/* ============================================================
   En Domingo — v0.4
   Bloque 1: glosario Ciclo/Color (regla general + contexto del día)
   Bloque 2: tema Auto/Claro/Oscuro (data-theme) + hero sin marca
   ============================================================ */

:root {
  --paper:       #F5F1E8;
  --ink:         #1A1814;
  --ink-soft:    #6B6358;
  --ink-faint:   #9B9286;
  --rule:        rgba(26, 24, 20, 0.12);
  --rule-strong: rgba(26, 24, 20, 0.24);

  /* Color litúrgico actual (lo cambia el JS) */
  --lit-bg:      #5E2A84;
  /* Color del texto sobre el fondo litúrgico */
  --lit-fg:      #FFFFFF;
  --lit-fg-soft: rgba(255, 255, 255, 0.75);
  --lit-fg-faint:rgba(255, 255, 255, 0.5);
  --lit-rule:    rgba(255, 255, 255, 0.2);

  /* Color de UI (links, botones en el body) */
  --accent:      #5E2A84;
}

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

html, body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Crimson Pro', 'Times New Roman', serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

body {
  background-image:
    radial-gradient(circle at 20% 30%, rgba(0,0,0,0.015) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(0,0,0,0.015) 0%, transparent 50%);
}

/* ============================================================
   HERO HEADER — color litúrgico
   ============================================================ */
.hero {
  background: var(--lit-bg);
  color: var(--lit-fg);
  transition: background 600ms ease, color 600ms ease;
  min-height: 360px;
  display: flex;
  box-shadow: 0 1px 0 var(--rule);
}

.hero-inner {
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
  padding: 40px 28px 48px;
  display: flex;
  flex-direction: column;
}

/* La marca salió del hero (vive en el footer). El botón compartir queda a la derecha. */
.hero-top {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  margin-bottom: 20px;
}

/* Área táctil 44×44px sin mover el ícono (margen negativo compensa el padding). */
.hero-share {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--lit-fg);
  padding: 12px;
  margin: -12px;
  line-height: 0;
  opacity: 0.85;
  transition: opacity 200ms ease;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.hero-share:hover { opacity: 1; }
.hero-share svg { display: block; }

/* Centro del hero: fecha + nombre, centrado verticalmente. */
.hero-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.hero-date {
  font-family: 'Crimson Pro', serif;
  font-weight: 400;
  font-size: 16px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lit-fg-soft);
  margin-bottom: 20px;
}

.hero-name {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: clamp(42px, 9vw, 60px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: var(--lit-fg);
  max-width: 14ch;
  margin: 0 auto;
}

/* Sublínea del hero: "Misa del domingo X" cuando hoy no es domingo. */
.hero-sub {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 500;
  font-size: 17px;
  color: var(--lit-fg-soft);
  margin-top: 16px;
}

/* ============================================================
   BLOQUE 2 — BARRA DE TEMA (Auto / Claro / Oscuro)
   Fila delgada en papel, encima de la navegación.
   ============================================================ */
.tema-bar {
  background: var(--paper);
  display: flex;
  justify-content: center;
  padding: 14px 28px 2px;
}

.tema-control {
  display: inline-flex;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}

.tema-control button {
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Crimson Pro', serif;
  font-size: 14px;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  padding: 7px 16px;
  min-height: 36px;
  border-radius: 999px;
  transition: background 200ms ease, color 200ms ease;
}
.tema-control button:hover { color: var(--ink); }
.tema-control button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}

/* ============================================================
   SUB-NAV — navegación de fechas
   ============================================================ */
.subnav {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.subnav-inner {
  max-width: 560px;
  margin: 0 auto;
  padding: 14px 28px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 32px;
}

/* Área táctil mínima 44×44px */
.subnav button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-soft);
  transition: color 200ms ease;
  padding: 12px 16px;
  min-height: 44px;
  min-width: 44px;
  font-family: 'Cormorant Garamond', serif;
}
.subnav button:hover { color: var(--ink); }
.subnav .arrow {
  font-size: 24px;
  font-weight: 300;
}

.subnav .today {
  font-size: 18px;
  font-style: italic;
  font-weight: 500;
  letter-spacing: 0.05em;
}

/* ============================================================
   CONTENIDO
   ============================================================ */
.content {
  max-width: 560px;
  margin: 0 auto;
  padding: 40px 28px 60px;
}

/* ============================================================
   BLOQUE 1 — GLOSARIO Ciclo / Color
   Siempre visible, entre la navegación y la liga a lecturas.
   Cada entrada: etiqueta (del motor) + texto (regla + contexto del día).
   ============================================================ */
.glosario {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 40px;
  text-align: center;
}

.glosario-label {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: 19px;
  line-height: 1.25;
  color: var(--ink);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.glosario-text {
  font-family: 'Crimson Pro', serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 42ch;
  margin: 0 auto;
}

.color-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--lit-bg);
  border: 1px solid rgba(0,0,0,0.15);
  transition: background 400ms ease;
  flex-shrink: 0;
}

/* CTA LECTURAS */
.cta-lecturas {
  text-align: center;
  margin-bottom: 48px;
}
.cta-lecturas a {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-style: italic;
  font-size: 21px;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: 3px;
  transition: opacity 200ms ease;
}
.cta-lecturas a:hover { opacity: 0.7; }
.cta-lecturas a::after {
  content: ' →';
  font-style: normal;
}

.cta-nota {
  font-family: 'Crimson Pro', serif;
  font-size: 15px;
  font-style: italic;
  color: var(--ink-faint);
  margin-top: 12px;
  line-height: 1.5;
}

/* PREGUNTAS */
.preguntas-label {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 500;
  font-size: 20px;
  color: var(--ink-soft);
  text-align: center;
  margin-bottom: 24px;
  letter-spacing: 0.01em;
}

.pregunta {
  border-top: 1px solid var(--rule);
  padding: 22px 0;
}
.pregunta:last-child {
  border-bottom: 1px solid var(--rule);
}

.pregunta-q {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: 23px;
  line-height: 1.3;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  list-style: none;
}
.pregunta-q::-webkit-details-marker { display: none; }
.pregunta-q::before {
  content: '+';
  font-family: 'Crimson Pro', serif;
  font-weight: 300;
  font-size: 24px;
  line-height: 1;
  color: var(--accent);
  flex-shrink: 0;
  width: 18px;
  transform: translateY(2px);
}
.pregunta[open] .pregunta-q::before { content: '−'; }

.pregunta-a {
  font-family: 'Crimson Pro', serif;
  font-size: 19px;
  line-height: 1.7;
  color: var(--ink);
  padding: 14px 0 4px 30px;
  animation: fadeIn 300ms ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   HERO FOOTER — espejo del header
   ============================================================ */
.footer {
  background: var(--lit-bg);
  color: var(--lit-fg);
  transition: background 600ms ease, color 600ms ease;
  padding: 56px 28px 48px;
  box-shadow: 0 -1px 0 var(--rule);
}

.footer-inner {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}

.footer-share {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--lit-fg);
  padding: 12px 32px;
  transition: opacity 200ms ease;
}
.footer-share:hover { opacity: 0.75; }
.footer-share svg { display: block; }
.footer-share-label {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 19px;
  letter-spacing: 0.02em;
}

.footer-rule {
  max-width: 200px;
  height: 1px;
  background: var(--lit-rule);
  margin: 36px auto;
}

/* Bloque de apoyo: Ko-fi + Stripe apilados, mismo ancho, arriba del compartir. */
.footer-support {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.footer-support .footer-kofi {
  min-width: 230px;
  justify-content: center;
}

.footer-kofi {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: 1px solid var(--lit-rule);
  border-radius: 999px;
  cursor: pointer;
  color: var(--lit-fg);
  padding: 11px 22px;
  font-family: 'Crimson Pro', serif;
  font-size: 16px;
  transition: background 200ms ease, border-color 200ms ease;
  text-decoration: none;
}
.footer-kofi:hover {
  background: rgba(255,255,255,0.08);
  border-color: var(--lit-fg-soft);
}
.footer-kofi .kofi-icon {
  font-size: 16px;
}

.footer-stripe {
  display: block;
  margin-top: 20px;
  font-family: 'Crimson Pro', serif;
  font-size: 16px;
  font-style: italic;
  color: var(--lit-fg-soft);
  text-decoration: none;
  transition: color 200ms ease;
}
.footer-stripe:hover { color: var(--lit-fg); }

/* Firma del proyecto — bajó del hero a aquí. */
.footer-signature {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--lit-rule);
  font-family: 'Crimson Pro', serif;
  font-size: 14px;
  letter-spacing: 0.12em;
  color: var(--lit-fg-faint);
  text-transform: uppercase;
}

/* ============================================================
   RESPONSIVE — desktop
   ============================================================ */
@media (min-width: 768px) {
  .hero-inner,
  .subnav-inner,
  .content,
  .footer-inner {
    max-width: 640px;
  }
  .hero-name {
    font-size: clamp(48px, 7vw, 68px);
  }
  .content {
    padding: 48px 40px 72px;
  }
  .hero-inner {
    padding: 48px 40px 56px;
  }
}

@media (min-width: 1024px) {
  .hero-inner,
  .subnav-inner,
  .content,
  .footer-inner {
    max-width: 720px;
  }
}

/* ============================================================
   TEMA OSCURO — data-theme
   Se aplica con override explícito (data-theme="dark") O en automático
   (auto / sin atributo) cuando el sistema está en oscuro.
   Las dos paletas deben mantenerse IDÉNTICAS.
   data-theme="light" nunca recibe la paleta oscura.
   ============================================================ */

/* (1) Override explícito: oscuro siempre, sin importar el sistema. */
:root[data-theme="dark"] {
  --paper:       #1A1814;
  --ink:         #EDE8DC;
  --ink-soft:    #A89F92;
  --ink-faint:   #6B6358;
  --rule:        rgba(237, 232, 220, 0.10);
  --rule-strong: rgba(237, 232, 220, 0.20);
}
:root[data-theme="dark"] body {
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.012) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(255,255,255,0.012) 0%, transparent 50%);
}
:root[data-theme="dark"] .hero,
:root[data-theme="dark"] .footer {
  filter: brightness(0.88) saturate(0.92);
}

/* (2) Automático: el sistema manda, salvo override explícito (light/dark). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    --paper:       #1A1814;
    --ink:         #EDE8DC;
    --ink-soft:    #A89F92;
    --ink-faint:   #6B6358;
    --rule:        rgba(237, 232, 220, 0.10);
    --rule-strong: rgba(237, 232, 220, 0.20);
  }
  :root:not([data-theme="light"]):not([data-theme="dark"]) body {
    background-image:
      radial-gradient(circle at 20% 30%, rgba(255,255,255,0.012) 0%, transparent 50%),
      radial-gradient(circle at 80% 70%, rgba(255,255,255,0.012) 0%, transparent 50%);
  }
  :root:not([data-theme="light"]):not([data-theme="dark"]) .hero,
  :root:not([data-theme="light"]):not([data-theme="dark"]) .footer {
    filter: brightness(0.88) saturate(0.92);
  }
}

/* ============================================================
   PREFERENCIA DE MOVIMIENTO REDUCIDO
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   PREGUNTA DEL DOMINGO — tarjeta tappeable
   ============================================================ */
.pregunta-card {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 1px solid var(--rule-strong);
  border-radius: 12px;
  padding: 24px 28px;
  cursor: pointer;
  transition: background 200ms ease, border-color 200ms ease, transform 150ms ease;
  margin-bottom: 48px;
}
.pregunta-card:hover,
.pregunta-card:focus-visible {
  background: rgba(0,0,0,0.03);
  border-color: var(--accent);
  outline: none;
}
.pregunta-card:active { transform: scale(0.99); }

.pregunta-card-q {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: 23px;
  line-height: 1.3;
  color: var(--ink);
  margin-bottom: 14px;
}
.pregunta-card-a {
  font-family: 'Crimson Pro', serif;
  font-size: 19px;
  line-height: 1.7;
  color: var(--ink);
}
.pregunta-card-hint {
  display: block;
  margin-top: 18px;
  font-family: 'Crimson Pro', serif;
  font-style: italic;
  font-size: 15px;
  color: var(--accent);
  opacity: 0.8;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 24, 20, 0.6);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: fadeInBackdrop 200ms ease;
}
.modal-backdrop[hidden] { display: none; }

@keyframes fadeInBackdrop {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.modal {
  background: var(--paper);
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  animation: slideUp 280ms cubic-bezier(0.32, 0.72, 0, 1);
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 16px;
  border-bottom: 1px solid var(--rule);
  flex-shrink: 0;
}
.modal-titulo {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 500;
  font-size: 18px;
  color: var(--ink-soft);
}
.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-soft);
  font-size: 18px;
  padding: 8px;
  margin: -8px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 200ms ease;
  border-radius: 50%;
}
.modal-close:hover { color: var(--ink); }
.modal-body {
  overflow-y: auto;
  padding: 8px 28px 40px;
  -webkit-overflow-scrolling: touch;
}
