/* ============================================================
   ATLATLAHUCAN — Sistema de diseño
   ============================================================ */

:root {
  /* Color — paleta tomada del sitio de referencia */
  --navy-deep:   #14284A;   /* logo / texto más oscuro */
  --navy:        #1B3A63;   /* overlay del héroe */
  --blue-band:   #3C6E9C;   /* franjas: lema y "últimas noticias" */
  --blue-mid:    #2E5F95;   /* enlaces, títulos de tarjetas, nav activo */
  --blue-light:  #EAF1F8;   /* fondos suaves de sección */
  --ink:         #1A1A1A;   /* texto de navegación */
  --ink-soft:    #3B5673;   /* texto de párrafo bajo tarjetas */
  --paper:       #FFFFFF;   /* fondo general — blanco, como el original */
  --white:       #FFFFFF;

  /* Tipografía — geométrica, como el sitio de referencia */
  --font-display: "Poppins", sans-serif;
  --font-body:    "Open Sans", sans-serif;

  /* Layout */
  --max-width: 1400px;
  --radius: 4px;
  --shadow: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-weight: 600;
  color: var(--navy-deep);
  margin: 0;
}

.eyebrow {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.8rem;
  color: var(--blue-mid);
  font-weight: 600;
}

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

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--blue-mid);
  color: var(--white);
  padding: 10px 16px;
  z-index: 200;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ============================================================
   HEADER / NAV
   ============================================================ */

.site-header {
  background: var(--white);
  border-bottom: 1px solid #E3E7EC;
  box-shadow: 0 2px 10px rgba(20, 40, 74, 0.08);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand__mark {
  height: 46px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.brand__mark img { height: 100%; width: auto; }

.brand__text {
  font-family: var(--font-display);
  line-height: 1.05;
}
.brand__text strong {
  display: block;
  font-size: 1.15rem;
  letter-spacing: 0.03em;
  color: var(--navy-deep);
}
.brand__text span {
  display: block;
  font-size: 0.68rem;
  color: var(--blue-mid);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 400;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav__link {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  padding: 10px 12px;
  position: relative;
  /* Reset — algunos ítems (los que abren submenú) son <button>, no <a>;
     sin este reset los navegadores centran el texto de los <button> */
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-display);
  display: inline-block;
}
.nav__link:hover,
.nav__link:focus-visible { color: var(--blue-mid); }
.nav__link[aria-current="page"] { color: var(--blue-mid); }
.nav__link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: 4px;
  height: 2px;
  background: var(--blue-mid);
}

.nav__item { position: relative; }

.nav__dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--white);
  border: 1px solid #E3E7EC;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 210px;
  padding: 8px;
  z-index: 50;
}
.nav__item:hover .nav__dropdown,
.nav__item:focus-within .nav__dropdown,
.nav__item.is-open > .nav__dropdown { display: block; }

.nav__dropdown a {
  display: block;
  padding: 9px 12px;
  border-radius: 4px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
}
.nav__dropdown a:hover { background: var(--blue-light); color: var(--blue-mid); }

/* Submenú anidado (p.ej. Tesorería → 2025-2027 / 2022-2024) */
.nav__subitem { position: relative; }
.nav__subitem > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.nav__arrow { font-size: 0.85rem; opacity: 0.55; }

.nav__subdropdown {
  display: none;
  position: absolute;
  top: -8px;
  left: 100%;
  margin-left: 4px;
  background: var(--white);
  border: 1px solid #E3E7EC;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 180px;
  padding: 8px;
  z-index: 60;
}
.nav__subitem:hover > .nav__subdropdown,
.nav__subitem:focus-within > .nav__subdropdown { display: block; }
.nav__subdropdown a {
  display: block;
  padding: 9px 12px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
}
.nav__subdropdown a:hover { background: var(--blue-light); color: var(--blue-mid); }

.nav__social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  margin-left: 10px;
}
.nav__social svg { width: 20px; height: 20px; fill: var(--blue-mid); }

.nav__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav__toggle span {
  display: block;
  width: 24px; height: 2px;
  background: var(--navy-deep);
  margin: 5px 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* ============================================================
   HERO
   ============================================================ */

/* Banner principal — imagen de campaña a todo lo ancho, tal cual, sin recorte */
.hero {
  position: relative;
  background: var(--navy);
  overflow: hidden;
}
.hero__banner {
  width: 100%;
  height: auto;
  display: block;
}

.hero__socials {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 14px;
  z-index: 2;
}
.hero__socials a svg { width: 18px; height: 18px; fill: rgba(255,255,255,0.85); }
.hero__socials a:hover svg { fill: var(--white); }

/* Franja de lema, debajo del banner */
.tagline-strip {
  background: var(--blue-band);
  color: var(--white);
  padding: 24px 0;
  text-align: center;
}
.tagline-strip p {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: clamp(1.05rem, 2.2vw, 1.4rem);
  font-weight: 600;
  margin: 0;
}

/* ============================================================
   SECCIONES / NOTICIAS
   ============================================================ */

.section {
  padding: 56px 0;
}
.section--tint { background: var(--blue-light); }

/* Franja de encabezado de sección (p.ej. "Últimas noticias destacadas") */
.section--band {
  background: var(--blue-band);
  color: var(--white);
  padding: 34px 0;
}
.section--band .section__head { margin-bottom: 0; align-items: center; justify-content: center; text-align: center; }
.section--band h1, .section--band h2 { color: var(--white); font-size: clamp(1.3rem, 3vw, 2.1rem); width: 100%; text-align: center; }
.section__icon {
  width: 56px; height: 56px;
  background: var(--white);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}
.section__icon:hover { transform: scale(1.06); }
.section__icon svg { width: 28px; height: 28px; fill: var(--blue-band); }

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 34px;
  flex-wrap: wrap;
}
.section__head h1, .section__head h2 { font-size: clamp(1.7rem, 3.5vw, 2.3rem); }

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
}

iframe{
  width: 100%;
  height: 100%;
}

/* Tarjetas planas, sin sombra ni recuadro — imagen + texto, como el sitio original */
.card {
  background: transparent;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: none;
  display: flex;
  flex-direction: column;
}

.card__media {
  background: linear-gradient(135deg, var(--navy) 0%, var(--blue-mid) 100%);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;

  /* Cambiar width por max-width o 100% para fluidez */
  width: 100%;
  max-width: 350px;
  height: 200px;
}
.card__media svg { width: 36%; height: 36%; opacity: 0.5; }
.card__tag {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(20,40,74,0.82);
  color: var(--white);
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 10px 14px;
}

.card__media img{
    width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Enlace invisible sobre el iframe de vista previa: deja ver la miniatura
   real de Facebook pero intercepta el clic para abrir la publicación en
   Facebook (pestaña nueva), en vez de reproducir el video adentro de la
   tarjeta */
.video-thumb-overlay {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  cursor: pointer;
  z-index: 1;
}

/* Modal de video — centrado, NO a pantalla completa */
.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal[hidden] { display: none; }
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 20, 35, 0.72);
  animation: navFade 0.2s ease;
}
.modal__dialog {
  position: relative;
  z-index: 1;
  width: min(92vw, 360px);
  max-height: 88vh;
  background: #000;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  animation: navDropIn 0.2s ease;
}
.modal__media { width: 100%; aspect-ratio: 267 / 476; }
.modal__media iframe { width: 100%; height: 100%; border: 0; display: block; }
.modal__close {
  position: absolute;
  top: -16px;
  right: -16px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.modal__close svg { width: 16px; height: 16px; fill: var(--navy-deep); }
.modal__close:hover { background: var(--white); transform: scale(1.06); }

.card__body {
  padding: 18px 4px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}
.card__body h3 {
  font-size: 1.05rem;
  line-height: 1.25;
  text-transform: none;
}
.card__body h3 a {
  color: var(--blue-mid);
  text-decoration: underline;
}
.card__body h3 a:hover { color: var(--navy-deep); }
.card__body p {
  color: var(--ink-soft);
  font-size: 0.93rem;
  margin: 0;
  flex-grow: 1;
}

.card__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;   /* ajusta la proporción que prefieras, ej. 4/3 o 1/1 */
}

.card__media a {
  display: block;
  width: 100%;
  height: 100%;
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;   /* recorta la imagen para llenar el espacio sin deformarla */
  display: block;
}


/* Tarjeta sin imagen (p.ej. selector de periodo en Transparencia) */
.period-card {
  background: var(--blue-light);
  border-radius: var(--radius);
  border: 1px solid #DADFE5;
}
.period-card .card__body { padding: 22px 22px 24px; }
.period-card h3 { font-size: 1.2rem; margin: 4px 0 2px; }

.card__link {
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: underline;
  color: var(--blue-mid);
  margin-top: 2px;
}
.card__link:hover { color: var(--navy-deep); }

/* Feed de Facebook (widget oficial) */
.fb-feed {
  display: flex;
  justify-content: center;
}
.fb-page, .fb-page span, .fb-page iframe {
  max-width: 100%;
}

/* Franja de título de página interior (blanco sobre --blue-band) */
.eyebrow-white {
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.75);
  margin: 0 0 4px;
}

/* Migas de pan */
.breadcrumbs {
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin-bottom: 18px;
}
.breadcrumbs a { color: var(--blue-mid); text-decoration: underline; }
.breadcrumbs a:hover { color: var(--navy-deep); }
.breadcrumbs span[aria-hidden] { margin: 0 6px; opacity: 0.5; }
.breadcrumbs span[aria-current] { color: var(--ink); font-weight: 600; }

.doc-intro {
  max-width: 760px;
  color: var(--ink-soft);
  font-size: 0.98rem;
}

/* ============================================================
   Transparencia / Tesorería — bloques por año, 3 columnas
   ============================================================ */

.year-block__title {
  text-align: center;
  font-size: 1.3rem;
  margin: 44px 0 20px;
}
.year-block__title:first-of-type { margin-top: 0; }

.year-block {
  display: grid;
  grid-template-columns: 1fr 1fr 0.9fr;
  gap: 20px;
  align-items: start;
  margin-bottom: 30px;
}
.year-block__col--sidebar { position: sticky; top: 84px; }

/* Caja individual de categoría */
.doc-box {
  border: 1px solid #DADFE5;
  border-radius: 4px;
  background: var(--white);
  padding: 12px 16px;
  margin-bottom: 10px;
  font-size: 0.88rem;
}
.doc-box--header {
  background: var(--blue-light);
  text-align: center;
  font-weight: 700;
  color: var(--navy-deep);
}
.doc-box--header p { margin: 0; line-height: 1.3; }
.doc-box--single { font-weight: 600; }
.doc-box--single > a { text-decoration: underline; color: var(--blue-mid); }

.doc-box__title {
  margin: 0 0 6px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}
.doc-box__note {
  margin: 8px 0 4px;
  font-size: 0.78rem;
  color: var(--ink-soft);
  font-style: italic;
}

.doc-sublist {
  list-style: disc;
  margin: 0;
  padding-left: 18px;
}
.doc-sublist li { margin-bottom: 3px; }
.doc-sublist a { color: var(--blue-mid); text-decoration: underline; font-weight: 600; }
.doc-sublist a:hover { color: var(--navy-deep); }
.doc-sublist--muted { opacity: 0.92; }

/* Documento aún no publicado: texto plano, sin liga */
.doc-pending {
  color: #8A93A0;
  font-weight: 400;
}

/* Caja lateral (SRFT / FAISMUN) */
.sidebar-box {
  border: 1px solid #DADFE5;
  border-radius: 4px;
  background: var(--blue-light);
  padding: 14px 16px;
  margin-bottom: 10px;
  font-size: 0.88rem;
}
.sidebar__label {
  font-weight: 700;
  color: var(--navy-deep);
  margin: 0 0 6px;
  font-size: 0.9rem;
}
.sidebar__label--tight { margin-top: 14px; }
.sidebar__quarter {
  font-style: italic;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 10px 0 2px;
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .year-block { grid-template-columns: 1fr; }
  .year-block__col--sidebar { position: static; }
}

/* Listado de documentos por categoría (Transparencia / Tesorería) */
.doc-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 8px 48px;
  align-items: start;
}
.doc-group {
  padding: 22px 0;
  border-bottom: 1px solid #E7EAEE;
}
.doc-group h3 {
  font-size: 1.02rem;
  text-transform: none;
  color: var(--navy-deep);
  margin-bottom: 10px;
  line-height: 1.3;
}
.doc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.doc-list li { margin-bottom: 6px; }
.doc-list a {
  color: var(--blue-mid);
  text-decoration: underline;
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.doc-list a::before {
  content: "";
  flex-shrink: 0;
  width: 14px; height: 16px;
  background: var(--blue-mid);
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6zm0 7V3.5L19.5 9H14z"/></svg>') center/contain no-repeat;
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6zm0 7V3.5L19.5 9H14z"/></svg>') center/contain no-repeat;
}
.doc-list a:hover { color: var(--navy-deep); }
.doc-list a:hover::before { background: var(--navy-deep); }

/* Footer simple: fondo blanco, copyright centrado — como el sitio original */
.site-footer {
  background: var(--white);
  color: var(--ink);
  padding: 28px 0;
  border-top: 1px solid #E7EAEE;
  box-shadow: 0 -2px 10px rgba(20, 40, 74, 0.08);
  text-align: center;
}
.site-footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.site-footer p {
  margin: 0;
  font-size: 0.9rem;
  text-align: center;
}

/* Por si el footer inyectado incluye una cuadrícula de columnas
   (enlaces, redes, etc.) — se centra en vez de alinearse a la izquierda */
.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px 32px;
  text-align: center;
  width: 100%;
}
.footer-grid > * { text-align: center; }

/* ============================================================
   CONTÁCTANOS
   ============================================================ */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-bottom: 40px;
}
@media (max-width: 900px) {
  .contact-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .contact-grid { grid-template-columns: 1fr; }
}
.contact-card {
  background: var(--white);
  border: 1px solid #E7EAEE;
  border-radius: 10px;
  padding: 26px 24px;
}
.contact-card__icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--blue-light);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.contact-card__icon svg { width: 21px; height: 21px; fill: var(--blue-mid); }
.contact-card h3 {
  font-size: 1.02rem;
  color: var(--navy-deep);
  margin-bottom: 10px;
  line-height: 1.3;
}
.contact-card p { color: var(--ink-soft); font-size: 0.94rem; line-height: 1.55; margin: 0 0 4px; }
.contact-link {
  color: var(--blue-mid);
  font-weight: 600;
  text-decoration: underline;
  word-break: break-word;
}
.contact-link:hover { color: var(--navy-deep); }
.contact-list { list-style: none; margin: 0; padding: 0; }
.contact-list li {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 7px 0; border-bottom: 1px solid #EFF2F5;
  font-size: 0.94rem; color: var(--ink-soft);
}
.contact-list li:last-child { border-bottom: none; }
.contact-list li span:first-child { color: var(--navy-deep); font-weight: 600; }
.contact-map {
  border: 0; width: 100%; height: 320px; border-radius: 10px; display: block;
}
.contact-note {
  color: #8A93A0; font-size: 0.82rem; font-style: italic; margin-top: 10px;
}
/* Oficinas y dependencias — tarjeta con mapa propio */
.offices-head {
  margin: 44px 0 22px;
  text-align: center;
}
.offices-head h2 { font-size: clamp(1.4rem, 2.6vw, 1.8rem); margin: 6px 0 10px; }
.offices-head .doc-intro { margin: 0 auto; text-align: center; }

.offices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
}
.office-card {
  background: var(--white);
  border: 1px solid #E7EAEE;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.office-card__map {
  border: 0;
  width: 100%;
  height: 160px;
  display: block;
}
.office-card__mappending {
  height: 160px;
  background: var(--blue-light);
  color: #8A93A0;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.office-card__body { padding: 18px 20px 22px; }
.office-card__body h3 { font-size: 1rem; color: var(--navy-deep); margin-bottom: 8px; line-height: 1.3; }
.office-card__body p { color: var(--ink-soft); font-size: 0.9rem; line-height: 1.5; margin: 0; }
.office-card__tags {
  font-weight: 600;
  color: var(--blue-mid) !important;
  font-size: 0.82rem !important;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 8px !important;
}

/* Botón flotante de Facebook, como en el sitio de referencia */
.fb-float {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 44px; height: 44px;
  background: var(--blue-mid);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 90;
  box-shadow: 0 4px 14px rgba(20,40,74,0.3);
}
.fb-float svg { width: 20px; height: 20px; fill: var(--white); }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 480px) {
  .section--band h1, .section--band h2 { font-size: 1.15rem; letter-spacing: 0.01em; }
}

@media (max-width: 860px) {
  /* Fondo oscurecido detrás del panel cuando el menú está abierto.
     Se activa solo con CSS (:has), sin depender del JS existente. */
  body:has(.nav.is-open) {
    overflow: hidden;
  }
  body:has(.nav.is-open)::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(15, 26, 46, 0.45);
    /* Debe quedar por debajo de .site-header (z-index: 100): el <nav> vive
       dentro del header, así que su propio z-index (150) sólo cuenta
       dentro del contexto de apilamiento del header. Si este valor fuera
       mayor a 100, el fondo se pintaría encima del menú, no detrás. */
    z-index: 95;
    animation: navFade 0.25s ease;
  }

  .nav {
    position: fixed;
    top: 68px;
    right: 0;
    bottom: 0;
    left: auto;
    width: min(86vw, 320px);
    background: var(--white);
    flex-direction: column;
    align-items: stretch;
    padding: 10px 14px 22px;
    gap: 0;
    transform: translateX(100%);
    transition: transform 0.28s ease;
    overflow-y: auto;
    z-index: 150;
    border-radius: 14px 0 0 0;
    box-shadow: -8px 0 28px rgba(18, 40, 63, 0.18);
  }
  .nav.is-open { transform: translateX(0); }

  .nav__item { width: 100%; }
  .nav__item + .nav__item { border-top: 1px solid #EEF1F5; }

  .nav__link {
    padding: 15px 12px;
    width: 100%;
    border-radius: 8px;
    transition: background 0.15s ease, color 0.15s ease;
  }
  .nav__link:hover,
  .nav__link:active { background: var(--blue-light); }
  .nav__link[aria-current="page"]::after { display: none; }
  .nav__link[aria-current="page"] {
    background: var(--blue-light);
    border-radius: 8px;
  }

  .nav__arrow { transition: transform 0.2s ease; }
  .nav__item.is-open > .nav__link .nav__arrow,
  .nav__subitem.is-open > a .nav__arrow { transform: rotate(90deg); }

  .nav__dropdown {
    position: static;
    display: none;
    box-shadow: none;
    border: none;
    border-left: 2px solid var(--blue-light);
    margin: 2px 0 8px 14px;
    padding: 4px 0 4px 10px;
    min-width: 0;
  }
  .nav__item.is-open .nav__dropdown {
    display: block;
    animation: navDropIn 0.18s ease;
  }
  .nav__dropdown a { padding: 11px 12px; border-radius: 6px; }

  .nav__toggle {
    display: block;
    position: relative;
    z-index: 151;
    border-radius: 8px;
  }
  .nav__toggle:hover { background: var(--blue-light); }

  /* Hamburguesa → X cuando el menú está abierto (solo CSS, vía :has) */
  body:has(.nav.is-open) .nav__toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  body:has(.nav.is-open) .nav__toggle span:nth-child(2) {
    opacity: 0;
  }
  body:has(.nav.is-open) .nav__toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .nav__social {
    margin: 14px 0 0;
    padding-top: 14px;
    border-top: 1px solid #EEF1F5;
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .nav__subdropdown {
    position: static;
    display: none;
    box-shadow: none;
    border: none;
    border-left: 2px solid var(--blue-light);
    padding-left: 10px;
    margin-left: 4px;
  }
  .nav__subitem.is-open > .nav__subdropdown {
    display: block;
    animation: navDropIn 0.18s ease;
  }
  .nav__subitem > a { padding: 12px; }

  .footer-grid { flex-direction: column; }
}

@keyframes navFade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes navDropIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

:focus-visible {
  outline: 2px solid var(--blue-mid);
  outline-offset: 2px;
}



