/* ==========================================================================
   SynkScroll — header renovado (compartido por inicio y páginas internas).
   Barra translúcida, navegación en cápsula y CTA sólido. Se carga al final
   para prevalecer sobre los estilos heredados de header.
   ========================================================================== */
body > header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-height);
  display: flex; align-items: center; gap: 14px;
  padding-inline: var(--gutter);
  background: rgba(246, 243, 251, .94);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid rgba(33, 21, 47, .08);
  box-shadow: none;
  transition: background .3s, box-shadow .3s, border-color .3s;
}
body > header.is-scrolled {
  background: rgba(250, 248, 253, .97);
  border-color: rgba(33, 21, 47, .1);
  box-shadow: 0 10px 30px -18px rgba(33, 21, 47, .35);
}
body > header .brand { width: 168px; margin-right: auto; flex-shrink: 0; }
body > header .brand img { display: block; width: 100%; height: auto; }
/* Descriptor junto al logo */
body > header .brand-descriptor {
  margin-right: auto; padding-left: 16px; border-left: 1px solid rgba(33, 21, 47, .16);
  font: 500 11px/1.35 'DM Sans', system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase;
  color: #6f5f84; white-space: nowrap;
}
body > header .brand-descriptor ~ * { margin-left: 0; }
body > header .brand:has(+ .brand-descriptor) { margin-right: 0; }
@media (max-width: 1240px) {
  body > header .brand-descriptor { display: none; }
  body > header .brand:has(+ .brand-descriptor) { margin-right: auto; }
}

/* Navegación en cápsula */
body > header nav#site-nav {
  position: absolute; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 2px;
  padding: 4px;
  background: rgba(255, 255, 255, .6);
  border: 1px solid rgba(33, 21, 47, .08);
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(33, 21, 47, .04);
  font: 500 15px/1 'DM Sans', 'Space Grotesk', system-ui, sans-serif;
  letter-spacing: 0;
  color: #5b5068;
}
body > header nav#site-nav a {
  position: relative; padding: 11px 18px; border-radius: 999px;
  color: inherit; text-decoration: none;
  transition: background .2s, color .2s;
}
body > header nav#site-nav a:after { display: none; }
body > header nav#site-nav a:hover { color: #21152f; background: rgba(134, 98, 208, .1); }
body > header nav#site-nav a[aria-current] {
  color: #21152f; background: #fff;
  box-shadow: 0 1px 3px rgba(33, 21, 47, .12), 0 0 0 1px rgba(33, 21, 47, .04);
}

/* Idioma: discreto, en texto */
body > header .lang-toggle {
  height: 36px; padding: 3px; margin: 0;
  background: transparent; border: 1px solid rgba(33, 21, 47, .14); border-radius: 999px;
  font: 600 11px/1 var(--mono, ui-monospace, monospace);
}
body > header .lang-toggle:hover { border-color: rgba(33, 21, 47, .3); }
body > header .lang-toggle [data-lang] { padding: 7px 10px; color: #7b6f8a; }
body > header .lang-toggle [data-lang].is-active { background: #21152f; color: #fff; }

/* CTA sólido, sin sombra dura */
body > header .nav-cta {
  display: inline-flex; align-items: center; gap: 10px;
  height: 42px; padding: 0 6px 0 18px; margin: 0;
  background: #21152f !important; color: #fff !important;
  border: 0 !important; border-radius: 999px !important; box-shadow: none !important;
  font: 600 14px/1 'DM Sans', 'Space Grotesk', system-ui, sans-serif !important;
  letter-spacing: 0; white-space: nowrap; text-decoration: none;
  transition: background .2s, transform .2s;
}
body > header .nav-cta span {
  display: grid; place-items: center; width: 30px; height: 30px; margin: 0;
  border-radius: 50%; background: #c7aff2; color: #21152f; font-size: 13px;
  transition: transform .25s;
}
body > header .nav-cta:hover { background: #3a2752 !important; }
body > header .nav-cta:hover span { transform: rotate(45deg); }

/* Progreso de lectura: línea fina */
body > header .site-reading-progress { height: 2px; background: linear-gradient(90deg, #8662d0, #c7aff2); }

body > header .menu-toggle { display: none; }

/* Tablet y celular: menú en panel flotante */
@media (max-width: 1050px) {
  body > header .brand { width: 140px; }
  body > header nav#site-nav { display: none; }
  body > header .menu-toggle {
    position: relative; display: grid; place-items: center;
    width: 42px; height: 42px; min-width: 42px; margin: 0; padding: 0;
    border: 1px solid rgba(33, 21, 47, .14); border-radius: 50%; background: rgba(255, 255, 255, .6);
    font-size: 0; color: transparent; cursor: pointer;
  }
  body > header .menu-toggle span { display: none; }
  body > header .menu-toggle:before, body > header .menu-toggle:after {
    content: ''; position: absolute; left: 50%; top: 50%; width: 16px; height: 1.5px;
    background: #21152f; border-radius: 2px; transition: transform .25s;
  }
  body > header .menu-toggle:before { transform: translate(-50%, -4px); }
  body > header .menu-toggle:after { transform: translate(-50%, 3px); }
  body > header .menu-toggle[aria-expanded="true"]:before { transform: translate(-50%, 0) rotate(45deg); }
  body > header .menu-toggle[aria-expanded="true"]:after { transform: translate(-50%, 0) rotate(-45deg); }
  body > header nav#site-nav.is-open {
    display: flex; flex-direction: column; align-items: stretch; gap: 2px;
    position: absolute; top: calc(100% + 8px); left: var(--gutter); right: var(--gutter); transform: none;
    padding: 8px; border-radius: 20px;
    background: rgba(252, 250, 255, .97); border: 1px solid rgba(33, 21, 47, .08);
    box-shadow: 0 24px 48px -20px rgba(33, 21, 47, .4);
    font-size: 16px;
  }
  body > header nav#site-nav.is-open a { padding: 15px 16px; border: 0; border-radius: 14px; }
}
@media (max-width: 520px) {
  body > header { gap: 8px; }
  body > header .brand { width: 118px; }
  body > header .lang-toggle { height: 34px; }
  body > header .lang-toggle [data-lang] { padding: 6px 8px; font-size: 10px; }
  body > header .nav-cta { height: 38px; padding: 0 4px 0 12px; gap: 6px; font-size: 12px !important; }
  body > header .nav-cta span { width: 28px; height: 28px; }
}
@media (max-width: 440px) {
  body > header .nav-cta { padding: 0; width: 40px; height: 40px; justify-content: center; font-size: 0 !important; }
  body > header .nav-cta span { width: auto; height: auto; background: none; color: #fff; font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  body > header, body > header * { transition: none !important; }
}
