/* =========================================================
   ZARIA · Base común a todas las páginas
   Reset, tipografía destacada, marcadores de imagen, botones,
   menú fijo y footer. Cada página añade su propia hoja
   (home.css, zaria.css…).
   ========================================================= */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

/* Final de página: en las páginas con footer, la raíz del documento
   lleva el fondo oscuro del footer. Es lo que se ve si queda algún
   hueco bajo el footer y al seguir deslizando al final (rebote del
   trackpad). El <body> y cada bloque conservan su propio fondo. */
html:has(> body > .footer) { background: var(--c-footer); }

body {
  margin: 0;
  background: var(--c-beige);
  color: var(--c-ink);
  font-family: var(--font-sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

h1, h2, h3, p, ul, ol, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

/* Oculto a la vista, disponible para lectores de pantalla y buscadores */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Serif destacada: solo palabras o líneas resaltadas */
.accent {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: var(--accent-weight);
  color: var(--c-rust-soft);
}

/* ---------- Medios y marcadores provisionales ---------- */
.media { position: relative; width: 100%; height: 100%; overflow: hidden; }
.media > img { width: 100%; height: 100%; object-fit: cover; }

.ph {
  position: absolute; inset: 0;
  display: flex; align-items: flex-end; justify-content: flex-start;
  padding: 16px;
  background: #d3c9bf;
  color: rgba(58, 30, 18, .55);
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
}
.ph[data-label]::after { content: attr(data-label); }
.ph--dark  { background: #8a5a3a; color: rgba(255, 255, 255, .6); }
.ph--rust  { background: #824b37; color: rgba(255, 255, 255, .6); }
.ph--umber { background: var(--c-umber); color: rgba(255, 255, 255, .5); }

.ph-mark {
  display: inline-block;
  background: linear-gradient(135deg, #c58d6a, #7a3e25 55%, #b67d5a);
  border-radius: 3px;
}

/* ---------- Botones ---------- */
.btn, .btn-outline {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--font-sans);
  font-weight: 500;
  white-space: nowrap;
  transition: opacity .2s ease, background-color .2s ease;
}
.btn {
  height: calc(34 * var(--u));
  padding: 0 calc(24 * var(--u));
  border-radius: 4px;
  font-size: calc(12 * var(--u));
  color: var(--c-white);
}
.btn:hover { opacity: .88; }
.btn--rust { background: var(--c-rust); }
.btn--ink  { background: var(--c-ink); }
.btn--lg   { height: calc(35 * var(--u)); min-width: calc(117 * var(--u)); font-size: calc(13 * var(--u)); }

.btn-outline {
  height: calc(34 * var(--u));
  padding: 0 calc(18 * var(--u));
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 3px;
  font-size: calc(12 * var(--u));
  color: var(--c-white);
}
.btn-outline:hover { background: rgba(255, 255, 255, .1); }

.icon-arrow--m { display: none; }
.site-nav__toggle { display: none; }

.icon-arrow {
  width: calc(14 * var(--u)); height: calc(14 * var(--u));
  fill: none; stroke: currentColor; stroke-width: 1.1;
}

/* =========================================================
   NAVEGACIÓN FIJA
   ========================================================= */
.site-nav {
  position: fixed;
  top: calc(72 * var(--u));
  left: 0;
  z-index: 100;
  color: var(--c-ink);
  transition: color .25s ease;
  /* El menú solo captura el cursor sobre sus enlaces: el resto de su
     caja deja pasar el cursor a lo que haya debajo (p. ej. las tarjetas). */
  pointer-events: none;
}
.site-nav ul { display: flex; flex-direction: column; align-items: flex-start; }
.site-nav a { pointer-events: auto; }
.site-nav.is-light { color: var(--c-beige); }
.site-nav a {
  display: flex; align-items: center;
  gap: calc(6 * var(--u));
  height: calc(35 * var(--u));
  font-size: calc(19 * var(--u));
  font-weight: 500;              /* mismo peso para todos, también el activo */
}
/* Trazo lateral: hueco fijo para que el texto no se mueva; en la página
   activa el trazo es más largo y algo más grueso (sin negrita). La copia
   clara del menú (modo clip) lo marca con .is-current. */
.site-nav a::before {
  content: "";
  flex: 0 0 auto;
  width: calc(40 * var(--u));
  height: 2px;
  background: linear-gradient(currentColor, currentColor) left center / calc(27 * var(--u)) 1px no-repeat;
  transition: background-size .25s ease;
}
.site-nav a[aria-current="page"]::before,
.site-nav a.is-current::before { background-size: 100% 2px; }
.site-nav a:hover { opacity: .7; }
.site-nav a:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

/* Copia clara del menú (modo "clip" de nav.js): se recorta a las
   superficies oscuras que hay debajo. No recibe cursor ni foco. */
.site-nav--overlay,
.site-nav--overlay a { pointer-events: none !important; }
.site-nav--overlay { transition: none; }
.site-nav--overlay a.is-hover { opacity: .7; }

/* ---------- Logo (bloque de marca; hoy oculto en el footer) ---------- */
.logo { display: inline-flex; flex-direction: column; align-items: center; color: #6b3a26; }
.logo__word {
  font-family: var(--font-sans);
  font-weight: 300;
  letter-spacing: .2em;
  margin-right: -.2em;
}
.logo__sub {
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .35em;
  margin-right: -.35em;
}

/* =========================================================
   7 · FOOTER
   ========================================================= */
.footer {
  background: var(--c-footer);
  color: var(--c-footer-text);
  /* El alto del footer tiene decimales: su último píxel quedaría
     cubierto a medias y dejaría asomar el beige del <body> como una
     línea clara. Esta prolongación oscura de 3 px la tapa. */
  box-shadow: 0 3px 0 var(--c-footer);
}
.footer__inner {
  display: grid;
  grid-template-columns: calc(368 * var(--u)) calc(339 * var(--u)) 1fr;
  width: calc(1003 * var(--u));
  margin-left: calc(218 * var(--u));
  padding: calc(48 * var(--u)) 0 calc(24 * var(--u));
}
.logo--footer { flex-direction: row; align-items: center; gap: calc(8 * var(--u)); color: var(--c-footer-text); }
.logo--footer .logo__mark { width: calc(32 * var(--u)); height: calc(30 * var(--u)); }
.logo--footer .logo__text { display: flex; flex-direction: column; align-items: flex-start; }
.logo--footer .logo__word { font-size: calc(22 * var(--u)); line-height: 1; font-weight: 400; }
.logo--footer .logo__sub  { font-size: calc(6 * var(--u)); margin-top: calc(4 * var(--u)); }
.footer__tagline {
  margin-top: calc(6 * var(--u));
  max-width: calc(230 * var(--u));
  font-size: calc(17 * var(--u));
  line-height: calc(22 * var(--u));
  font-weight: 400;
  color: #d8cbbf;
}
.footer__label {
  font-size: calc(9 * var(--u));
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--c-footer-label);
}
/* Mientras los otros bloques estén ocultos, «Get in touch» conserva su columna */
.footer__col--contact { grid-column: 3; padding-bottom: calc(24 * var(--u)); }
.footer__col ul { margin-top: calc(2 * var(--u)); }
.footer__col li { font-size: calc(10.5 * var(--u)); line-height: calc(24 * var(--u)); }
.footer__col a:hover { color: var(--c-white); }
/* Enlace legal (11 nov.): discreto, bajo «Get in touch» */
.footer__legal { display: flex; flex-wrap: wrap; column-gap: calc(22 * var(--u)); margin-top: calc(14 * var(--u)); }
.footer__legal a {
  display: inline-block;
  font-size: max(11px, calc(9 * var(--u)));
  line-height: 1.6;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(227, 216, 204, .78);
  transition: color .2s ease;
}
.footer__legal a:hover, .footer__legal a[aria-current="page"] { color: var(--c-white); }
.footer__legal a:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }
.footer__bottom {
  grid-column: 1 / -1;
  display: flex; justify-content: space-between;
  margin-top: calc(42 * var(--u));
  padding-top: calc(16 * var(--u));
  border-top: 1px solid rgba(255, 255, 255, .14);
  font-size: calc(8 * var(--u));
  letter-spacing: .15em;
  text-transform: uppercase;
  color: rgba(227, 216, 204, .7);
}

/* ---------- Base móvil provisional (≤ 820 px) ---------- */
@media (max-width: 1023px) {
  :root { --u: 1px; }

  .site-nav--overlay { display: none; }   /* en móvil no hay copia clara */

  /* Menú móvil: botón fijo de cuatro líneas (arriba a la izquierda) que
     abre un desplegable debajo. Solo se ven las líneas; la zona táctil
     invisible mide 44 × 44 px. nav.js crea el botón y gestiona .is-open. */
  .site-nav {
    /* env(): bajo la hora y la batería en páginas con viewport-fit=cover (Zaria) */
    top: calc(6px + env(safe-area-inset-top, 0px)); left: 6px; right: auto;
    display: flex; flex-direction: column; align-items: flex-start;
  }
  .site-nav__toggle {
    pointer-events: auto;
    display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
    width: 44px; height: 44px; padding: 0; margin: 0;
    border: 0; border-radius: 0;
    background: none; box-shadow: none;
    -webkit-appearance: none; appearance: none;
    color: var(--c-ink);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color .25s ease;
  }
  .site-nav__toggle span {
    display: block; flex: 0 0 auto; width: 22px; height: 2px;
    background: currentColor;
  }
  .site-nav.is-light .site-nav__toggle { color: var(--c-beige); }
  .site-nav__toggle:focus-visible { outline: 2px solid currentColor; outline-offset: -2px; }
  /* Solo durante la portada (nav.js): fuera de ella se desvanece y no
     recibe toques */
  .site-nav { transition: color .25s ease, opacity .3s ease, visibility 0s; }
  .site-nav.is-past-hero { opacity: 0; visibility: hidden; transition: color .25s ease, opacity .3s ease, visibility 0s linear .3s; }
  .site-nav.is-past-hero, .site-nav.is-past-hero * { pointer-events: none !important; }

  .site-nav ul {
    display: none;
    pointer-events: auto;
    flex-direction: column; align-items: stretch; gap: 0;
    min-width: 190px;
    margin: 0 0 0 11px; padding: 6px 0;
    border-radius: 10px;
    background: rgba(242, 233, 222, .98);
    box-shadow: 0 10px 30px rgba(43, 28, 20, .2);
    color: var(--c-ink);
  }
  .site-nav.is-open ul { display: flex; }
  .site-nav a { height: 48px; padding: 0 20px 0 14px; font-size: 17px; gap: 8px; }
  .site-nav a::before { width: 24px; background-size: 14px 1px; }
  .site-nav li + li a { border-top: 1px solid rgba(89, 45, 29, .1); }
  .site-nav a:hover { opacity: 1; background: rgba(89, 45, 29, .06); }

  /* El CTA superior de la portada se oculta: Contact está en el menú */
  .hero__cta, .zhero__cta, .shero__cta, .sp-hero__cta { display: none !important; }

  /* Flecha de los botones: el icono SVG de escritorio sustituye al
     carácter ↗ (Safari lo pinta como emoji). */
  .arrow-glyph { display: none; }
  .icon-arrow--m { display: inline-block; flex: 0 0 auto; }
  .footer__col a .icon-arrow--m { vertical-align: -2px; margin-left: 2px; }
  .bk-index__arrow .icon-arrow--m { width: 1em; height: 1em; vertical-align: -.1em; }

  .footer__inner { grid-template-columns: 1fr; row-gap: 32px; width: auto; margin: 0; padding: 48px 20px 24px; }
  .footer__col--contact { grid-column: 1; }
  .footer__tagline { max-width: none; }
  .footer__label { font-size: 11px; }
  .footer__col li { font-size: 14px; line-height: 28px; }
  .footer__bottom { flex-direction: column; gap: 8px; margin-top: 8px; font-size: 10px; }
  .footer__legal { margin-top: 6px; column-gap: 24px; }
  .footer__legal a { display: inline-flex; align-items: center; min-height: 44px; font-size: 12px; }

  .btn, .btn-outline { height: 40px; font-size: 13px; padding: 0 18px; }
  .icon-arrow { width: 14px; height: 14px; }
}


/* =========================================================
   TABLET HORIZONTAL Y PORTÁTIL PEQUEÑO (1024–1279 px, 12 nov.)
   La composición de escritorio se escala con la ventana (--u); aquí
   solo se fijan tamaños mínimos legibles y zonas táctiles cómodas
   para textos y controles pequeños. No cambia la composición.
   ========================================================= */
@media (min-width: 1024px) and (max-width: 1279px) {
  .btn, .btn-outline { font-size: max(12.5px, calc(12 * var(--u))); height: max(38px, calc(34 * var(--u))); padding-left: max(16px, calc(24 * var(--u))); padding-right: max(16px, calc(24 * var(--u))); }
  .icon-arrow { width: max(12px, calc(14 * var(--u))); height: max(12px, calc(14 * var(--u))); }
  .footer__label { font-size: max(10px, calc(9 * var(--u))); }
  .footer__col li { font-size: max(13px, calc(10.5 * var(--u))); line-height: max(26px, calc(24 * var(--u))); }
  .footer__bottom { font-size: max(9.5px, calc(8 * var(--u))); }
}


/* =========================================================
   13 NOV. · LOGO SUPERIOR, MENÚ COMPACTO Y FOOTER
   (bloque añadido al final: sustituye a las reglas anteriores
   del footer y del menú donde coinciden)
   ========================================================= */

/* ---------- Logo superior: integrado en cada portada, enlaza a Home ----------
   PNG recortado a su contenido (sin el margen transparente del original).
   Variante clara (solo letras en --c-linen) en portadas oscuras. */
.brand-top {
  position: absolute;
  top: calc(30 * var(--u));
  left: 50%;
  z-index: 6;
  width: max(130px, calc(160 * var(--u)));
  transform: translateX(-50%);
  line-height: 0;
}
.brand-top img { display: block; width: 100%; height: auto; }
.brand-top:focus-visible { outline: 2px solid currentColor; outline-offset: 6px; }
main.legal { position: relative; }                     /* páginas legales: logo en la cabecera */
html:not(.ct-motion) .ct-intro { position: relative; } /* Contact sin animación */

/* ---------- Menú de escritorio: completo en la portada, compacto después ----------
   nav.js añade .is-compact al llegar al segundo bloque (o siempre, con
   data-nav-compact="always"). Antes, .is-fading desvanece la lista. */
@media (min-width: 1024px) {
  .site-nav ul { transition: opacity .18s ease; }
  .site-nav.is-fading ul { opacity: 0; }
  .site-nav__toggle {
    display: none; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
    position: absolute; top: 0; left: calc(14 * var(--u));
    width: 44px; height: 44px; padding: 0; margin: 0;
    border: 0; border-radius: 0; background: none;
    -webkit-appearance: none; appearance: none;
    color: inherit; cursor: pointer;
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity .2s ease, visibility 0s linear .2s, color .25s ease;
  }
  .site-nav__toggle span { display: block; width: 22px; height: 2px; background: currentColor; }
  .site-nav__toggle:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
  .site-nav.is-compact .site-nav__toggle {
    display: flex;
    opacity: 1; visibility: visible; pointer-events: auto;
    animation: zaria-nav-in .2s ease;
  }
  @keyframes zaria-nav-in { from { opacity: 0; } to { opacity: 1; } }
  /* Desplegable */
  .site-nav.is-compact ul {
    position: absolute; top: 52px; left: calc(14 * var(--u));
    align-items: stretch;
    min-width: 200px; padding: 6px 0;
    border-radius: 10px;
    background: rgba(242, 233, 222, .98);
    box-shadow: 0 10px 30px rgba(43, 28, 20, .2);
    color: var(--c-ink);
    opacity: 0; visibility: hidden; transform: translateY(-6px); pointer-events: none;
    transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
  }
  .site-nav.is-compact.is-open ul {
    opacity: 1; visibility: visible; transform: none; pointer-events: auto;
    transition: opacity .18s ease, transform .18s ease, visibility 0s;
  }
  .site-nav.is-compact a { height: 46px; padding: 0 22px 0 14px; font-size: 16px; gap: 8px; }
  .site-nav.is-compact a::before { width: 24px; background-size: 14px 1px; }
  .site-nav.is-compact a[aria-current="page"]::before { background-size: 100% 2px; }
  .site-nav.is-compact li + li a { border-top: 1px solid rgba(89, 45, 29, .1); }
  .site-nav.is-compact a:hover { opacity: 1; background: rgba(89, 45, 29, .06); }
  .site-nav.is-compact a:focus-visible { outline-offset: -3px; }
}

/* ---------- Menú móvil: botón siempre visible (13 nov.) ----------
   Ya no se oculta al dejar la portada; el desplegable solo se abre al
   pulsarlo y cabe en pantallas bajas. */
@media (max-width: 1023px) {
  .site-nav.is-past-hero { opacity: 1; visibility: visible; }
  .site-nav ul { max-height: calc(100dvh - 72px - env(safe-area-inset-top, 0px)); overflow-y: auto; }
  .brand-top { top: calc(14px + env(safe-area-inset-top, 0px)); width: 124px; }
  /* Zaria (móvil): el titular empieza justo arriba; se baja para dejar aire bajo el logo */
  header.zhero { padding-top: calc(98px + env(safe-area-inset-top, 0px)); }
}

/* ---------- Footer: marca | apartados | contacto, y franja legal ---------- */
.footer__inner {
  grid-template-columns: calc(380 * var(--u)) calc(300 * var(--u)) 1fr;
  column-gap: 0;
  padding: calc(76 * var(--u)) 0 calc(34 * var(--u));
}
.footer__brand { grid-column: 1; }
.footer__logo { display: inline-block; width: calc(170 * var(--u)); line-height: 0; }
.footer__logo img { display: block; width: 100%; height: auto; }
.footer__logo:focus-visible { outline: 1px solid currentColor; outline-offset: 6px; }
.footer__tagline { margin-top: calc(20 * var(--u)); max-width: calc(260 * var(--u)); font-size: max(15px, calc(17 * var(--u))); line-height: 1.35; }
.footer__col--nav { grid-column: 2; }
.footer__col--contact { grid-column: 3; padding-bottom: 0; }
.footer__label { font-size: max(12px, calc(12 * var(--u))); }
.footer__col ul { margin-top: calc(14 * var(--u)); }
.footer__col li { font-size: max(14px, calc(14 * var(--u))); line-height: 1.5; }
.footer__col li + li { margin-top: calc(8 * var(--u)); }
.footer__col a { transition: color .2s ease; }
.footer__col a:hover, .footer__col a[aria-current="page"] { color: var(--c-white); }
.footer__col a:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }
.footer__bottom {
  grid-column: 1 / -1;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: calc(12 * var(--u)) calc(32 * var(--u));
  margin-top: calc(64 * var(--u));
  padding-top: calc(22 * var(--u));
  border-top: 1px solid rgba(255, 255, 255, .14);
  font-size: max(12px, calc(12 * var(--u)));
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(227, 216, 204, .78);
}
.footer__bottom .footer__legal { margin-top: 0; column-gap: calc(28 * var(--u)); row-gap: 4px; }
.footer__legal a { font-size: inherit; letter-spacing: inherit; }
.footer__copy { margin: 0; }

@media (min-width: 1024px) and (max-width: 1279px) {
  .footer__label { font-size: max(12px, calc(12 * var(--u))); }
  .footer__col li { font-size: max(14px, calc(14 * var(--u))); line-height: 1.5; }
  .footer__bottom { font-size: 12px; }
}
@media (max-width: 1023px) {
  .footer__inner { grid-template-columns: 1fr; row-gap: 40px; padding: 56px 20px 28px; }
  .footer__brand, .footer__col--nav, .footer__col--contact { grid-column: 1; }
  .footer__logo { width: 150px; }
  .footer__tagline { max-width: none; font-size: 16px; }
  .footer__label { font-size: 12px; }
  .footer__col ul { margin-top: 10px; }
  .footer__col li { font-size: 15px; line-height: 1.5; }
  .footer__col li + li { margin-top: 0; }
  .footer__col a { display: inline-flex; align-items: center; min-height: 40px; }
  .footer__bottom { flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 8px; padding-top: 18px; font-size: 12px; }
  .footer__bottom .footer__legal { column-gap: 24px; }
  .footer__legal a { min-height: 44px; font-size: 12px; }
}

/* Botón sobre cualquier fondo (13 nov.): fuera de la portada lleva un
   fondo claro discreto para leerse sobre fotos y bloques oscuros. */
.site-nav.has-backdrop .site-nav__toggle {
  background: rgba(242, 233, 222, .92);
  color: var(--c-ink);
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(43, 28, 20, .16);
  transition: background-color .2s ease, box-shadow .2s ease, color .25s ease;
}

@media (prefers-reduced-motion: reduce) {
  .site-nav ul, .site-nav__toggle, .site-nav.is-compact ul { transition: none !important; animation: none !important; }
}

/* ---------- Botón sobre portadas con mucho detalle (13 nov., 3.ª) ----------
   nav.js añade .on-panel cuando el BOTÓN (móvil o escritorio compacto)
   está sobre un elemento con data-nav-panel (franjas de Services, fotos de
   las portadas de servicio): el botón lleva su fondo claro. El menú
   completo de escritorio no lleva ningún fondo: solo cambia el color de
   letras y líneas según la zona (data-nav-theme). */
.site-nav.on-panel, .site-nav.on-panel.is-light { color: var(--c-ink); }
/* El botón (móvil o escritorio compacto) lleva su fondo claro también aquí */
.site-nav.on-panel .site-nav__toggle {
  background: rgba(242, 233, 222, .92);
  color: var(--c-ink);
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(43, 28, 20, .16);
}
