/* ============================================================
   RESET Y BASE
   ============================================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

:root {
  /* Color litúrgico base interpolado (se actualiza desde JS) */
  --liturgical-color: #006b3c;
  --liturgical-color-soft: #e6f0ff;
  --liturgical-text-color: #ffffff;
  --liturgical-gradient: linear-gradient(180deg, #006b3c, #004426);

  /* Intensidad (0–1) para transiciones avanzadas si se quiere usar en el futuro */
  --liturgical-intensity: 1;

  /* Colores base de fondo y texto */
  --page-bg: #f7f4ef;
  --page-text: #333333;
}

/* ============================================================
   BASE GLOBAL
   ============================================================ */

body {
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.6;
  background-color: var(--page-bg);
  color: var(--page-text);
  transition:
    background-color 0.6s ease,
    color 0.6s ease;
}

/* ============================================================
   ESTRUCTURA GENERAL
   ============================================================ */

.site-header {
  position: relative;
  z-index: 10;
  background: var(--liturgical-gradient);
  color: var(--liturgical-text-color);
  transition:
    background-color 0.6s ease,
    background-image 0.6s ease,
    color 0.6s ease,
    box-shadow 0.6s ease;
}

.hero-image {
  width: 100%;
  height: 10vh;
  overflow: hidden;
  transition: filter 0.6s ease;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand {
  text-align: center;
  padding: 1rem 0;
}

.site-title {
  font-size: 2rem;
  font-weight: 700;
}

.site-subtitle {
  font-size: 1rem;
  color: #e5e1da;
  transition: color 0.6s ease;
}

.darkmode-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: inherit;
  z-index: 100000;
}

main {
  padding: 0 1rem;
  transition: color 0.6s ease;
}

h2,
h3 {
  color: var(--liturgical-color);
  transition: color 0.6s ease;
}

.site-footer {
  background: var(--liturgical-gradient);
  color: var(--liturgical-text-color);
  text-align: center;
  padding: 1.5rem 1rem;
  margin-top: 3rem;
  transition:
    background-color 0.6s ease,
    background-image 0.6s ease,
    color 0.6s ease,
    box-shadow 0.6s ease;
}

.site-footer a {
  color: #cce6ff;
  text-decoration: none;
  transition: color 0.6s ease;
}

.footer-social img {
  width: 28px;
  margin: 0 0.4rem;
}

/* ============================================================
   ACCESIBILIDAD
   ============================================================ */

:focus {
  outline: 3px solid #d4af37;
  outline-offset: 3px;
}

/* ============================================================
   MODO OSCURO GLOBAL
   ============================================================ */

.dark-mode {
  --page-bg: #12151c;
  --page-text: #d8d5cf;
}

.dark-mode body {
  background-color: var(--page-bg);
}

.dark-mode .site-header {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
}

.dark-mode .site-subtitle {
  color: #d8d5cf;
}

.dark-mode .hero-image img {
  filter: brightness(0.6);
}

.dark-mode main {
  color: var(--page-text);
}

.dark-mode h2,
.dark-mode h3 {
  color: #c9a94d;
}

.dark-mode .site-footer {
  box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.6);
}

.dark-mode .site-footer a {
  color: #c9a94d;
}

/* ============================================================
   PALETAS LITÚRGICAS BASE (COLORES DE REFERENCIA)
   ============================================================ */

/* Estos colores son usados por JS para interpolar y actualizar
   --liturgical-color y --liturgical-gradient */

body.ordinario {
  --liturgical-color: #006b3c;
  --liturgical-color-soft: #e0f2e9;
  --liturgical-text-color: #ffffff;
  --liturgical-gradient: linear-gradient(180deg, #006b3c, #004426);
}

body.adviento {
  --liturgical-color: #4b0082;
  --liturgical-color-soft: #efe0ff;
  --liturgical-text-color: #ffffff;
  --liturgical-gradient: linear-gradient(180deg, #4b0082, #360061);
}

body.navidad {
  --liturgical-color: #d4af37;
  --liturgical-color-soft: #fff7d9;
  --liturgical-text-color: #1a1a1a;
  --liturgical-gradient: linear-gradient(180deg, #d4af37, #8a6d1f);
}

body.cuaresma {
  --liturgical-color: #5a005a;
  --liturgical-color-soft: #f0e0f0;
  --liturgical-text-color: #ffffff;
  --liturgical-gradient: linear-gradient(180deg, #5a005a, #3a003a);
}

body.pascua {
  --liturgical-color: #ffffff;
  --liturgical-color-soft: #f5f7ff;
  --liturgical-text-color: #002b55;
  --liturgical-gradient: linear-gradient(180deg, #ffffff, #e6e6ff);
  /* Ajuste de contraste para Pascua (modo claro) */
}

/* Ajuste de contraste para Pascua (modo claro) */
body.pascua .site-subtitle {
  color: var(--liturgical-text-color);
}

/* Contraste título h2 y h3 */
body.pascua h2,
body.pascua h3 {
  color: var(--liturgical-text-color);
}

/* Modo oscuro: se respetan los mismos colores base pero con
   gradientes más profundos */

body.dark-mode.ordinario {
  --liturgical-gradient: linear-gradient(180deg, #004426, #002b18);
}

body.dark-mode.adviento {
  --liturgical-gradient: linear-gradient(180deg, #2a004d, #1b0033);
}

body.dark-mode.navidad {
  --liturgical-gradient: linear-gradient(180deg, #8a6d1f, #5c4712);
  --liturgical-text-color: #f7f4ef;
}

body.dark-mode.cuaresma {
  --liturgical-gradient: linear-gradient(180deg, #3a003a, #220022);
}

body.dark-mode.pascua {
  --liturgical-gradient: linear-gradient(180deg, #0a1a2b, #050c14);
  --liturgical-text-color: #d8d5cf;
}

/* ============================================================
   OVERLAYS DE FESTIVIDADES (NO ROMPEN LA TRANSICIÓN)
   ============================================================ */

body.overlay-inmaculada {
  --page-bg: #e8f0ff;
  --liturgical-color: #003c8f;
  --liturgical-color-soft: #e0ebff;
  --liturgical-text-color: #ffffff;
  --liturgical-gradient: linear-gradient(180deg, #003c8f, #002f6b);
}

body.overlay-guadalupe {
  --page-bg: #f7f4ef;
  --liturgical-color: #0b3d2e;
  --liturgical-color-soft: #e0f2eb;
  --liturgical-text-color: #ffffff;
  --liturgical-gradient: linear-gradient(180deg, #0b3d2e, #06251b);
}

body.overlay-carmen {
  --page-bg: #f7f2e8;
  --liturgical-color: #4b2e14;
  --liturgical-color-soft: #f0e2d0;
  --liturgical-text-color: #ffffff;
  --liturgical-gradient: linear-gradient(180deg, #4b2e14, #3a2410);
}

body.overlay-sonsoles {
  --page-bg: #eef4ff;
  --liturgical-color: #003c8f;
  --liturgical-color-soft: #e0ebff;
  --liturgical-text-color: #ffffff;
  --liturgical-gradient: linear-gradient(180deg, #003c8f, #002f6b);
}

body.overlay-todos-santos {
  --page-bg: #fdf8ef;
  --liturgical-color: #c9a94d;
  --liturgical-color-soft: #f7ebc8;
  --liturgical-text-color: #3a2a00;
  --liturgical-gradient: linear-gradient(180deg, #c9a94d, #8a6d1f);
}

body.overlay-corpus {
  --page-bg: #fffdf5;
  --liturgical-color: #d4af37;
  --liturgical-color-soft: #fff7d9;
  --liturgical-text-color: #3a2a00;
  --liturgical-gradient: linear-gradient(180deg, #d4af37, #8a6d1f);
}

body.overlay-sagrado-corazon {
  --page-bg: #fff5f5;
  --liturgical-color: #8b0000;
  --liturgical-color-soft: #ffd6d6;
  --liturgical-text-color: #ffffff;
  --liturgical-gradient: linear-gradient(180deg, #8b0000, #5a0000);
}

body.overlay-cristo-rey {
  --page-bg: #fffdf5;
  --liturgical-color: #b8860b;
  --liturgical-color-soft: #f7e3b5;
  --liturgical-text-color: #ffffff;
  --liturgical-gradient: linear-gradient(180deg, #b8860b, #8b6508);
}

body.overlay-inmaculado-corazon {
  --page-bg: #fff0f5;
  --liturgical-color: #d36c9e;
  --liturgical-color-soft: #ffd6ea;
  --liturgical-text-color: #ffffff;
  --liturgical-gradient: linear-gradient(180deg, #d36c9e, #a34c78);
}

/* Modo oscuro overlays (ajuste de gradientes) */

body.dark-mode.overlay-inmaculada {
  --liturgical-gradient: linear-gradient(180deg, #002f6b, #001f47);
}

body.dark-mode.overlay-guadalupe {
  --liturgical-gradient: linear-gradient(180deg, #06251b, #041a13);
}

body.dark-mode.overlay-carmen {
  --liturgical-gradient: linear-gradient(180deg, #3a2410, #2a1a0c);
}

body.dark-mode.overlay-sonsoles {
  --liturgical-gradient: linear-gradient(180deg, #002f6b, #001f47);
}

body.dark-mode.overlay-todos-santos {
  --liturgical-gradient: linear-gradient(180deg, #8a6d1f, #6d5412);
}

body.dark-mode.overlay-corpus {
  --liturgical-gradient: linear-gradient(180deg, #8a6d1f, #6d5412);
}

body.dark-mode.overlay-sagrado-corazon {
  --liturgical-gradient: linear-gradient(180deg, #5a0000, #3d0000);
}

body.dark-mode.overlay-cristo-rey {
  --liturgical-gradient: linear-gradient(180deg, #8b6508, #6d4d06);
}

body.dark-mode.overlay-inmaculado-corazon {
  --liturgical-gradient: linear-gradient(180deg, #a34c78, #7a3a5a);
}

/* ============================================================
   ANIMACIONES ESPECIALES (TIEMPOS Y OVERLAYS)
   ============================================================ */

/* PASCUA — luz ascendente */
@keyframes pascua-luz {
  from {
    box-shadow: 0 -40px 80px rgba(255, 255, 255, 0.0);
  }
  to {
    box-shadow: 0 -40px 80px rgba(255, 255, 255, 0.4);
  }
}

body.pascua:not(.modo-silencio) .site-header,
body.pascua:not(.modo-silencio) .site-footer {
  animation: pascua-luz 12s ease-in-out infinite alternate;
}

/* NAVIDAD — brillo dorado */
@keyframes navidad-brillo {
  0% {
    box-shadow: 0 0 0 rgba(212, 175, 55, 0.0);
  }
  50% {
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.5);
  }
  100% {
    box-shadow: 0 0 0 rgba(212, 175, 55, 0.0);
  }
}

body.navidad.modo-fiesta:not(.modo-silencio) .site-header,
body.navidad.modo-fiesta:not(.modo-silencio) .site-footer {
  animation: navidad-brillo 16s ease-in-out infinite;
}

/* PENTECOSTÉS / FIESTA MAYOR — pulso suave */
@keyframes fiesta-pulso {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-1px);
  }
  100% {
    transform: translateY(0);
  }
}

body.modo-fiesta:not(.modo-silencio) .site-header,
body.modo-fiesta:not(.modo-silencio) .site-footer {
  animation: fiesta-pulso 18s ease-in-out infinite;
}

/* SONSOLES — doble sol rotatorio */

@keyframes giro-horario {
  from {
    transform: translateY(-50%) rotate(0deg);
  }
  to {
    transform: translateY(-50%) rotate(360deg);
  }
}

@keyframes giro-antihorario {
  from {
    transform: translateY(-50%) rotate(0deg);
  }
  to {
    transform: translateY(-50%) rotate(-360deg);
  }
}

body.sonsoles:not(.modo-silencio) .site-header::before,
body.sonsoles:not(.modo-silencio) .site-header::after,
body.sonsoles:not(.modo-silencio) .site-footer::before,
body.sonsoles:not(.modo-silencio) .site-footer::after,
body.overlay-sonsoles:not(.modo-silencio) .site-header::before,
body.overlay-sonsoles:not(.modo-silencio) .site-header::after,
body.overlay-sonsoles:not(.modo-silencio) .site-footer::before,
body.overlay-sonsoles:not(.modo-silencio) .site-footer::after {
  content: "☼";
  position: absolute;
  left: 1rem;
  top: 50%;
  font-size: 1.4rem;
  color: #d4af37;
  opacity: 0.9;
}

body.sonsoles:not(.modo-silencio) .site-header::before,
body.sonsoles:not(.modo-silencio) .site-footer::before,
body.overlay-sonsoles:not(.modo-silencio) .site-header::before,
body.overlay-sonsoles:not(.modo-silencio) .site-footer::before {
  animation: giro-horario 28s linear infinite;
}

body.sonsoles:not(.modo-silencio) .site-header::after,
body.sonsoles:not(.modo-silencio) .site-footer::after,
body.overlay-sonsoles:not(.modo-silencio) .site-header::after,
body.overlay-sonsoles:not(.modo-silencio) .site-footer::after {
  animation: giro-antihorario 32s linear infinite;
  opacity: 0.7;
}

body.dark-mode.sonsoles .site-header::before,
body.dark-mode.sonsoles .site-header::after,
body.dark-mode.sonsoles .site-footer::before,
body.dark-mode.sonsoles .site-footer::after,
body.dark-mode.overlay-sonsoles .site-header::before,
body.dark-mode.overlay-sonsoles .site-header::after,
body.dark-mode.overlay-sonsoles .site-footer::before,
body.dark-mode.overlay-sonsoles .site-footer::after {
  color: #c9a94d;
}

/* INMACULADA — halo azul */
@keyframes inmaculada-halo {
  0% {
    box-shadow: 0 0 0 rgba(0, 60, 143, 0.0);
  }
  50% {
    box-shadow: 0 0 20px rgba(0, 60, 143, 0.5);
  }
  100% {
    box-shadow: 0 0 0 rgba(0, 60, 143, 0.0);
  }
}

body.overlay-inmaculada:not(.modo-silencio) .site-header,
body.overlay-inmaculada:not(.modo-silencio) .site-footer {
  animation: inmaculada-halo 18s ease-in-out infinite;
}

/* GUADALUPE — pulso verde */
@keyframes guadalupe-pulso {
  0% {
    box-shadow: 0 0 0 rgba(11, 61, 46, 0.0);
  }
  50% {
    box-shadow: 0 0 18px rgba(11, 61, 46, 0.5);
  }
  100% {
    box-shadow: 0 0 0 rgba(11, 61, 46, 0.0);
  }
}

body.overlay-guadalupe:not(.modo-silencio) .site-header,
body.overlay-guadalupe:not(.modo-silencio) .site-footer {
  animation: guadalupe-pulso 20s ease-in-out infinite;
}

/* CARMEN — brillo cálido */
@keyframes carmen-brillo {
  0% {
    box-shadow: 0 0 0 rgba(75, 46, 20, 0.0);
  }
  50% {
    box-shadow: 0 0 18px rgba(75, 46, 20, 0.5);
  }
  100% {
    box-shadow: 0 0 0 rgba(75, 46, 20, 0.0);
  }
}

body.overlay-carmen:not(.modo-silencio) .site-header,
body.overlay-carmen:not(.modo-silencio) .site-footer {
  animation: carmen-brillo 22s ease-in-out infinite;
}

/* CORPUS — pulso dorado */
@keyframes corpus-pulso {
  0% {
    box-shadow: 0 0 0 rgba(212, 175, 55, 0.0);
  }
  50% {
    box-shadow: 0 0 22px rgba(212, 175, 55, 0.6);
  }
  100% {
    box-shadow: 0 0 0 rgba(212, 175, 55, 0.0);
  }
}

body.overlay-corpus:not(.modo-silencio) .site-header,
body.overlay-corpus:not(.modo-silencio) .site-footer {
  animation: corpus-pulso 20s ease-in-out infinite;
}

/* SAGRADO CORAZÓN — latido */
@keyframes sagrado-latido {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.01);
  }
  100% {
    transform: scale(1);
  }
}

body.overlay-sagrado-corazon:not(.modo-silencio) .site-header,
body.overlay-sagrado-corazon:not(.modo-silencio) .site-footer {
  animation: sagrado-latido 16s ease-in-out infinite;
}

/* CRISTO REY — destello */
@keyframes cristo-destello {
  0% {
    box-shadow: 0 0 0 rgba(184, 134, 11, 0.0);
  }
  50% {
    box-shadow: 0 0 24px rgba(184, 134, 11, 0.6);
  }
  100% {
    box-shadow: 0 0 0 rgba(184, 134, 11, 0.0);
  }
}

body.overlay-cristo-rey:not(.modo-silencio) .site-header,
body.overlay-cristo-rey:not(.modo-silencio) .site-footer {
  animation: cristo-destello 24s ease-in-out infinite;
}

/* INMACULADO CORAZÓN — pulso rosado */
@keyframes inmaculado-pulso {
  0% {
    box-shadow: 0 0 0 rgba(211, 108, 158, 0.0);
  }
  50% {
    box-shadow: 0 0 20px rgba(211, 108, 158, 0.6);
  }
  100% {
    box-shadow: 0 0 0 rgba(211, 108, 158, 0.0);
  }
}

body.overlay-inmaculado-corazon:not(.modo-silencio) .site-header,
body.overlay-inmaculado-corazon:not(.modo-silencio) .site-footer {
  animation: inmaculado-pulso 20s ease-in-out infinite;
}

/* ============================================================
   MODO SILENCIO LITÚRGICO (TRIDUO PASCUAL)
   ============================================================ */

/* Cuando el body tiene .modo-silencio:
   - se desactivan animaciones
   - se simplifican colores
   - se eliminan brillos y sombras
*/

body.modo-silencio .site-header,
body.modo-silencio .site-footer {
  animation: none !important;
  box-shadow: none !important;
  background-image: none !important;
  background-color: #2b2b2b !important;
  color: #f0f0f0 !important;
}

body.modo-silencio {
  --page-bg: #111111;
  --page-text: #e0e0e0;
}

/* Quiet Hours: simulamos modo nocturno suave */
body.quiet-hours {
  background-color: #0b1724;
  color: #f5f5f5;
}

body.quiet-hours .main-nav {
  background: #0b1724;
  color: #f5f5f5;
}

body.quiet-hours .submenu {
  background: #111d2b;
  border-color: #2a3a4f;
}

body.quiet-hours .submenu a,
body.quiet-hours .submenu button {
  color: #f5f5f5;
}

/* ============================================================
   PANEL DE DEPURACIÓN LITÚRGICA
   ============================================================ */

.liturgical-debug {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  background: rgba(0, 0, 0, 0.75);
  color: #f7f4ef;
  padding: 0.8rem 1rem;
  border-radius: 6px;
  font-size: 0.8rem;
  z-index: 999999;
  max-width: 260px;
  backdrop-filter: blur(4px);
}

.liturgical-debug h4 {
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  font-weight: 700;
}

.liturgical-debug p {
  margin-bottom: 0.2rem;
}

.liturgical-debug label {
  display: block;
  margin-top: 0.4rem;
}

.liturgical-debug select,
.liturgical-debug input[type="checkbox"] {
  margin-top: 0.2rem;
}

/* Ocultar por defecto; se activará desde JS si se desea */
.liturgical-debug {
  display: none;
}

body.modo-debug .liturgical-debug {
  display: block;
}

/* ============================================================
   MÓVIL
   ============================================================ */

@media (max-width: 768px) {
  .hero-image {
    height: 8vh;
  }

  .site-title {
    font-size: 1.6rem;
  }

  .site-subtitle {
    font-size: 0.9rem;
  }

  .liturgical-debug {
    max-width: 90%;
    right: 0.5rem;
    left: 0.5rem;
  }
}

/* ============================================================
   MODO ALTA VISIBILIDAD — ACCESIBILIDAD AA/AAA
   ============================================================ */

body.alta-visibilidad {
  font-size: 1.15rem !important;
  line-height: 1.6 !important;
  color: #000 !important;
  background: #fff !important;
}

body.alta-visibilidad * {
  text-shadow: none !important;
  box-shadow: none !important;
}

/* Enlaces y botones */
body.alta-visibilidad a,
body.alta-visibilidad button {
  color: #000 !important;
  border-bottom: 2px solid #000 !important;
}

body.alta-visibilidad a:hover,
body.alta-visibilidad button:hover {
  background: #ffd500 !important;
  color: #000 !important;
}

/* Menú principal */
body.alta-visibilidad .main-nav {
  background: #fff !important;
  border-bottom: 3px solid #000 !important;
}

body.alta-visibilidad .menu-item > a,
body.alta-visibilidad .menu-item > button {
  color: #000 !important;
  background: transparent !important;
}

body.alta-visibilidad .menu-item > a:hover,
body.alta-visibilidad .menu-item > button:hover {
  background: #ffd500 !important;
  color: #000 !important;
}

/* Submenús */
body.alta-visibilidad .submenu {
  background: #fff !important;
  border: 2px solid #000 !important;
}

body.alta-visibilidad .submenu a,
body.alta-visibilidad .submenu button {
  color: #000 !important;
}

body.alta-visibilidad .submenu a:hover,
body.alta-visibilidad .submenu button:hover {
  background: #ffd500 !important;
  color: #000 !important;
}

.high-visibility-btn {
  margin-top: 1rem;
  padding: 0.6rem 1rem;
  font-size: 1rem;
  border: 2px solid #000;
  background: #fff;
  cursor: pointer;
}

.high-visibility-btn:hover {
  background: #ffd500;
}

/* Aviso visual cuando el modo alta visibilidad está activo */
body.alta-visibilidad .high-visibility-btn {
  background: #ffd500 !important;
  border-color: #000 !important;
  color: #000 !important;
  font-weight: bold;
}

body.alta-visibilidad .high-visibility-btn::after {
  content: " (activo)";
  font-size: 0.9rem;
  margin-left: 0.3rem;
}

/* ============================================================
   TRANSICIONES LITÚRGICAS MÁS VIVAS Y ELEGANTES
   ============================================================ */

/* Transiciones globales */
body {
  transition:
    background-color 1.2s ease,
    color 1.2s ease,
    --liturgical-color 1.2s ease,
    --liturgical-gradient 1.2s ease,
    --page-bg 1.2s ease,
    --page-text 1.2s ease;
}

.site-header,
.site-footer {
  transition:
    background-color 1.2s ease,
    background-image 1.2s ease,
    color 1.2s ease,
    box-shadow 1.2s ease;
}

/* Deslizamiento del gradiente */
.site-header,
.site-footer {
  background-size: 100% 200%;
  background-position: 0 0;
}

body.ordinario .site-header,
body.ordinario .site-footer,
body.adviento .site-header,
body.adviento .site-footer,
body.navidad .site-header,
body.navidad .site-footer,
body.cuaresma .site-header,
body.cuaresma .site-footer,
body.pascua .site-header,
body.pascua .site-footer {
  animation: liturgical-slide 1.8s ease forwards;
}

@keyframes liturgical-slide {
  from { background-position: 0 100%; }
  to   { background-position: 0 0; }
}

/* ============================================================
   EFECTOS ESPECIALES POR TIEMPO LITÚRGICO
   ============================================================ */

/* Pascua — resplandor blanco suave */
body.pascua:not(.modo-silencio) .site-header,
body.pascua:not(.modo-silencio) .site-footer {
  animation: pascua-glow 6s ease-in-out infinite alternate;
}

@keyframes pascua-glow {
  from { box-shadow: 0 0 0 rgba(255,255,255,0.0); }
  to   { box-shadow: 0 0 25px rgba(255,255,255,0.25); }
}

/* Navidad — brillo dorado elegante */
body.navidad:not(.modo-silencio) .site-header,
body.navidad:not(.modo-silencio) .site-footer {
  animation: navidad-gold 8s ease-in-out infinite alternate;
}

@keyframes navidad-gold {
  from { box-shadow: 0 0 0 rgba(212,175,55,0.0); }
  to   { box-shadow: 0 0 20px rgba(212,175,55,0.35); }
}

/* Adviento — halo violeta suave */
body.adviento:not(.modo-silencio) .site-header,
body.adviento:not(.modo-silencio) .site-footer {
  animation: adviento-halo 10s ease-in-out infinite alternate;
}

@keyframes adviento-halo {
  from { box-shadow: 0 0 0 rgba(75,0,130,0.0); }
  to   { box-shadow: 0 0 20px rgba(75,0,130,0.35); }
}

/* Cuaresma — oscurecimiento respirante */
body.cuaresma:not(.modo-silencio) .site-header,
body.cuaresma:not(.modo-silencio) .site-footer {
  animation: cuaresma-dim 12s ease-in-out infinite alternate;
}

@keyframes cuaresma-dim {
  from { filter: brightness(1); }
  to   { filter: brightness(0.85); }
}

/* Ordinario — pulso verde suave */
body.ordinario:not(.modo-silencio) .site-header,
body.ordinario:not(.modo-silencio) .site-footer {
  animation: ordinario-pulse 14s ease-in-out infinite alternate;
}

@keyframes ordinario-pulse {
  from { box-shadow: 0 0 0 rgba(0,107,60,0.0); }
  to   { box-shadow: 0 0 18px rgba(0,107,60,0.25); }
}

/* ============================================================
   COMPATIBILIDAD CON MODO SILENCIO Y ALTA VISIBILIDAD
   ============================================================ */

body.modo-silencio .site-header,
body.modo-silencio .site-footer,
body.alta-visibilidad .site-header,
body.alta-visibilidad .site-footer {
  animation: none !important;
  box-shadow: none !important;
  filter: none !important;
}

/* ============================================================
   CALENDARIO DISCRETO Y STICKY
   ============================================================ */

.liturgical-calendar {
  position: sticky;
  top: 6rem; /* debajo del menú */
  align-self: start; /* evita estiramientos raros */
  width: 180px;
  padding: 0.5rem;
  background: rgba(255,255,255,0.85);
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.1);
}

.liturgical-calendar h2 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

#liturgical-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.15rem;
}

/* Día del calendario */
.liturgical-day {
  text-align: center;
  padding: 0.15rem 0;
  font-size: 0.7rem;
  border-radius: 3px;
  font-weight: bold;
}

/* Colores por tiempo litúrgico */
.liturgical-day.ordinario { background: #e0f2e9; }
.liturgical-day.adviento { background: #efe0ff; }
.liturgical-day.navidad { background: #fff7d9; }
.liturgical-day.cuaresma { background: #f0e0f0; }
.liturgical-day.pascua { background: #f5f7ff; }

/* Overlays */
.liturgical-day.overlay {
  border: 2px solid #d4af37;
}

/* Hoy */
.liturgical-day.today {
  outline: 2px solid #003c8f;
  outline-offset: 1px;
}

/* Información del día */
.liturgical-today-info {
  margin-top: 1rem;
  font-size: 0.8rem;
}

.liturgical-today-info h3 {
  margin-bottom: 0.3rem;
  font-size: 0.9rem;
}

/* Contenedor general para alinear calendario + contenido */
.layout-with-calendar {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2rem;
  max-width: 1100px;   /* controla el ancho total */
  margin: 2rem auto;   /* centra todo */
  padding: 0 1rem;
}

/* ============================================================
   CABECERA DEL CALENDARIO (NAVEGACIÓN)
   ============================================================ */

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.calendar-header button {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
}

.calendar-header button:hover {
  background: rgba(0,0,0,0.1);
  border-radius: 4px;
}

/* Tooltip */
.liturgical-day {
  position: relative;
}

.liturgical-day:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%);
  background: #222;
  color: #fff;
  padding: 0.3rem 0.5rem;
  font-size: 0.7rem;
  border-radius: 4px;
  white-space: nowrap;
  z-index: 99999;
}

/* ============================
   IMÁGENES DE LA HISTORIA
   ============================ */

.historia-fig {
  margin: 1.5rem 0;
  text-align: center;
}

.historia-img {
  width: 100%;
  max-width: 650px;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
}

.historia-fig figcaption {
  margin-top: .5rem;
  font-size: .95rem;
  color: #555;
  font-style: italic;
}

/* ============================
   BOTONES DESCARGA PDF
   ============================ */

.pdf-buttons {
  text-align: center;
  margin: 2rem 0;
}

.pdf-btn {
  display: inline-block;
  margin: 0.5rem;
  padding: 0.8rem 1.4rem;
  background: #004080;
  color: white;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  font-size: 1.1rem;
  transition: background 0.3s ease;
}

.pdf-btn:hover,
.pdf-btn:focus {
  background: #002f5e;
  outline: 3px solid #d4af37;
  outline-offset: 3px;
}

/* ============================
   ACORDEONES
   ============================ */


.acordeon-header {
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  padding: .6rem 0;
  font-size: 1.3rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: inherit;
}

.acordeon-header:focus {
  outline: 3px solid #d4af37;
  outline-offset: 3px;
}

/* ============================
   ACORDEONES
   ============================ */

main p {
  text-align: justify;
}

main li {
  text-align: justify;
}

main figure {
  text-align: center;
}

/* ============================
   ACORDEONES – COMPORTAMIENTO
   ============================ */

/* Por defecto, el contenido va oculto */
.acordeon-content {
  display: none;
  padding: 0.5rem 0 1rem;
}

/* Cuando la sección está abierta, se muestra */
.acordeon-section.acordeon-open .acordeon-content {
  display: block;
}

/* Flecha indicadora */
.acordeon-header span {
  transition: transform 0.3s ease;
}

/* Girar flecha cuando está abierto */
.acordeon-section.acordeon-open .acordeon-header span {
  transform: rotate(90deg);
}

/* ============================
   SIN FOCUS PARA HISTORIA
   ============================ */

main:focus {
  outline: none !important;
}

/* ============================================================
   QUIET HOURS — PALETAS LITÚRGICAS OSCURAS DERIVADAS
   ============================================================ */

/* ORDINARIO — verde profundo */
body.quiet-hours.ordinario {
  --liturgical-gradient: linear-gradient(180deg, #002b18, #00170d);
  --liturgical-text-color: #e8f5ee;
}

/* ADVIENTO — violeta profundo */
body.quiet-hours.adviento {
  --liturgical-gradient: linear-gradient(180deg, #1e0033, #120020);
  --liturgical-text-color: #f0e6ff;
}

/* NAVIDAD — dorado oscuro */
body.quiet-hours.navidad {
  --liturgical-gradient: linear-gradient(180deg, #5c4712, #3a2f0c);
  --liturgical-text-color: #fff7d9;
}

/* CUARESMA — morado penitencial profundo */
body.quiet-hours.cuaresma {
  --liturgical-gradient: linear-gradient(180deg, #220022, #140014);
  --liturgical-text-color: #f5e6f5;
}

/* PASCUA — blanco nocturno (azul profundo) */
body.quiet-hours.pascua {
  --liturgical-gradient: linear-gradient(180deg, #0a1a2b, #050c14);
  --liturgical-text-color: #e6ecff;
}

/* Aplicación general del modo nocturno */
body.quiet-hours .main-nav,
body.quiet-hours .site-header,
body.quiet-hours .site-footer {
  background: var(--liturgical-gradient) !important;
  color: var(--liturgical-text-color) !important;
}

body.quiet-hours .menu-item > a,
body.quiet-hours .menu-item > button {
  color: var(--liturgical-text-color) !important;
}

body.quiet-hours .submenu {
  background: rgba(0,0,0,0.6) !important;
  border-color: rgba(255,255,255,0.2) !important;
}

body.quiet-hours .submenu a,
body.quiet-hours .submenu button {
  color: var(--liturgical-text-color) !important;
}

body.quiet-hours .submenu a:hover,
body.quiet-hours .submenu button:hover {
  background: rgba(255,255,255,0.1) !important;
  color: var(--liturgical-text-color) !important;
}

/* ============================================================
   QUIET HOURS — CALENDARIO ACCESIBLE
   ============================================================ */

body.quiet-hours .liturgical-calendar {
  background: rgba(0,0,0,0.55) !important;
  border-color: rgba(255,255,255,0.2) !important;
  color: var(--liturgical-text-color) !important;
}

body.quiet-hours .liturgical-day {
  background: rgba(255,255,255,0.08) !important;
  color: var(--liturgical-text-color) !important;
  font-weight: 600;
}

body.quiet-hours .liturgical-day.today {
  outline: 2px solid var(--liturgical-text-color) !important;
}

body.quiet-hours .liturgical-day.overlay {
  border: 2px solid #d4af37 !important;
}

body.quiet-hours .liturgical-day:hover::after {
  background: rgba(0,0,0,0.85) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255,255,255,0.3);
}