/* ═══════════════════════════════════════════════════════════════════════════
   CARO & ASOCIADOS — Identidad de la división de Abogados (noviembre de 2026)

   Fuente: guía «Abogados Portada v2». Se carga SOLO desde el layout público,
   después de tokens.css, site.css y components.css. El panel y el login usan
   otro layout: nada de este archivo llega a ellos.

   Dos capas:

   1. RE-TEÑIDO. Todo el sitio está construido sobre las variables de
      tokens.css. Redefinirlas aquí, bajo body.ab, cambia paleta y tipografía
      de TODAS las páginas jurídicas sin tocar su marcado ni tokens.css (que
      el panel también carga).

   2. HERO DE PORTADA (.ab-*): único bloque con marcado nuevo. Los textos
      del sitio no se tocan: el rediseño es solo de presentación.

   Reglas del sistema (de la guía, no romperlas):
     · Dorado: solo trazos de 1 px (diagonales 1,25 px). La única superficie
       dorada maciza es el botón principal.
     · Texto dorado sobre fondo claro: #8A6326 (5,0:1). #D6A354 sobre claro
       da 2,1:1 y solo sirve para líneas decorativas.
     · Radios: 2 px botones, campos y placa del logo; 6 px tarjetas; fotos
       con esquinas rectas.
     · Fondos planos, sin degradados.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── 01 · FUENTES (alojadas en el servidor; sin Google Fonts) ──────────────
   Latin cubre todo el español (á é í ó ú ñ ü ¿ ¡). Licencia SIL OFL 1.1.   */

@font-face {
    font-family: 'Cormorant Garamond';
    src: url('/assets/fonts/cormorant-garamond-var.woff2') format('woff2-variations');
    font-weight: 300 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Cormorant Garamond';
    src: url('/assets/fonts/cormorant-garamond-var-italic.woff2') format('woff2-variations');
    font-weight: 300 700;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: 'Manrope';
    src: url('/assets/fonts/manrope-var.woff2') format('woff2-variations');
    font-weight: 200 800;
    font-style: normal;
    font-display: swap;
}

/* ── 02 · RE-TEÑIDO: tokens bajo body.ab ───────────────────────────────────
   Contrastes verificados (WCAG 2.1):
     ivory   #F5F7FB / navy #071D3A   15,7:1
     mute    #C3CCD9 / navy           10,4:1     dim #9DABBF / navy  7,2:1
     gold    #D6A354 / navy            7,4:1     gold / #0C2B52      6,2:1
     navy    #071D3A / gold (botón)    7,4:1
     graphite-mute #4A5B73 / #F5F7FB   6,5:1     dim #56677F         5,4:1
     gold-deep #8A6326 / #F5F7FB       5,0:1     / #FFFFFF           5,4:1   */

body.ab {
    --ab-navy: #071D3A;
    --ab-navy-2: #082448;
    --ab-blue: #123F71;
    --ab-paper: #F5F7FB;
    --ab-gold: #D6A354;
    --ab-gold-soft: #C9AD75;
    --ab-gold-text: #8A6326;
    --ab-ink-2: #4A5B73;
    --ab-line: #E1E6EE;
    --ab-pad: clamp(20px, 4.5vw, 64px);
    --ab-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    --ab-sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;

    /* Mapeo sobre los tokens del sitio */
    --ink-900: #071D3A;
    --ink-850: #082448;
    --ink-800: #0C2B52;
    --ink-700: #16375F;
    --ink-600: #1D4270;

    --paper: #F5F7FB;
    --paper-alt: #FFFFFF;
    --paper-deep: #E1E6EE;

    --ivory: #F5F7FB;
    --ivory-mute: #C3CCD9;
    --ivory-dim: #9DABBF;
    --graphite: #071D3A;
    --graphite-mute: #4A5B73;
    --graphite-dim: #56677F;

    --navy: #071D3A;
    --navy-deep: #041530;
    --navy-lift: #7FB2E5;
    --gold: #D6A354;
    --gold-soft: #C9AD75;
    --gold-warm: #D6A354;
    --gold-deep: #8A6326;

    --line-dark: rgba(245, 247, 251, 0.14);
    --line-dark-2: rgba(245, 247, 251, 0.28);
    --line-light: rgba(7, 29, 58, 0.12);
    --line-light-2: rgba(7, 29, 58, 0.24);
    --line-gold: rgba(214, 163, 84, 0.45);
    --focus: #D6A354;

    --font-display: var(--ab-serif);
    --font-display-alt: var(--ab-serif);
    --font-sans: var(--ab-sans);

    background-color: var(--ab-navy);
    font-family: var(--ab-sans);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Cormorant es fina a 400: los titulares van a 500, como pide la guía. */
.ab .display-1, .ab .display-2, .ab .display-3, .ab .display-4 { font-weight: 500; letter-spacing: -0.012em; }
.ab .display-1 em, .ab .display-2 em, .ab .display-3 em, .ab .display-4 em { font-weight: 500; font-style: italic; }
.ab .section--paper .display-1 em,
.ab .section--paper .display-2 em,
.ab .section--paper .display-3 em { color: var(--ab-gold-text); }

/* Antetítulo: filete de 28 px, sin el rombo anterior. */
.ab .eyebrow { font-weight: 700; letter-spacing: .24em; gap: 14px; }
.ab .eyebrow::before {
    width: 28px; height: 1px;
    background: var(--ab-gold);
    background-image: none;
}
.ab .section--paper .eyebrow::before { background: var(--ab-gold); opacity: 1; }

/* Foco visible y consistente. */
.ab :focus-visible { outline: 2px solid var(--ab-gold); outline-offset: 3px; }
.ab .section--paper :focus-visible,
.ab .footer :focus-visible { outline-color: var(--ab-navy); box-shadow: 0 0 0 5px rgba(214, 163, 84, .45); }

/* ── 03 · BOTONES DEL SITIO (re-teñidos) ────────────────────────────────── */
.ab .btn { border-radius: 2px; font-weight: 700; letter-spacing: .04em; min-height: 3.375rem; padding-inline: 1.75rem; }
.ab .btn--sm { min-height: 2.75rem; padding-inline: 1.15rem; }
.ab .btn--gold::after { background-color: var(--ab-gold-soft); }
.ab .btn--gold:hover, .ab .btn--gold:focus-visible { color: var(--ab-navy); border-color: var(--ab-gold-soft); }
.ab .btn--ghost { --btn-bd: rgba(255, 255, 255, .7); }
.ab .btn--ghost::after { background-color: rgba(255, 255, 255, .08); }
.ab .btn--ghost:hover, .ab .btn--ghost:focus-visible { color: #fff; border-color: #fff; }

/* ── 04 · CABECERA ──────────────────────────────────────────────────────── */
.ab .header { height: 96px; }
.ab .header.is-stuck,
.ab:not(.page-home) .header {
    background-color: var(--ab-navy);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom-color: transparent;
    box-shadow: 0 1px 0 rgba(214, 163, 84, .35);
    height: 72px;
}

/* Logotipo original sobre placa blanca (el archivo tiene fondo blanco). */
.ab .header .logo {
    background: #fff;
    padding: 8px 12px;
    border-radius: 2px;
    box-shadow: inset 0 -1px 0 var(--ab-gold);
}
.ab .header .logo__img { height: 40px; max-width: none; transition: height .35s var(--ease-out); }
.ab .header.is-stuck .logo__img,
.ab:not(.page-home) .header .logo__img { height: 34px; }

.ab .nav__link { font-size: 13px; font-weight: 500; letter-spacing: .06em; color: rgba(255, 255, 255, .82); }
.ab .nav__link:hover, .ab .nav__link:focus-visible, .ab .nav__link[aria-current="page"] { color: #fff; }
.ab .nav__link::after { background-color: var(--ab-gold); height: 1px; }
.ab .nav__link[aria-current="page"] { font-weight: 600; }

.ab .lang { font-weight: 600; letter-spacing: .1em; }
.ab .lang a { color: rgba(255, 255, 255, .72); }
.ab .lang [aria-current="true"] { color: var(--ab-gold); }

/* Entre 1024 y 1199 px no caben nav + idioma + botón: el botón se cortaba
   (ya ocurría antes del rediseño). «Contacto» sigue en la navegación. */
@media (min-width: 64rem) and (max-width: 74.99rem) { .ab .header__cta { display: none; } }

.ab .burger { width: 44px; height: 44px; border: 1px solid rgba(255, 255, 255, .3); border-radius: 2px; }
.ab .burger span:nth-child(2) { background-color: var(--ab-gold); }

.ab .menu { background-color: var(--ab-navy); }
.ab .menu__link { font-family: var(--ab-serif); font-weight: 500; }

/* ── 05 · HERO DE PÁGINA INTERIOR ──────────────────────────────────────────
   Banda azul plana con la diagonal dorada. Sin foto genérica de fondo.    */
.ab .page-hero {
    background-color: var(--ab-navy);
    padding-top: calc(72px + clamp(56px, 7vw, 96px));
    padding-bottom: clamp(48px, 6vw, 72px);
}
.ab .page-hero--media { min-height: 0; }
.ab .page-hero__scrim { background: rgba(7, 29, 58, .86); }
.ab .page-hero__title { font-size: clamp(2.25rem, 1.5rem + 3vw, 3.5rem); line-height: 1.08; max-width: 20ch; }
.ab .page-hero__lead { color: var(--ivory-mute); }
.ab .ab-diagonal {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: -1;
}
.ab .ab-diagonal line { stroke: var(--ab-gold); stroke-width: 1.25; }
@media (max-width: 859px) { .ab .ab-diagonal { opacity: .55; } }
.ab .breadcrumb { font-size: 12px; color: rgba(255, 255, 255, .65); }
.ab .breadcrumb a { color: rgba(255, 255, 255, .65); }
.ab .breadcrumb a:hover { color: #fff; }

/* Bandas alternas: la «alt» pasa a navy secundario. */
.ab .section--alt { background-color: var(--ab-navy-2); }

/* ── 06 · PIE (claro, filete dorado) ────────────────────────────────────── */
.ab .footer {
    background-color: var(--ab-paper);
    border-top: 1px solid var(--ab-gold);
    color: var(--ab-navy);
    --ivory: #071D3A;
    --ivory-mute: #4A5B73;
    --ivory-dim: #56677F;
    --gold-warm: #8A6326;
    --line-dark: var(--ab-line);
}
.ab .footer__heading { color: var(--ab-gold-text); font-weight: 700; letter-spacing: .22em; }
.ab .footer__list a { color: var(--ab-navy); }
.ab .footer__list a:hover, .ab .footer__list a:focus-visible { color: var(--ab-gold-text); }
.ab .footer__statement { color: var(--ab-navy); font-weight: 500; }
.ab .footer .logo__img { height: 44px; max-width: none; }
.ab .footer .social { color: var(--ab-navy); border-color: var(--ab-line); }
.ab .footer .social:hover, .ab .footer .social:focus-visible { color: var(--ab-navy); background: var(--ab-gold); border-color: var(--ab-gold); }
.ab .footer__legal a:hover { color: var(--ab-gold-text); }

/* ── 07 · FORMULARIO DE CONTACTO: tarjeta blanca ───────────────────────────
   Las variables se redefinen dentro del formulario: los mismos campos del
   sitio pasan a texto navy sobre blanco sin tocar su marcado ni su lógica. */
.ab .contact-grid form {
    --ivory: #071D3A;
    --ivory-mute: #4A5B73;
    --ivory-dim: #4A5B73;
    --line-dark-2: #D3DAE4;
    --danger: #B42318;
    background: #fff;
    color: var(--ab-navy);
    border: 1px solid var(--ab-line);
    border-radius: 6px;
    padding: clamp(24px, 3.5vw, 40px);
}
.ab .contact-grid form .field__label { font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ab-navy); }
.ab .contact-grid form .field__label .req { color: var(--ab-gold-text); }
.ab .contact-grid form .input,
.ab .contact-grid form .select {
    height: 48px; padding: 0 14px;
    border: 1px solid #D3DAE4; border-radius: 2px;
    background: #fff; color: var(--ab-navy);
}
.ab .contact-grid form .textarea { padding: 12px 14px; border: 1px solid #D3DAE4; border-radius: 2px; background: #fff; color: var(--ab-navy); }
.ab .contact-grid form .select option { background: #fff; color: var(--ab-navy); }
.ab .contact-grid form .input:focus,
.ab .contact-grid form .select:focus,
.ab .contact-grid form .textarea:focus { border-color: var(--ab-gold); box-shadow: 0 0 0 3px rgba(214, 163, 84, .18); }
.ab .contact-grid form [aria-invalid="true"] { border-color: #B42318; }
.ab .contact-grid form .checkbox input { border-color: #8A97A9; }
.ab .contact-grid form .checkbox input:checked::after { border-color: var(--ab-navy); }
.ab .contact-grid form a { color: var(--ab-gold-text); }
.ab .contact-grid form .text-dim { color: var(--ab-ink-2); }
.ab .contact-grid form :focus-visible { outline-color: var(--ab-navy); }

/* ═══════════════════════════════════════════════════════════════════════════
   COMPONENTES NUEVOS (.ab-*)
   ═══════════════════════════════════════════════════════════════════════════ */

.ab-wrap { max-width: 1320px; margin: 0 auto; padding: 0 var(--ab-pad); }
.ab-dark { color: #fff; }

/* ── Tipografía ─────────────────────────────────────────────────────────── */
.ab-h1 { font-family: var(--ab-serif); font-weight: 500; font-size: clamp(44px, 5.4vw, 84px); line-height: 1.02; letter-spacing: -.012em; color: #fff; margin: 0 0 30px; text-wrap: balance; }
.ab-h1 em { font-style: italic; color: var(--ab-gold); }
.ab-lead { font-size: 17px; line-height: 1.75; color: var(--ab-ink-2); text-wrap: pretty; margin: 0 0 18px; max-width: 60ch; }
.ab-dark .ab-lead { color: rgba(245, 247, 251, .82); }
.ab-kicker { display: inline-flex; align-items: center; gap: 14px; font-size: 11px; font-weight: 700; letter-spacing: .24em; text-transform: uppercase; color: var(--ab-gold-text); margin: 0 0 20px; }
.ab-kicker::before { content: ""; width: 28px; height: 1px; background: var(--ab-gold); }
.ab-dark .ab-kicker { color: var(--ab-gold); }

/* ── Botones ────────────────────────────────────────────────────────────── */
.ab-btn {
    display: inline-flex; align-items: center; gap: 12px;
    height: 56px; padding: 0 30px; white-space: nowrap;
    font: 700 14px/1 var(--ab-sans); letter-spacing: .04em;
    border-radius: 2px; border: 1px solid transparent; text-decoration: none;
    transition: background-color .25s, color .25s, border-color .25s, transform .25s;
}
.ab-btn--gold { background: var(--ab-gold); color: var(--ab-navy); }
.ab-btn--gold:hover { background: var(--ab-gold-soft); color: var(--ab-navy); transform: translateY(-1px); }
.ab-btn--ghost { border-color: rgba(255, 255, 255, .7); color: #fff; font-weight: 600; }
.ab-btn--ghost:hover { background: rgba(255, 255, 255, .08); border-color: #fff; color: #fff; }
@media (max-width: 859px) { .ab-btn { height: 54px; width: 100%; justify-content: center; } }


/* ── Hero de portada ────────────────────────────────────────────────────── */
.ab-hero { position: relative; height: 880px; max-height: 100svh; min-height: 640px; background: var(--ab-navy); overflow: hidden; }
.ab-hero__panel {
    position: absolute; inset: 0 0 0 auto; width: 58%;
    clip-path: polygon(22% 0, 100% 0, 100% 100%, 0 100%);
    background: var(--ab-blue);
}
.ab-hero__panel img {
    position: absolute; bottom: 0; right: 4%;
    height: 96%; width: auto; max-width: none;
    filter: contrast(1.08) saturate(.75);
    /* Dos máscaras intersectadas: la elipse funde los lados y el degradado
       vertical evita el corte recto del borde superior de la foto. */
    -webkit-mask-image: radial-gradient(ellipse 62% 78% at 52% 60%, #000 58%, transparent 86%),
                        linear-gradient(180deg, transparent 0, #000 20%);
    -webkit-mask-composite: source-in;
            mask-image: radial-gradient(ellipse 62% 78% at 52% 60%, #000 58%, transparent 86%),
                        linear-gradient(180deg, transparent 0, #000 20%);
            mask-composite: intersect;
}
/* Velo: funde la foto con el azul del panel por la izquierda y por abajo. */
.ab-hero__panel::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background:
        linear-gradient(90deg, rgba(7, 29, 58, .85), transparent 34%),
        linear-gradient(0deg, rgba(7, 29, 58, .7), transparent 30%);
}
.ab-hero__line { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ab-hero__line line { stroke: var(--ab-gold); stroke-width: 1.25; }
.ab-line--tab, .ab-line--mob { display: none; }
.ab-hero__inner { position: relative; height: 100%; display: flex; align-items: center; }
/* El texto no debe cruzar la línea dorada: en su punto más a la izquierda
   (abajo) la línea está al 42 % del ancho. 38vw deja margen a cualquier ancho. */
.ab-hero__copy { max-width: min(540px, 38vw); padding-top: 60px; }
.ab-actions { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 42px; }
/* «Desliza» alineado con el texto del hero (mismo borde que .ab-wrap). */
.ab-hero .hero__scroll { left: max(var(--ab-pad), calc((100% - 1320px) / 2 + var(--ab-pad))); z-index: 1; }

@media (min-width: 860px) and (max-width: 1099px) {
    .ab-hero__panel { width: 50%; }
    .ab-line--desk { display: none; }
    .ab-line--tab { display: block; }
    .ab-hero__copy { max-width: calc(50vw - 112px); }
}
@media (max-width: 859px) {
    .ab-hero { height: auto; max-height: none; min-height: 0; }
    .ab-hero__panel { position: relative; width: 100%; height: 500px; clip-path: polygon(0 0, 100% 0, 100% 84%, 0 100%); }
    .ab-hero__panel img { right: auto; left: 50%; transform: translateX(-46%); height: 92%; }
    .ab-hero__line { height: 500px; }
    .ab-line--desk { display: none; }
    .ab-line--mob { display: block; }
    .ab-hero__inner { height: auto; padding-top: 28px; padding-bottom: 56px; }
    .ab-hero__copy { max-width: none; padding-top: 0; }
    .ab-actions { flex-direction: column; gap: 12px; margin-top: 30px; }
}

/* ── Movimiento reducido ───────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .ab-btn, .ab .header, .ab .header .logo__img { transition: none !important; }
    .ab-btn--gold:hover { transform: none; }
}
