/* ============================================================
   Sistema de títulos · Erik David
   Futura (con sus pesos) + Playfair Display itálica como acento.
   Se carga al final de cada página para que todos los h1/h2
   compartan la misma voz, sin importar el CSS local de la página.
   ============================================================ */

:root {
  --title-sans: Futura, 'Jost', Arial, sans-serif;
  --title-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --title-sans-weight: 300;
  --title-tracking: -0.035em;
  --title-leading: 1.02;
  /* La itálica de Playfair ocupa algo menos que Futura en caja alta:
     la subimos un poco para que las dos líneas se lean del mismo tamaño. */
  --title-serif-scale: 1.02;
  --title-serif-tracking: -0.012em;
}

/* --- Parte sans: Futura -------------------------------------------------- */
:is(h1, h2) {
  font-family: var(--title-sans) !important;
  font-style: normal !important;
  letter-spacing: var(--title-tracking) !important;
  line-height: var(--title-leading) !important;
  text-wrap: balance;
  font-kerning: normal;
  font-feature-settings: "kern" 1, "liga" 1;
}

/* Los títulos que venían completos en serif (Cormorant) pasan a Futura ligera. */
:is(h1, h2):not(.listing-header-heading) {
  font-weight: var(--title-sans-weight) !important;
}

/* --- Parte serif: Playfair itálica -------------------------------------- */
:is(h1, h2) :is(.editorial, .title-serif),
:is(h1, h2):has(.heading-sans, .hero-title-sans) [lang]:not(.hero-title-sans, .hero-title-sans *),
:is(h1, h2) em {
  font-family: var(--title-serif) !important;
  font-style: italic !important;
  font-weight: 400 !important;
  font-size: calc(1em * var(--title-serif-scale)) !important;
  letter-spacing: var(--title-serif-tracking) !important;
  line-height: inherit !important;
  /* Pega la itálica a la palabra sans sin huecos ni saltos de línea raros */
  margin: 0 !important;
  padding: 0 !important;
  vertical-align: baseline;
  white-space: normal;
}

/* Barrios: el patrón estaba invertido (serif base + span sans).
   .hero-title-sans es una etiqueta dorada en mayúsculas: conserva su propio estilo. */
:is(h1, h2) .heading-sans {
  font-family: var(--title-sans) !important;
  font-style: normal !important;
  font-weight: var(--title-sans-weight) !important;
  font-size: calc(1em / var(--title-serif-scale)) !important;
  letter-spacing: var(--title-tracking) !important;
}

/* Pantallas pequeñas: interlineado un pelo más abierto para las ascendentes de la itálica */
@media (max-width: 720px) {
  :root {
    --title-leading: 1.06;
    --title-tracking: -0.03em;
  }
}

/* ============================================================
   Texto de lectura · Plus Jakarta Sans (solo web)
   Futura se queda en títulos, etiquetas, menú, botones y enlaces CTA.
   ============================================================ */
:root {
  --text-sans: 'Plus Jakarta Sans', 'Helvetica Neue', Arial, sans-serif;
}

:is(p, li, dd, td, th, blockquote, figcaption, label, input, textarea, select, small, address):not(
  .eyebrow, [class*="eyebrow"], [class*="kicker"], [class*="label"], [class*="theme"], .editorial, .editorial *,
  .btn, [class*="btn"], .textlink, [class*="chip"], [class*="tag"],
  nav *, header *, .editorial-rail *, h1 *, h2 *, h3 *, button *, .btn *
) {
  font-family: var(--text-sans) !important;
  /* Jakarta tiene la "x" más alta que Futura: la igualamos para no inflar los tamaños */
  font-size-adjust: ex-height 0.5;
  font-optical-sizing: auto;
  word-spacing: 0.03em;
}

/* Futura 300 pasaba por "regular"; en Jakarta usamos 400 para que se lea bien sobre negro */
:is(p, li, dd, td, blockquote, figcaption, address, small):not(.editorial, .editorial *, .eyebrow, [class*="eyebrow"], [class*="kicker"], [class*="label"], nav *, header *, h1 *, h2 *, h3 *) {
  font-weight: 400 !important;
}

:is(p, li, dd, td, blockquote) :is(strong, b) {
  font-weight: 600 !important;
}

/* Footer: el texto legal de 12px gris era lo menos legible del sitio */
footer :is(p, small) {
  font-size: 13px !important;
  line-height: 1.6 !important;
}

/* Subtítulos dentro de tarjetas/listas no heredan la fuente de lectura */
:is(h3, h4, h5, h6) {
  font-family: var(--title-sans);
}

/* Testimonios: la cita era serif grande; en Jakarta competía con el título de la sección */
.experiences p.exp-text, p.exp-text.exp-text {
  font-size: clamp(18px, 1.45vw, 22px) !important;
  line-height: 1.6 !important;
  font-weight: 300 !important;
  color: #e8e8e8;
  max-width: 62ch;
}
@media (max-width: 720px) {
  p.exp-text.exp-text { font-size: 17px !important; line-height: 1.6 !important; }
}

/* Acentos serif fuera de los títulos (pies de foto, frases destacadas, firma):
   la misma Playfair itálica que los títulos, nunca Minion/Cormorant */
.editorial:not(h1 *, h2 *) {
  font-family: var(--title-serif) !important;
  font-style: italic !important;
  font-weight: 400 !important;
  letter-spacing: -0.01em !important;
}
/* La firma lleva dentro un enlace CTA: ese sigue en Futura recta */
.editorial :is(a, .textlink, .btn) {
  font-family: var(--title-sans) !important;
  font-style: normal !important;
  font-weight: 300 !important;
  letter-spacing: normal !important;
}

/* ============================================================
   Escala única de títulos
   - Header de cada página (h1): mismo tamaño en todo el sitio
   - Títulos de sección (h2): mismo tamaño en todo el sitio
   Excepciones: cabecera compuesta de listings, aviso legal,
   subtítulos de la política de privacidad y diálogos.
   ============================================================ */
:root {
  --title-h1: clamp(46px, 6.8vw, 104px);
  --title-h2: clamp(36px, 4.8vw, 72px);
}

h1:not(.listing-header-heading) {
  font-size: var(--title-h1) !important;
}

h2:not(.unit-legal h2, #privacy h2, dialog h2, #dialog-title, .dialog-body h2, [role="dialog"] h2) {
  font-size: var(--title-h2) !important;
}

/* Botones: siempre Futura (algunos caían en Arial, p. ej. "Continue on WhatsApp") */
.btn, button.btn, a.btn {
  font-family: var(--title-sans) !important;
}

/* ============================================================
   Párrafo de entrada junto a los títulos de sección
   Un solo tamaño en todo el sitio, claramente por debajo del título.
   ============================================================ */
:root {
  --text-lead: clamp(16px, 1.25vw, 18px);
}
:is(
  .advantage-lede p, .exp-lede, .exp-lede p, .svc-lead, .svc-copy > p,
  .section-top p, .sig-home-intro p, .feature-copy p, .process-heading p,
  .chapter-contact > div > p, .project-wrap > p,
  :is(div, header):has(> h2) > p,
  div:has(> div > h2) > p,
  div:has(> div > h2) > div:not(:has(h2, form, ol, ul, article)) > p
):not(.eyebrow, [class*="eyebrow"], [class*="kicker"], [class*="label"], [class*="note"], [class*="small"], .small, .editorial, .exp-text, .asking-price, [class*="price"], form *) {
  font-size: var(--text-lead) !important;
  line-height: 1.65 !important;
}
@media (max-width: 720px) {
  .advantage-lede { margin-top: 28px !important; }
}

/* ============================================================
   Módulos finales (contacto + preguntas frecuentes): una sola escala
   - subtítulos (tarjeta y preguntas): 22px Futura
   - texto secundario (listas, respuestas, intro del formulario): 17px
   - formulario (etiquetas y campos): 16px
   - enlaces con flecha: 17px
   ============================================================ */
:root {
  --text-body: 16px;
  --text-form: 16px;
  --title-h3-small: clamp(18px, 1.35vw, 20px);
}
:is(#respuestas, #contacto, .chapter-section) :is(h3, summary) {
  font-size: var(--title-h3-small) !important;
  line-height: 1.35 !important;
  font-weight: 400 !important;
}
:is(#respuestas, #contacto, .chapter-section) :is(.guide p, .guide li, details p, details li, .goal-context) {
  font-size: var(--text-body) !important;
  line-height: 1.6 !important;
}
:is(#inquiry, .chapter-section form) :is(label, label > span, input, select, textarea) {
  font-size: var(--text-form) !important;
}
:is(#respuestas, #contacto, .chapter-section) .textlink {
  font-size: var(--text-body) !important;
}
:is(#respuestas, #contacto, .chapter-section) .btn {
  font-size: var(--text-form) !important;
}
/* Etiquetas doradas (eyebrow): mismo tamaño en todo el sitio */
p.eyebrow, span.eyebrow.eyebrow {
  font-size: 12px !important;
}
/* Excepción: etiqueta "Client Experiences" más grande */
.experiences .section-top p.eyebrow {
  font-size: 16px !important;
}
@media (max-width: 760px) {
  .experiences .section-top p.eyebrow {
    font-size: 14px !important;
  }
}

/* ============================================================
   Negro grafito translúcido: idioma activo, menú y caja de cookies
   ============================================================ */
:root {
  --graphite: #141414;
  --graphite-glass: rgba(20, 20, 20, 0.82);
}
/* Selector de idioma: sin cápsula; solo el idioma activo lleva el grafito */
.language-switch button {
  color: #e6e6e6 !important;
  padding: 7px 4px !important;
}
/* Idioma activo: dorado sobre el header negro (todas las páginas)… */
.language-switch button[aria-pressed="true"] {
  color: #C89733 !important;
  background: none !important;
  font-weight: 700 !important;
}
/* …y negro grafito sobre el header transparente de la home (cielo claro) */
body:not(.unit-view):has(.hero-photo) header.top .language-switch button[aria-pressed="true"] {
  color: var(--graphite) !important;
}
.language-switch span {
  color: #e6e6e6 !important;
  opacity: .7;
}
/* Menú hamburguesa */
.top .menu, header .menu {
  background: var(--graphite-glass) !important;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
/* Caja de cookies */
.cookie-box {
  background: var(--graphite-glass) !important;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
/* Lista de la tarjeta y respuestas: menos aire entre líneas y elementos */
:is(#respuestas, .chapter-section) :is(.guide li) {
  line-height: 1.5 !important;
  margin-bottom: 8px !important;
}
:is(#respuestas, .chapter-section) .guide ul {
  margin: 14px 0 22px !important;
}
:is(#respuestas, .chapter-section) summary {
  padding-top: 18px !important;
  padding-bottom: 18px !important;
}

/* ============================================================
   Foco en campos de formulario: línea dorada inferior en vez del
   contorno desplazado (tapaba la etiqueta del campo de arriba)
   ============================================================ */
form :is(input, select, textarea):focus,
form :is(input, select, textarea):focus-visible {
  outline: none !important;
  border-bottom-color: #C89733 !important;
  box-shadow: 0 1px 0 0 #C89733 !important;
}

/* Etiqueta "Virtual staging · …" sobre las fotos del hero: sin fondo */
.hero-staging {
  background: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .75), 0 0 2px rgba(0, 0, 0, .5);
}
