/* ==========================================================================
   RUT — TINTA Y SOL · base.css
   Reset + tipografía + componentes compartidos de TODO el rediseño.
   Requiere tokens.css cargado antes. Las fuentes (Fraunces, Plus Jakarta
   Sans, IBM Plex Mono) se enlazan desde Google Fonts en el <head> del HTML:

   <link rel="preconnect" href="https://fonts.googleapis.com">
   <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
   <link href="https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400..600;1,9..144,400..600&family=IBM+Plex+Mono:wght@400;500&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap" rel="stylesheet">
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. Fallbacks métricos (minimizan CLS mientras cargan las webfonts)
   -------------------------------------------------------------------------- */
@font-face {
  font-family: "Fraunces-fallback";
  src: local("Georgia"), local("Times New Roman");
  size-adjust: 106%;
  ascent-override: 92%;
  descent-override: 24%;
}
@font-face {
  font-family: "Jakarta-fallback";
  src: local("Segoe UI"), local("Arial");
  size-adjust: 101%;
}

/* --------------------------------------------------------------------------
   1. Reset ligero
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
body {
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: var(--leading-body);
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
img, picture, video, svg { display: block; max-width: 100%; }
img { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
ul[class], ol[class] { list-style: none; padding: 0; }
a { color: var(--indigo); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
p, li { max-width: var(--measure); }
hr { border: 0; border-top: var(--rule); }

:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
}
.bg-ink :focus-visible,
.bg-ink-deep :focus-visible {
  outline: var(--focus-ring-inverse);
}

::selection { background: var(--sol); color: var(--ink); }

/* --------------------------------------------------------------------------
   2. Tipografía base
   -------------------------------------------------------------------------- */
h1, h2, h3 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 550;
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-display);
  text-wrap: balance;
}
h1 { font-size: var(--step-6); }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-2); }
h4, h5, h6 { font-family: var(--font-sans); font-weight: 700; line-height: 1.3; }
h4 { font-size: var(--step-1); }

em, .italic-emo { font-style: italic; } /* itálica Fraunces: solo palabras emocionales y citas */

.display-1 { font-size: var(--step-6); }
.display-2 { font-size: var(--step-5); }
.giant     { font-size: var(--step-7); line-height: 0.95; }
.lead      { font-size: var(--step-1); line-height: 1.45; max-width: 46ch; text-wrap: pretty; }
.text-2    { color: var(--gray-text); }
.small     { font-size: var(--step--1); }

/* --------------------------------------------------------------------------
   3. Layout: contenedor y retícula de 12 columnas
   -------------------------------------------------------------------------- */
.container {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--margin-page);
}
.grid-12 {
  display: grid;
  grid-template-columns: repeat(var(--grid-cols), minmax(0, 1fr));
  column-gap: var(--gutter);
}
.section { padding-block: var(--space-section); }
.section--flush-top { padding-top: 0; }

/* Fondos de bloque (ritmo tinta/papel §3.4) */
.bg-ink       { background: var(--ink); color: var(--white); }
.bg-ink-deep  { background: var(--ink-deep); color: var(--white); }
.bg-paper     { background: var(--paper); }
.bg-paper-warm{ background: var(--paper-warm); }
.bg-mist      { background: var(--mist); }
.bg-ink a, .bg-ink-deep a { color: var(--white); }
.bg-ink a:hover, .bg-ink-deep a:hover { color: var(--sol); }
.bg-ink p, .bg-ink-deep p { color: var(--white); }
.bg-ink .text-2, .bg-ink-deep .text-2 { color: var(--white-60); }

/* --------------------------------------------------------------------------
   4. Accesibilidad: skip-link y utilidades
   -------------------------------------------------------------------------- */
.skip-link {
  position: fixed;
  top: 8px; left: 8px;
  z-index: var(--z-skip);
  padding: 12px 20px;
  background: var(--ink);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; color: var(--white); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* --------------------------------------------------------------------------
   5. COMPONENTE · Eyebrow mono (metadato editorial)
   Uso: <p class="eyebrow">CAP. 01 — PARA VIVIR</p>
   Variante sobre tinta: .eyebrow--inverse · Con marca sol: .eyebrow--sol
   -------------------------------------------------------------------------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  color: var(--indigo);
}
.eyebrow--inverse { color: var(--sol); }
.eyebrow--muted   { color: var(--gray-text); }
.eyebrow--sol::before {
  content: "";
  display: inline-block;
  width: 22px; height: 10px;
  margin-right: 10px;
  background: var(--sol);
  vertical-align: baseline;
}

/* --------------------------------------------------------------------------
   6. COMPONENTE · Subrayado firma (el gesto del subrayador §3.5.1)
   Uso: <em class="hl">empieza aquí</em> dentro de un titular.
   Sin JS el subrayado es visible; con JS (html.js) parte de 0 y se anima
   cuando el observer añade .is-inked al elemento o a un ancestro [data-ink].
   -------------------------------------------------------------------------- */
.hl {
  font-style: inherit;
  background-image: linear-gradient(var(--sol), var(--sol));
  background-repeat: no-repeat;
  background-size: 100% 0.34em;
  background-position: 0 86%;
  padding-inline: 0.04em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
html.js .hl {
  background-size: 0% 0.34em;
  transition: background-size var(--dur-med) var(--ease-editorial);
}
html.js .is-inked .hl,
html.js .hl.is-inked { background-size: 100% 0.34em; }

/* Enlace destacado con subrayado firma en hover */
.link-hl {
  color: inherit;
  text-decoration: none;
  background-image: linear-gradient(var(--sol), var(--sol));
  background-repeat: no-repeat;
  background-size: 0% 2px;
  background-position: 0 100%;
  transition: background-size var(--dur-fast) var(--ease-editorial);
  padding-bottom: 2px;
}
.link-hl:hover, .link-hl:focus-visible { background-size: 100% 2px; color: inherit; }

/* --------------------------------------------------------------------------
   7. COMPONENTE · Botones (3 variantes §3.3)
   .btn--primary  → fondo índigo, texto blanco (sobre fondos claros)
   .btn--sol      → fondo sol, texto tinta (sobre fondos navy)
   .btn--ghost    → borde 1.5px, transparente (.btn--ghost-inverse sobre tinta)
   -------------------------------------------------------------------------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap-min);
  padding: 12px 26px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: var(--step-0);
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
}
.btn::before { /* barrido de fondo izquierda→derecha */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--dur-fast) var(--ease-editorial);
}
.btn:hover::before, .btn:focus-visible::before { transform: scaleX(1); }
.btn .btn-arrow { transition: transform var(--dur-fast) var(--ease-editorial); flex: none; }
.btn:hover .btn-arrow, .btn:focus-visible .btn-arrow { transform: translateX(4px); }

.btn--primary { background: var(--indigo); color: var(--white); }
.btn--primary::before { background: var(--ink); }
.btn--primary:hover, .btn--primary:focus-visible { color: var(--white); }

.btn--sol { background: var(--sol); color: var(--ink); }
.btn--sol::before { background: var(--sol-hover); }
.btn--sol:hover, .btn--sol:focus-visible { color: var(--ink); }

.btn--ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn--ghost::before { background: var(--ink); }
.btn--ghost:hover, .btn--ghost:focus-visible { color: var(--white); }

.btn--ghost-inverse { border-color: var(--white); color: var(--white); background: transparent; }
.btn--ghost-inverse::before { background: var(--white); }
.btn--ghost-inverse:hover, .btn--ghost-inverse:focus-visible { color: var(--ink); }

/* --------------------------------------------------------------------------
   8. COMPONENTE · Figure editorial (foto documento §3.4)
   Uso: <figure class="figure-ed"><div class="figure-ed__frame"><img …></div>
        <figcaption>COMEDOR — PLANTA BAJA</figcaption></figure>
   Ratios: .ratio-45 (4:5) · .ratio-32 (3:2) · .ratio-169 (16:9) · .ratio-11
   -------------------------------------------------------------------------- */
.figure-ed { margin: 0; }
.figure-ed__frame {
  position: relative; /* ancla del arco decorativo, inmune a márgenes del <figure> */
  overflow: hidden;
  border-radius: var(--radius-s);
  background: var(--mist);
}
.figure-ed__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-editorial);
}
.figure-ed:hover .figure-ed__frame img { transform: scale(1.04); }
.figure-ed figcaption {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  color: var(--gray-text);
  transition: transform var(--dur-fast) var(--ease-editorial);
}
.figure-ed:hover figcaption { transform: translateX(4px); }
.bg-ink .figure-ed figcaption, .bg-ink-deep .figure-ed figcaption { color: var(--white-60); }

.ratio-45  { aspect-ratio: 4 / 5; }
.ratio-32  { aspect-ratio: 3 / 2; }
.ratio-169 { aspect-ratio: 16 / 9; }
.ratio-11  { aspect-ratio: 1 / 1; }

/* --------------------------------------------------------------------------
   9. COMPONENTE · Filete y folio de sección (§3.1.3)
   Uso: <header class="section-head"><span class="folio">02</span> …</header>
   -------------------------------------------------------------------------- */
.section-head {
  display: flex;
  align-items: baseline;
  gap: var(--gutter);
  padding-top: var(--space-cluster);
  border-top: var(--rule-ink);
  margin-bottom: var(--space-block);
}
.bg-ink .section-head, .bg-ink-deep .section-head { border-top: var(--rule-inverse); }
.folio {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: var(--step-4);
  font-weight: 400;
  line-height: 1;
  color: var(--indigo);
  flex: none;
}
.bg-ink .folio, .bg-ink-deep .folio { color: var(--indigo-bright); } /* solo decorativo sobre navy */
.bg-paper-warm .folio { color: var(--indigo); }

/* --------------------------------------------------------------------------
   9b. COMPONENTE · Arco de remate (doble línea concéntrica, derivado del
   trazo del logotipo) sobre la esquina de una foto.
   Uso: <figure class="figure-ed ..."><div class="figure-ed__frame arco-frame
          ratio-32"><svg class="arco" ...><use href="#trazo-arco"/></svg>
          <img ...></div></figure> — el arco va DENTRO de .figure-ed__frame
          (no en el <figure> exterior), que es quien ancla su posición y no
          se ve afectado por el margen negativo del solape asimétrico.
          Requiere el <symbol id="trazo-arco"> compartido, incluido una vez
          por página tras el skip-link.
   -------------------------------------------------------------------------- */
.arco-frame .arco {
  position: absolute;
  /* Offset positivo (hacia dentro): el arco queda contenido en la propia
     caja de la foto (overflow:hidden), inmune al margen negativo que
     usan las cabeceras de capítulo para el solape asimétrico con el
     titular. Un offset negativo aquí haría que el arco "se saliera"
     de la foto justo por donde esta monta bajo el H1, solapando el texto. */
  top: clamp(10px, 1.2vw, 18px);
  left: clamp(10px, 1.2vw, 18px);
  width: clamp(56px, 7vw, 96px);
  height: auto;
  color: var(--white);
  z-index: 1;
  pointer-events: none;
  filter: drop-shadow(0 1px 3px rgba(10, 31, 68, 0.45));
}
.arco-frame--sol .arco { color: var(--sol); }

/* --------------------------------------------------------------------------
   9c. COMPONENTE · Hilo — línea tubular de doble filo, divisor entre
   secciones. Dos paths paralelos; se dibujan al entrar en viewport.
   Uso: <div class="hilo hilo--ink" data-reveal aria-hidden="true">
          <svg viewBox="0 0 1440 110" preserveAspectRatio="none"><path
          pathLength="1" d="…"/><path pathLength="1" d="…"/></svg></div>
   -------------------------------------------------------------------------- */
.hilo { overflow: hidden; line-height: 0; }
.hilo svg {
  display: block;
  width: 100%;
  height: clamp(64px, 9vw, 110px);
}
.hilo path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.hilo--ink    { color: var(--ink); }
.hilo--indigo { color: var(--indigo); }
.hilo--flip svg { transform: scaleX(-1); }

/* el hilo no usa el reveal de opacidad: solo el dibujo del trazo */
html.js .hilo[data-reveal] { opacity: 1; transform: none; }
html.js .hilo path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 700ms var(--ease-editorial);
}
html.js .hilo path + path { transition-delay: 140ms; }
html.js .hilo.is-visible path { stroke-dashoffset: 0; }

/* --------------------------------------------------------------------------
   10. COMPONENTE · Banda de tranquilidad (familias §3.6)
   Franja de tinta con datos en mono + cifras Fraunces (contadores en JS).
   Uso: <section class="calm-bar"><div class="calm-bar__grid container">
          <div class="calm-stat"><span class="calm-stat__num" data-count-to="24">24</span>…
   -------------------------------------------------------------------------- */
.calm-bar {
  background: var(--ink);
  color: var(--white);
  padding-block: clamp(36px, 6vh, 64px);
}
.calm-bar__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: var(--gutter);
}
.calm-stat {
  border-left: var(--rule-inverse);
  padding-left: clamp(14px, 1.5vw, 24px);
}
.calm-stat__num {
  display: block;
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: var(--step-4);
  font-weight: 500;
  line-height: 1.05;
  color: var(--sol);
  font-variant-numeric: tabular-nums;
}
.calm-stat__num sub, .calm-stat__num .unit {
  font-size: 0.45em;
  font-family: var(--font-mono);
  letter-spacing: var(--tracking-mono);
  vertical-align: baseline;
}
.calm-stat__label {
  display: block;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  color: var(--white-60);
}

/* --------------------------------------------------------------------------
   11. COMPONENTE · Tarjeta editorial (blog / actualidad / cruces)
   Uso: <a class="card-ed" href="…"><figure class="figure-ed">…</figure>
        <p class="card-ed__meta">16 ABR — COMUNIDAD</p><h3 class="card-ed__title">…</h3></a>
   -------------------------------------------------------------------------- */
.card-ed {
  display: block;
  color: inherit;
  text-decoration: none;
  padding-bottom: var(--space-cluster);
  border-bottom: var(--rule-ink);
}
.card-ed__meta {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  color: var(--gray-text);
}
.card-ed__title {
  margin-top: 8px;
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: var(--step-2);
  font-weight: 550;
  line-height: 1.15;
  letter-spacing: var(--tracking-display);
}
.card-ed:hover .card-ed__title { color: var(--indigo); }
.card-ed__excerpt { margin-top: 8px; color: var(--gray-text); font-size: var(--step-0); }

/* --------------------------------------------------------------------------
   12. COMPONENTE · Vídeo testimonio (click-to-play YouTube)
   Uso: <figure class="video-testi"><button class="video-testi__btn" data-yt="ID">
          <img …><span class="video-testi__play">…</span></button>
        <figcaption><strong>Encarni</strong> — Antigua residente</figcaption></figure>
   -------------------------------------------------------------------------- */
.video-testi { margin: 0; }
.video-testi__btn {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 0;
  border-radius: var(--radius-s);
  overflow: hidden;
  cursor: pointer;
  background: var(--ink);
}
.video-testi__btn img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-editorial);
}
.video-testi__btn:hover img { transform: scale(1.04); }
.video-testi__play {
  position: absolute;
  left: 12px; bottom: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  background: var(--sol);
  color: var(--ink);
  border-radius: var(--radius-s);
  transition: background var(--dur-fast) var(--ease-editorial);
}
.video-testi__btn:hover .video-testi__play { background: var(--sol-hover); }
.video-testi__play svg { width: 18px; height: 18px; fill: currentColor; }
.video-testi iframe {
  width: 100%; height: 100%;
  border: 0;
  position: absolute; inset: 0;
}
.video-testi figcaption {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  color: var(--gray-text);
}
.video-testi figcaption strong { color: inherit; font-weight: 500; }
.bg-ink .video-testi figcaption { color: var(--white-60); }

/* --------------------------------------------------------------------------
   13. COMPONENTE · Header sticky (todas las páginas)
   Transparente sobre el hero → tras scroll (html.js + .is-scrolled desde
   main.js): fondo blanco, filete inferior y logo reducido.
   Estructura: header.site-header > div.site-header__bar > [logo | nav | cta | burger]
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: var(--z-header);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background var(--dur-fast) ease, border-color var(--dur-fast) ease;
}
.site-header.is-scrolled,
.site-header.is-open {
  background: var(--white);
  border-bottom: var(--rule);
}
.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gutter);
  min-height: var(--header-h);
  transition: min-height var(--dur-fast) ease;
}
.site-header.is-scrolled .site-header__bar { min-height: var(--header-h-compact); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}
/* Marca — logotipo oficial (rut-ink.png sobre claro): el wordmark real
   de trazo tubular sustituye a la reconstrucción tipográfica "RUT" */
.brand__logo-img {
  height: 48px;
  width: auto;
  transition: height var(--dur-fast) ease;
}
.site-header.is-scrolled .brand__logo-img { height: 38px; } /* logo reducido */

/* Variante de dos logos (blanco + tinta): para páginas cuyo hero es
   oscuro bajo el header transparente. Se incluyen ambas imágenes en el
   HTML y se alternan por CSS según .is-scrolled — sin JS adicional.
   Uso: <img class="brand__logo-img brand__logo-img--ink" .../>
        <img class="brand__logo-img brand__logo-img--white" .../> */
.brand__logo-img--white { display: none; }
.site-header:not(.is-scrolled) .brand__logo-img--white { display: block; }
.site-header:not(.is-scrolled) .brand__logo-img--ink { display: none; }
.brand__sub {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  color: var(--gray-text);
}
@media (max-width: 1100px) { .brand__sub { display: none; } }

.site-nav ul, .site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-nav > ul {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.3vw, 26px);
}
.site-nav a { text-decoration: none; }
.site-nav > ul > li > a {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  min-height: var(--tap-min);
  font-weight: 600;
  font-size: var(--step--1);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink);
  /* subrayado amarillo que crece desde la izquierda */
  background-image: linear-gradient(var(--sol), var(--sol));
  background-repeat: no-repeat;
  background-size: 0% 2px;
  background-position: 0 calc(50% + 0.9em);
  transition: background-size var(--dur-fast) var(--ease-editorial);
}
.site-nav > ul > li > a:hover,
.site-nav > ul > li > a:focus-visible,
.site-nav > ul > li > a[aria-current="page"] { background-size: 100% 2px; color: var(--ink); }

.nav-item { position: relative; }
.nav-sub {
  position: absolute;
  top: 100%; left: -18px;
  min-width: 250px;
  padding: 8px 0;
  background: var(--white);
  border: var(--rule);
  border-top: 2px solid var(--sol);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity var(--dur-fast) ease, transform var(--dur-fast) ease, visibility var(--dur-fast);
}
.nav-item:hover .nav-sub,
.nav-item:focus-within .nav-sub,
.nav-item.is-open .nav-sub {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.nav-sub a {
  display: block;
  padding: 10px 18px;
  font-size: var(--step--1);
  color: var(--ink);
}
.nav-sub a:hover, .nav-sub a:focus-visible { background: var(--mist); color: var(--indigo); }

.site-header__cta { flex: none; }

.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: var(--tap-min);
  height: var(--tap-min);
  padding: 10px;
  background: none;
  border: 0;
  cursor: pointer;
}
.burger span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--ink);
  transition: transform var(--dur-fast) ease, opacity var(--dur-fast) ease;
}
.site-header.is-open .burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-header.is-open .burger span:nth-child(2) { opacity: 0; }
.site-header.is-open .burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 1020px) {
  .burger { display: flex; }
  .site-header__cta { display: none; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--white);
    border-bottom: var(--rule);
    max-height: calc(100vh - var(--header-h-compact));
    overflow-y: auto;
  }
  .site-header.is-open .site-nav { display: block; }
  .site-nav > ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px var(--margin-page) 24px;
  }
  .site-nav > ul > li { border-bottom: var(--rule); }
  .site-nav > ul > li > a { width: 100%; padding: 12px 0; background-position: 0 100%; }
  .nav-sub {
    position: static;
    display: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    border: 0;
    border-top: 0;
    padding: 0 0 10px 14px;
    min-width: 0;
  }
  .nav-item.is-open .nav-sub { display: block; }
}

/* --------------------------------------------------------------------------
   14. COMPONENTE · Footer tinta (sumario de revista, todas las páginas)
   Estructura: footer.site-footer > .site-footer__trazo + .site-footer__cols + .site-footer__legal
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--ink-deep);
  color: var(--white);
  padding-top: var(--space-block);
}
/* El logotipo oficial completo, como marca fantasma (sustituye a la
   antigua palabra "RUT" reconstruida con la tipografía de la web) */
.site-footer__trazo {
  display: block;
  width: min(50vw, 400px);
  height: auto;
  opacity: 0.14;
  user-select: none;
  pointer-events: none;
  margin-bottom: calc(var(--space-block) * 0.4);
}
.site-footer__logo {
  height: 40px;
  width: auto;
  margin-bottom: 12px;
}
.site-footer__social { margin-top: 16px; }

/* Iconos sociales (footer y cierre). Componente compartido: sin esta
   regla los <svg> quedan sin tamaño y se renderizan enormes. */
.social-row { display: flex; gap: 10px; }
.social-row a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap-min);
  height: var(--tap-min);
  border: 1px solid var(--white-20);
  border-radius: var(--radius-s);
  transition: border-color var(--dur-fast) ease, transform var(--dur-fast) var(--ease-editorial);
}
.social-row a:hover { border-color: var(--sol); transform: translateY(-2px); }
.social-row svg { width: 18px; height: 18px; fill: var(--white); }
.social-row a:hover svg { fill: var(--sol); }
.site-footer__cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-cluster) var(--gutter);
  padding-block: var(--space-block);
  border-top: var(--rule-inverse);
}
.site-footer__cols h2 {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  color: var(--sol);
  margin-bottom: 14px;
}
.site-footer__cols li { padding: 4px 0; font-size: var(--step--1); }
.site-footer__cols a {
  color: var(--white-60);
  text-decoration: none;
}
.site-footer__cols a:hover, .site-footer__cols a:focus-visible { color: var(--sol); }
.site-footer__cols address { font-style: normal; color: var(--white-60); font-size: var(--step--1); }
.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 8px var(--gutter);
  justify-content: space-between;
  padding-block: 22px;
  border-top: var(--rule-inverse);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.04em;
  color: var(--white-60);
}

/* --------------------------------------------------------------------------
   15. Motion base: reveals (gateados por html.js — sin JS todo es visible)
   Uso: data-reveal en el elemento; data-reveal-group en un padre para
   escalonar hijos (main.js pone --reveal-delay por índice, 80ms).
   -------------------------------------------------------------------------- */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity var(--dur-slow) var(--ease-editorial),
    transform var(--dur-slow) var(--ease-editorial);
  transition-delay: var(--reveal-delay, 0ms);
}
html.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* --------------------------------------------------------------------------
   16. WhatsApp flotante (canal real de contacto de la RUT)
   -------------------------------------------------------------------------- */
.wa-float {
  position: fixed;
  right: 22px; bottom: 22px;
  z-index: var(--z-float);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid var(--sol);
  transition: transform var(--dur-fast) var(--ease-editorial), background var(--dur-fast) ease;
}
.wa-float:hover { transform: scale(1.06); background: var(--indigo); }
.wa-float svg { width: 26px; height: 26px; fill: var(--sol); }

/* --------------------------------------------------------------------------
   17. Formularios (labels visibles, campos mist, área táctil ≥44px)
   -------------------------------------------------------------------------- */
.field { margin-bottom: 18px; }
.field label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field textarea {
  width: 100%;
  min-height: var(--tap-min);
  padding: 10px 14px;
  background: var(--mist);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  color: var(--ink);
}
.field input:focus, .field textarea:focus {
  outline: var(--focus-ring);
  outline-offset: 0;
  border-color: var(--indigo);
}
.field--check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: var(--step--1);
}
.field--check input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--indigo); }
.form-ok {
  display: none;
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--paper-warm);
  border-left: 4px solid var(--sol);
  font-size: var(--step--1);
}
.form-ok.is-visible { display: block; }

/* --------------------------------------------------------------------------
   18. prefers-reduced-motion (§3.5 — obligatorio)
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  html.js [data-reveal] { opacity: 1; transform: none; }
  html.js .hl { background-size: 100% 0.34em; }
}
