/* duxels-shared · header2.css — el header estilo Google (v0.6.0): ☰ · marca · ? ⚙ ⋮⋮⋮ avatar, el menú lateral y el footer común (footer2.mjs).
   Solo lo carga una página con `header: 2` (worker.mjs, render.mjs «head»); se carga DESPUÉS de chrome.css y user-menu.css y se apoya en sus variables.
   Sin estilos en línea en el marcado: todo está aquí. Estados que pone header2-state.js / header2.js sobre <html>:
     data-dxh-menu="open" | "rail"   computadora: menú abierto (por omisión) o angosto, solo íconos (recuerda: localStorage `dx.menu`)
     data-dxh-drawer="open"          celular: el menú está encima del contenido
   Puntos de corte: 800px (celular / computadora). Objetivos táctiles de 44px. */

html[data-dxh] { --dxh-h: 56px; --dxh-side-w: 0px; scroll-padding-top: var(--dxh-h); }
@media (min-width: 801px) {
  html[data-dxh] { --dxh-h: 64px; --dxh-side-w: 256px; }
  html[data-dxh][data-dxh-menu="rail"] { --dxh-side-w: 72px; }
  html[data-dxh][data-dxh-nomenu] { --dxh-side-w: 0px; }
}
/* El contenido de la página deja el hueco del header (arriba) y del menú (izquierda); el footer queda dentro del <body>, así que se mueve con él */
html[data-dxh] body { margin-top: var(--dxh-h); margin-left: var(--dxh-side-w); transition: margin-left 0.2s ease; }
html[data-dxh-drawer="open"] { overflow: hidden; }
/* sin JS el ☰ no hace nada (ni abre el cajón ni angosta el menú): se esconde en todos los anchos; header2-state.js / header2.js ponen data-dxh-js */
html:not([data-dxh-js]) .dxh-menu-btn { display: none; }
/* un sitio sin menú no tiene nada que abrir: ni ☰ ni menú lateral, en computadora y en celular */
.top.dxh.dxh-nomenu .dxh-side, .dxh-nomenu .dxh-menu-btn { display: none; }

/* ---- la barra -------------------------------------------------------------------------------------------------------------------------- */
.top.dxh {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  height: var(--dxh-h); padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  background: #121a33; border-bottom: 1px solid #24304f; color: #e8ecf8; font-family: var(--font);
}
.top.dxh::before { content: none; }
.dxh ul { list-style: none; margin: 0; padding: 0; }
.dxh-left, .dxh-right { display: flex; align-items: center; flex: none; gap: 4px; }
.dxh-right { position: relative; margin-left: auto; }

.dxh-btn {
  display: inline-flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: #c9d2e8; font: inherit; text-decoration: none; cursor: pointer;
}
.dxh-btn:hover { background: #1c2647; color: #fff; }
.dxh-btn[aria-expanded="true"] { background: #1f2d57; color: #fff; }
.dxh-btn:focus-visible, .dxh-brand:focus-visible, .dxh-app:focus-visible, .dxh .dxh-item:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.dxh-btn svg { display: block; flex: none; }

/* la marca: solo [logo del sitio] Sitio; «By Duxels» está en el footer común */
.dxh-brand { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 44px; overflow: hidden; color: #e8ecf8; text-decoration: none; }
.dxh-logo { flex: none; width: 32px; height: 32px; border-radius: 8px; }
.dxh-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.25rem; font-weight: 600; letter-spacing: 0.01em; }


/* el menú de usuario (user-menu.css) en la barra: el avatar es el botón de 44px y su menú cuelga de .dxh-right */
.top.dxh .nav-login, .top.dxh .nav-login.has-avatar { width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #c9d2e8; }
.top.dxh .nav-login:hover { background: #1c2647; color: #fff; }
.top.dxh .nav-login[aria-expanded="true"] { background: #1f2d57; color: #fff; border: 0; }
.dxh .nav-avatar { width: 32px; height: 32px; font-size: 0.8rem; }
.dxh .nav-user-menu a {
  display: flex; align-items: center; width: 100%; padding: 11px 12px; border: 0; border-radius: 8px; text-align: left;
  font: inherit; color: inherit; text-decoration: none; background: transparent; cursor: pointer;
}
.dxh .nav-user-menu a:hover, .dxh .nav-user-menu a:focus-visible { background: rgba(105, 135, 220, 0.14); color: var(--fg); outline: none; }

/* el cuadro de apps (⋮⋮⋮) */
.dxh-apps { position: relative; }
.dxh-pop {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 30; width: 360px; max-width: calc(100vw - 16px); max-height: calc(100vh - var(--dxh-h) - 24px); overflow-y: auto;
  padding: 20px; border: 1px solid #2e3b66; border-radius: 24px; background: #161f3d; color: #e8ecf8; box-shadow: 0 14px 42px rgba(0, 0, 0, 0.45);
}
.dxh-pop[hidden] { display: none; }
.dxh-pop-title { margin: 0 0 12px; font-size: 0.95rem; font-weight: 600; color: #c9d2e8; }
.dxh-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.dxh-app {
  display: flex; flex-direction: column; align-items: center; gap: 8px; min-height: 44px; padding: 12px 4px; border-radius: 16px;
  color: #e8ecf8; text-decoration: none; font-size: 0.8125rem; text-align: center;
}
.dxh-app span { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.dxh-app:hover { background: #1c2647; }
.dxh-app.is-current { background: #1f2d57; }
.dxh-app img { display: block; width: 44px; height: 44px; border-radius: 12px; }

/* ---- el menú lateral -------------------------------------------------------------------------------------------------------------------- */
.top.dxh .dxh-side {
  position: fixed; top: var(--dxh-h); left: 0; bottom: 0; z-index: 2; width: var(--dxh-side-w); min-width: 0;
  display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; gap: 4px; padding: 12px; font-size: 0.9375rem; overflow-x: hidden; overflow-y: auto;
  background: #121a33; border-right: 1px solid #24304f; color: #c9d2e8; transition: width 0.2s ease;
}
.dxh-items { display: flex; flex-direction: column; gap: 4px; }
.dxh-side-head { display: none; }
.dxh-divider { margin-top: 8px; padding-top: 8px; border-top: 1px solid #24304f; }
.dxh .dxh-item {
  display: flex; align-items: center; gap: 14px; height: 44px; padding: 0 14px; border-radius: 22px;
  color: #c9d2e8; text-decoration: none; white-space: nowrap;
}
.dxh .dxh-item svg { flex: none; }
.dxh .dxh-item:hover { background: #1c2647; color: #fff; }
.dxh .dxh-item[aria-current="page"] { background: #1f2d57; color: #e8ecf8; font-weight: 600; }
.dxh-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.dxh-scrim { display: none; }

@media (min-width: 801px) {
  /* angosto, como Gmail: solo los íconos (el nombre sigue ahí para los lectores de pantalla y sale como title al pasar el mouse) */
  html[data-dxh-menu="rail"] .top.dxh .dxh-side { padding: 12px 0; align-items: center; }
  html[data-dxh-menu="rail"] .dxh .dxh-item { justify-content: center; width: 48px; padding: 0; }
  html[data-dxh-menu="rail"] .dxh-label {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
  }
  html[data-dxh-menu="rail"] .dxh-divider { width: 48px; }
}

/* ---- celular: el menú se esconde y sale encima del contenido; ? y ⚙ se quedan en la barra ---------------------------------------- */
@media (max-width: 800px) {
  .top.dxh { gap: 4px; padding-left: max(6px, env(safe-area-inset-left)); padding-right: max(6px, env(safe-area-inset-right)); }
  .dxh-brand { gap: 6px; }
  .dxh-logo { width: 28px; height: 28px; }
  .dxh-name { font-size: 1.0625rem; }
  .dxh-pop {
    position: fixed; top: calc(var(--dxh-h) + 8px); right: 8px; left: 8px; width: auto; max-width: 360px; margin-left: auto;
  }
  .dxh-scrim:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 1; background: rgba(5, 8, 20, 0.6); }
  .top.dxh .dxh-side {
    top: 0; z-index: 2; width: min(300px, 86vw); padding: 10px 10px 16px; visibility: hidden; transform: translateX(-100%);
    transition: transform 0.2s ease, visibility 0s linear 0.2s;
  }
  html[data-dxh-drawer="open"] .top.dxh .dxh-side { visibility: visible; transform: none; transition-delay: 0s; }
  .dxh-side-head { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 4px; }
  .dxh-side-head .dxh-name { font-size: 1.0625rem; }
  .dxh .dxh-item { height: 48px; border-radius: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html[data-dxh] body, .top.dxh .dxh-side { transition: none; }
}
@media (forced-colors: active) {
  .dxh .dxh-item[aria-current="page"], .dxh-app.is-current { outline: 2px solid CanvasText; }
}

/* ---- el footer común (footer2.mjs) ------------------------------------------------------------------------------------------------------- */
.foot.dxf {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px;
  min-height: 56px; padding: 6px max(24px, env(safe-area-inset-right)) 6px max(24px, env(safe-area-inset-left));
  background: #0e1324; border-top: 1px solid #24304f; color: #9aa6c4; font-size: 0.8125rem; text-align: left;
}
.dxf-left, .dxf-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dxf-left { flex: 0 1 auto; }
.dxf-right { flex: 0 1 auto; flex-wrap: wrap; justify-content: flex-end; }
.dxf-logo { display: block; flex: none; width: 20px; height: 20px; }
.dxf-links { display: flex; flex: 1 1 auto; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0 4px; min-width: 0; }
.dxf-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; border-radius: 8px; color: #c9d2e8; text-decoration: none; }
.dxf-link:hover { color: #fff; background: #1c2647; }
.dxf-link:focus-visible { outline: 2px solid var(--fg); outline-offset: -2px; }
.dxf-version { min-width: 0; overflow-wrap: anywhere; color: #9aa6c4; }
/* el idioma ES | EN: un interruptor compacto de botones con aria-pressed (chrome-lang.js lo maneja con el mismo `set` y la misma cookie duxels-lang) */
.dxf-lang { display: inline-flex; align-items: center; padding: 0; border: 1px solid #2e3b66; border-radius: 22px; background: #121a33; overflow: hidden; }
.dxf-lang-btn { min-width: 44px; min-height: 44px; padding: 0 12px; border: 0; background: transparent; color: #c9d2e8; font: inherit; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.04em; cursor: pointer; }
.dxf-lang-btn:hover { background: #1c2647; color: #fff; }
.dxf-lang-btn[aria-pressed="true"] { background: #1f2d57; color: #fff; }
.dxf-lang-btn:focus-visible { outline: 2px solid var(--fg); outline-offset: -3px; }
@media (max-width: 800px) {
  .foot.dxf { flex-direction: column; align-items: center; justify-content: center; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); text-align: center; }
  .dxf-links, .dxf-right { justify-content: center; }
  .dxf-left { justify-content: center; }
}
