/* EL MODO NOCTURNO (Luisito, 02/11/2026). UNA SOLA HOJA, y solo manda con data-tema="oscuro" en <html>.

   POR QUE NO HAY UNA VARIABLE POR COLOR: las pantallas llevan unos 3.500 colores fijos escritos en sus
   propias plantillas, y esas variables solo las leeria el marco. Asi que el color se transforma en la
   pagina entera: claro <-> oscuro, respetando el tono, sin tocar ni una pantalla.

   --tema-pagina: 0,9 deja el blanco en gris muy oscuro y el negro en gris claro: ni negro puro ni blancos
                  brillantes, y rojo, amarillo y verde quedan apagados pero distinguibles.
   --tema-foto:   lo que devuelve su color a fotos, video y lo incrustado (un PDF sigue en claro).
                  Salen con un 80 % de contraste: PARA JUZGAR EL COLOR DE UNA FOTO, EL MODO CLARO.

   SOLO EN PANTALLA: `@media screen` deja fuera la impresion. */
@media screen {
  html[data-tema="oscuro"] {
    --tema-pagina: invert(.9) hue-rotate(180deg);
    --tema-foto: invert(1) hue-rotate(180deg);
    filter: var(--tema-pagina);
    background: #fff;
    min-height: 100%;
  }
  html[data-tema="oscuro"] :is(img, video, canvas, iframe, embed, object, [style*="background-image"], [style*="url("]) {
    filter: var(--tema-foto);
  }
  /* LO QUE YA ERA OSCURO SE QUEDA OSCURO: si no, el menu y el pie saldrian como franjas claras. */
  html[data-tema="oscuro"] :is(#menu, #footer, .pie-area) { filter: var(--tema-foto); }
  html[data-tema="oscuro"] :is([style*="background-image"], [style*="url("], #menu, #footer, .pie-area) :is(img, video, canvas) { filter: none; }
}
.tema-boton { border: 0; background: none; cursor: pointer; padding: 0 4px; font: inherit; font-size: 1.05em; line-height: 1; color: inherit; }
.tema-boton::before { content: "\263E"; }
html[data-tema="oscuro"] .tema-boton::before { content: "\2600"; }
@media print { .tema-boton { display: none; } }
