/* El navegador mete 8px de margen al body y desalinearía la cabecera */
body{ margin: 0; }

/* Alto de la cabecera. Va en :root porque lo usan las secciones de la landing,
   que no son descendientes de .cab. El script lo ajusta al alto real medido,
   que cambia con el ancho de pantalla. */
:root{ --cab-alto: 64px; }

/* ============================================================================
   CABECERA · Festival del Conocimiento
   Un solo componente para todo el sitio: landing y páginas internas.
   Lo monta assets/js/cabecera.js
   ========================================================================== */

.cab{
  position: sticky; top: 0; z-index: 900;
  background: #12343B;
  border-bottom: 1px solid rgba(255,255,255,.09);
  transition: background .25s ease, border-color .25s ease;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* En la landing arranca transparente sobre el hero y se vuelve sólida al bajar */
.cab--flotante{
  background: transparent;
  border-bottom-color: transparent;
  position: fixed; left: 0; right: 0;
}
.cab--flotante.is-solida{
  background: #12343B;
  border-bottom-color: rgba(255,255,255,.12);
}

.cab__in{
  max-width: 1240px; margin-inline: auto; padding: 0 24px;
  height: 64px;          /* fija, no min-height: la barra no debe crecer nunca */
  display: flex; align-items: center; gap: 18px;
}

/* ------------------------------------------------------------------ marca -- */
.cab__marca{
  display: flex; align-items: center; gap: 11px;
  text-decoration: none; color: #fff; flex: none;
}
.cab__marca img{ width: 34px; height: auto; display: block; }
.cab__marca b{
  font-family: 'Space Grotesk','Inter',sans-serif;
  font-weight: 700; font-size: .95rem; line-height: 1; letter-spacing: -.01em;
  white-space: nowrap;
}

/* ------------------------------------------------------------------- menú -- */
.cab__menu{
  display: flex; align-items: center; gap: 16px;
  margin-left: auto;
  /* Sin flex-wrap a propósito: si no cupiera, la barra se partiría en dos
     filas y crecería. Antes de llegar a ese punto entra el menú plegable.
     El contenido necesita ~1068px, así que el corte va en 1120px: la holgura
     cubre que las tipografías de respaldo rendericen más anchas si Space
     Grotesk no llegara a cargar. */
}

.cab__nav{ display: flex; gap: 2px; align-items: center; }
.cab__nav a{
  color: rgba(255,255,255,.78); text-decoration: none;
  font-family: 'Space Grotesk','Inter',sans-serif;
  font-weight: 600; font-size: .87rem;
  padding: 8px 13px; border-radius: 100px;
  white-space: nowrap; transition: background .16s ease, color .16s ease;
}
.cab__nav a:hover{ background: rgba(255,255,255,.13); color: #fff; }
.cab__nav a[aria-current]{ background: rgba(255,255,255,.15); color: #fff; }

/* --------------------------------------------------------------- sesión --- */
.cab__auth{ display: flex; align-items: center; gap: 10px; }

.cab__quien{
  font-size: .8rem; color: rgba(255,255,255,.62);
  max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.cab__btn{
  display: inline-flex; align-items: center; justify-content: center;
  font-family: 'Space Grotesk','Inter',sans-serif;
  font-weight: 600; font-size: .87rem; line-height: 1;
  padding: 10px 18px; border-radius: 100px;
  text-decoration: none; border: 0; cursor: pointer;
  white-space: nowrap; transition: background .16s ease, transform .16s ease, color .16s ease;
}
.cab__btn:hover{ transform: translateY(-1px); }

.cab__btn--cta{ background: #D4116F; color: #fff; }
.cab__btn--cta:hover{ background: #B80A63; }

.cab__btn--linea{
  background: transparent; color: #fff;
  border: 1.5px solid rgba(255,255,255,.42);
}
.cab__btn--linea:hover{ background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.7); }

.cab__btn--salir{
  background: none; color: rgba(255,255,255,.72);
  border: 1px solid rgba(255,255,255,.24);
  padding: 8px 15px; font-size: .82rem;
}
.cab__btn--salir:hover{ background: rgba(255,255,255,.13); color: #fff; }

/* ------------------------------------------------------- botón hamburguesa */
.cab__toggle{
  display: none; margin-left: auto;
  width: 44px; height: 44px; border: 0; border-radius: 10px;
  background: rgba(255,255,255,.1); cursor: pointer;
  align-items: center; justify-content: center; flex-direction: column; gap: 5px;
}
.cab__toggle span{
  display: block; width: 19px; height: 2px; border-radius: 2px; background: #fff;
  transition: transform .25s ease, opacity .2s ease;
}
.cab__toggle[aria-expanded="true"] span:nth-child(1){ transform: translateY(7px) rotate(45deg); }
.cab__toggle[aria-expanded="true"] span:nth-child(2){ opacity: 0; }
.cab__toggle[aria-expanded="true"] span:nth-child(3){ transform: translateY(-7px) rotate(-45deg); }

.cab :focus-visible{ outline: 3px solid #F6D20A; outline-offset: 2px; }

/* ------------------------------------------------------------------ móvil -- */
@media (max-width: 1120px){
  .cab__toggle{ display: flex; }

  .cab__menu{
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    background: #0B252A;
    border-bottom: 1px solid rgba(255,255,255,.1);
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 12px 24px 22px;
    max-height: calc(100dvh - 64px); overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,.35);
  }
  .cab__menu.is-abierto{ display: flex; }

  .cab__nav{ flex-direction: column; align-items: stretch; gap: 0; }
  .cab__nav a{
    padding: 13px 4px; border-radius: 0; font-size: .98rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
  }
  .cab__nav a:hover{ background: none; color: #F6D20A; }

  .cab__auth{
    flex-direction: column; align-items: stretch; gap: 10px;
    margin-top: 18px;
  }
  .cab__btn{ width: 100%; padding: 14px 18px; font-size: .95rem; }
  .cab__quien{ max-width: none; text-align: center; padding: 4px 0 6px; }

  /* En móvil la cabecera flotante se vuelve sólida al abrir el menú */
  .cab--flotante:has(.cab__menu.is-abierto){ background: #12343B; }
}

/* ---------------------------------------------------------------- anclas --- */
/* Para que los títulos no queden escondidos bajo la cabecera pegajosa */
[id^="fdc-"]{ scroll-margin-top: calc(var(--cab-alto) + 14px); }

@media (prefers-reduced-motion: reduce){
  .cab, .cab__btn, .cab__nav a, .cab__toggle span{ transition: none !important; }
}
