/* =====================================================
   ARCHIVO GENERAL SAN JUAN — home.css
   Estilos exclusivos de la pantalla Home (home.html).
   Requiere shared.css cargado antes.
   ===================================================== */

/* ─── HOME page wrapper ──────────────────────────────────────────────── */
.pg-home {
  flex: 1;
  display: block;
}

/* ─── Hero ───────────────────────────────────────────────────────────── */
.home-hero {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px 40px;
  position: relative;
  background:
    linear-gradient(180deg, oklch(99% 0.005 70 / 0.88) 0%, oklch(97% 0.01 60 / 0.82) 100%),
    image-set(
      url('../assets/cabecera-naranja.webp') type('image/webp'),
      url('../assets/cabecera-naranja.jpg')  type('image/jpeg')
    ) center / cover no-repeat;
  /* visible: en desktop la placa de accesos sobresale del borde inferior */
  overflow: visible;
}

/* El hero termina en un borde neto, sin desvanecerse hacia el fondo: es ese
   borde el que la placa de accesos tiene que pisar. Con el degradado que
   había antes, la mitad de arriba y la de abajo de la placa quedaban sobre
   el mismo blanco y el solapado no se leía. */

.hero-h1 {
  font-family: var(--fu);
  font-size: clamp(28px, 4.5vw, 48px);
  font-weight: 700;
  color: var(--ct);
  line-height: 1.16;
  letter-spacing: -0.5px;
  max-width: 32ch;
  margin-bottom: 20px;
  position: relative;
  text-wrap: balance;
}

.hero-h1 .accent { color: var(--cp-act); }

.hero-h2 {
  font-family: var(--fb);
  font-size: clamp(16px, 2vw, 18px);
  color: var(--ct2);
  line-height: 1.65;
  max-width: 52ch;
  margin-bottom: 4px;
  position: relative;
}

.home-search-wrap {
  width: 100%;
  max-width: 620px;
  position: relative;
}

/* Override search pill inside hero */
.home-hero .search-pill {
  background: var(--csurf);
  box-shadow: 0 2px 12px oklch(0% 0 0 / 0.1), 0 8px 24px oklch(0% 0 0 / 0.08);
}

.home-hero .search-pill:focus-within {
  box-shadow: 0 4px 16px oklch(0% 0 0 / 0.14), 0 10px 32px oklch(0% 0 0 / 0.1);
}

/* ─── Hero: chips de contexto ────────────────────────────────────────── */
.hero-chips-wrap {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
  margin-top: 0;
  margin-bottom: 24px;
  position: relative;
  flex-wrap: wrap;
}

.segmented-buttons {
  display: flex;
  border-radius: 9999px;
  border: 1.5px solid var(--cbrd2);
  background: var(--csurf);
  overflow: hidden;
}

.seg-btn {
  font-family: var(--fu);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 20px;
  border: none;
  background: transparent;
  color: var(--ct2);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.seg-btn:hover {
  color: var(--ct);
  background: var(--cmuted);
}

.seg-btn.active {
  background: var(--cp-btn, oklch(55% 0.19 40));
  color: oklch(100% 0 0);
  font-weight: 600;
}

.seg-btn.active:hover { background: var(--cp-btn-hover, oklch(49% 0.22 35)); }

.seg-div {
  width: 1px;
  background: var(--cbrd2);
}

.action-chip {
  font-family: var(--fu);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 18px 8px 20px;
  border-radius: 9999px;
  border: 1.5px solid var(--cbrd2);
  background: var(--csurf);
  color: var(--cp-dk);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  min-height: 44px;
}

.action-chip:hover {
  border-color: var(--cp);
  background: oklch(from var(--cp) l c h / 0.04);
}

.action-chip.active {
  border-color: var(--cp);
  background: oklch(from var(--cp) l c h / 0.1);
  color: var(--cp-dk);
}

.action-chip svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.revistas-cta-wrap {
  width: 100%;
  max-width: 620px;
  position: relative;
  text-align: center;
  display: none;
}

.btn-large-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--fu);
  font-size: 16px;
  font-weight: 700;
  color: var(--cton);
  background: var(--cp-btn, oklch(55% 0.19 40));
  border: none;
  border-radius: 9999px;
  padding: 14px 32px;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
  box-shadow: 0 4px 12px oklch(from var(--cp) l c h / 0.2);
}

.btn-large-cta:hover {
  background: var(--cp-btn-hover, oklch(49% 0.22 35));
  transform: translateY(-1px);
}

.btn-large-cta svg {
  width: 18px;
  height: 18px;
}

.hero-periodo {
  font-family: var(--fu);
  font-size: 13px;
  color: var(--ct3);
  margin-top: 16px;
  margin-bottom: 20px;
  position: relative;
  min-height: 1.2em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.hero-periodo svg {
  width: 14px;
  height: 14px;
  opacity: 0.8;
  flex-shrink: 0;
}

/* ─── Revistas link en hero ──────────────────────────────────────────── */
.hero-revistas-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.hero-revistas-wrap .hero-revistas-label {
  font-size: 13px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ct3);
  margin-right: 0;
  white-space: nowrap;
}

.hero-revistas-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 0;
  font-family: var(--fu);
  font-size: 13px;
  font-weight: 600;
  color: var(--ct3);
  text-decoration: none;
  padding: 6px 14px 6px 16px;
  min-height: 44px;
  border-radius: 9999px;
  border: 1.5px solid var(--cbrd2);
  background: var(--csurf);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  position: relative;
}

.hero-revistas-link:hover {
  border-color: var(--cp);
  color: var(--cp-dk);
  background: oklch(from var(--cp) l c h / 0.04);
}

.hero-revistas-link svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}


/* ─── Context chips (hero) ───────────────────────────────────────────── */
.hero-context-chips {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  width: 100%;
  max-width: 620px;
  margin-top: 14px;
  position: relative;
}

.hero-context-chips.visible { display: flex; }

.context-chip-label {
  font-family: var(--fu);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ct3);
}

.context-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 10px 14px 10px 16px;
  border-radius: 9999px;
  border: 1.5px solid var(--cbrd2);
  background: var(--csurf);
  color: var(--cp-dk);
  font-family: var(--fu);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  white-space: nowrap;
  min-height: 44px;
}

.context-chip-btn:hover {
  border-color: var(--cp);
  background: oklch(from var(--cp) l c h / 0.04);
}

.context-chip-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ─── Skeleton loading ───────────────────────────────────────────────── */
@keyframes shimmer {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}

.skel {
  border-radius: 4px;
  background: var(--cmuted);
  position: relative;
  overflow: hidden;
}

.skel::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
      transparent 0%,
      oklch(93% 0.008 70 / 0.8) 50%,
      transparent 100%);
  animation: shimmer 1.4s ease-in-out infinite;
}

/* ─── Accesos directos (placa montada sobre el borde del hero) ───────── */
/* Una sola placa dividida en celdas: el hero tiene overflow:hidden, así que
   la placa es hermana de .home-hero y sube con margin-top negativo.        */
/* Base (mobile y tablet): la placa cierra el hero, en flujo normal.
   Solapar no sirve acá: apilada mide varias filas y taparía el buscador. */
.svc-quick {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1060px;
  margin: var(--gsj-space-10) auto 0;
  text-align: left;
}

/* Desktop: anclada al borde inferior del hero y corrida 50% hacia afuera.
   Así el solape es siempre exacto y no depende del alto del hero, que
   cambia con el viewport por min-height: 60vh. */
@media (min-width: 1024px) {
  .home-hero { padding-bottom: 168px; }

  .svc-quick {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-width: calc(1060px + 48px);
    margin: 0 auto;
    padding-inline: var(--gsj-container-pad);
    transform: translateY(50%);
  }

  /* Deja pasar la mitad de la placa que invade lo que sigue al hero */
  .home-hero + .normas-strip { padding-top: 156px; }
  .home-hero + .home-section { padding-top: 200px; }
  .normas-strip + .home-section { padding-top: 56px; }
}

/* ─── Normas archivísticas (franja) ──────────────────────────────────────
   Banda tonal sobre el par primary-container/on-primary-container del DS:
   destaca el marco normativo sin robarle foco al buscador. El listado
   completo vive en normas.html.                                        */
.normas-strip {
  background: var(--csurf);
  padding: var(--gsj-space-6) var(--gsj-container-pad) 0;
}

.normas-strip__inner {
  max-width: 1060px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: var(--gsj-space-6);
  background: var(--gsj-color-primary-container);
  border-radius: var(--gsj-radius-lg);
  padding: var(--gsj-space-5) var(--gsj-space-6);
}

.normas-strip__head {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: var(--gsj-space-3);
}

.normas-strip__icon {
  width: 22px;
  height: 22px;
  color: var(--gsj-color-on-primary-container);
  flex-shrink: 0;
  margin-top: 2px;
}

.normas-strip__title {
  font-family: var(--fu);
  font-size: 18px;
  font-weight: 700;
  color: var(--gsj-color-on-primary-container);
  line-height: 1.3;
  margin-bottom: 3px;
}

.normas-strip__sub {
  font-family: var(--fb);
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--gsj-color-on-primary-container);
  max-width: 62ch;
}

.normas-strip__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--gsj-space-2) var(--gsj-space-5);
  flex-shrink: 0;
}

.normas-strip__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 9px 20px;
  border-radius: 9999px;
  background: var(--cp-btn, oklch(55% 0.19 40));
  font-family: var(--fu);
  font-size: 14.5px;
  font-weight: 700;
  color: oklch(100% 0 0);
  text-decoration: none;
  transition: background 0.15s;
  white-space: nowrap;
}

.normas-strip__btn:hover { background: var(--cp-btn-hover, oklch(49% 0.22 35)); }

.normas-strip__btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.normas-strip__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--fu);
  font-size: 14px;
  font-weight: 600;
  color: var(--gsj-color-on-primary-container);
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.normas-strip__link:hover { text-decoration-thickness: 2px; }

@media (max-width: 900px) {
  .normas-strip__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--gsj-space-4);
  }

  .normas-strip__link { white-space: normal; }
}

.svc-quick__slab {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--csurf);
  border: 1px solid var(--cbrd);
  border-radius: var(--gsj-radius-xl);
  box-shadow:
    0 1px 3px oklch(0% 0 0 / 0.10),
    0 10px 30px oklch(0% 0 0 / 0.07);
  overflow: hidden;
}

.svc-quick__item {
  display: flex;
  flex-direction: column;
  gap: var(--gsj-space-3);
  padding: var(--gsj-space-8);
  border-left: 1px solid var(--cbrd);
  color: inherit;
  text-decoration: none;
  transition: background-color 160ms var(--ease), box-shadow 160ms var(--ease);
}

.svc-quick__item:first-child {
  border-left: 0;
}

/* Hover: sólo el fondo tonal del DS. Sin barra ni borde de acento. */
.svc-quick__item:hover {
  background: var(--gsj-color-primary-container);
  text-decoration: none;
}

/* Outline hacia adentro: la placa recorta con overflow:hidden */
.svc-quick__item:focus-visible {
  outline-offset: -4px;
  border-radius: 0;
}

.svc-quick__icon {
  width: 26px;
  height: 26px;
  color: var(--cp-dk);
  flex-shrink: 0;
}

.svc-quick__title {
  font-family: var(--fu);
  font-size: 18px;
  font-weight: 700;
  color: var(--ct);
  line-height: var(--gsj-line-height-snug);
}

/* 16px mínimo: regla de legibilidad del sistema (adultos mayores) */
.svc-quick__desc {
  font-family: var(--fu);
  font-size: 16px;
  font-weight: 400;
  color: var(--ct2);
  line-height: 1.5;
}

@media (prefers-reduced-motion: reduce) {
  .svc-quick__item { transition: none; }
}

@media (max-width: 1023px) {
  .svc-quick__slab { grid-template-columns: repeat(2, 1fr); }

  .svc-quick__item:nth-child(odd)  { border-left: 0; }
  .svc-quick__item:nth-child(n+3)  { border-top: 1px solid var(--cbrd); }

  /* Con tres celdas, la última queda sola en su fila: que ocupe el ancho
     completo en vez de dejar medio cajón vacío al lado. */
  .svc-quick__item:nth-child(odd):last-child { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  .svc-quick__slab { grid-template-columns: 1fr; }

  .svc-quick__item {
    border-left: 0;
    padding: var(--gsj-space-5);
  }

  .svc-quick__item + .svc-quick__item { border-top: 1px solid var(--cbrd); }
}

/* Destinos de los accesos: el header es sticky (80px) */
.home-section[id],
.pilar[id] {
  scroll-margin-top: 96px;
}

/* ─── Sección base ───────────────────────────────────────────────────── */
.home-section {
  padding: 80px 24px;
  background: var(--cbg);
}

.home-section--white  { background: var(--csurf); }
.home-section--muted  { background: var(--cmuted); }

.section-inner {
  max-width: 1060px;
  margin: 0 auto;
}

.sec-label {
  font-family: var(--fu);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--cp-dk);
  margin-bottom: 8px;
}

.sec-title {
  font-family: var(--fu);
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 700;
  color: var(--ct);
  margin-bottom: 12px;
  line-height: 1.2;
}

.sec-sub {
  font-family: var(--fb);
  font-size: 16px;
  color: var(--ct2);
  line-height: 1.75;
  margin-bottom: 44px;
}

/* ─── Institución (2 col) ────────────────────────────────────────────── */
.inst-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 64px;
  align-items: start;
}

.inst-body {
  font-family: var(--fb);
  font-size: 16px;
  color: var(--ct2);
  line-height: 1.8;
  margin-bottom: 28px;
}

.cta-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--fu);
  font-size: 14px;
  font-weight: 700;
  color: var(--cp-dk);
  text-decoration: none;
  transition: color 0.15s, gap 0.15s;
}

.cta-link:hover {
  color: var(--cp-act);
  gap: 10px;
}

.cta-link svg {
  width: 14px;
  height: 14px;
}

.inst-stats-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--cbrd);
  border-radius: 14px;
  overflow: hidden;
}

.inst-stat {
  background: var(--csurf);
  padding: 24px 28px;
}

.inst-stat:first-child { border-radius: 14px 14px 0 0; }
.inst-stat:last-child  { border-radius: 0 0 14px 14px; }

.inst-stat-num {
  font-family: var(--fu);
  font-size: 36px;
  font-weight: 700;
  color: var(--cp-dk);
  letter-spacing: -1px;
  line-height: 1;
  margin-bottom: 4px;
}

.inst-stat-lbl {
  font-family: var(--fb);
  font-size: 13px;
  color: var(--ct3);
  line-height: 1.4;
}

/* ─── Servicios — 3 Pilares M3 ───────────────────────────────────────── */
.svc-pillars {
  display: flex;
  flex-direction: column;
  gap: var(--gsj-space-4);
  padding: var(--gsj-space-10) var(--gsj-container-pad) 0;
  max-width: calc(1060px + 48px);
  margin-inline: auto;
}

.pilar {
  border-radius: var(--gsj-radius-xl);
  overflow: hidden;
}

.pilar--tramites { background: var(--gsj-color-primary-container); }
.pilar--cultura  { background: var(--gsj-color-secondary-container); }
.pilar--sipar    { background: var(--gsj-color-bg-muted); }

.pilar__body {
  display: grid;
  grid-template-columns: 55fr 45fr;
  min-height: 320px;
}

.pilar__content {
  padding: var(--gsj-space-8);
  display: flex;
  flex-direction: column;
  gap: var(--gsj-space-6);
}

.pilar__media { overflow: hidden; }
.pilar__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pilar__header {
  display: flex;
  align-items: center;
  gap: var(--gsj-space-4);
}

.pilar__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--gsj-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pilar--tramites .pilar__icon,
.pilar--sipar    .pilar__icon {
  background: var(--gsj-color-primary);
  color: var(--gsj-color-on-primary);
}

.pilar--cultura .pilar__icon {
  background: var(--gsj-color-accent);
  color: oklch(19.2% 0 0);
}

.pilar__meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pilar__label {
  font-family: var(--gsj-font-heading);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gsj-color-primary-text);
}

.pilar__name {
  font-family: var(--gsj-font-heading);
  font-size: clamp(18px, 2.5vw, 22px);
  font-weight: 700;
  color: var(--gsj-color-text);
  line-height: var(--gsj-line-height-snug);
  margin: 0;
}

/* Una columna: con el cuerpo a 16px, dos columnas dejan renglones de ~30
   caracteres. Antes entraban porque el texto estaba a 13px, que es lo que
   PRODUCT.md prohíbe para esta población de usuarios. */
.pilar__services {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  flex: 1;
}

.pilar__service-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--gsj-space-3) 0;
  border-top: 1px solid var(--gsj-color-border);
}

/* 17px: tiene que quedar por encima de los 16px de la descripción, si no
   el título del servicio pesa menos que su propio texto. */
.pilar__service-title {
  font-family: var(--gsj-font-heading);
  font-size: 17px;
  font-weight: 700;
  color: var(--gsj-color-text);
  line-height: var(--gsj-line-height-snug);
}

/* 16px mínimo (PRODUCT.md): estos párrafos son el cuerpo de la sección,
   no metadatos, y los leen adultos mayores en trámite jubilatorio. */
.pilar__service-desc {
  font-family: var(--gsj-font-body);
  font-size: 16px;
  color: var(--gsj-color-text-secondary);
  line-height: 1.5;
  max-width: 68ch;
}

.pilar__cta {
  display: flex;
  align-items: center;
  gap: var(--gsj-space-4);
  flex-wrap: wrap;
}

.pilar__btn {
  display: inline-flex;
  align-items: center;
  gap: var(--gsj-space-2);
  font-family: var(--gsj-font-heading);
  font-size: 14px;
  font-weight: 600;
  color: var(--gsj-color-on-primary);
  background: var(--cp-btn, oklch(55% 0.19 40));
  text-decoration: none;
  border-radius: var(--gsj-radius-full);
  padding: 10px 24px;
  min-height: 44px;
  transition: background var(--gsj-duration-fast) var(--gsj-ease-standard);
}

.pilar__btn:hover { background: var(--cp-btn-hover, oklch(49% 0.22 35)); }

.pilar__btn:focus-visible {
  outline: 3px solid oklch(from var(--gsj-color-primary) l c h / 0.65);
  outline-offset: 2px;
}

.pilar__btn svg { flex-shrink: 0; }

.pilar__btn-secondary {
  display: inline-flex;
  align-items: center;
  font-family: var(--gsj-font-heading);
  font-size: 14px;
  font-weight: 600;
  color: var(--gsj-color-primary-text);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 10px 0;
  min-height: 44px;
  transition: color var(--gsj-duration-fast) var(--gsj-ease-standard);
}

.pilar__btn-secondary:hover { color: var(--gsj-color-primary-active); }

.pilar__btn-secondary:focus-visible {
  outline: 3px solid oklch(from var(--gsj-color-primary) l c h / 0.65);
  outline-offset: 2px;
  border-radius: 2px;
}

@media (max-width: 720px) {
  .pilar__body { grid-template-columns: 1fr; }
  .pilar__media { order: -1; min-height: 200px; aspect-ratio: 16 / 7; }
  .pilar__services { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .pilar { border-radius: var(--gsj-radius-lg); }
  .pilar__content { padding: var(--gsj-space-6); }
}

/* ─── Z-Pattern estructura ───────────────────────────────────────────── */
.z-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 3px;
}

.z-row:first-child .z-text  { border-radius: 14px 0 0 0; }
.z-row:first-child .z-visual { border-radius: 0 14px 0 0; }
.z-row:last-child  .z-text  { border-radius: 0 0 14px 0; }
.z-row:last-child  .z-visual { border-radius: 0 0 0 14px; }

.z-row.flip .z-text   { order: 2; border-radius: 0; }
.z-row.flip .z-visual { order: 1; border-radius: 0; }

.z-row:first-child.flip .z-text   { border-radius: 0 14px 0 0; }
.z-row:first-child.flip .z-visual { border-radius: 14px 0 0 0; }
.z-row:last-child.flip  .z-text   { border-radius: 0 0 0 14px; }
.z-row:last-child.flip  .z-visual { border-radius: 0 0 14px 0; }

.z-text {
  background: var(--csurf);
  padding: 40px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.z-dept-num {
  font-family: var(--fu);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--cp-dk);
  margin-bottom: 10px;
}

.z-dept-title {
  font-family: var(--fu);
  font-size: 18px;
  font-weight: 700;
  color: var(--ct);
  margin-bottom: 12px;
  line-height: 1.25;
}

.z-dept-desc {
  font-family: var(--fb);
  font-size: 16px;
  color: var(--ct2);
  line-height: 1.75;
}

.z-visual {
  background: var(--cmuted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  gap: 8px;
  text-align: center;
  min-height: 200px;
}

.z-visual-num {
  font-family: var(--fu);
  font-size: clamp(48px, 6vw, 76px);
  font-weight: 700;
  color: var(--cp-dk);
  letter-spacing: -2px;
  line-height: 1;
}

.z-visual-lbl {
  font-family: var(--fb);
  font-size: 13px;
  color: var(--ct3);
  line-height: 1.4;
}

.z-visual-icon {
  color: var(--cp);
  opacity: 0.25;
}

.z-visual-icon svg {
  width: 56px;
  height: 56px;
}

/* Contenedor del bloque Z completo */
.z-container {
  max-width: 1060px;
  margin: 32px auto 0;
  border-radius: 14px;
  overflow: hidden;
}

/* Número más pequeño (Dto. 02 — "1991") */
.z-visual-num--sm {
  font-size: clamp(32px, 4vw, 52px);
}

/* Label descriptivo largo (Secretaría Técnica) */
.z-visual-lbl--coord {
  font-size: 15px;
  color: var(--ct2);
  max-width: 16ch;
}


/* ─── FAQ Acordeón ───────────────────────────────────────────────────── */
.faq-list {
  display: flex;
  flex-direction: column;
  max-width: 780px;
}

.faq-item { border-bottom: 1px solid var(--cbrd); }
.faq-item:first-child { border-top: 1px solid var(--cbrd); }

.faq-q {
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  gap: 16px;
  font-family: var(--fu);
  font-size: 16px;
  font-weight: 600;
  color: var(--ct);
  text-align: left;
  transition: color 0.15s;
}

.faq-q:hover { color: var(--cp-dk); }

.faq-q svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--ct3);
  transition: transform 0.25s var(--ease), color 0.15s;
}

.faq-item.open .faq-q svg {
  transform: rotate(45deg);
  color: var(--cp-dk);
}

.faq-item.open .faq-q { color: var(--cp-dk); }

.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s var(--ease);
}

.faq-item.open .faq-a { max-height: 600px; }

.faq-a-inner {
  font-family: var(--fb);
  font-size: 16px;
  color: var(--ct2);
  line-height: 1.75;
  padding-bottom: 20px;
}

@media (prefers-reduced-motion: reduce) {
  .skel::after { animation: none; }
}

/* ─── Responsive home ────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .inst-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .inst-stats-col {
    flex-direction: row;
    gap: 0;
  }

  .inst-stat { flex: 1; }
  .inst-stat:first-child { border-radius: 14px 0 0 14px; }
  .inst-stat:last-child  { border-radius: 0 14px 14px 0; }

  .svc-item { grid-template-columns: 40px 1fr; }

  .z-row,
  .z-row.flip { grid-template-columns: 1fr; }

  .z-row .z-visual,
  .z-row.flip .z-visual { order: unset; }

  .z-row .z-text,
  .z-row.flip .z-text { order: unset; border-radius: 0 !important; }

  .z-row .z-visual,
  .z-row.flip .z-visual { border-radius: 0 !important; }

  .z-row:first-child .z-text   { border-radius: 14px 14px 0 0 !important; }
  .z-row:last-child  .z-visual { border-radius: 0 0 14px 14px !important; }
}

@media (max-width: 480px) {
  .inst-stats-col {
    flex-direction: column;
    gap: 2px;
  }

  .inst-stat { flex: unset; }
  .inst-stat:first-child { border-radius: 14px 14px 0 0; }
  .inst-stat:last-child  { border-radius: 0 0 14px 14px; }
}

@media (max-width: 560px) {
  .svc-item.svc-hidden { display: none; }

  .services-more-btn { display: block; }

  .hero-h1 { max-width: 100%; }
}

/* ─── Noticias ───────────────────────────────────────────────────────────
   Tarjetas pobladas por home.js desde api-noticias.php. La sección vive
   hidden hasta que hay notas: nada de layout fantasma si el feed cae.  */
.noticias-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gsj-space-6);
  /* Sin sec-sub en esta sección: el aire entre título y grilla va acá */
  margin-top: var(--gsj-space-6);
}

.noticia {
  display: flex;
  flex-direction: column;
  background: var(--csurf);
  border: 1px solid var(--cbrd);
  border-radius: var(--gsj-radius-lg);
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease);
}

.noticia:hover {
  background: var(--gsj-color-primary-container);
  border-color: var(--cbrd2);
}

.noticia__media {
  display: block;
  aspect-ratio: 16 / 10;
  background: var(--cmuted);
  /* Sin esto, la tarjeta con el título más largo encoge su imagen y las
     alturas de la fila quedan desparejas */
  flex-shrink: 0;
}

.noticia__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.noticia__date {
  font-family: var(--fu);
  font-size: 13px;
  color: var(--ct2);
  padding: var(--gsj-space-4) var(--gsj-space-5) 0;
}

.noticia__title {
  font-family: var(--fu);
  font-size: 17px;
  font-weight: 600;
  color: var(--ct);
  line-height: 1.4;
  text-wrap: pretty;
  /* margin y no padding: con padding, overflow:hidden deja asomar la
     cuarta línea recortada por el line-clamp */
  margin: 6px var(--gsj-space-5) var(--gsj-space-5);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.noticia:hover .noticia__title { text-decoration: underline; }

.noticias-more {
  margin-top: var(--gsj-space-6);
}

.noticias-more a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  font-family: var(--fu);
  font-size: 15px;
  font-weight: 600;
  color: var(--cp-act);
  text-decoration: none;
}

.noticias-more a:hover { text-decoration: underline; }

.noticias-more svg {
  width: 15px;
  height: 15px;
}

@media (max-width: 900px) {
  .noticias-grid {
    grid-template-columns: 1fr;
    gap: var(--gsj-space-4);
  }

  .noticia__media { aspect-ratio: 21 / 9; }
}
