/* ea7kkk.com.es — modo diurno / nocturno.
   Se carga después de styles.min.css; los overrides llevan el prefijo
   [data-bs-theme="dark"] para ganar a los <style> de cada página sin !important. */

:root { color-scheme: light; }

[data-bs-theme="dark"] {
  color-scheme: dark;
  --bs-body-bg: #131b25;
  --bs-body-color: #dfe7ef;
  --bs-emphasis-color: #fff;
  --bs-secondary-color: #9aabbd;
  --bs-border-color: #2a3646;
  --bs-tertiary-bg: #1b2430;
  --bs-secondary-bg: #1b2430;
}

/* ---------------------------------------------------------------- botones */
/* Conmutador de tema: en móvil vive dentro del menú (no ocupa pantalla) y a partir
   de 768 px sale flotando abajo a la derecha. El «ir arriba» siempre flota, encima. */
.caja-tema { display: flex; align-items: center; }

.btn-tema {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0; margin-left: .55rem;
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .85);
  cursor: pointer;
}
.btn-tema:hover, .btn-tema:focus-visible {
  color: #fff; border-color: rgba(255, 255, 255, .55);
  background: rgba(255, 255, 255, .16); outline: none;
}

.btn-arriba {
  position: fixed; right: .9rem; bottom: .9rem; z-index: 1040;
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0;
  border-radius: 50%; border: 1px solid #cfd8e3; background: #fff; color: #43536a;
  box-shadow: 0 6px 18px rgba(15, 25, 40, .18); cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}
.btn-arriba.visible { opacity: 1; visibility: visible; transform: none; }
.btn-arriba:hover, .btn-arriba:focus-visible { color: #1e7fd0; border-color: #9fb6cc; outline: none; }
html[data-bs-theme="dark"] .btn-arriba {
  background: #22303f; border-color: #3a4b5f; color: #dfe7ef;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .5);
}
html[data-bs-theme="dark"] .btn-arriba:hover { background: #2a3b4d; border-color: #4a7fae; color: #fff; }

@media (min-width: 768px) {
  .caja-tema { display: contents; }        /* el <li> desaparece del menú */
  .btn-tema {
    position: fixed; right: .9rem; bottom: .9rem; z-index: 1040; margin: 0;
    width: 44px; height: 44px; border-radius: 50%;
    border: 1px solid #cfd8e3; background: #fff; color: #43536a;
    box-shadow: 0 6px 18px rgba(15, 25, 40, .18);
    transition: box-shadow .15s ease, background .15s ease, color .15s ease;
  }
  .btn-tema:hover, .btn-tema:focus-visible {
    color: #1e7fd0; border-color: #9fb6cc; background: #fff;
    box-shadow: 0 8px 22px rgba(15, 25, 40, .26);
  }
  html[data-bs-theme="dark"] .btn-tema {
    background: #22303f; border-color: #3a4b5f; color: #dfe7ef;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .5);
  }
  html[data-bs-theme="dark"] .btn-tema:hover {
    background: #2a3b4d; border-color: #4a7fae; color: #fff;
  }
  .btn-arriba { bottom: calc(.9rem + 44px + .55rem); }
}

.btn-tema svg, .btn-arriba svg { display: block; }
.btn-tema .ic-sol { display: none; }
/* ojo: el <nav> de Bootstrap Studio lleva su propio data-bs-theme="dark", así que
   hay que colgar la regla del <html> para que solo cuente el tema global */
html[data-bs-theme="dark"] .btn-tema .ic-luna { display: none; }
html[data-bs-theme="dark"] .btn-tema .ic-sol { display: block; }
@media print { .btn-tema, .btn-arriba { display: none !important; } }

/* ---------------------------------------------------------------- base */
[data-bs-theme="dark"] body { background: #131b25; color: #dfe7ef; }
[data-bs-theme="dark"] .text-body-secondary { color: #9aabbd !important; }
[data-bs-theme="dark"] footer.bg-body,
[data-bs-theme="dark"] footer[data-bs-theme="light"] { background: #131b25 !important; color: #c3d0dd; }
[data-bs-theme="dark"] h1, [data-bs-theme="dark"] h2,
[data-bs-theme="dark"] h3, [data-bs-theme="dark"] h4 { color: #eef3f8; }
[data-bs-theme="dark"] h2.sec,
[data-bs-theme="dark"] .sec-fila h2.sec { color: #eef3f8; }
[data-bs-theme="dark"] hr { border-color: #2a3646; }

/* colores literales metidos con style="" en glosario, aplicaciones y enlaces
   (Bootstrap Studio): se reescriben por el valor exacto del atributo. */
[data-bs-theme="dark"] [style*="background-color: rgb(241, 241, 241)"] { background-color: #1b2430 !important; }
[data-bs-theme="dark"] [style*="background-color: rgb(249, 249, 249)"] { background-color: #1e2836 !important; }
[data-bs-theme="dark"] [style*="color: rgb(17, 17, 17)"] { color: #e6edf5 !important; }
[data-bs-theme="dark"] [style*="color: rgb(30, 116, 173)"] { color: #6cb6ef !important; }

/* ---------------------------------------------------------------- portada e interiores */
[data-bs-theme="dark"] .section-kicker { color: #93a3b5; }
[data-bs-theme="dark"] .post-card { background: #1b2430; border-color: #2a3646; }
[data-bs-theme="dark"] .post-card:hover { box-shadow: 0 10px 26px rgba(0,0,0,.45); }
[data-bs-theme="dark"] .post-card-img { background: #22303f; }
[data-bs-theme="dark"] .post-date { color: #93a3b5; }
[data-bs-theme="dark"] .post-card-body h3 a { color: #e6edf5; }
[data-bs-theme="dark"] .post-card-body h3 a:hover { color: #6cb6ef; }
[data-bs-theme="dark"] .post-card-body p { color: #a9b7c6; }
[data-bs-theme="dark"] .tag,
[data-bs-theme="dark"] .post-tags a { background: #22303f; color: #9dc3e0 !important; }
[data-bs-theme="dark"] .tag:hover,
[data-bs-theme="dark"] .post-tags a:hover { background: #2a3b4d; color: #bfd9ee !important; }
[data-bs-theme="dark"] .post-more { color: #6cb6ef; }
[data-bs-theme="dark"] .cat-chip { background: #1b2430; border-color: #2a3646; color: #cfdae6; }
[data-bs-theme="dark"] .cat-chip:hover { background: #22303f; border-color: #6cb6ef; color: #6cb6ef; }
[data-bs-theme="dark"] .apps > .col-md-12,
[data-bs-theme="dark"] .enlaces > .col-md-12,
[data-bs-theme="dark"] .sdr-grid > .col { background: #1b2430; border-color: #2a3646; }
[data-bs-theme="dark"] .apps > .col-md-12:hover,
[data-bs-theme="dark"] .enlaces > .col-md-12:hover,
[data-bs-theme="dark"] .sdr-grid > .col:hover { border-color: #3d5570; }
[data-bs-theme="dark"] .apps h3,
[data-bs-theme="dark"] .sdr-grid h2 { color: #e6edf5; }
[data-bs-theme="dark"] .apps p > span:first-child { color: #e6edf5 !important; }
[data-bs-theme="dark"] .apps p { color: #c3d0dd; }
[data-bs-theme="dark"] .apps p a span,
[data-bs-theme="dark"] .enlaces h4 > span { color: #93a3b5 !important; }
[data-bs-theme="dark"] .apps-leyenda,
[data-bs-theme="dark"] .sdr-grid p { color: #a9b7c6; }
[data-bs-theme="dark"] .enlaces p { color: #c3d0dd; }
[data-bs-theme="dark"] .enlaces h4 a,
[data-bs-theme="dark"] .enlaces p a span { color: #6cb6ef !important; }

/* ---------------------------------------------------------------- radiosondas / histórico */
[data-bs-theme="dark"] .cifra,
[data-bs-theme="dark"] .sonda,
[data-bs-theme="dark"] .vivo,
[data-bs-theme="dark"] .tabla-wrap,
[data-bs-theme="dark"] .ficha,
[data-bs-theme="dark"] .control-puntos { background: #1b2430; border-color: #2a3646; }
[data-bs-theme="dark"] .cifra b,
[data-bs-theme="dark"] .sonda h2,
[data-bs-theme="dark"] .vivo-cab,
[data-bs-theme="dark"] .tabla-radiosondas td.serie { color: #e6edf5; }
[data-bs-theme="dark"] .cifra span,
[data-bs-theme="dark"] .sonda-meta,
[data-bs-theme="dark"] .grafica-tit,
[data-bs-theme="dark"] .atrib,
[data-bs-theme="dark"] .leyenda,
[data-bs-theme="dark"] .nota,
[data-bs-theme="dark"] .vivo-hace { color: #93a3b5; }
[data-bs-theme="dark"] a.cifra-enlace span,
[data-bs-theme="dark"] a.al-historico { color: #6cb6ef; }
[data-bs-theme="dark"] .tabla-radiosondas th { background: #22303f; color: #cfdae6; }
[data-bs-theme="dark"] .tabla-radiosondas td { border-top-color: #2a3646; color: #c3d0dd; }
[data-bs-theme="dark"] a.sondehub { color: #6cb6ef; }
[data-bs-theme="dark"] .mapa { background: #22303f; }
[data-bs-theme="dark"] .chip-vivo { background: #17362a; color: #6fd3a0; }
[data-bs-theme="dark"] .vivo-btn { background: #22303f; border-color: #2a3646; color: #6cb6ef; }
[data-bs-theme="dark"] .vivo { border-left-color: #2f86cf; border-color: #2a3646; }
/* los valores de la tarjeta «en vuelo»: sin esto quedaban #16202c sobre #1b2430 (ilegibles) */
html[data-bs-theme="dark"] .vivo-datos b { color: #e6edf5; }
html[data-bs-theme="dark"] .vivo-datos span { color: #9fb0c2; }
html[data-bs-theme="dark"] .vivo-datos .dif.sube { color: #4fd18a; }
html[data-bs-theme="dark"] .vivo-datos .dif.baja { color: #ff8272; }
html[data-bs-theme="dark"] .vivo-pie,
html[data-bs-theme="dark"] .vivo-hace { color: #9fb0c2; }
/* SVG de las gráficas: la rejilla y el relleno son claros por defecto */
[data-bs-theme="dark"] .sonda svg polygon { fill: #1d2a38; }
[data-bs-theme="dark"] .sonda svg line[stroke="#e5e8ee"] { stroke: #2a3646; }
[data-bs-theme="dark"] .sonda svg text[fill="#8b97a6"] { fill: #93a3b5; }
[data-bs-theme="dark"] .sonda svg text[fill="#5d6a7a"] { fill: #a9b7c6; }

/* histórico */
[data-bs-theme="dark"] {
  --tinta: #e6edf5;
  --gris: #a9b7c6;
  --suave: #93a3b5;
  --linea: #2a3646;
  --azul: #6cb6ef;
}
[data-bs-theme="dark"] .campo input,
[data-bs-theme="dark"] .campo select { background: #1b2430; color: #dfe7ef; border-color: #2a3646; }
[data-bs-theme="dark"] .campo input:focus,
[data-bs-theme="dark"] .campo select:focus { outline-color: #2f86cf; border-color: #2f86cf; }
[data-bs-theme="dark"] .campo-reset .chip { background: #22303f; border-color: #33506e; color: #b9d3ea; }
[data-bs-theme="dark"] .chip { background: #22303f; color: #cfdae6; border-color: #2a3646; }
[data-bs-theme="dark"] .chip.activo { background: #1c3350; border-color: #4a7fae; color: #cfe6f8; }
[data-bs-theme="dark"] .chip-reset { color: #93a3b5; }
[data-bs-theme="dark"] thead th { background: #22303f; color: #cfdae6; }
[data-bs-theme="dark"] tbody td { border-bottom-color: #22303f; color: #c3d0dd; }
[data-bs-theme="dark"] tbody tr:hover { background: #1f2c3a; }
[data-bs-theme="dark"] tbody tr.sel { background: #1c3350; }
[data-bs-theme="dark"] .bajar a,
[data-bs-theme="dark"] .bajar button { background: #22303f; border-color: #2a3646; color: #cfdae6; }
[data-bs-theme="dark"] .bajar a:hover,
[data-bs-theme="dark"] .bajar button:hover { background: #2a3b4d; border-color: #4a7fae; }
[data-bs-theme="dark"] .pagina button { background: #22303f; border-color: #2a3646; color: #cfdae6; }
[data-bs-theme="dark"] .pagina button:hover:not([disabled]) { background: #2a3b4d; border-color: #4a7fae; }
[data-bs-theme="dark"] .aviso { background: #2a2a1c; border-color: #4d4626; color: #e8d9a0; }
[data-bs-theme="dark"] .fila-puntos { border-top-color: #2a3646; }
[data-bs-theme="dark"] .ficha .aviso { background: #2a2a1c; }

/* ---------------------------------------------------------------- blog (tema HTMLy) */
[data-bs-theme="dark"] .article-wrap,
[data-bs-theme="dark"] .side-box { background: #1b2430; border-color: #2a3646; }
[data-bs-theme="dark"] .article-wrap h1.post-title,
[data-bs-theme="dark"] .post-body h2,
[data-bs-theme="dark"] .post-body h3,
[data-bs-theme="dark"] .post-body h4 { color: #e6edf5; }
[data-bs-theme="dark"] .post-body { color: #c3d0dd; }
[data-bs-theme="dark"] .post-body blockquote { background: #1f2c3a; border-left-color: #33506e; color: #cfdae6; }
[data-bs-theme="dark"] .post-body code { background: #22303f; color: #e6edf5; }
[data-bs-theme="dark"] .post-body th { background: #22303f; color: #cfdae6; }
[data-bs-theme="dark"] .post-body th,
[data-bs-theme="dark"] .post-body td { border-color: #2a3646; }
[data-bs-theme="dark"] .side-box h2 { color: #93a3b5; }
[data-bs-theme="dark"] .side-box li { border-bottom-color: #243040; }
[data-bs-theme="dark"] .side-box a { color: #cfdae6; }
[data-bs-theme="dark"] .pager a,
[data-bs-theme="dark"] .pager span { background: #1b2430; border-color: #2a3646; color: #cfdae6; }
[data-bs-theme="dark"] .pager .disabled { color: #6b7a8d; }
[data-bs-theme="dark"] .post-meta { color: #93a3b5; }
