@charset "UTF-8";

/* =============================================================
   Escuela Primaria "Gral. Ignacio Zaragoza" — Zongolica, Veracruz
   Sistema de diseño. Paleta muestreada del escudo institucional.
   Ver CONTEXTO.md, sección 4, antes de cambiar colores o radios.
   ============================================================= */

@import url('fuentes.css');

/* ── 1. Tokens ─────────────────────────────────────────────── */

:root {
  /* Azul de la casaca del retrato */
  --azul-950: #071223;
  --azul-900: #0c1d33;
  --azul-800: #12294a;
  --azul-700: #1a3a63;
  --azul-600: #24507f;
  --azul-200: #b9cadf;
  --azul-100: #dee7f1;

  /* Oro del escudo */
  --oro-700: #8a6318;
  --oro-600: #a87c22;
  --oro-500: #c4972e;
  --oro-400: #d0a050;
  --oro-300: #e0be7c;
  --oro-200: #efdcb4;
  --oro-100: #f8efd9;

  /* Guinda: reservado al sello del 50 aniversario */
  --guinda-700: #6e1b26;
  --guinda-500: #8e2733;

  /* Papel y tinta */
  --papel: #fbf8f2;
  --papel-2: #f4ede0;
  --blanco: #fffdf9;
  --tinta: #1a1714;
  --tinta-2: #57504a;
  --tinta-3: #857c72;
  --linea: #e3dacb;
  --linea-fuerte: #d3c6ae;

  --exito: #2f6b3d;
  --exito-fondo: #eaf3ec;
  --error: #9a2b28;
  --error-fondo: #fbeceb;

  --fuente-titulo: "Source Serif 4", Georgia, "Times New Roman", serif;
  --fuente-texto: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;

  --ancho: 1180px;
  --ancho-lectura: 68ch;
  --canal: clamp(1.25rem, 4vw, 2.5rem);

  --r-chico: 3px;
  --r: 6px;

  --sombra: 0 1px 2px rgba(26, 23, 20, .05), 0 8px 24px -18px rgba(26, 23, 20, .35);
  --transicion: 160ms ease;
}

/* ── 2. Reinicio ───────────────────────────────────────────── */

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

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

body {
  margin: 0;
  background: var(--papel);
  color: var(--tinta);
  font: 400 1.0625rem/1.7 var(--fuente-texto);
  font-feature-settings: "kern", "liga";
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

img, svg, video { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }

a { color: var(--azul-600); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--azul-800); }

:focus-visible {
  outline: 2px solid var(--oro-500);
  outline-offset: 2px;
  border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ── 3. Tipografía ─────────────────────────────────────────── */

h1, h2, h3, h4 {
  font-family: var(--fuente-titulo);
  font-weight: 600;
  line-height: 1.14;
  letter-spacing: -.014em;
  margin: 0 0 .5em;
  color: var(--azul-900);
  text-wrap: balance;
}

h1 { font-size: clamp(2rem, 1.35rem + 2.7vw, 3.25rem); letter-spacing: -.022em; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.125rem); }
h3 { font-size: clamp(1.125rem, 1.02rem + .5vw, 1.375rem); }
h4 { font-size: 1.0625rem; font-family: var(--fuente-texto); font-weight: 600; letter-spacing: 0; }

p { margin: 0 0 1.15em; }
p:last-child { margin-bottom: 0; }

/* Etiqueta breve de sección. Mayúsculas SOLO aquí, nunca en párrafos. */
.rotulo {
  display: block;
  font-family: var(--fuente-texto);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--oro-700);
  margin: 0 0 .85rem;
}
.rotulo-claro { color: var(--oro-300); }

/* Filete dorado heráldico: recurso principal de separación */
.filete {
  width: 56px;
  height: 2px;
  background: var(--oro-400);
  border: 0;
  margin: 0 0 1.5rem;
}
.filete-centro { margin-inline: auto; }

.entrada {
  font-size: clamp(1.0625rem, 1rem + .35vw, 1.1875rem);
  line-height: 1.65;
  color: var(--tinta-2);
  max-width: var(--ancho-lectura);
}

.texto-cuerpo { max-width: var(--ancho-lectura); }
.texto-cuerpo p + p { margin-top: 0; }

.dato-menor { font-size: .875rem; color: var(--tinta-3); }

/* Versalitas para fechas y números dentro de tarjetas */
.versalita {
  font-family: var(--fuente-texto);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--tinta-3);
}

/* ── 4. Estructura ─────────────────────────────────────────── */

.envoltura {
  width: 100%;
  max-width: var(--ancho);
  margin-inline: auto;
  padding-inline: var(--canal);
}

.principal { flex: 1 0 auto; }

.banda { padding-block: clamp(3rem, 6vw, 5.25rem); }
.banda-corta { padding-block: clamp(2rem, 4vw, 3rem); }
.banda-papel2 { background: var(--papel-2); }
.banda-blanca { background: var(--blanco); }
.banda-azul { background: var(--azul-900); color: var(--azul-100); }
.banda-azul h1, .banda-azul h2, .banda-azul h3 { color: #fff; }

.banda + .banda:not(.banda-papel2):not(.banda-azul):not(.banda-blanca) {
  border-top: 1px solid var(--linea);
}

/* Encabezado de apartado: título, filete y bajada */
.encabezado-pagina { padding-block: clamp(2.5rem, 5vw, 4rem) clamp(1.5rem, 3vw, 2.25rem); }
.encabezado-pagina h1 { margin-bottom: .65rem; }

/* Retículas */
.rejilla { display: grid; gap: clamp(1.25rem, 2.5vw, 2rem); }
.rejilla-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.rejilla-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); }
.rejilla-4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); }

/* Pocas piezas: se fijan las columnas y el bloque se centra, en vez de dejar
   una columna vacía a la derecha. La clase la pone clase_pocas() en PHP. */
.rejilla.pocas { justify-content: center; }
.rejilla.pocas-1 { grid-template-columns: minmax(0, 26rem); }
.rejilla.pocas-2 { grid-template-columns: repeat(2, minmax(0, 24rem)); }
@media (max-width: 47rem) {
  .rejilla.pocas-1,
  .rejilla.pocas-2 { grid-template-columns: minmax(0, 1fr); }
}

/* Editorial asimétrica: contenido principal + costado */
.dos-columnas {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  grid-template-columns: 1fr;
  align-items: start;
}
@media (min-width: 62rem) {
  .dos-columnas { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
  .dos-columnas-inversa { grid-template-columns: minmax(0, 1fr) minmax(0, 1.65fr); }
}

/* ── 5. Encabezado del sitio ───────────────────────────────── */

.saltar-al-contenido {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--oro-400);
  color: var(--azul-950);
  padding: .7rem 1.1rem;
  font-weight: 600;
  z-index: 100;
}
.saltar-al-contenido:focus { left: .5rem; top: .5rem; }

.sitio-cabecera {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--azul-900);
  border-bottom: 2px solid var(--oro-400);
}

.cabecera-fila {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  min-height: 4.75rem;
}

.marca {
  display: flex;
  align-items: center;
  gap: .85rem;
  text-decoration: none;
  color: #fff;
  flex-shrink: 0;
}
.marca:hover { color: #fff; }
.marca img { width: 46px; height: 46px; object-fit: contain; flex-shrink: 0; }
.marca-texto { display: none; line-height: 1.22; max-width: 19rem; }
@media (min-width: 30rem) { .marca-texto { display: block; } }
.marca-nombre {
  display: block;
  font-family: var(--fuente-titulo);
  font-size: .98rem;
  font-weight: 600;
  letter-spacing: -.01em;
}
.marca-lugar {
  display: block;
  margin-top: .12rem;
  font-size: .7rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--oro-300);
}

.menu { display: none; align-items: center; gap: .15rem; }
@media (min-width: 66rem) { .menu { display: flex; } }

.menu a {
  display: block;
  padding: .55rem .7rem;
  font-size: .9375rem;
  font-weight: 500;
  color: var(--azul-200);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color var(--transicion), border-color var(--transicion);
}
.menu a:hover { color: #fff; border-bottom-color: rgba(208, 160, 80, .45); }
.menu a[aria-current="page"] { color: #fff; border-bottom-color: var(--oro-400); }

.cabecera-acciones { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }

.boton-menu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  background: transparent;
  border: 1px solid rgba(185, 202, 223, .3);
  border-radius: var(--r-chico);
  color: #fff;
  cursor: pointer;
}
.boton-menu:hover { border-color: var(--oro-400); }
@media (min-width: 66rem) { .boton-menu { display: none; } }

.menu-movil {
  display: none;
  border-top: 1px solid rgba(185, 202, 223, .18);
  padding-block: .6rem 1rem;
}
.menu-movil.abierto { display: block; }
@media (min-width: 66rem) { .menu-movil { display: none !important; } }
.menu-movil a {
  display: block;
  padding: .7rem .25rem;
  color: var(--azul-200);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid rgba(185, 202, 223, .12);
}
.menu-movil a:last-child { border-bottom: 0; }
.menu-movil a[aria-current="page"] { color: var(--oro-300); }

/* ── 6. Cintillo del 50 aniversario ────────────────────────── */

.cintillo {
  background: var(--guinda-700);
  color: var(--oro-200);
  border-bottom: 1px solid rgba(208, 160, 80, .35);
  font-size: .8125rem;
  letter-spacing: .04em;
}
.cintillo .envoltura {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .35rem .9rem;
  padding-block: .5rem;
  text-align: center;
}
.cintillo strong { color: #fff; font-weight: 600; }
.cintillo a { color: var(--oro-300); text-underline-offset: 3px; }
.cintillo a:hover { color: #fff; }

/* ── 7. Portada ────────────────────────────────────────────── */

.portada {
  position: relative;
  background: var(--azul-900);
  color: var(--azul-100);
  overflow: hidden;
  border-bottom: 2px solid var(--oro-400);
}

/* Trama grabada tipo papel de valor. Sustituye al degradado genérico. */
.portada::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(58deg, rgba(208, 160, 80, .055) 0 1px, transparent 1px 9px),
    repeating-linear-gradient(-58deg, rgba(208, 160, 80, .04) 0 1px, transparent 1px 13px);
  pointer-events: none;
}
.portada > * { position: relative; }

.portada-rejilla {
  display: grid;
  gap: clamp(2.25rem, 5vw, 4rem);
  align-items: center;
  padding-block: clamp(3rem, 7vw, 5.5rem);
}
@media (min-width: 60rem) {
  .portada-rejilla { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); }
}

.portada h1 { color: #fff; margin-bottom: .75rem; }
.portada .rotulo { color: var(--oro-300); }
.portada .entrada { color: var(--azul-200); }
.portada .filete { margin-bottom: 1.35rem; }

.portada-datos {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1.5rem;
  margin: 1.6rem 0 0;
  padding: 1.1rem 0 0;
  border-top: 1px solid rgba(185, 202, 223, .2);
  font-size: .8125rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--azul-200);
  list-style: none;
}
.portada-datos strong { color: var(--oro-300); font-weight: 600; }

.portada-emblema {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}
.portada-emblema .escudo {
  width: min(15rem, 62vw);
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, .4));
}

/* ── 8. Sello del 50 aniversario ───────────────────────────── */

/* El reinicio pone `display: block` a los SVG, así que `text-align: center`
   no basta para centrarlo: hace falta el margen automático. */
.sello { width: min(11.5rem, 46vw); margin-inline: auto; }
.sello-anillo { fill: none; stroke: var(--oro-400); }
/* El tamaño lo calcula sello.php según lo largo que sea el nombre. */
.sello-texto {
  font-family: var(--fuente-texto);
  font-size: 7.4px;
  font-weight: 600;
  letter-spacing: .18em;
  fill: var(--oro-300);
  text-transform: uppercase;
}
.sello-cifra {
  font-family: var(--fuente-titulo);
  font-size: 39px;
  font-weight: 700;
  fill: var(--oro-400);
  letter-spacing: -.03em;
}
.sello-pie {
  font-family: var(--fuente-texto);
  font-size: 8.2px;
  font-weight: 600;
  letter-spacing: .2em;
  fill: var(--oro-200);
  text-transform: uppercase;
}
.sello-anios {
  font-family: var(--fuente-titulo);
  font-size: 10.5px;
  font-style: italic;
  fill: var(--oro-300);
}
.sello-rombo { fill: var(--oro-400); }
/* Variante sobre fondo claro */
.sello-claro .sello-anillo { stroke: var(--oro-500); }
.sello-claro .sello-texto,
.sello-claro .sello-anios { fill: var(--oro-700); }
.sello-claro .sello-cifra { fill: var(--guinda-700); }
.sello-claro .sello-pie { fill: var(--oro-700); }
.sello-claro .sello-rombo { fill: var(--oro-500); }

/* ── 9. Botones ────────────────────────────────────────────── */

.boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .72rem 1.4rem;
  border: 1px solid transparent;
  border-radius: var(--r-chico);
  font-size: .9375rem;
  font-weight: 600;
  letter-spacing: .01em;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transicion), color var(--transicion), border-color var(--transicion);
}
.boton svg { width: 1.05em; height: 1.05em; flex-shrink: 0; }

/* El hover oscurece el acento en vez de aclararlo. Aclarándolo, un tema de
   acento rojo se queda sin contraste con su propia tinta al pasar el ratón:
   fondo claro y letra clara. Oscurecer funciona con oro y con rojo por igual. */
.boton-oro { background: var(--oro-400); color: var(--azul-950); }
.boton-oro:hover { background: var(--oro-500); color: var(--azul-950); }

.boton-azul { background: var(--azul-800); color: #fff; }
.boton-azul:hover { background: var(--azul-700); color: #fff; }

.boton-contorno { background: transparent; border-color: rgba(255, 255, 255, .38); color: #fff; }
.boton-contorno:hover { border-color: var(--oro-400); color: var(--oro-300); }

.boton-contorno-oscuro { background: transparent; border-color: var(--linea-fuerte); color: var(--azul-800); }
.boton-contorno-oscuro:hover { border-color: var(--azul-800); background: var(--blanco); }

.boton-ingresar {
  background: transparent;
  border-color: var(--oro-400);
  color: var(--oro-300);
  padding: .5rem 1rem;
  font-size: .875rem;
}
.boton-ingresar:hover { background: var(--oro-400); color: var(--azul-950); }

.boton-bloque { width: 100%; }
.boton-chico { padding: .45rem .9rem; font-size: .84rem; }
.boton-peligro { background: var(--error); color: #fff; }
.boton-peligro:hover { background: #7d221f; color: #fff; }
.boton:disabled { opacity: .55; cursor: not-allowed; }

.grupo-botones { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.9rem; }

/* Enlace con flecha */
.enlace-flecha {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-weight: 600;
  font-size: .9375rem;
  text-decoration: none;
  color: var(--azul-600);
}
.enlace-flecha::after { content: "\2192"; transition: transform var(--transicion); }
.enlace-flecha:hover::after { transform: translateX(3px); }

/* Enlace de regreso: la flecha va antes del texto, no después. */
.enlace-flecha.hacia-atras::after { content: none; }
.enlace-flecha.hacia-atras::before { content: "\2190"; transition: transform var(--transicion); }
.enlace-flecha.hacia-atras:hover::before { transform: translateX(-3px); }

/* ── 10. Tarjetas ──────────────────────────────────────────── */

.tarjeta {
  background: var(--blanco);
  border: 1px solid var(--linea);
  border-radius: var(--r);
  overflow: hidden;
}
.tarjeta-cuerpo { padding: clamp(1.25rem, 2.5vw, 1.75rem); }
.tarjeta-hueca { background: transparent; border-style: dashed; }

.tarjeta-nota { display: flex; flex-direction: column; }
.tarjeta-nota a { text-decoration: none; color: inherit; }
.tarjeta-nota .figura {
  aspect-ratio: 16 / 10;
  background: var(--papel-2);
  overflow: hidden;
  border-bottom: 1px solid var(--linea);
}
.tarjeta-nota .figura img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 400ms ease;
}
.tarjeta-nota:hover .figura img { transform: scale(1.035); }
.tarjeta-nota h3 { margin: .5rem 0 .5rem; }
.tarjeta-nota:hover h3 { color: var(--azul-600); }
.tarjeta-nota .tarjeta-cuerpo { flex: 1; display: flex; flex-direction: column; }

/* El resumen se recorta a tres renglones. Sin esto, un resumen largo y uno
   corto dejan las tarjetas de la misma fila con el pie a distinta altura. */
.tarjeta-nota .resumen {
  color: var(--tinta-2);
  font-size: .9375rem;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

/* `auto` empuja el pie al fondo: así todas las tarjetas lo alinean igual. */
.tarjeta-nota .pie-nota {
  margin-top: auto;
  padding-top: .95rem;
  border-top: 1px solid var(--linea);
}

/* Franja conmemorativa a todo lo ancho: sello a un costado, texto al otro.
   Va sobre papel crema con filete dorado arriba, para marcar el corte sin
   competir con el encabezado ni con el pie, que ya son azules. */
.franja-aniversario {
  background: var(--papel-2);
  border-top: 2px solid var(--oro-400);
  border-bottom: 1px solid var(--linea);
}
.aniversario-fila {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(1.5rem, 5vw, 3.5rem);
}
.aniversario-fila .sello {
  width: min(11rem, 44vw);
  flex-shrink: 0;
  margin-inline: auto;   /* centrado mientras el texto va debajo */
}
.aniversario-fila > div { flex: 1; min-width: min(100%, 22rem); }
.aniversario-fila h2 { font-size: clamp(1.4rem, 1.2rem + .9vw, 1.9rem); margin-bottom: 0; }
.aniversario-fila .filete { margin: .9rem 0 1.1rem; }
.aniversario-fila p { max-width: 62ch; color: var(--tinta-2); }
.aniversario-fila p + p { margin-top: -.35rem; }

@media (min-width: 44rem) {
  .aniversario-fila .sello { margin-inline: 0; }   /* ya cabe al costado */
}

/* Bloque con acento dorado a la izquierda */
.bloque-acento {
  border-left: 3px solid var(--oro-400);
  padding-left: clamp(1rem, 2vw, 1.5rem);
}

/* ── 11. Línea del tiempo (Historia) ───────────────────────── */

.linea-tiempo { position: relative; margin: 0; padding: 0 0 0 clamp(1.75rem, 4vw, 2.75rem); list-style: none; }
.linea-tiempo::before {
  content: "";
  position: absolute;
  left: 0; top: .55rem; bottom: .55rem;
  width: 2px;
  background: linear-gradient(var(--oro-300), var(--oro-400) 30%, var(--linea-fuerte));
}
.hito { position: relative; padding-bottom: clamp(1.75rem, 3.5vw, 2.75rem); }
.hito:last-child { padding-bottom: 0; }
.hito::before {
  content: "";
  position: absolute;
  left: calc(-1 * clamp(1.75rem, 4vw, 2.75rem) - 5px);
  top: .5rem;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--papel);
  border: 2px solid var(--oro-500);
}
.hito-anio {
  font-family: var(--fuente-titulo);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--oro-700);
  line-height: 1;
  margin-bottom: .3rem;
  display: block;
}
.hito h3 { margin-bottom: .35rem; }
.hito p { color: var(--tinta-2); font-size: .9375rem; }

/* ── 12. Galería ───────────────────────────────────────────── */

/* Retícula pareja: todas las miniaturas se ven del mismo tamaño y proporción,
   sin importar cómo venga la fotografía. El recorte es SOLO de la miniatura;
   al ampliarla se ve completa y con su proporción original. */
.rejilla-galeria {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
  gap: .75rem;
}
.rejilla-galeria.pocas { justify-content: center; }
.rejilla-galeria.pocas-1 { grid-template-columns: minmax(0, 22rem); }
.rejilla-galeria.pocas-2 { grid-template-columns: repeat(2, minmax(0, 20rem)); }
@media (max-width: 34rem) {
  .rejilla-galeria.pocas-1,
  .rejilla-galeria.pocas-2 { grid-template-columns: minmax(0, 1fr); }
}

.foto {
  position: relative;
  margin: 0;
  aspect-ratio: 4 / 3;
  background: var(--papel-2);
  border: 1px solid var(--linea);
  border-radius: var(--r-chico);
  overflow: hidden;
  cursor: zoom-in;
}
/* `cover` llena el recuadro recortando lo que sobra; `center` mantiene el
   centro de la escena, que es donde suele estar la gente. */
.foto img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 400ms ease;
}
.foto:hover img { transform: scale(1.04); }
.foto figcaption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1.75rem .8rem .6rem;
  background: linear-gradient(transparent, rgba(7, 18, 35, .82));
  color: #fff;
  font-size: .8125rem;
  line-height: 1.4;
  opacity: 0;
  transition: opacity var(--transicion);
}
.foto:hover figcaption, .foto:focus-within figcaption { opacity: 1; }

/* Visor */
.visor {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  place-items: center;
  padding: clamp(.75rem, 2vw, 1.75rem);
  background: rgba(7, 18, 35, .975);
}
.visor.abierto { display: grid; }
/* El <figure> centra la imagen y su pie; sin esto la imagen se pega a la izquierda. */
.visor figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
  max-height: 100%;
}
/* Sin ancho ni alto fijos: la imagen sale a su tamaño real, reducida solo si
   no cabe. Nunca se agranda ni se deforma, y jamás se recorta. */
.visor img {
  max-width: 100%;
  max-height: 84vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--r-chico);
}
.visor figcaption {
  color: var(--azul-200);
  text-align: center;
  margin-top: 1.1rem;
  font-size: .9375rem;
  max-width: 62ch;
  line-height: 1.5;
}
.visor-cerrar {
  position: absolute;
  top: 1rem; right: 1rem;
  width: 2.75rem; height: 2.75rem;
  display: grid; place-items: center;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: var(--r-chico);
  color: #fff;
  font-size: 1.35rem;
  cursor: pointer;
}
.visor-cerrar:hover { border-color: var(--oro-400); color: var(--oro-300); }

/* ── 13. Documentos ────────────────────────────────────────── */

.lista-documentos { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--linea); }
.documento {
  display: flex;
  align-items: center;
  gap: clamp(.85rem, 2vw, 1.35rem);
  padding: 1.1rem .25rem;
  border-bottom: 1px solid var(--linea);
}
.documento-icono {
  flex-shrink: 0;
  width: 2.75rem; height: 2.75rem;
  display: grid; place-items: center;
  background: var(--oro-100);
  border: 1px solid var(--oro-200);
  border-radius: var(--r-chico);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .05em;
  color: var(--oro-700);
  text-transform: uppercase;
}
.documento-info { flex: 1; min-width: 0; }
.documento-info h3 { font-size: 1.0625rem; font-family: var(--fuente-texto); font-weight: 600; letter-spacing: 0; margin-bottom: .15rem; }
.documento-info p { font-size: .875rem; color: var(--tinta-2); margin: 0; }

/* ── 14. Formularios ───────────────────────────────────────── */

.formulario { display: grid; gap: 1.15rem; }
.formulario-rejilla { display: grid; gap: 1.15rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }

.campo { display: grid; gap: .4rem; }
.campo > label { font-size: .875rem; font-weight: 600; color: var(--azul-900); }
.campo .requerido { color: var(--error); }
.campo .ayuda { font-size: .8125rem; color: var(--tinta-3); }

.campo input[type="text"],
.campo input[type="email"],
.campo input[type="tel"],
.campo input[type="url"],
.campo input[type="password"],
.campo input[type="number"],
.campo input[type="date"],
.campo input[type="file"],
.campo select,
.campo textarea {
  width: 100%;
  padding: .68rem .8rem;
  background: var(--blanco);
  border: 1px solid var(--linea-fuerte);
  border-radius: var(--r-chico);
  color: var(--tinta);
  transition: border-color var(--transicion), box-shadow var(--transicion);
}
.campo textarea { min-height: 9rem; resize: vertical; line-height: 1.6; }
.campo input:focus, .campo select:focus, .campo textarea:focus {
  outline: none;
  border-color: var(--azul-600);
  box-shadow: 0 0 0 3px rgba(36, 80, 127, .13);
}
.campo input[aria-invalid="true"], .campo textarea[aria-invalid="true"] { border-color: var(--error); }
.campo .error-campo { font-size: .8125rem; color: var(--error); }

.campo-casilla { display: flex; align-items: center; gap: .55rem; }
.campo-casilla input { width: 1.05rem; height: 1.05rem; accent-color: var(--azul-700); }
.campo-casilla label { font-size: .9375rem; font-weight: 500; }

/* Trampa para robots: invisible pero no display:none */
.trampa { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ── 15. Avisos ────────────────────────────────────────────── */

.aviso {
  padding: .85rem 1.05rem;
  border: 1px solid;
  border-left-width: 3px;
  border-radius: var(--r-chico);
  font-size: .9375rem;
  margin-bottom: 1.15rem;
}
.aviso-ok { background: var(--exito-fondo); border-color: #c3ddc9; border-left-color: var(--exito); color: #23522e; }
.aviso-error { background: var(--error-fondo); border-color: #eec8c6; border-left-color: var(--error); color: #7d221f; }

.vacio {
  padding: clamp(2.5rem, 6vw, 4rem) 1.5rem;
  text-align: center;
  border: 1px dashed var(--linea-fuerte);
  border-radius: var(--r);
  color: var(--tinta-3);
  background: var(--papel-2);
}
.vacio h3 { color: var(--tinta-2); margin-bottom: .35rem; }

/* ── 16. Datos de contacto ─────────────────────────────────── */

.lista-datos { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.15rem; }
.lista-datos li { display: flex; gap: .85rem; }
.lista-datos svg { width: 1.2rem; height: 1.2rem; flex-shrink: 0; margin-top: .22rem; color: var(--oro-600); }
.lista-datos dt, .lista-datos .etiqueta {
  display: block;
  font-size: .75rem; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--tinta-3); margin-bottom: .15rem;
}
.lista-datos dd, .lista-datos .valor { display: block; margin: 0; color: var(--tinta); }

.mapa {
  border: 1px solid var(--linea);
  border-radius: var(--r);
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--papel-2);
}
.mapa iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ── 17. Paginación ────────────────────────────────────────── */

.paginacion { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: center; margin-top: 2.75rem; }
.paginacion a, .paginacion span {
  min-width: 2.4rem;
  padding: .45rem .7rem;
  text-align: center;
  border: 1px solid var(--linea-fuerte);
  border-radius: var(--r-chico);
  text-decoration: none;
  font-size: .9rem;
  color: var(--azul-800);
  background: var(--blanco);
}
.paginacion a:hover { border-color: var(--azul-700); }
.paginacion .actual { background: var(--azul-800); border-color: var(--azul-800); color: #fff; font-weight: 600; }
.paginacion .inerte { opacity: .4; }

/* ── 18. Pie del sitio ─────────────────────────────────────── */

.sitio-pie {
  background: var(--azul-900);
  color: var(--azul-200);
  border-top: 2px solid var(--oro-400);
  font-size: .9375rem;
  margin-top: auto;
}
.pie-rejilla {
  display: grid;
  gap: clamp(1.75rem, 4vw, 3rem);
  padding-block: clamp(2.5rem, 5vw, 3.5rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
}
.pie-identidad { display: flex; gap: 1rem; align-items: flex-start; }
.pie-identidad img { width: 54px; height: 54px; flex-shrink: 0; }
.pie-nombre { font-family: var(--fuente-titulo); font-size: 1.0625rem; font-weight: 600; color: #fff; line-height: 1.3; margin-bottom: .3rem; }
.sitio-pie p { margin: 0 0 .2rem; }

.pie-enlaces { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem 1rem; }
.pie-enlaces a { color: var(--azul-200); text-decoration: none; }
.pie-enlaces a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

/* Los emblemas oficiales van a color sobre una tarjeta clara: sobre el azul
   perderían legibilidad y no se debe alterar el color de un logotipo oficial. */
.pie-oficial { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-top: 1.35rem; }
.pie-oficial a, .pie-oficial span {
  display: inline-flex;
  align-items: center;
  padding: .5rem .7rem;
  background: var(--papel);
  border-radius: var(--r-chico);
}
.pie-oficial img { height: 26px; width: auto; }

.pie-legal {
  border-top: 1px solid rgba(185, 202, 223, .16);
  padding-block: 1.15rem;
  font-size: .8125rem;
  color: #8ea4bf;
  display: flex;
  flex-wrap: wrap;
  gap: .35rem 1.25rem;
  justify-content: space-between;
}
.pie-legal a { color: #8ea4bf; }
.pie-legal a:hover { color: var(--oro-300); }

.enlace-social {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: var(--azul-200);
  text-decoration: none;
  font-weight: 500;
}
.enlace-social svg { width: 1.25rem; height: 1.25rem; flex-shrink: 0; }
.enlace-social:hover { color: var(--oro-300); }

/* Acceso de la dirección: presente para quien lo busca, invisible para el resto. */
.enlace-discreto {
  color: #6f8299;
  text-decoration: none;
  opacity: .8;
  transition: color var(--transicion), opacity var(--transicion);
}
.enlace-discreto:hover,
.enlace-discreto:focus-visible { color: var(--oro-300); opacity: 1; }

/* ── 19. Utilidades mínimas ────────────────────────────────── */

.solo-lectores {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}
.centrado { text-align: center; }
.pila { display: grid; gap: 1.25rem; }
.entre { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
/* En celular el botón dejaba de caber al lado y estrangulaba el texto. */
@media (max-width: 44rem) {
  .entre { flex-direction: column; align-items: stretch; }
  .entre .boton { justify-self: start; align-self: flex-start; }
}

/* ── 20. Impresión ─────────────────────────────────────────── */

@media print {
  .sitio-cabecera, .sitio-pie, .cintillo, .grupo-botones, .visor, .boton-menu { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .banda { padding-block: 1rem; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; }
}
