/* ==========================================================================
   Ajustes de contraste y tema oscuro.
   Se carga despues de estilos.css y no lo modifica: la paridad del catalogo
   y de las fichas se mantiene intacta.
   ========================================================================== */

:root {
  /* El gris translucido sobre azul (0.72 de blanco) quedaba alrededor de
     3.2:1 y se leia mal. Este tono solido supera 7:1 sobre #14259c. */
  --text-inv-2: #dee3f8;

  /* Superficies del tema oscuro. Se declaran aqui para que existan en ambos. */
  --sup: #ffffff;
  --sup-2: #f5f6f9;
}

/* ------------------------------------------------------------------ oscuro */

html[data-tema="oscuro"] {
  --paper: #070b1e;
  --paper-2: #0b1130;
  --line: #1f2654;
  --text: #eef1fb;
  --text-2: #a9b1d6;
  --sup: #0f1638;
  --sup-2: #131b44;
  --ink: #0a1233;
  --ink-2: #060a1c;
}

html[data-tema="oscuro"] body {
  background: var(--paper);
  color: var(--text);
}

html[data-tema="oscuro"] .site-header {
  background: rgba(7, 11, 30, 0.9);
  border-bottom-color: var(--line);
}

/* Superficies que estaban fijas en blanco. */
html[data-tema="oscuro"] .card,
html[data-tema="oscuro"] .chip,
html[data-tema="oscuro"] .buscador,
html[data-tema="oscuro"] .calc,
html[data-tema="oscuro"] .bloque,
html[data-tema="oscuro"] .pasos li,
html[data-tema="oscuro"] .descarga-inline,
html[data-tema="oscuro"] .diseno,
html[data-tema="oscuro"] .leccion,
html[data-tema="oscuro"] .nomenclatura-pieza,
html[data-tema="oscuro"] .tool-campos,
html[data-tema="oscuro"] .ruta,
html[data-tema="oscuro"] .licencia-bloque,
html[data-tema="oscuro"] .biblio-orden,
html[data-tema="oscuro"] .paquete {
  background: var(--sup);
  border-color: var(--line);
}

html[data-tema="oscuro"] .card-media {
  background: var(--sup-2);
}

html[data-tema="oscuro"] .section.paper-2,
html[data-tema="oscuro"] .family:hover {
  background: var(--paper-2);
}

html[data-tema="oscuro"] .specs th,
html[data-tema="oscuro"] .specs td {
  border-color: var(--line);
}

html[data-tema="oscuro"] .specs th {
  color: var(--text-2);
}

html[data-tema="oscuro"] .field input,
html[data-tema="oscuro"] .field select {
  background: var(--sup);
  border-color: var(--line);
  color: var(--text);
}

html[data-tema="oscuro"] .btn-outline {
  border-color: var(--line);
  color: var(--text);
}

html[data-tema="oscuro"] .header-cta {
  background: var(--brand-yellow);
  color: var(--brand-blue);
}

/* ------------------------------------------------------- boton de tema */

.tema-boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: transparent;
  color: inherit;
  cursor: pointer;
  flex: none;
}

.tema-boton:hover {
  border-color: var(--text-2);
}

.tema-boton svg {
  width: 18px;
  height: 18px;
  display: block;
}

.tema-boton .icono-luna {
  display: none;
}

html[data-tema="oscuro"] .tema-boton .icono-sol {
  display: none;
}

html[data-tema="oscuro"] .tema-boton .icono-luna {
  display: block;
}

@media (max-width: 860px) {
  .tema-boton {
    width: 36px;
    height: 36px;
  }
}

/* ---------------------------------------------- ficha tecnica ampliada

   La tabla larga se pinta dentro de la misma .specs para heredar el estilo.
   El separador de grupo necesita anular el ancho de 42% de .specs th. */

.specs-bloque {
  margin-top: 34px;
}

.specs tr.specs-grupo th {
  width: auto;
  padding: 26px 16px 12px;
  background: transparent;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-sans, inherit);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-2);
}

.specs tr.specs-grupo:first-child th {
  padding-top: 6px;
}
