/* Inter, SIL Open Font License: fonts/OFL.txt */
@font-face {
  font-family: Inter;
  src: url("/fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* El panel (admin/panel.css) también carga esta hoja. Lo que comparte con él (:root, html, body,
   a, img, .site-header, .bar, .brand, .page, .eyebrow, .empty, .entry, .ficha-*, .button) no cambia
   de valor aquí: lo propio de la web va bajo .site, la clase del <body> de cada página pública. */
:root {
  --bg: #f6f5f2;
  --ink: #161412;
  --text: var(--ink);
  --muted: #6f6962;
  --line: rgba(22, 20, 18, 0.12);
  --accent: #7b2d3e;
  --card: #fff;
  --header: 4.25rem;
  --page: 72rem;
  --read: 40rem;

  /* Escala y radios de la web. Son nombres que panel.css no usa. */
  --step-0: 1.0625rem;
  --step-1: clamp(1.15rem, 2vw, 1.35rem);
  --step-2: clamp(1.35rem, 2vw, 1.75rem);
  --step-3: clamp(1.75rem, 2.4vw, 2.35rem);
  --step-4: clamp(2.5rem, 4vw, 3.5rem);
  --step-5: clamp(2.75rem, 5vw, 4.5rem);
  --step-6: clamp(3.25rem, 7vw, 6.5rem);
  --round-s: 0.5rem;
  --round-m: 0.75rem;
  --band: #efece6;
  --accent-soft: color-mix(in srgb, var(--accent) 8%, var(--bg));
  --gutter: 1.25rem;
  --wrap: min(100% - 2 * var(--gutter), var(--page) - 2 * var(--gutter));
  --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E");
  --arrow-back: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 12H5M11 18l-6-6 6-6'/%3E%3C/svg%3E");
  --arrow-out: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7M8 7h9v9'/%3E%3C/svg%3E");
  --quote-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 30'%3E%3Cpath d='M0 30V18C0 8 5.5 1.6 15.5 0l1.6 4.2C11.4 6 8.7 9.8 8.4 15H16v15zm22 0V18c0-10 5.5-16.4 15.5-18l1.6 4.2C33.4 6 30.7 9.8 30.4 15H38v15z'/%3E%3C/svg%3E");
}

/* En la web el gris es más oscuro (6,3:1) y la columna de lectura, más corta (~70 caracteres). */
.site {
  --muted: #5f5953;
  --read: 38rem;
}

* { box-sizing: border-box; }

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

html:has(> body.site) { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: clip;
}

body.nav-open { overflow: hidden; }

/* hidden oculta siempre, aunque la pieza tenga su propio display (.button, .viewer-btn). */
.site [hidden] { display: none !important; }

img { max-width: 100%; height: auto; display: block; }

a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }

a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.site :is(h1, h2, h3) { text-wrap: balance; }

.site :is(p, li, dd, blockquote, figcaption, td) { text-wrap: pretty; }

.site ::selection { background: color-mix(in srgb, var(--accent) 20%, transparent); }

/* Enlaces dentro del texto: subrayado granate suave y granate al pasar. */
.site :is(p, dd, td, figcaption, blockquote) a:not([class]) {
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.site :is(p, dd, td, figcaption, blockquote) a:not([class]):hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

/* Un teléfono o un horario no se parten en dos líneas. */
.site a[href^="tel:"],
.nw { white-space: nowrap; }

.site [id] { scroll-margin-top: calc(var(--header) + 1.25rem); }

.site .chapter:target h2,
.site section:target > h2,
.site .sheet > div:target dt { animation: target-flash 1.4s ease-out; }

@keyframes target-flash {
  from { color: var(--accent); }
}

.skip {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--bg);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  z-index: 40;
}

.skip:focus { top: 0.5rem; }

/* Etiquetas: un solo estilo para las mayúsculas pequeñas de la web. El panel conserva el suyo
   (.eyebrow y .kicker, más abajo). */
.site :is(.eyebrow, .kicker, .hero-kicker, .footer-label, .sheet:not(.with-photo, .is-tiles) dt,
  .times h3, .stats span, .reach small, .contact-form label span, .prose h2, .notice time,
  .ficha-nav-label, .list-count, .legal th) {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.site-icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Cabecera y menú */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px) saturate(1.2);
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  max-width: none;
  margin: 0 auto;
  min-height: var(--header);
  padding: 0.7rem 1.25rem;
}

.site .bar {
  max-width: var(--page);
  padding-inline: var(--gutter);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.brand img {
  width: auto;
  height: 2rem;
  aspect-ratio: 3 / 4;
  object-fit: contain;
}

.site .brand img { height: 2.25rem; }

.brand-name {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  white-space: nowrap;
}

.menu-button {
  appearance: none;
  position: relative;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  padding: 0.55rem 0.95rem;
  min-height: 2.75rem;
  border-radius: 999px;
  cursor: pointer;
}

/* Tres líneas que se cruzan en un aspa al abrir. */
.menu-icon,
.menu-icon::before,
.menu-icon::after {
  display: block;
  width: 1.05rem;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.menu-icon { position: relative; transition: background 0.2s ease; }

.menu-icon::before,
.menu-icon::after {
  content: "";
  position: absolute;
  left: 0;
  transition: transform 0.22s ease;
}

.menu-icon::before { transform: translateY(-5px); }

.menu-icon::after { transform: translateY(5px); }

.site-header.is-open .menu-icon { background: transparent; }

.site-header.is-open .menu-icon::before { transform: rotate(45deg); }

.site-header.is-open .menu-icon::after { transform: rotate(-45deg); }

.nav {
  display: none;
}

.site-header.is-open .nav {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.15rem;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: calc(100dvh - var(--header));
  z-index: 10;
  background: var(--bg);
  padding: 1.25rem var(--gutter) calc(2.5rem + env(safe-area-inset-bottom));
  overflow: auto;
  animation: nav-in 0.18s ease-out;
}

@keyframes nav-in {
  from { opacity: 0; transform: translateY(-0.4rem); }
}

.nav a,
.nav-more {
  color: var(--text);
  text-decoration: none;
}

.nav > a:not(.nav-cta),
.nav-parent {
  display: flex;
  align-items: center;
  padding: 0.15rem 0;
  font-size: clamp(2rem, 8vw, 2.75rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.nav-cta { flex: none; align-self: flex-start; margin-top: 1.25rem; }

.nav a[aria-current="page"]:not(.nav-cta),
.nav-group:has(a[aria-current="page"]) > .nav-parent { color: var(--accent); }

.nav-group { display: flex; flex-wrap: wrap; align-items: center; }

span.nav-parent { cursor: pointer; }

.nav-more {
  appearance: none;
  border: 0;
  background: transparent;
  width: 2.75rem;
  height: 2.75rem;
  cursor: pointer;
  color: var(--text);
}

.nav-more::before {
  content: "";
  display: block;
  width: 0.45rem;
  height: 0.45rem;
  margin: 0 auto;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.22s ease;
}

.nav-group.is-open .nav-more::before { transform: rotate(225deg) translateY(-1px); }

/* En el móvil los subapartados cuelgan de un filete. */
.nav-sub {
  display: none;
  flex-basis: 100%;
  margin: 0.2rem 0 0.75rem 0.35rem;
  padding: 0 0 0.1rem 1rem;
  border-left: 1px solid var(--line);
}

.nav-group.is-open > .nav-sub { display: grid; }

.nav-sub a {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  font-size: clamp(1.15rem, 4.2vw, 1.35rem);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.nav-sub a[aria-current="page"] { color: var(--accent); }

/* Contacto rápido, al pie del menú móvil. */
.nav-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 2rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.nav-quick a {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.75rem;
  padding: 0 1.05rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font-size: 0.98rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.nav-quick .site-icon { color: var(--accent); }

/* Botones */

a.button,
button.button,
.contact-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  min-height: 2.75rem;
  padding: 0 1.15rem;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
  cursor: pointer;
}

a.button:hover,
button.button:hover,
.contact-form button:hover {
  color: #fff;
  text-decoration: none;
  filter: brightness(1.06);
}

.button.is-outline {
  gap: 0.5rem;
  border: 1.5px solid color-mix(in srgb, currentColor 40%, transparent);
  background: transparent;
  color: var(--ink);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.button.is-outline:hover {
  border-color: currentColor;
  background: var(--accent-soft);
  color: var(--accent);
  filter: none;
}

.button.is-outline.is-light {
  border-color: rgba(255, 255, 255, 0.75);
  color: #fff;
}

.button.is-outline.is-light:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* Página */

.page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  width: min(100%, var(--page));
  max-width: var(--page);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

.page h1,
.hero h1,
.page-head h1 {
  margin: 0;
  max-width: 100%;
  font-size: var(--step-5);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.96;
  overflow-wrap: break-word;
}

.page h1 { margin-bottom: 0.25rem; }

.page-head { margin: 0 0 0.5rem; }

.lede {
  margin: 0.9rem 0 0;
  max-width: var(--read);
  font-size: var(--step-1);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.45;
}

.eyebrow,
.kicker {
  margin: 0 0 0.85rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow { color: var(--accent); }

.kicker { color: var(--muted); }

.empty {
  margin: 0;
  max-width: var(--read);
  color: var(--muted);
}

.section-title {
  margin: 0 0 1.5rem;
  font-size: var(--step-3);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

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

/* «Todos los horarios», «Todas las noticias»…: una flecha detrás del enlace. */
:is(.week-more, .more-link) a::after {
  content: "";
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  margin-left: 0.35em;
  vertical-align: -0.04em;
  background: currentColor;
  -webkit-mask: var(--arrow) center / contain no-repeat;
  mask: var(--arrow) center / contain no-repeat;
  transition: transform 0.2s ease;
}

:is(.week-more, .more-link) a:hover::after { transform: translateX(0.2em); }

/* Portada */

.home {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

.hero {
  position: relative;
  display: block;
  min-width: 0;
  min-height: clamp(32rem, 78vh, 52rem);
  margin: 0;
  padding: 0;
  overflow: hidden;
  color: #fff;
}

.hero-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-width: 0;
  min-height: clamp(32rem, 78vh, 52rem);
  width: min(100%, var(--page));
  margin: 0 auto;
  padding: 0 var(--gutter) 2.4rem;
}

/* Velo: oscuro donde va el texto, para que se lea sobre el rótulo de la fachada. */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top,
    rgba(20, 16, 14, 0.9) 0%, rgba(20, 16, 14, 0.66) 34%,
    rgba(20, 16, 14, 0.2) 64%, rgba(20, 16, 14, 0) 88%);
  pointer-events: none;
}

.hero-kicker {
  margin: 0 0 0.55rem;
  color: #fff;
}

.hero h1 {
  max-width: 12em;
  color: #fff;
  font-size: var(--step-6);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.96;
  text-wrap: balance;
}

.hero .lede {
  max-width: 30rem;
  margin-top: 0.9rem;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.35);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin: 1.35rem 0 0;
}

.hero :focus-visible { outline-color: #fff; }

.hero-photo {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  max-width: none;
  height: 100%;
  margin: 0;
  object-fit: cover;
  object-position: center 72%;
}

.week,
.home-board,
.paths {
  width: var(--wrap);
  margin-inline: auto;
}

.week { padding-top: 3rem; }

.week > h2 { margin: 0 0 1.25rem; }

.week ul {
  display: grid;
  gap: 1.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.week-figure {
  margin: 0;
  font-size: 2.5rem;
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.week li p:last-child {
  margin: 0.5rem 0 0;
  max-width: 22rem;
  color: var(--muted);
}

.week-more { margin: 1.5rem 0 2.75rem; }

.home-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.block {
  padding: 3rem 0;
  border-top: 1px solid var(--line);
}

.home-avisos { grid-column: 1 / -1; }

.home-avisos:has(.empty) { padding-block: 2rem; }

[data-avisos-list]:has(.notice) {
  padding-left: 1.25rem;
  border-left: 3px solid var(--accent);
}

.notice {
  padding: 1.15rem 0;
  border-top: 1px solid var(--line);
}

.notice:first-child {
  padding-top: 0;
  border-top: 0;
}

.notice time { color: var(--accent); }

.notice p {
  margin: 0.4rem 0 0;
  max-width: var(--read);
  white-space: pre-wrap;
}

[data-posts-list] {
  display: grid;
  gap: 2.5rem;
}

.more-link { margin: 2rem 0 0; }

.paths ol {
  display: grid;
  gap: 1.75rem;
  margin: 0;
  padding: 3rem 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.paths a {
  display: grid;
  gap: 0.35rem;
  color: inherit;
  text-decoration: none;
}

.paths span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.paths strong {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: var(--step-3);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.1;
  transition: color 0.15s ease;
}

.paths strong::after {
  content: "";
  width: 0.62em;
  height: 0.62em;
  flex: none;
  background: currentColor;
  -webkit-mask: var(--arrow) center / contain no-repeat;
  mask: var(--arrow) center / contain no-repeat;
  transition: transform 0.2s ease;
}

.paths a:hover strong { color: var(--accent); }

.paths a:hover strong::after { transform: translateX(0.2em); }

.paths p { margin: 0; max-width: 22rem; }

/* La app: banda cálida a lo ancho, con la pantalla de inicio asomando por abajo. */
.close {
  overflow: hidden;
  background: var(--band);
}

.close-inner {
  display: grid;
  gap: 2.25rem;
  width: var(--wrap);
  margin-inline: auto;
  padding-top: 3.5rem;
}

.close-copy > p:first-child {
  margin: 0;
  max-width: 12em;
  font-size: var(--step-3);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.app-line { margin: 1.25rem 0 0; }

.app-shot {
  justify-self: center;
  width: min(68%, 15rem);
  margin: 0;
  padding: 0.5rem 0.5rem 0;
  background: var(--ink);
  border-radius: 2.25rem 2.25rem 0 0;
}

.app-shot img {
  width: 100%;
  border-radius: 1.8rem 1.8rem 0 0;
}

/* Tiendas de la app */

.store-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 3rem;
  padding: 0.35rem 0.95rem 0.35rem 0.7rem;
  border-radius: 0.7rem;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  line-height: 1.05;
}

.store-badge svg {
  width: 1.35rem;
  height: 1.35rem;
  min-width: 1.35rem;
  min-height: 1.35rem;
  flex: none;
  overflow: hidden;
}

.store-badge > span { white-space: nowrap; }

.store-badge small,
.store-badge strong { display: block; }

.store-badge small {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.store-badge strong {
  margin-top: 0.12rem;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

a.store-badge { transition: background 0.16s ease, transform 0.16s ease; }

a.store-badge:hover {
  background: #2c2824;
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
}

span.store-badge { cursor: default; }

.app-note .store-badges { margin-top: 0.9rem; }

.footer-col .store-badges { margin-top: 0.45rem; }

.link-tiles .store-links {
  grid-column: 1 / -1;
  padding: 1.35rem 0 1.5rem;
  border-bottom: 1px solid var(--line);
}

/* Tarjetas de noticias, eventos y Ayuda DANA */

.story {
  display: grid;
  align-content: start;
  gap: 0.45rem;
  color: inherit;
  text-decoration: none;
}

/* Marco 4:3: la foto entera sobre una copia suya desenfocada que llena el hueco. */
.story-media {
  position: relative;
  display: block;
  overflow: hidden;
  isolation: isolate;
  aspect-ratio: 4 / 3;
  margin-bottom: 0.55rem;
  border-radius: var(--round-m);
  background: var(--band);
}

.story-backdrop {
  position: absolute;
  inset: -12%;
  z-index: -1;
  width: 124%;
  max-width: none;
  height: 124%;
  object-fit: cover;
  filter: blur(26px) saturate(1.15) brightness(0.92);
}

.story-photo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.story-media.is-empty { background: var(--band) url("/logo.png") center / auto 42% no-repeat; }

.story h2,
.story h3 {
  margin: 0;
  font-size: var(--step-2);
  font-weight: 560;
  letter-spacing: -0.022em;
  line-height: 1.18;
  transition: color 0.15s ease;
}

.story time {
  color: var(--muted);
  font-size: 0.9rem;
}

.story p {
  margin: 0.1rem 0 0;
  max-width: var(--read);
  font-size: 0.98rem;
  line-height: 1.55;
}

.story:hover :is(h2, h3) { color: var(--accent); }

.story:hover .story-photo { transform: scale(1.02); }

.story:focus-visible {
  outline-offset: 6px;
  border-radius: var(--round-m);
}

.stories {
  display: grid;
  gap: 2.75rem 2rem;
}

.site main[data-list] > h1 { margin-bottom: 2rem; }

.list-more {
  display: grid;
  justify-items: center;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 2.25rem;
  border-top: 1px solid var(--line);
}

.list-count {
  margin: 0;
  color: var(--muted);
}

/* Ficha */

.ficha-cover,
.entry img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.75rem;
}

.ficha-cover { margin-top: 1.5rem; }

.ficha-date {
  margin: 0.8rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.entry {
  max-width: var(--read);
  margin-top: 2rem;
}

.entry p { margin: 0 0 1rem; }

.entry ul,
.entry ol {
  margin: 0 0 1.15rem;
  padding-left: 1.25rem;
}

.entry ul { list-style: disc; }
.entry ol { list-style: decimal; }

.entry li { margin: 0.35rem 0; }

.entry img { margin: 1.25rem 0; }

.entry blockquote {
  margin: 1.5rem 0;
  padding: 0;
  border: 0;
  font-size: 1.25rem;
  line-height: 1.35;
}

/* La ficha publicada: columna de lectura centrada, portada y galerías algo más anchas.
   Las reglas de h2, h3, cita y enlace son las del editor del panel (.post-editor). */
.site main[data-ficha] {
  grid-template-columns:
    [full-start] minmax(0, 1fr) [feature-start] minmax(0, 9rem)
    [read-start] min(100%, var(--read)) [read-end]
    minmax(0, 9rem) [feature-end] minmax(0, 1fr) [full-end];
}

.site main[data-ficha] > *,
.site main[data-ficha] .entry > * { grid-column: read; }

.site main[data-ficha] .entry { display: contents; }

.site main[data-ficha] > .ficha-cover,
.site main[data-ficha] .entry > .gallery { grid-column: feature; }

.site main[data-ficha] > h1 {
  font-size: clamp(2.25rem, 4vw, 3.5rem);
  letter-spacing: -0.04em;
  line-height: 1.02;
}

.site main[data-ficha] .entry > :first-child { margin-top: 2.25rem; }

.ficha-back { margin: 0 0 1.25rem; }

.ficha-back a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.75rem;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s ease;
}

.ficha-back a::before {
  content: "";
  width: 1em;
  height: 1em;
  background: currentColor;
  -webkit-mask: var(--arrow-back) center / contain no-repeat;
  mask: var(--arrow-back) center / contain no-repeat;
}

.ficha-back a:hover { color: var(--accent); }

.ficha-missing { margin: 1.75rem 0 0; }

.site .ficha-cover {
  justify-self: center;
  width: auto;
  max-height: min(80vh, 44rem);
  margin-top: 2rem;
}

.site .entry {
  font-size: var(--step-0);
  line-height: 1.7;
}

.site .entry h2 {
  margin: 2.25rem 0 0.75rem;
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.site .entry h3 {
  margin: 1.75rem 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
}

.site .entry blockquote {
  margin: 1.75rem 0;
  padding-left: 1.1rem;
  border-left: 3px solid var(--accent);
  font-size: var(--step-1);
  line-height: 1.45;
}

.site .entry a:not([class]) { color: var(--accent); }

.site .entry li::marker { color: var(--accent); }

/* La introducción de Ayuda DANA va con aire de entradilla. */
.site main[data-list] > .entry {
  margin: 0 0 2.75rem;
  font-size: var(--step-1);
  line-height: 1.5;
}

.site main[data-list] > .entry p { margin: 0; }

/* Fotos seguidas del texto, en rejilla (galeria.js). */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 1.25rem 0 2rem;
}

.gallery-item {
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: var(--round-s);
  background: var(--band);
}

/* Con un número impar de fotos, la primera va a lo ancho para que no quede una sola al final. */
.gallery > :first-child:nth-last-child(odd) {
  grid-column: 1 / -1;
  aspect-ratio: 16 / 9;
}

.site .entry .gallery img {
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: cover;
  border-radius: 0;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-item:hover img { transform: scale(1.03); }

.ficha-nav {
  display: grid;
  gap: 0.25rem;
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.ficha-nav-link {
  display: grid;
  gap: 0.3rem;
  padding: 1rem 0;
  color: inherit;
  text-decoration: none;
}

.ficha-nav-label { color: var(--muted); }

.ficha-nav-title {
  font-size: var(--step-1);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.25;
  transition: color 0.15s ease;
}

.ficha-nav-link time {
  color: var(--muted);
  font-size: 0.9rem;
}

.ficha-nav-link:hover .ficha-nav-title { color: var(--accent); }

/* Visor de fotos */

html:has(.viewer[open]) { overflow: hidden; }

.viewer {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(16, 13, 11, 0.95);
  color: #fff;
}

.viewer[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.viewer::backdrop { background: transparent; }

.viewer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem max(0.75rem, env(safe-area-inset-right)) 0.75rem max(1.25rem, env(safe-area-inset-left));
}

.viewer-count {
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

.viewer-figure {
  display: grid;
  place-items: center;
  min-height: 0;
  margin: 0;
  padding: 0 1rem;
  touch-action: pan-y;
}

.viewer-img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  border-radius: var(--round-s);
  user-select: none;
}

.viewer-nav {
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding: 1rem 1rem max(1rem, env(safe-area-inset-bottom));
}

.viewer-btn {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease;
}

.viewer-btn:hover { background: rgba(255, 255, 255, 0.18); }

.viewer-btn .site-icon { width: 1.35rem; height: 1.35rem; }

.viewer :focus-visible { outline-color: #fff; }

/* Texto largo y citas */

.prose,
.quote {
  max-width: var(--read);
  overflow-wrap: break-word;
}

.prose { margin-top: 2.25rem; }

.prose ul {
  margin: 0 0 1.15rem;
  padding: 0 0 0 1.15rem;
  list-style: none;
}

.prose li {
  position: relative;
  padding: 0.3rem 0;
  line-height: 1.5;
}

.prose ul li::before {
  content: "";
  position: absolute;
  top: calc(0.3rem + 0.75em - 0.19rem);
  left: -1rem;
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 50%;
  background: var(--accent);
}

.prose h2 {
  margin: 2.25rem 0 0.85rem;
  color: var(--accent);
}

.quote {
  position: relative;
  margin: 2rem 0 0;
  padding: 0;
  border: 0;
  font-size: var(--step-2);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.3;
}

.quote p { margin: 0; }

.quote cite {
  display: block;
  margin-top: 0.85rem;
  font-size: 0.95rem;
  font-style: normal;
  letter-spacing: -0.01em;
  color: var(--muted);
}

/* Cita de cabecera (Sacramentos, Camino, cierre de Historia): comilla granate. */
.page > .quote,
.quote.is-lead {
  padding-top: 2.1rem;
  font-size: var(--step-3);
  line-height: 1.22;
}

.page > .quote::before,
.quote.is-lead::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 1.9rem;
  height: 1.45rem;
  background: var(--accent);
  -webkit-mask: var(--quote-mark) left top / contain no-repeat;
  mask: var(--quote-mark) left top / contain no-repeat;
}

/* La de cierre de Historia va dentro del texto y es larga: un escalón menos. */
.prose .quote.is-lead {
  margin: 2.5rem 0;
  font-size: var(--step-2);
  line-height: 1.3;
}

/* Cita dentro de un capítulo: más pequeña, con filete. */
.chapter .quote,
.prose .quote:not(.is-lead) {
  margin: 1.5rem 0;
  padding-left: 1.1rem;
  border-left: 3px solid var(--accent);
  font-size: var(--step-1);
  line-height: 1.45;
  letter-spacing: -0.012em;
}

.chapter .quote cite { margin-top: 0.6rem; font-size: 0.9rem; }

.chapter .prose > .quote:first-child { margin-top: 0; }

/* Índices de página */

.toc {
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: piece;
}

.toc li { counter-increment: piece; }

.toc a {
  position: relative;
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr);
  column-gap: 0.75rem;
  align-items: baseline;
  padding: 0.9rem 2rem 0.9rem 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: var(--step-2);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.15;
  text-decoration: none;
  transition: color 0.15s ease;
}

.toc a::before {
  content: counter(piece, decimal-leading-zero);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.toc a::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0.25rem;
  width: 1rem;
  height: 1rem;
  margin-top: -0.5rem;
  background: currentColor;
  -webkit-mask: var(--arrow) center / contain no-repeat;
  mask: var(--arrow) center / contain no-repeat;
  opacity: 0;
  transform: translateX(-0.3rem);
  transition: opacity 0.15s ease, transform 0.2s ease;
}

.toc a:hover::after { opacity: 1; transform: none; }

.toc a span {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.4;
}

.toc a:hover { color: var(--accent); }

.toc li:last-child a { border-bottom: 1px solid var(--line); }

/* Si el índice va justo antes de un capítulo, el filete del capítulo lo cierra. */
.toc:has(+ .chapter) li:last-child a,
.toc.is-split:has(+ .chapter) li:nth-last-child(2):nth-child(odd) a { border-bottom: 0; }

/* Horarios: el índice son fichas táctiles. */
.toc.is-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.toc.is-inline a,
.toc.is-inline li:last-child a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 1.05rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font-size: 0.98rem;
  letter-spacing: -0.01em;
}

.toc.is-inline a::before,
.toc.is-inline a::after { content: none; }

.toc.is-inline a:hover { border-color: currentColor; }

/* Capítulos */

.chapter {
  display: grid;
  gap: 1.5rem;
  padding: 3.5rem 0;
  border-top: 1px solid var(--line);
}

.chapter figure { margin: 0; }

.chapter.is-poster img {
  width: 100%;
  max-width: 28rem;
  border-radius: var(--round-m);
}

.chapter h2 {
  margin: 0;
  font-size: var(--step-3);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.chapter .lede { margin-top: 0.65rem; }

.chapter .prose { margin-top: 1.25rem; }

.chapter.is-poster .prose img.figure {
  width: min(24rem, 100%);
  height: auto;
  margin: 1.5rem 0;
}

.chapter .sheet { margin-top: 1.75rem; }

.chapter .sheet:last-child > div:last-child { border-bottom: 0; }

.chapter.is-mark { display: block; }

.chapter.is-mark .sheet { max-width: var(--read); }

.chapter-head {
  display: grid;
  grid-template-columns: 4.25rem minmax(0, 1fr);
  gap: 0.15rem 1.1rem;
  align-items: center;
}

.chapter.is-mark img {
  width: 4.25rem;
  height: 4.25rem;
  object-fit: cover;
  border-radius: 50%;
}

.chapter-head .kicker { margin-bottom: 0.15rem; }

.chapter-head .lede { margin-top: 0.3rem; }

/* Fichas de datos */

.sheet { margin: 0; }

.sheet > div {
  display: grid;
  gap: 0.35rem;
  padding: 1.35rem 0;
  border-top: 1px solid var(--line);
}

.sheet > div:last-child { border-bottom: 1px solid var(--line); }

.sheet dt {
  margin: 0;
  color: var(--muted);
}

.sheet dd {
  margin: 0;
  font-size: var(--step-1);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.3;
}

.page .sheet { margin-top: 3rem; }

.sheet.with-photo > div {
  grid-template-columns: 4.5rem minmax(0, 1fr);
  align-items: center;
  column-gap: 1.15rem;
  row-gap: 0.15rem;
}

.sheet.with-photo img {
  width: 4.5rem;
  height: 4.5rem;
  object-fit: cover;
  border-radius: 50%;
  grid-row: 1 / span 2;
}

.sheet.with-photo dt,
.sheet.with-photo dd { grid-column: 2; }

.sheet.with-photo dt {
  align-self: end;
  color: var(--ink);
  font-size: var(--step-2);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.sheet.with-photo dd {
  align-self: start;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
}

/* Ventajas fiscales de Obras: cuatro piezas. */
.sheet.is-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1.25rem;
  margin-top: 1.75rem;
}

.sheet.is-tiles > div,
.sheet.is-tiles > div:last-child {
  align-content: start;
  padding: 1.25rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.sheet.is-tiles dt {
  color: var(--ink);
  font-size: var(--step-3);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.sheet.is-tiles dd {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0;
}

/* Horarios */

.times {
  display: grid;
  gap: 2.5rem 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.times h3 {
  margin: 0 0 0.85rem;
  color: var(--muted);
}

.times ul { list-style: none; margin: 0; padding: 0; }

.times li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.35rem 1rem;
  align-items: baseline;
  padding: 0.35rem 0;
}

.when {
  color: var(--ink);
  font-size: clamp(2rem, 3vw, 3.25rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.96;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Horarios: los pinta horarios.js desde Firestore. Todas las secciones igual. */
.horarios { margin-top: 2.75rem; }

.horarios > section + section {
  margin-top: 2.75rem;
  padding-top: 2.25rem;
  border-top: 1px solid var(--line);
}

/* Una hora larga («9:30–13:30 y 17:30–19:30») parte en líneas en vez de salirse,
   y si es más que un tramo (is-long, lo pone horarios.js) va más pequeña. */
.horarios .when { white-space: normal; text-wrap: balance; }

.horarios .when.is-long {
  font-size: var(--step-2);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.horarios .times li.is-text { grid-template-columns: minmax(0, 1fr); }

.site .page-head .updated {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.times.is-line { gap: 0; }

.times.is-line li {
  grid-template-columns: 1fr;
  gap: 0.2rem 1.5rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--line);
}

.times.is-line li:last-child { border-bottom: 1px solid var(--line); }

/* Cifras */

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.75rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stats strong {
  display: block;
  font-size: var(--step-4);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
}

/* «Ascensores» no lleva número: un tamaño menos para que quepa. */
.stats li:not(:has(span)) strong {
  font-size: var(--step-2);
  line-height: 1.1;
}

.stats li:not(:has(span)) { align-self: center; }

.stats span {
  display: block;
  margin-top: 0.4rem;
  color: var(--muted);
}

/* Obras */

.wide-photo {
  display: block;
  width: 100vw;
  max-width: 100vw;
  height: auto;
  margin: 2rem 0 2.5rem calc(50% - 50vw);
}

.statement {
  max-width: var(--read);
  margin: 0 0 0.85rem;
  font-size: var(--step-3);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.statement + .kicker { margin-top: 2.75rem; }

.kicker + .lede { margin-top: 0; }

.page .stats { margin-top: 2rem; }

.page .figure { margin: 2.5rem 0; }

.cost-line {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem 2rem;
  margin-top: 0.5rem;
}

.cost-line + .eyebrow { margin-top: 4.5rem; }

.cost-figure {
  margin: 0.35rem 0 0;
  font-size: clamp(2.35rem, 11vw, 3.25rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.96;
  font-variant-numeric: tabular-nums;
}

.read { max-width: var(--read); }

.accounts {
  display: grid;
  gap: 1.75rem;
  margin-top: 2.5rem;
}

.accounts > div {
  display: grid;
  justify-items: start;
}

.account {
  margin: 0.35rem 0 0;
  font-size: var(--step-2);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.copy-button {
  margin-top: 0.85rem;
  font-size: 0.9rem;
}

.copy-button.is-done { color: var(--accent); border-color: currentColor; }

.donate-end { margin: 2.75rem 0 0; }

/* Contacto */

.map { margin-top: 1.75rem; }

.map iframe {
  display: block;
  width: 100%;
  height: clamp(16rem, 40vw, 24rem);
  border: 0;
  border-radius: var(--round-m);
  background: var(--band);
}

.map p { margin: 0.75rem 0 0; }

.reach {
  display: grid;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}

.reach a {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  align-content: center;
  column-gap: 0.85rem;
  row-gap: 0.2rem;
  min-height: 4.75rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: clamp(1.1rem, 1.5vw, 1.45rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.25;
  text-decoration: none;
  transition: color 0.15s ease;
}

.reach .site-icon {
  grid-row: 1 / span 2;
  align-self: center;
  width: 1.4rem;
  height: 1.4rem;
  color: var(--accent);
}

.reach a > :not(svg) { grid-column: 2; }

.reach [data-value] { overflow-wrap: anywhere; }

.reach li:last-child a { border-bottom: 1px solid var(--line); }

.reach small { color: var(--muted); }

.reach a:hover { color: var(--accent); }

.contact-form {
  display: grid;
  gap: 1.15rem;
  max-width: 36rem;
  margin-top: 2.5rem;
}

.contact-form label {
  display: grid;
  gap: 0.4rem;
}

.contact-form label span { color: var(--muted); }

.contact-form input,
.contact-form textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid color-mix(in srgb, var(--ink) 20%, transparent);
  border-radius: var(--round-s);
  background: var(--card);
  color: inherit;
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.contact-form textarea { min-height: 8.5rem; resize: vertical; }

.contact-form input:focus-visible,
.contact-form textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.contact-form button {
  justify-self: stretch;
  min-height: 3rem;
}

.app-note { margin-top: 2rem; max-width: var(--read); }

/* Enlaces */

.link-tiles {
  display: grid;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.link-tiles + .eyebrow {
  margin-top: 3.25rem;
  margin-bottom: 0.65rem;
}

.link-tiles + .eyebrow + .link-tiles { margin-top: 0; }

.link-tiles > li > a {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}

.link-tiles img {
  width: 5.5rem;
  height: 5.5rem;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 1.35rem;
}

.link-tiles > li > a strong {
  display: block;
  font-size: var(--step-2);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.15;
  transition: color 0.15s ease;
}

/* Son sitios de fuera: una flecha oblicua al pasar. */
.link-tiles > li > a strong::after {
  content: "";
  display: inline-block;
  width: 0.7em;
  height: 0.7em;
  margin-left: 0.3em;
  background: currentColor;
  -webkit-mask: var(--arrow-out) center / contain no-repeat;
  mask: var(--arrow-out) center / contain no-repeat;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.link-tiles > li > a:hover strong::after { opacity: 1; }

.link-tiles > li > a small {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.link-tiles > li > a:hover strong { color: var(--accent); }

/* Acontecimientos */

.poster-grid {
  display: grid;
  gap: 1.25rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}

.poster-grid li {
  overflow: hidden;
  border-radius: var(--round-m);
}

.poster-grid img {
  width: 100%;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.poster-grid li:hover img { transform: scale(1.02); }

/* Historia y Camino */

img.figure,
.pair img {
  width: 100%;
  height: auto;
  border-radius: var(--round-m);
}

/* Historia abre con la fachada y la cita de san Juan Pablo II, una junto a otra desde 640. */
.lead {
  display: grid;
  gap: 2rem;
  margin-top: 1.75rem;
}

.lead img {
  width: 100%;
  max-width: 24rem;
  border-radius: var(--round-m);
}

.lead .quote { margin: 0; }

.pair {
  display: grid;
  gap: 1rem;
}

.prose .pair,
.prose .figure { margin: 2rem 0; }

.pair.is-cover {
  max-width: 55rem;
  margin: 2rem 0;
}

.camino-close {
  display: grid;
  gap: 2rem;
}

.seal {
  display: block;
  width: min(100%, 16rem);
  height: auto;
}

/* Privacidad */

.legal { max-width: 48rem; margin-top: 2.25rem; }

.legal p,
.legal ul { max-width: var(--read); }

.legal h2 {
  margin: 2.75rem 0 0.75rem;
  font-size: var(--step-2);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.legal ul { padding-left: 1.25rem; }

.legal li { margin: 0.45rem 0; }

.legal li::marker { color: var(--accent); }

.legal .soft { color: var(--muted); }

.legal code {
  padding: 0.05rem 0.35rem;
  border-radius: 0.3rem;
  background: var(--band);
  font-size: 0.9em;
}

.legal table {
  width: 100%;
  margin: 1.25rem 0 1.5rem;
  border-collapse: collapse;
  font-size: 0.98rem;
  line-height: 1.5;
}

.legal th,
.legal td {
  padding: 0.85rem 1rem 0.85rem 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.legal th {
  color: var(--muted);
  border-bottom-color: color-mix(in srgb, var(--ink) 30%, transparent);
}

.legal-logo {
  width: auto;
  height: 4rem;
  margin-bottom: 1.5rem;
}

.legal-end {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.95rem;
}

/* En el móvil cada fila de una tabla se apila, con su cabecera delante de cada celda. */
@media (max-width: 639px) {
  .legal table,
  .legal tbody,
  .legal tr,
  .legal td { display: block; width: 100%; }

  .legal thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .legal tr {
    padding: 0.85rem 0;
    border-top: 1px solid var(--line);
  }

  .legal tr:last-child { border-bottom: 1px solid var(--line); }

  .legal td {
    padding: 0.3rem 0;
    border: 0;
  }

  .legal td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.15rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }
}

/* Pie */

.site-footer {
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 70%, var(--bg));
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas:
    "brand brand"
    "celebrar informarse"
    "contacto contacto"
    "legal legal";
  gap: 2rem 1.5rem;
  width: min(100%, var(--page));
  margin: 0 auto;
  padding: 2.5rem var(--gutter) 2rem;
}

.footer-brand { grid-area: brand; }

.footer-col.is-celebrar { grid-area: celebrar; }

.footer-col.is-informarse { grid-area: informarse; }

.footer-col.is-contacto { grid-area: contacto; }

.footer-logo {
  width: auto;
  height: 2.75rem;
  margin-bottom: 0.85rem;
}

.footer-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.footer-address {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.footer-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.footer-label {
  margin: 0 0 0.3rem;
  color: var(--muted);
}

.footer-inner a.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  max-width: 100%;
  min-width: 0;
  color: var(--text);
  font-weight: 520;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: color 0.15s ease;
}

.footer-link .site-icon { color: var(--muted); transition: color 0.15s ease; }

.footer-inner a.footer-link:hover,
.footer-inner a.footer-link:hover .site-icon { color: var(--accent); }

.footer-legal {
  grid-area: legal;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  padding-top: 1.15rem;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
}

.footer-legal a,
.footer-name {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  color: var(--ink);
  text-decoration: none;
}

.footer-legal a + a::before,
.footer-name::before {
  content: "·";
  margin: 0 0.65rem;
  color: var(--muted);
}

.footer-legal a:hover { color: var(--accent); }

.footer-name {
  margin: 0;
  color: var(--muted);
}

/* Tablet: desde 640 aparecen las columnas. */
@media (min-width: 640px) {
  .hero h1 { text-wrap: pretty; }

  .week ul {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
  }

  .week-figure { font-size: clamp(2rem, 1rem + 3vw, 3.5rem); }

  .home-board {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 2rem;
    align-items: start;
  }

  .paths ol {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
  }

  .paths strong { font-size: clamp(1.5rem, 1rem + 1.6vw, 2.35rem); }

  .stories { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .poster-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .toc.is-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 1.5rem;
  }

  .toc.is-split li { display: flex; }

  .toc.is-split a {
    flex: 1;
    min-width: 0;
    align-items: center;
    border-top: 0;
    border-bottom: 1px solid var(--line);
  }

  .toc.is-split li:nth-child(-n + 2) a { border-top: 1px solid var(--line); }

  .times:not(.is-line) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

  .sheet.with-photo {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 2rem;
  }

  .sheet.with-photo > div { border-bottom: 1px solid var(--line); }

  .link-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 1.5rem;
  }

  .pair {
    display: flex;
    align-items: flex-start;
  }

  /* Cada foto crece según su proporción (--ar): misma altura, sin recortar. */
  .pair img {
    flex: var(--ar, 1) 1 0%;
    min-width: 0;
  }

  .ficha-nav {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 2rem;
  }

  .lead {
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    column-gap: clamp(2rem, 5vw, 4.5rem);
    align-items: center;
  }

  .ficha-nav-link.is-next {
    grid-column: 2;
    text-align: right;
  }

  .contact-form button { justify-self: start; }

  .footer-inner {
    grid-template-areas:
      "brand contacto"
      "celebrar informarse"
      "legal legal";
    column-gap: 2.5rem;
  }
}

/* Escritorio: desde 880 el menú va en horizontal. site.js abre el submenú móvil por debajo de 880px. */
@media (min-width: 880px) {
  :root { --gutter: 2rem; }

  .menu-button { display: none; }

  .bar {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 1rem;
    padding: 0 1.25rem;
  }

  .site .brand img { height: 2.5rem; }

  .nav {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.05rem 0.85rem;
    position: static;
    width: auto;
    height: auto;
    margin-left: auto;
    padding: 0;
    background: transparent;
    overflow: visible;
    border: 0;
  }

  .site-header.is-open .nav {
    position: static;
    display: flex;
    flex-direction: row;
    align-items: center;
    width: auto;
    height: auto;
    padding: 0;
    overflow: visible;
    animation: none;
  }

  .nav-quick { display: none; }

  .nav > a:not(.nav-cta),
  .nav-parent {
    position: relative;
    min-height: 2.75rem;
    padding: 0;
    font-size: 0.92rem;
    letter-spacing: -0.02em;
  }

  .nav > a:not(.nav-cta) { transition: color 0.16s ease; }

  .nav > a:not(.nav-cta):hover { color: var(--accent); }

  /* La sección activa lleva un filete bajo la palabra. */
  .nav > a[aria-current="page"]:not(.nav-cta)::after,
  .nav-group:has(a[aria-current="page"]) > .nav-parent::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0.45rem;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
  }

  .nav-cta { margin-top: 0; align-self: center; }

  .nav-group { position: relative; flex-wrap: nowrap; }

  .nav-group::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 0.7rem;
  }

  .nav-parent {
    flex: none;
    transition: color 0.16s ease;
  }

  .nav-group:hover > .nav-parent,
  .nav-group:focus-within > .nav-parent { color: var(--accent); }

  .nav-group:hover > .nav-more::before,
  .nav-group:focus-within > .nav-more::before {
    transform: rotate(225deg) translateY(-1px);
  }

  .nav-more { width: 1.5rem; height: 2.75rem; }

  .nav-sub {
    display: grid;
    position: absolute;
    top: calc(100% + 0.45rem);
    left: 0;
    z-index: 25;
    min-width: 16.5rem;
    margin: 0;
    padding: 0.4rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 0.9rem;
    box-shadow: 0 16px 40px rgba(22, 20, 18, 0.1);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    translate: 0 0.45rem;
    scale: 0.98;
    transform-origin: 0 0;
    transition:
      opacity 0.18s ease,
      translate 0.28s cubic-bezier(0.16, 1, 0.3, 1),
      scale 0.28s cubic-bezier(0.16, 1, 0.3, 1),
      visibility 0.18s;
  }

  .nav-sub::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    height: 0.55rem;
  }

  .nav > .nav-group:last-of-type > .nav-sub {
    left: auto;
    right: 0;
    transform-origin: 100% 0;
  }

  .nav-group:hover > .nav-sub,
  .nav-group:focus-within > .nav-sub,
  .nav-group.is-open > .nav-sub {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    translate: 0 0;
    scale: 1;
  }

  .nav-sub a {
    min-height: 2.5rem;
    padding: 0.35rem 0.8rem;
    border-radius: 0.55rem;
    font-size: 0.95rem;
    opacity: 0;
    translate: 0 0.35rem;
    transition:
      opacity 0.22s ease,
      translate 0.28s cubic-bezier(0.16, 1, 0.3, 1),
      background 0.16s ease,
      color 0.16s ease;
  }

  .nav-group:hover > .nav-sub a,
  .nav-group:focus-within > .nav-sub a,
  .nav-group.is-open > .nav-sub a {
    opacity: 1;
    translate: 0 0;
  }

  .nav-group:hover > .nav-sub a:nth-child(1),
  .nav-group:focus-within > .nav-sub a:nth-child(1) { transition-delay: 0.03s; }

  .nav-group:hover > .nav-sub a:nth-child(2),
  .nav-group:focus-within > .nav-sub a:nth-child(2) { transition-delay: 0.06s; }

  .nav-group:hover > .nav-sub a:nth-child(3),
  .nav-group:focus-within > .nav-sub a:nth-child(3) { transition-delay: 0.09s; }

  .nav-group:hover > .nav-sub a:nth-child(4),
  .nav-group:focus-within > .nav-sub a:nth-child(4) { transition-delay: 0.12s; }

  .nav-group:hover > .nav-sub a:nth-child(5),
  .nav-group:focus-within > .nav-sub a:nth-child(5) { transition-delay: 0.15s; }

  .nav-sub a:hover {
    background: color-mix(in srgb, var(--accent) 8%, #fff);
    color: var(--accent);
    text-decoration: none;
  }

  .nav-sub a[aria-current="page"] {
    background: color-mix(in srgb, var(--accent) 7%, #fff);
  }

  .page { padding: 3.5rem 2rem 5rem; }

  .site :is(.prose, .entry, .read) { font-size: 1.125rem; }

  .site main[data-list] > .entry { font-size: var(--step-1); }

  .hero::after {
    background:
      linear-gradient(90deg, rgba(20, 16, 14, 0.72) 0%, rgba(20, 16, 14, 0.42) 42%, rgba(20, 16, 14, 0) 72%),
      linear-gradient(to top, rgba(20, 16, 14, 0.7) 0%, rgba(20, 16, 14, 0.2) 45%, rgba(20, 16, 14, 0) 75%);
  }

  .week { padding-top: 4.5rem; }

  .home-board { column-gap: 3rem; }

  .block { padding: 4rem 0; }

  .paths ol { padding: 4.5rem 0; }

  .close-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    column-gap: 4rem;
    padding-top: 0;
  }

  .close-copy {
    align-self: center;
    padding-block: 4.5rem;
  }

  .app-shot {
    width: 16rem;
    margin-top: 3.5rem;
  }

  .chapter { padding: 4.5rem 0; }

  .toc.is-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 2rem;
  }

  .toc.is-split { column-gap: 2.5rem; }

  .chapter.is-mark {
    padding: 3.5rem 0;
  }

  .chapter-head { grid-template-columns: 5rem minmax(0, 1fr); }

  .chapter.is-mark img { width: 5rem; height: 5rem; }

  /* Capítulo con lámina: texto y lámina en dos columnas; la lámina acompaña al leer. */
  .chapter.is-poster {
    grid-template-columns: minmax(0, 38rem) minmax(14rem, 21rem);
    justify-content: space-between;
    column-gap: clamp(2rem, 5vw, 4.5rem);
    align-items: start;
  }

  .chapter.is-poster figure {
    order: 2;
    position: sticky;
    top: calc(var(--header) + 1.5rem);
  }

  .chapter.is-poster img { max-width: none; }

  .chapter.is-poster .prose { max-width: none; }

  .sheet > div {
    grid-template-columns: 14rem minmax(0, 1fr);
    gap: 1.5rem;
    align-items: baseline;
  }

  .sheet dd { font-size: var(--step-2); }

  .sheet.with-photo > div {
    grid-template-columns: 4.5rem minmax(0, 1fr);
    align-items: center;
    row-gap: 0.15rem;
  }

  .sheet.with-photo dd { font-size: 1.0625rem; }

  .sheet.is-tiles {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    column-gap: 2rem;
  }

  .sheet.is-tiles > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.35rem;
  }

  .sheet.is-tiles dd { font-size: 1rem; }

  .gallery {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.75rem;
  }

  /* Tres por fila. Si sobra una, la primera va a lo ancho; si sobran dos, las dos primeras a medias. */
  .gallery > *,
  .gallery > :first-child:nth-last-child(odd) {
    grid-column: span 2;
    aspect-ratio: 4 / 3;
  }

  .gallery > :first-child:nth-last-child(3n + 1) {
    grid-column: 1 / -1;
    aspect-ratio: 16 / 9;
  }

  .gallery > :first-child:nth-last-child(3n + 2),
  .gallery > :first-child:nth-last-child(3n + 2) + * {
    grid-column: span 3;
    aspect-ratio: 3 / 2;
  }

  .times:not(.is-line):has(> :nth-child(3)) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.3fr);
    align-items: start;
  }

  .times.is-line li {
    grid-template-columns: minmax(10rem, 16rem) 8rem minmax(0, 1fr);
  }

  .stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem 1rem;
  }

  .stats li:not(:has(span)) strong { font-size: var(--step-3); }

  .cost-figure { font-size: var(--step-6); }

  .accounts { grid-template-columns: minmax(0, 1.6fr) minmax(8rem, 0.6fr); }

  .page.is-contact {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto auto auto 1fr;
    grid-template-areas:
      "head head"
      "map map"
      "reach form"
      "app form";
    column-gap: 4rem;
    align-items: start;
  }

  .page.is-contact > .page-head { grid-area: head; }

  .page.is-contact > .map { grid-area: map; }

  .page.is-contact > .reach { grid-area: reach; }

  .page.is-contact > .contact-form { grid-area: form; }

  .page.is-contact > .app-note { grid-area: app; }

  .link-tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 0;
    column-gap: 2rem;
  }

  .link-tiles .store-links { border-bottom: 0; }

  .link-tiles > li > a {
    grid-template-columns: 1fr;
    align-content: start;
    justify-items: start;
    gap: 1rem;
    padding: 1.5rem 0 1.35rem;
    border-bottom: 0;
    border-top: 1px solid var(--line);
  }

  .link-tiles img {
    width: auto;
    height: 7rem;
    max-width: 100%;
    border-radius: 1.7rem;
  }

  .camino-close {
    grid-template-columns: minmax(0, 1fr) 14rem;
    align-items: start;
    column-gap: 3rem;
  }
}

/* Escritorio ancho */
@media (min-width: 1100px) {
  .bar { padding: 0 2rem; gap: 1.5rem; }

  .nav { gap: 0.1rem 1.15rem; }

  .nav > a:not(.nav-cta),
  .nav-parent { font-size: 0.98rem; }

  .poster-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  .stories { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  /* Sacramentos: la ficha de datos de cada capítulo, a la derecha y fija al leer. */
  .chapter.is-mark {
    display: grid;
    grid-template-columns: minmax(0, 38rem) minmax(14rem, 20rem);
    justify-content: space-between;
    column-gap: clamp(2rem, 5vw, 4.5rem);
    row-gap: 0;
    align-items: start;
  }

  .chapter.is-mark > .prose > :first-child { margin-top: 0; }

  .chapter.is-mark > .chapter-head,
  .chapter.is-mark > .prose { grid-column: 1; }

  .chapter.is-mark > .sheet {
    grid-column: 2;
    grid-row: 1 / span 2;
    position: sticky;
    top: calc(var(--header) + 1.5rem);
    margin-top: 0;
  }

  .chapter.is-mark > .sheet > div { grid-template-columns: minmax(0, 1fr); gap: 0.35rem; }

  .chapter.is-mark > .sheet > div:first-child { border-top: 0; padding-top: 0.5rem; }

  .footer-inner {
    grid-template-columns: minmax(10rem, 0.9fr) minmax(9rem, 0.85fr) minmax(9rem, 0.9fr) minmax(20rem, 1.45fr);
    grid-template-areas:
      "brand celebrar informarse contacto"
      "legal legal legal legal";
    gap: 2rem 2.5rem;
    padding: 2.75rem var(--gutter) 2.25rem;
  }

  .footer-inner a.footer-link,
  .footer-legal a,
  .footer-name { min-height: 0; }

  .footer-inner a.footer-link { padding: 0.28rem 0; }

  .footer-inner a[href^="mailto:"] {
    white-space: nowrap;
    min-width: max-content;
    font-size: 0.95rem;
    overflow-wrap: normal;
  }
}

@view-transition { navigation: auto; }

::view-transition-old(root),
::view-transition-new(root) { animation-duration: 0.18s; }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }

  html:has(> body.site) { scroll-behavior: auto; }

  .site *,
  .site *::before,
  .site *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .site :is(.site-header, .site-footer, .skip, .hero-photo, .hero-actions, .list-more,
    .ficha-back, .ficha-nav, .copy-button, .store-badges, .map iframe, .app-shot) { display: none !important; }

  .site { background: #fff; color: #000; font-size: 11pt; }

  .site .page { padding: 0; }

  .site .hero,
  .site .hero-copy { min-height: 0; color: #000; }

  .site .hero::after { content: none; }

  .site .hero h1,
  .site .hero-kicker,
  .site .hero .lede { color: #000; text-shadow: none; }

  .site a { color: inherit; text-decoration: none; }

  .site :is(.chapter, .block, .times section, .sheet > div, .story) { break-inside: avoid; }

  .site .chapter.is-poster figure,
  .site .chapter.is-mark > .sheet { position: static; }

  .site .close { background: none; }
}
