/* ==========================================================================
   SADEV — Sistema de Administración de Desarrollo Curricular
   U.E. Rogelia Menacho de Balcázar · Cobija, Pando · Bolivia

   Token system derived from the institution's own seal:
   sky blue, ceremonial gold, sun-rising green, deep navy ink, warm paper.
   No build step — plain CSS with custom properties, mobile-first.
   ========================================================================== */

:root {
  /* --- Color: paleta vívida — nada de verde, nada de sepia institucional.
     Tinta violeta profunda + 4 acentos saturados, cada uno con un trabajo
     fijo (magenta = acción principal, turquesa = información/frescura,
     ámbar = el dorado real del escudo, violeta = profundidad/degradados),
     para que "colorido" no signifique "caótico". --- */
  --ink:        #150E2B; /* tinta índigo, no negro puro ni azul-noche */
  --ink-70:     #150E2Bb3;
  --oro:        #FFB627; /* el dorado real del escudo, ahora más saturado */
  --oro-dark:   #E69A0E;
  --magenta:    #FF2D78; /* acento principal — CTA, "estás aquí" */
  --magenta-dark: #D91E63;
  --turquesa:   #00C9C0; /* acento fresco secundario */
  --turquesa-dark: #00A399;
  --violeta:    #7C3AED; /* profundidad, degradados, nivel primario */
  --violeta-dark: #6023D9;
  --papel:      #FFFFFF; /* blanco franco, no crema */
  --papel-2:    #F5F1FF; /* banda con un toque violeta, no beige */
  --carbon:     #150E2B; /* footer / secciones oscuras: la misma tinta */
  --carbon-2:   #241a42;
  --linea:      #ECE6FA; /* hairline con tinte violeta, no tostado */
  --blanco:     #FFFFFF;

  /* --- Type: Poppins, una sola tipografía en TODO el proyecto — landing,
     login y portal docente. --f-mono ya no es una fuente aparte; se deja
     el nombre de variable para no reescribir cada selector que la usa. --- */
  --f-display: 'Poppins', -apple-system, Segoe UI, sans-serif;
  --f-body:    'Poppins', -apple-system, Segoe UI, sans-serif;
  --f-mono:    'Poppins', -apple-system, Segoe UI, sans-serif;

  /* --- Rhythm ---
     --radius se mantiene chico (documento oficial: los paneles grandes
     — expediente, tarjetas, contacto — siguen de canto recto a propósito,
     como un formulario impreso). Solo los controles interactivos pequeños
     (botones, toggles) usan --radius; nada se redondea "porque sí". */
  --container: 1180px;
  --radius: 9px;
  --shadow-doc: 0 18px 50px -20px rgba(21, 14, 43, 0.35);
  --shadow-lift: 0 24px 46px -22px rgba(21, 14, 43, 0.4);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  font-family: var(--f-body);
  color: var(--ink);
  background: var(--papel);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

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

/* --- Eyebrow / "Artículo" numbering ----------------------------------
   Justified here because PDC documents are themselves built from
   numbered official sections — this label echoes that document logic. */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-mono);
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--oro-dark);
  margin-bottom: 14px;
}
.eyebrow::before {
  content: '';
  width: 26px;
  height: 1px;
  background: var(--oro-dark);
}

h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 600; color: var(--ink); margin: 0; text-wrap: balance; }

.section-head { max-width: 640px; margin: 0 auto 56px; text-align: center; }
.section-head h2 { font-size: clamp(28px, 4vw, 40px); font-weight: 600; margin-bottom: 14px; }
.section-head p { color: var(--ink-70); font-size: 16px; }

.section { padding: 96px 0; }
.section--tight { padding: 72px 0; }
.bg-papel-2 { background: var(--papel-2); }
.bg-blanco { background: var(--blanco); }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--papel);
  border-bottom: 1px solid var(--linea);
  transition: box-shadow .25s ease, background-color .25s ease;
}
.site-header.is-scrolled { box-shadow: 0 8px 24px -18px rgba(21,14,43,.5); background: var(--blanco); }

.site-header__bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
}
/* Solo el escudo como marca — sin texto "SADEV" al lado; a este tamaño
   (58px) el detalle del sello ya se lee, y se mantiene igual en móvil
   porque .brand no tiene una regla aparte por breakpoint. */
.brand { display: flex; align-items: center; flex-shrink: 0; }
.brand img { display: block; height: 58px; width: 44px; object-fit: contain; }

.nav-desktop { display: none; }
@media (min-width: 1200px) {
  .nav-desktop { display: flex; align-items: center; gap: 34px; }
}
.nav-desktop a {
  position: relative;
  font-family: var(--f-mono); font-size: 13px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink);
  padding: 6px 0;
  transition: color .2s ease;
}
.nav-desktop a::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, var(--magenta), var(--turquesa));
  transform: scaleX(0); transform-origin: left;
  transition: transform .25s ease;
}
.nav-desktop a:hover, .nav-desktop a.is-active { color: var(--magenta-dark); }
.nav-desktop a:hover::after, .nav-desktop a.is-active::after { transform: scaleX(1); }

.header-actions { display: flex; align-items: center; gap: 18px; }
.icon-btn { background: none; border: 0; cursor: pointer; color: var(--ink); font-size: 16px; padding: 4px; }
.icon-btn:hover { color: var(--oro-dark); }

/* Un solo lenguaje de botón en toda la página: el degradado magenta→violeta
   es SIEMPRE la acción principal (Portal Docente); todo lo demás es
   secundario y discreto (borde fino, sin relleno) — nunca dos botones
   sólidos de igual peso compitiendo uno al lado del otro. */
.btn-admin {
  display: none;
  font-family: var(--f-mono); font-size: 12.5px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--blanco);
  background: linear-gradient(120deg, #38bdf8, #2563eb); border: 1.5px solid transparent;
  padding: 9px 18px; border-radius: var(--radius);
  transition: border-color .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.btn-admin:hover {
  color: var(--blanco);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -8px rgba(37,99,235,.55);
}
@media (min-width: 1200px) { .btn-admin { display: inline-block; } }

/* Portal Docente — la acción principal de toda la página; mismo degradado
   que .btn-primary del hero, así el CTA se ve idéntico dondequiera que
   aparezca (header fijo, hero, sección de niveles). */
.btn-docente {
  display: none; align-items: center; gap: 8px;
  font-family: var(--f-mono); font-size: 12.5px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--papel);
  background: linear-gradient(120deg, var(--magenta), var(--violeta));
  padding: 9px 18px; border-radius: var(--radius); border: 1.5px solid transparent;
  transition: box-shadow .2s ease, transform .2s ease;
}
.btn-docente:hover { box-shadow: 0 10px 20px -8px rgba(255,45,120,.5); transform: translateY(-2px); }
@media (min-width: 1200px) { .btn-docente { display: inline-flex; } }
.nav-mobile .btn-docente { display: inline-flex; justify-content: center; margin-top: 14px; }

.nav-toggle {
  display: inline-flex; background: none; border: 1px solid var(--linea);
  border-radius: var(--radius); padding: 9px 11px; cursor: pointer; color: var(--ink);
  font-size: 18px; min-width: 44px; min-height: 44px;
}
@media (min-width: 1200px) { .nav-toggle { display: none; } }

.nav-mobile {
  display: none;
  flex-direction: column;
  border-top: 1px solid var(--linea);
  padding: 8px 24px 18px;
  max-height: calc(100svh - 87px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.nav-mobile.is-open { display: flex; }
.nav-mobile a {
  font-family: var(--f-mono); font-size: 13.5px; letter-spacing: .05em; text-transform: uppercase;
  padding: 13px 4px; border-bottom: 1px solid var(--linea); color: var(--ink);
}
.nav-mobile .btn-admin { display: inline-block; margin-top: 14px; text-align: center; }
@media (min-width: 1200px) { .nav-mobile { display: none !important; } }

/* ==========================================================================
   Hero — "documento oficial" with the real seal as a stamp
   ========================================================================== */
.hero {
  position: relative;
  background:
    linear-gradient(165deg, rgba(6,22,56,.94) 0%, rgba(8,32,82,.86) 55%, rgba(10,44,110,.80) 100%),
    url('../images/hero-school-v2.png');
  background-size: cover;
  background-position: center 30%;
  padding: 68px 0 56px;
  overflow: hidden;
}
/* Malla de color animada — magenta, turquesa, violeta y ámbar en degradados
   radiales superpuestos sobre la foto, no un lineal de 2 tonos. Es el
   momento más vívido de la página, y se mueve solo, muy lento, como una
   aurora sobre el patio de la unidad educativa. */
.hero::before {
  content: '';
  position: absolute; inset: -12%;
  background:
    radial-gradient(640px 540px at 10% 15%, rgba(37,99,235,.62), transparent 60%),
    radial-gradient(680px 560px at 90% 10%, rgba(14,165,233,.52), transparent 58%),
    radial-gradient(760px 620px at 75% 92%, rgba(29,78,216,.58), transparent 60%),
    radial-gradient(520px 460px at 8% 90%, rgba(56,189,248,.40), transparent 58%);
  filter: blur(6px);
}
/* Textura de puntos por encima de la malla — conserva el motivo "documento"
   sin apagar el color. */
.hero::after {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.1) 1.4px, transparent 1.4px);
  background-size: 26px 26px;
}
@media (prefers-reduced-motion: no-preference) {
  .hero::before { animation: meshDrift 16s ease-in-out infinite alternate; }
}
@keyframes meshDrift {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-3%, 2%) scale(1.06); }
}
/* Una sola columna, centrada — sin el sello repetido en el hero (ya está
   en el header, no hace falta un segundo logo dominando la pantalla). */
.hero__grid {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}

.hero__eyebrow { color: var(--oro); }
.hero__eyebrow::before { background: var(--oro); }

.hero h1 {
  color: var(--papel);
  font-size: clamp(28px, 3.6vw, 40px);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin-bottom: 16px;
}
/* El énfasis del titular pasa por los 3 acentos principales — no un solo
   color plano — porque este es el único lugar de la página donde el
   titular "presume" toda la paleta de una vez. */
.hero h1 em {
  font-style: normal;
  background: linear-gradient(95deg, #7dd3fc 0%, #38bdf8 50%, #ffffff 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead { color: #E7E1FA; font-size: 16px; line-height: 1.6; max-width: 52ch; margin: 0 auto 26px; }

.hero__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }

/* Único momento de movimiento orquestado de la página: la entrada del
   hero al cargar, en cascada. El resto de las secciones se queda quieto
   y visible desde el primer fotograma — sin fade-in repetido al hacer
   scroll en cada bloque. */
@media (prefers-reduced-motion: no-preference) {
  .hero-in {
    opacity: 0; transform: translateY(16px);
    animation: heroRise .75s cubic-bezier(.16,.84,.44,1) forwards;
  }
  .hero-in--1 { animation-delay: .05s; }
  .hero-in--2 { animation-delay: .16s; }
  .hero-in--3 { animation-delay: .27s; }
  .hero-in--4 { animation-delay: .38s; }
  .hero-in--5 { animation-delay: .3s; }
  @keyframes heroRise { to { opacity: 1; transform: none; } }
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--f-mono); font-size: 13.5px; letter-spacing: .05em; text-transform: uppercase;
  padding: 15px 26px; border-radius: var(--radius); border: 1px solid transparent;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, border-color .18s ease, color .18s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: linear-gradient(120deg, var(--magenta), var(--violeta)); color: var(--blanco); }
.btn-primary:hover { box-shadow: 0 14px 28px -10px rgba(255,45,120,.55); }
/* Botón del hero en azul, a juego con el degradado azul del slider. */
.hero .btn-primary { background: linear-gradient(120deg, #38bdf8, #2563eb); }
.hero .btn-primary:hover { box-shadow: 0 14px 28px -10px rgba(37,99,235,.65); }
.btn-outline { border-color: rgba(255,255,255,.4); color: var(--papel); }
.btn-outline:hover { border-color: var(--oro); color: var(--oro); box-shadow: 0 12px 24px -12px rgba(255,182,39,.5); }

/* El sello ya no vive en el hero (dominaba la pantalla) — el escudo del
   header (46px) es la única marca visible ahí; .seal/.seal-wrap quedan
   sin uso en esta página. */

/* ==========================================================================
   Expediente strip (replaces the 4 clashing color blocks)
   ========================================================================== */
.expediente {
  background: var(--blanco);
  box-shadow: var(--shadow-doc);
  margin: -46px auto 0;
  position: relative; z-index: 5;
  max-width: var(--container);
}
.expediente__grid {
  display: grid; grid-template-columns: 1fr;
}
@media (min-width: 600px) { .expediente__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .expediente__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.expediente__item {
  display: flex; align-items: center; gap: 16px;
  padding: 26px 28px;
  border-bottom: 1px solid var(--linea);
}
@media (min-width: 760px) {
  .expediente__item { border-bottom: 0; border-right: 1px solid var(--linea); }
  .expediente__item:last-child { border-right: 0; }
}
.expediente__item {
  transition: background-color .2s ease;
}
.expediente__item:hover { background: var(--papel-2); }
/* Insignias 3D: degradado + brillo de cristal + sombra de color, un tono
   distinto por ítem — igual lenguaje que el panel admin, a mayor escala. */
.expediente__item i {
  position: relative;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 46px; height: 46px; font-size: 18px;
  color: #fff; border-radius: 14px;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}
.expediente__item i::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(160deg, rgba(255,255,255,.6), rgba(255,255,255,0) 60%);
  mix-blend-mode: soft-light;
}
.expediente__item:hover i { transform: translateY(-3px) rotate(-8deg) scale(1.08); }
.expediente__item:nth-of-type(1) i { background: linear-gradient(150deg, #4de6dd, var(--turquesa)); box-shadow: 0 8px 16px -6px rgba(0,201,192,.55); }
.expediente__item:nth-of-type(2) i { background: linear-gradient(150deg, #ff77ac, var(--magenta));  box-shadow: 0 8px 16px -6px rgba(255,45,120,.5); }
.expediente__item:nth-of-type(3) i { background: linear-gradient(150deg, #ffd075, var(--oro));      box-shadow: 0 8px 16px -6px rgba(255,182,39,.5); }
.expediente__item:nth-of-type(4) i { background: linear-gradient(150deg, #a680f5, var(--violeta));  box-shadow: 0 8px 16px -6px rgba(124,58,237,.5); }
.expediente__item h4 { font-family: var(--f-body); font-weight: 700; font-size: 15px; }
.expediente__item span { display: block; font-family: var(--f-mono); font-size: 11px; color: var(--ink-70); letter-spacing: .04em; }

/* ==========================================================================
   Feature cards
   ========================================================================== */
.features { display: grid; gap: 1px; background: var(--linea); border: 1px solid var(--linea); }
@media (min-width: 720px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1020px) { .features { grid-template-columns: repeat(3, 1fr); } }

.feature {
  background: var(--blanco);
  padding: 34px 30px;
  display: flex; gap: 20px;
  position: relative;
  transition: background-color .2s ease;
}
.feature:hover { background: var(--papel-2); }
.feature i {
  position: relative;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 50px; height: 50px; font-size: 20px;
  color: #fff; border-radius: 15px;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}
.feature i::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(160deg, rgba(255,255,255,.6), rgba(255,255,255,0) 60%);
  mix-blend-mode: soft-light;
}
.feature:hover i { transform: translateY(-3px) rotate(-8deg) scale(1.08); }
.feature:nth-of-type(1) i { background: linear-gradient(150deg, #ff77ac, var(--magenta));  box-shadow: 0 8px 16px -6px rgba(255,45,120,.5); }
.feature:nth-of-type(2) i { background: linear-gradient(150deg, #4de6dd, var(--turquesa)); box-shadow: 0 8px 16px -6px rgba(0,201,192,.55); }
.feature:nth-of-type(3) i { background: linear-gradient(150deg, #ffd075, var(--oro));      box-shadow: 0 8px 16px -6px rgba(255,182,39,.5); }
.feature:nth-of-type(4) i { background: linear-gradient(150deg, #a680f5, var(--violeta));  box-shadow: 0 8px 16px -6px rgba(124,58,237,.5); }
.feature:nth-of-type(5) i { background: linear-gradient(150deg, #ffd075, var(--oro));      box-shadow: 0 8px 16px -6px rgba(255,182,39,.5); }
.feature:nth-of-type(6) i { background: linear-gradient(150deg, #a680f5, var(--violeta));  box-shadow: 0 8px 16px -6px rgba(124,58,237,.5); }

@media (prefers-reduced-motion: no-preference) {
  .expediente__item i, .feature i { animation: badgePop .5s cubic-bezier(.34,1.56,.64,1) backwards; }
  .expediente__item:nth-of-type(1) i, .feature:nth-of-type(1) i { animation-delay: .04s; }
  .expediente__item:nth-of-type(2) i, .feature:nth-of-type(2) i { animation-delay: .1s; }
  .expediente__item:nth-of-type(3) i, .feature:nth-of-type(3) i { animation-delay: .16s; }
  .expediente__item:nth-of-type(4) i, .feature:nth-of-type(4) i { animation-delay: .22s; }
  .feature:nth-of-type(5) i { animation-delay: .28s; }
  .feature:nth-of-type(6) i { animation-delay: .34s; }
  @keyframes badgePop { from { opacity: 0; transform: scale(.4) rotate(-10deg); } to { opacity: 1; transform: none; } }
}
.feature h4 { font-size: 17px; font-weight: 700; font-family: var(--f-body); margin-bottom: 8px; }
.feature p { font-size: 14.5px; color: var(--ink-70); margin: 0; }

/* ==========================================================================
   About / stats
   ========================================================================== */
.about__grid { display: grid; gap: 56px; align-items: center; }
@media (min-width: 940px) { .about__grid { grid-template-columns: 1fr 1fr; } }
.about p { color: var(--ink-70); margin-bottom: 20px; }
.about h2 { font-size: clamp(28px, 4vw, 38px); font-weight: 600; margin-bottom: 22px; }

.stat-row { display: flex; gap: 48px; margin-top: 28px; }
.stat b {
  display: block; font-family: var(--f-mono); font-weight: 700;
  font-size: 42px; color: var(--ink); line-height: 1;
}
.stat span { display: block; margin-top: 8px; font-size: 13.5px; color: var(--ink-70); }
.stat--oro b { color: var(--oro-dark); }
.stat--magenta b { color: var(--magenta-dark); }

.media-frame { position: relative; border: 6px solid var(--blanco); box-shadow: var(--shadow-lift); }
.media-frame img { width: 100%; height: 420px; object-fit: cover; }
.play-btn {
  position: absolute; inset: 0; margin: auto; width: 74px; height: 74px;
  background: var(--oro); border-radius: 50%; border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 20px; color: var(--ink);
  transition: transform .2s ease;
}
.play-btn:hover { transform: scale(1.08); }

/* ==========================================================================
   Stats band (dark)
   ========================================================================== */
/* Misma malla vívida del hero, más contenida — la página se siente como un
   solo sistema de color, no una foto stock oscurecida seguida de un panel
   distinto. */
.stats-band {
  position: relative;
  overflow: hidden;
  background: var(--ink);
  color: var(--papel);
}
.stats-band::before {
  content: '';
  position: absolute; inset: -20%;
  background:
    radial-gradient(600px 460px at 12% 100%, rgba(255,45,120,.4), transparent 60%),
    radial-gradient(600px 460px at 88% 0%, rgba(0,201,192,.4), transparent 60%),
    radial-gradient(520px 420px at 50% 50%, rgba(124,58,237,.3), transparent 62%);
  filter: blur(8px);
}
@media (prefers-reduced-motion: no-preference) {
  .stats-band::before { animation: meshDrift 20s ease-in-out infinite alternate; }
}
.stats-band__grid { position: relative; z-index: 1; display: grid; gap: 40px; text-align: center; }
@media (min-width: 700px) { .stats-band__grid { grid-template-columns: repeat(4, 1fr); } }
.stats-band i {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; margin-bottom: 16px;
  font-size: 22px; color: #fff; border-radius: 16px;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}
.stats-band i::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(160deg, rgba(255,255,255,.6), rgba(255,255,255,0) 60%);
  mix-blend-mode: soft-light;
}
.stats-band__grid > div:hover i { transform: translateY(-3px) rotate(-8deg) scale(1.08); }
.stats-band__grid > div:nth-child(1) i { background: linear-gradient(150deg, #4de6dd, var(--turquesa)); box-shadow: 0 8px 18px -6px rgba(0,201,192,.6); }
.stats-band__grid > div:nth-child(2) i { background: linear-gradient(150deg, #ff77ac, var(--magenta));  box-shadow: 0 8px 18px -6px rgba(255,45,120,.55); }
.stats-band__grid > div:nth-child(3) i { background: linear-gradient(150deg, #ffd075, var(--oro));      box-shadow: 0 8px 18px -6px rgba(255,182,39,.55); }
.stats-band__grid > div:nth-child(4) i { background: linear-gradient(150deg, #a680f5, var(--violeta));  box-shadow: 0 8px 18px -6px rgba(124,58,237,.55); }
.stats-band b { display: block; font-family: var(--f-mono); font-size: 34px; font-weight: 700; }
.stats-band span { font-size: 13px; color: #D8CFF2; letter-spacing: .03em; }

/* ==========================================================================
   Niveles
   ========================================================================== */
.niveles { display: grid; gap: 26px; margin-bottom: 52px; }
@media (min-width: 780px) { .niveles { grid-template-columns: repeat(3, 1fr); } }
.nivel {
  background: var(--blanco); border: 1px solid var(--linea);
  padding: 0;
  overflow: hidden;
  transition: box-shadow .25s ease, transform .25s ease;
}
.nivel:hover { box-shadow: var(--shadow-lift); transform: translateY(-4px); }
.nivel__bar { height: 6px; }
.nivel--turquesa .nivel__bar { background: linear-gradient(90deg, var(--turquesa), #4de6dd); }
.nivel--magenta .nivel__bar  { background: linear-gradient(90deg, var(--magenta), #ff77ac); }
.nivel--oro .nivel__bar      { background: linear-gradient(90deg, var(--oro), #ffd075); }
.nivel__body { padding: 32px 28px; }
.nivel h3 { font-size: 19px; font-weight: 700; font-family: var(--f-body); margin-bottom: 12px; }
.nivel p { font-size: 14.5px; color: var(--ink-70); margin: 0; }

/* ==========================================================================
   Events
   ========================================================================== */
.events { display: flex; flex-direction: column; gap: 24px; }
@media (min-width: 940px) { .events { flex-direction: row; } }
.event-feature {
  flex: 1; background: var(--blanco); border: 1px solid var(--linea);
  transition: box-shadow .25s ease, transform .25s ease;
}
.event-feature:hover { box-shadow: var(--shadow-lift); transform: translateY(-3px); }
.event-feature img { width: 100%; height: 240px; object-fit: cover; }
.event-feature__body { display: flex; gap: 24px; padding: 28px; align-items: flex-start; }
.event-list { flex: 1; display: flex; flex-direction: column; gap: 18px; }
.event-row {
  display: flex; gap: 20px; background: var(--blanco); border: 1px solid var(--linea); padding: 22px;
  transition: box-shadow .25s ease, transform .25s ease;
}
.event-row:hover { box-shadow: var(--shadow-lift); transform: translateY(-3px); }

.date-badge { text-align: center; flex-shrink: 0; }
.date-badge b { display: block; font-family: var(--f-mono); font-size: 26px; color: var(--ink); }
.date-badge span { display: block; font-family: var(--f-mono); font-size: 11px; color: var(--ink-70); letter-spacing: .06em; text-transform: uppercase; }
.date-badge .time { margin-top: 8px; background: var(--ink); color: var(--papel); font-family: var(--f-mono); font-size: 10.5px; padding: 6px 8px; line-height: 1.5; }

.event h4 { font-size: 16.5px; font-weight: 700; font-family: var(--f-body); margin-bottom: 6px; }
.event-meta { display: flex; flex-wrap: wrap; gap: 14px; font-family: var(--f-mono); font-size: 11.5px; color: var(--oro-dark); margin-bottom: 8px; }
.event p { font-size: 13.5px; color: var(--ink-70); margin: 0; }

/* ==========================================================================
   Contact
   ========================================================================== */
.contact-card {
  display: flex; flex-direction: column; background: var(--blanco);
  border: 1px solid var(--linea); box-shadow: var(--shadow-doc);
  max-width: 1000px; margin: 0 auto; overflow: hidden;
}
@media (min-width: 860px) { .contact-card { flex-direction: row; } }
#contacto .section-head { margin-bottom: 28px; }
.contact-form { flex: 1.15; min-width: 0; padding: 26px; }
.contact-required { margin: 0 0 16px; color: #596174; font-size: 12px; }
.contact-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.contact-form .field { min-width: 0; }
.contact-form .field--full { grid-column: 1 / -1; }
.contact-form label { display: block; margin-bottom: 5px; font-size: 12px; font-weight: 600; color: var(--ink); }
.contact-form label span { font-weight: 400; color: #596174; }
.contact-form input, .contact-form textarea {
  width: 100%; border: 1px solid #d9deea; border-radius: 6px;
  background: #fff; padding: 10px 12px; font-family: var(--f-body); font-size: 14px;
  color: var(--ink); min-height: 44px; transition: border-color .2s, box-shadow .2s;
}
.contact-form textarea { resize: vertical; min-height: 90px; max-height: 320px; }
.contact-form input::placeholder, .contact-form textarea::placeholder { color: #667085; }
.contact-form input:focus, .contact-form textarea:focus { outline: 2px solid #2563eb; outline-offset: 2px; border-color: #2563eb; }
.contact-form [aria-invalid="true"] { border-color: #b42318; }
.field-error { display: block; color: #b42318; font-size: 12px; line-height: 1.4; margin-top: 4px; }
.field-error:empty { display: none; }
.contact-actions { display: flex; justify-content: center; margin-top: 18px; }
.btn-contact { background: #2563eb; color: #fff; min-height: 44px; padding: 12px 28px; }
.btn-contact:hover { background: #1d4ed8; }
.btn-contact:focus-visible { outline: 3px solid #2563eb; outline-offset: 4px; }
.contact-notice { font-size: 12px; color: #596174; text-align: center; margin: 10px 0 0; }
.contact-status { color: #344054; font-size: 13px; margin: 12px 0 0; }
.contact-status:empty { display: none; }
.contact-map { flex: 1; min-width: 0; min-height: 300px; position: relative; background: #f7f7f8; }
.contact-map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
@media (max-width: 540px) {
  .contact-form { padding: 20px; }
  .contact-fields { grid-template-columns: 1fr; gap: 12px; }
  .contact-map { min-height: 260px; }
  .contact-form input, .contact-form textarea { font-size: 16px; }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--carbon); color: #9AA0AC; padding: 64px 0 30px; }
.footer-grid { display: grid; gap: 40px; margin-bottom: 40px; }
@media (min-width: 780px) { .footer-grid { grid-template-columns: 1.3fr 1fr 1fr; } }
.footer-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.footer-brand img { display: block; height: 40px; width: 30px; object-fit: contain; flex-shrink: 0; }
.footer-brand span { font-family: var(--f-display); color: var(--papel); font-size: 19px; font-weight: 600; }
.site-footer h5 { font-family: var(--f-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--papel); margin-bottom: 16px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.site-footer a:hover { color: var(--oro); }
.social-row { display: flex; gap: 10px; margin-top: 18px; }
.social-row a {
  width: 38px; height: 38px; border-radius: var(--radius); background: var(--carbon-2);
  display: flex; align-items: center; justify-content: center; transition: background-color .2s ease;
}
.social-row a:hover { background: var(--oro); color: var(--ink); }
.footer-bottom { border-top: 1px solid var(--carbon-2); padding-top: 26px; text-align: center; font-size: 13px; }

/* Educational back-to-top control */
.back-to-top {
  position: fixed; right: calc(24px + env(safe-area-inset-right, 0px));
  bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  width: 60px; height: 60px; display: grid; place-items: center;
  border: 2px solid #fff; border-radius: 50%; background: #2563eb; color: #fff;
  box-shadow: 0 6px 20px rgba(37, 99, 235, .35); cursor: pointer;
  touch-action: manipulation; transition: transform .2s, box-shadow .2s;
}
.back-to-top[hidden] { display: none; }
.back-to-top:hover { transform: translateY(-3px); box-shadow: 0 9px 24px rgba(37, 99, 235, .45); }
.back-to-top:focus-visible { outline: 3px solid #172554; outline-offset: 4px; }
.back-to-top__label {
  position: absolute; right: calc(100% + 10px); white-space: nowrap;
  background: #172554; color: #fff; padding: 7px 12px; border-radius: 6px;
  font-family: var(--f-body); font-size: 12px; font-weight: 600;
  opacity: 0; visibility: hidden; pointer-events: none;
}
.back-to-top:hover .back-to-top__label, .back-to-top:focus-visible .back-to-top__label { opacity: 1; visibility: visible; }
@media (max-width: 540px) {
  .back-to-top { width: 54px; height: 54px; right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce) { .back-to-top { transition: none; } .back-to-top:hover { transform: none; } }

/* Keep intrinsic text widths and sticky navigation from clipping content. */
.expediente__item > div, .feature > div, .event { min-width: 0; overflow-wrap: anywhere; }
section[id] { scroll-margin-top: 104px; }
@media (min-width: 600px) and (max-width: 1099px) {
  .expediente__item { border-bottom: 1px solid var(--linea); border-right: 0; }
  .expediente__item:nth-child(odd) { border-right: 1px solid var(--linea); }
  .expediente__item:nth-last-child(-n+2) { border-bottom: 0; }
}
