/* =============================================================================
   TEMA.CSS — Botón para cambiar entre modo normal y modo oscuro + base del modo oscuro.
   Los colores oscuros de cada página están en css/oscuro/*.css (se activan con
   <html data-tema="oscuro">). El script js/tema.js guarda la elección del visitante.
   ============================================================================= */

/* Botón (luna en modo normal, sol en modo oscuro) */
.tema-btn {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  margin: 0 0.6rem 0 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
}
.tema-btn:hover { background: var(--soft); border-color: var(--cyan, #12c2e9); }
.tema-btn:active { transform: scale(0.94); }
.tema-btn:focus-visible { outline: 2px solid var(--cyan, #12c2e9); outline-offset: 2px; }
.tema-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tema-btn .tema-sol { display: none; }
html[data-tema="oscuro"] .tema-btn .tema-sol { display: block; }
html[data-tema="oscuro"] .tema-btn .tema-luna { display: none; }

/* Botón flotante (abajo a la izquierda) */
.tema-btn--float {
  position: fixed; left: 1.2rem; bottom: 1.2rem; z-index: 61;
  width: 48px; height: 48px; margin: 0;
  background: #fff; border-color: var(--line);
  box-shadow: 0 10px 25px rgba(7, 20, 46, 0.22);
}
html[data-tema="oscuro"] .tema-btn--float { background: #121928; border-color: #26324d; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); }
/* El aviso de cookies se corre a la derecha del botón */
.cookie { left: 4.9rem; max-width: min(440px, calc(100vw - 6.1rem - 70px)); }

/* Transición suave solo mientras se cambia de modo */
html.tema-anim, html.tema-anim *, html.tema-anim *::before, html.tema-anim *::after {
  transition: background-color 0.3s, color 0.3s, border-color 0.3s, fill 0.3s, stroke 0.3s !important;
}

/* ---- Base del modo oscuro ---- */
html[data-tema="oscuro"] {
  color-scheme: dark;
  --text: #e6ecf8;
  --muted: #9fb0cc;
  --soft: #0e1424;
  --line: #26324d;
}
html[data-tema="oscuro"] body { background: #0a0f1c; color: var(--text); }
html[data-tema="oscuro"] img:not(.logo-img) { filter: brightness(0.9); }
html[data-tema="oscuro"] ::placeholder { color: #7f8fad; }
html[data-tema="oscuro"] ::selection { background: #12c2e9; color: #060f24; }

/* Rayita separadora del encabezado (junto a "Mi cuenta"): un poco más visible */
@media (min-width: 901px) {
  .nv-actions { border-left: 1.5px solid #aab8d2; }
  html[data-tema="oscuro"] .nv-actions { border-left-color: #51648a; }
}
