/* Shared site header (2026-09-29): logo + language pills + ONE menu.
   Used by inicio, contacto, tutorial and codigo; copied by build_netlify.sh.
   inicio/contacto/codigo still carry an inline copy of the base rules below
   (identical); the tutorial relies on this file alone.

   Cristina: "no podemos tener las tres opciones arriba a la derecha" — Guía de
   uso, Contáctanos and Iniciar sesión / Mi cuenta live in ONE dropdown next to
   the language pills. It is a <details>, so it opens and closes without
   JavaScript; kn-header.js only adds close-on-outside-click / Escape and the
   "Mi cuenta" label. */

/* ---- base header ---- */
.kn-header { position: sticky; top: 0; z-index: 1000;
  background: rgba(14,14,17,0.82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,0.08); }
.kn-header-inner { max-width: 1160px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  font-family: Roboto, system-ui, -apple-system, "Segoe UI", sans-serif; }
.kn-logo { display: inline-flex; align-items: center; gap: 12px; text-decoration: none;
  color: #f8f4f7; font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; }
.kn-logo img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.kn-logo .pink { color: #db5662; }
.kn-nav { display: inline-flex; align-items: center; gap: 8px; }
.kn-lang { display: inline-flex; gap: 6px; }
.kn-lang button {
  font-family: inherit; font-size: .82rem; font-weight: 700;
  padding: 7px 13px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04); color: #b8aeb6;
  transition: all .2s ease; white-space: nowrap;
}
.kn-lang button:hover { color: #f8f4f7; }
.kn-lang button.kn-active { background: #db5662; border-color: #db5662; color: #fff; }
.lang-abbr { display: none; }
@media (max-width: 700px) {
  .lang-full { display: none; }
  .lang-abbr { display: inline; }
}
@media (max-width: 560px) {
  .kn-logo span { display: none; }
  .kn-lang button { font-size: .76rem; padding: 6px 10px; }
}

/* ---- menu ---- */

.kn-menu { position: relative; }
.kn-menu > summary {
  list-style: none; cursor: pointer; user-select: none;
  display: inline-flex; align-items: center; gap: 8px;
  font-family: Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 700; font-size: 15px; line-height: 1.25; color: #f8f4f7;
  padding: 8px 16px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.05);
  transition: all .2s ease; white-space: nowrap;
}
/* Icon only (Cristina 2026-09-29: no hace falta que diga "Menú"); the word
   stays for screen readers in .kn-sr. */
.kn-menu > summary { justify-content: center; width: 40px; height: 40px; padding: 0; box-sizing: border-box; }
.kn-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.kn-menu > summary::-webkit-details-marker { display: none; }
.kn-menu > summary::marker { content: ""; }
.kn-menu > summary:hover { background: rgba(255,255,255,0.09); }
.kn-menu[open] > summary { border-color: #db5662; background: rgba(219,86,98,0.14); }
.kn-menu > summary:focus-visible { outline: 2px solid #db5662; outline-offset: 2px; }
.kn-menu-icon { display: inline-flex; flex-direction: column; gap: 3px; }
.kn-menu-icon i { display: block; width: 16px; height: 2px; border-radius: 2px; background: currentColor;
  transition: transform .2s ease, opacity .2s ease; }
.kn-menu[open] .kn-menu-icon i:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.kn-menu[open] .kn-menu-icon i:nth-child(2) { opacity: 0; }
.kn-menu[open] .kn-menu-icon i:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

.kn-menu-panel {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 1001;
  width: 250px; max-width: calc(100vw - 32px); box-sizing: border-box;
  padding: 8px; border-radius: 18px;
  background: #1a1a1f; border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 22px 50px rgba(0,0,0,0.55);
  display: flex; flex-direction: column; gap: 2px;
  font-family: Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  animation: kn-menu-in .16s ease-out;
}
@keyframes kn-menu-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.kn-menu-panel a {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 12px; text-decoration: none;
  color: #e9e3e8; font-weight: 700; font-size: 15.5px; line-height: 1.25; white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.kn-menu-panel a svg { flex: none; color: #db5662; }
.kn-menu-panel a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.kn-menu-panel a[aria-current="page"] { background: rgba(219,86,98,0.12); color: #fff; }
.kn-menu-sep { height: 1px; margin: 6px 6px; background: rgba(255,255,255,0.08); }
.kn-menu-panel a.kn-cta {
  justify-content: center; color: #fff; margin-top: 2px;
  background: linear-gradient(135deg, #db5662, #f07a85);
  box-shadow: 0 8px 22px rgba(219,86,98,0.32);
}
.kn-menu-panel a.kn-cta:hover { filter: brightness(1.06); }

@media (max-width: 560px) {
  .kn-menu > summary { width: 36px; height: 36px; }
}
