/* ── Font self-hosted ── */
@font-face { font-family: 'Libre Bodoni'; font-style: normal; font-weight: 400; font-display: swap; src: url('/font/libre-bodoni-400.woff2') format('woff2'); }
@font-face { font-family: 'Libre Bodoni'; font-style: normal; font-weight: 600; font-display: swap; src: url('/font/libre-bodoni-700.woff2') format('woff2'); }
@font-face { font-family: 'Libre Bodoni'; font-style: normal; font-weight: 700; font-display: swap; src: url('/font/libre-bodoni-700.woff2') format('woff2'); }
@font-face { font-family: 'EB Garamond'; font-style: normal; font-weight: 400; font-display: swap; src: url('/font/eb-garamond-400.woff2') format('woff2'); }
@font-face { font-family: 'EB Garamond'; font-style: italic; font-weight: 400; font-display: swap; src: url('/font/eb-garamond-400i.woff2') format('woff2'); }
@font-face { font-family: 'EB Garamond'; font-style: normal; font-weight: 600; font-display: swap; src: url('/font/eb-garamond-600.woff2') format('woff2'); }
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: calc(100% * var(--pv-dim-testo, 1)); scroll-behavior: smooth; --pv-dim-testo: 1; }
body {
  font-family: 'EB Garamond', serif;
  font-size: 1.1rem;
  color: #3a2a14;
  background: #f5eed6;
  line-height: 1.7;
  min-height: 100vh;
}

/* ── Sfondo animato (canvas) ── */
#sfondo-landing {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ── Dissolvenza ingresso sfalsata ── */
@keyframes comparsa-sezione {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
.comparsa {
  opacity: 0;
  animation: comparsa-sezione 0.8s ease forwards;
}
.comparsa-1 { animation-delay: 0.1s; }
.comparsa-2 { animation-delay: 0.3s; }
.comparsa-3 { animation-delay: 0.5s; }
.comparsa-4 { animation-delay: 0.7s; }
.comparsa-5 { animation-delay: 0.9s; }

/* ── Cornice medievale della pagina ── */
.cornice-pagina {
  max-width: 780px;
  margin: 2rem auto;
  padding: 0 1rem calc(48px + env(safe-area-inset-bottom, 0px));
  position: relative;
  z-index: 1;
}
.bordo-manoscritto {
  border: 2px solid #c8a96e;
  border-radius: 4px;
  padding: 2.5rem 3rem;
  position: relative;
  overflow: visible;
  background: linear-gradient(135deg, #f5eed6 0%, #f0e8cc 50%, #f5eed6 100%);
  box-shadow:
    0 0 0 6px #f5eed6,
    0 0 0 8px #d4c4a8,
    0 0 0 14px #f5eed6,
    0 0 0 15px #e8dcc0,
    0 4px 20px rgba(58,42,20,0.08),
    0 12px 40px rgba(58,42,20,0.05);
}
/* Angoli ornamentali — vite */
.angolo-ornamento {
  position: absolute;
  width: 100px;
  height: 100px;
  overflow: visible;
  z-index: 2;
}
.angolo-ornamento.alto-sx { top: -6px; left: -6px; }
.angolo-ornamento.alto-dx { top: -6px; right: -6px; transform: scaleX(-1); }
.angolo-ornamento.basso-sx { bottom: -6px; left: -6px; transform: scaleY(-1); }
.angolo-ornamento.basso-dx { bottom: -6px; right: -6px; transform: scale(-1, -1); }
/* Tralci laterali */
.tralcio-wrap {
  position: absolute;
  pointer-events: none;
  opacity: 0.45;
  z-index: 1;
}
.tralcio-wrap svg {
  display: block;
  width: 100%;
  height: 100%;
}
.tralcio-wrap.alto {
  top: -4px;
  left: 80px;
  right: 80px;
  height: 28px;
}
.tralcio-wrap.basso {
  bottom: -4px;
  left: 80px;
  right: 80px;
  height: 28px;
  transform: scaleY(-1);
}
.tralcio-wrap.sx {
  left: -8px;
  top: 80px;
  bottom: 80px;
  width: 28px;
}
.tralcio-wrap.dx {
  right: -8px;
  top: 80px;
  bottom: 80px;
  width: 28px;
  transform: scaleX(-1);
}

/* ── Lampada illustrata ── */
.lampada-illustrata {
  display: block;
  margin: 0 auto 1.5rem;
  width: 64px;
  height: 64px;
  opacity: 0.85;
}

/* ── Intestazione ── */
.intestazione {
  text-align: center;
  padding: 1rem 0 2rem;
}
.intestazione h1 {
  font-family: 'Libre Bodoni', serif;
  font-size: 2.8rem;
  font-weight: 700;
  color: #3a2a14;
  margin-bottom: 0.3rem;
  letter-spacing: 0.04em;
}
.intestazione .sottotitolo {
  font-style: italic;
  color: #6b4c2a;
  font-size: 1.15rem;
  margin-bottom: 2rem;
  letter-spacing: 0.02em;
}
.citazione-introduttiva {
  font-style: italic;
  color: #6b4c2a;
  font-size: 1.2rem;
  line-height: 1.6;
  margin: 0 auto 1rem;
  max-width: 500px;
  text-align: center;
}
.citazione-fonte {
  text-align: right;
  font-size: 0.85rem;
  color: #8b6b45;
  max-width: 500px;
  margin: 0 auto;
}

/* ── Fregio divisore ── */
.fregio-divisore {
  display: block;
  margin: 2rem auto;
  height: 24px;
  width: 240px;
  opacity: 0.7;
}

/* ── Elenco passi ── */
.contenuto {
  padding: 0 0 1rem;
}
.sezione-titolo {
  font-family: 'Libre Bodoni', serif;
  font-size: 1.4rem;
  color: #6b4c2a;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  text-align: center;
  border-bottom: none;
}

.elenco-passi {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.passo-card {
  display: block;
  padding: 0.75rem 0;
  text-decoration: none;
  color: #3a2a14;
  transition: color 300ms ease;
  border-bottom: 1px solid #e8dcc0;
}
.passo-card:hover {
  color: #8b6914;
}
.passo-titolo {
  font-family: 'Libre Bodoni', serif;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.passo-ref {
  font-size: 0.9rem;
  color: #8b6b45;
}
.passo-descrizione-tema {
  font-size: 0.8rem;
  font-style: italic;
  color: #8b6b45;
  margin-top: 0.15rem;
  opacity: 0.8;
}
.passo-tema {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--testo-tema, #f5eed6);
  background: var(--accento-tema, #c8a96e);
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  margin-top: 0.5rem;
}
/* Fleuron decorativo fra le card */
.fleuron-passo {
  display: block;
  margin: 0 auto;
  text-align: center;
  color: #c8a96e;
  font-size: 1.2rem;
  opacity: 0.5;
  line-height: 1;
}

/* ── Filtri Tematici ── */
.filtri-tematici, .indici-categorizzati {
  margin: 2rem 0;
}
.filtri-tematici-titolo, .indici-categorizzati-titolo {
  font-family: 'Libre Bodoni', serif;
  font-size: 1.15rem;
  color: #6b4c2a;
  margin-bottom: 1rem;
  text-align: center;
}
.elenco-temi, .elenco-libri {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  list-style: none; /* In case ul is used */
  padding: 0;
}
.filtro-tema, .filtro-libro {
  font-family: 'EB Garamond', serif;
  font-size: 0.9rem;
  padding: 0.4rem 0.8rem;
  border: 1.5px solid var(--bordo-filtro, #d4c4a8);
  border-radius: 20px;
  background: var(--sfondo-filtro, #f5eed6);
  color: var(--testo-filtro, #3a2a14);
  cursor: pointer;
  transition: all 250ms ease;
  white-space: nowrap;
}
.filtro-tema:hover, .filtro-libro:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.filtro-tema.attivo, .filtro-libro.attivo {
  background: var(--sfondo-filtro-attivo, #c8a96e);
  border-color: var(--bordo-filtro-attivo, #8b6914);
  color: var(--testo-filtro-attivo, #f5eed6);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

/* ── Footer ── */
/* ── Widget Lettura del giorno ── */
.lettura-giorno {
  margin: 0.5rem 0 2rem;
}
.lettura-giorno-titolo {
  font-family: 'Libre Bodoni', serif;
  font-size: 1.15rem;
  color: #6b4c2a;
  margin-bottom: 0.75rem;
  text-align: center;
}
.lg-nav-data {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.lg-nav-btn {
  background: none;
  border: 1px solid #d4c4a8;
  color: #6b4c2a;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 250ms ease;
  font-family: 'EB Garamond', serif;
}
.lg-nav-btn:hover { background: #8b6914; color: #f5eed6; border-color: #8b6914; }
.lg-data-selettore {
  background: none;
  border: 1px solid #d4c4a8;
  color: #6b4c2a;
  font-family: 'EB Garamond', serif;
  font-size: 0.95rem;
  padding: 0.3rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 250ms ease;
  letter-spacing: 0.03em;
  position: relative;
}
.lg-data-selettore:hover { background: #f0e8cc; border-color: #8b6914; }
.lg-data-input-nascosto {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.lettura-giorno-celebrazione {
  font-style: italic;
  color: #8b6b45;
  text-align: center;
  margin-bottom: 1rem;
  font-size: 1.05rem;
}
.colore-liturgico {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 0.4rem;
  vertical-align: middle;
  border: 1px solid rgba(0,0,0,0.15);
}
.colore-liturgico.bianco { background: #f5f0e0; }
.colore-liturgico.rosso { background: #a83232; }
.colore-liturgico.verde { background: #4a7c4a; }
.colore-liturgico.viola { background: #6a3a7a; }
.colore-liturgico.rosa { background: #c87a8a; }
.lettura-giorno-lista {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.lettura-giorno-item {
  font-size: 0.95rem;
  color: #3a2a14;
}
.lettura-giorno-intestazione {
  margin-bottom: 0.4rem;
}
.lettura-giorno-tipo {
  display: inline-block;
  font-size: 0.75rem;
  color: #8b6b45;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  min-width: 5em;
}
.lettura-giorno-ref {
  font-weight: 600;
}
.lettura-giorno-testo {
  font-family: 'EB Garamond', 'Libre Bodoni', serif;
  font-size: 1.05rem;
  line-height: 1.7;
  color: #3a2a14;
  margin-top: 0.3rem;
  padding: 0.5rem 0.8rem;
  text-align: justify;
}
.lettura-giorno-testo .versetto {
  color: #a08860;
  font-size: 0.7em;
  vertical-align: super;
  margin-right: 0.1em;
}
/* ── Capolettera miniato (stile Pergamena) ── */
.capolettera {
  float: left;
  font-family: 'Libre Bodoni', serif;
  font-size: 3.2em;
  line-height: 0.8;
  margin: 0.05em 0.1em 0 0;
  padding: 0.1em 0.14em 0.06em 0.1em;
  color: #6b4c2a;
  background: linear-gradient(145deg, #f5eed6 0%, #e8dcc0 60%, #d4c4a0 100%);
  border: 2.5px solid #8b6b45;
  border-radius: 3px;
  box-shadow: inset 0 0 8px rgba(139,107,69,0.2), 2px 2px 6px rgba(58,42,20,0.15);
  text-shadow: 1px 1px 0 rgba(196,168,120,0.6);
  position: relative;
}
.lettura-giorno-titolo a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid #d4c4a8;
  transition: color 250ms ease, border-color 250ms ease;
}
.lettura-giorno-titolo a:hover {
  color: #8b6914;
  border-bottom-color: #8b6914;
}
.lettura-giorno-nascosto { display: none; }
.lettura-sezione-divisore {
  border-top: 1px solid #d4c4a8;
  margin: 1.5rem 0;
}
.lg-link-piano {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.95rem;
}
.lg-link-piano a {
  color: #6b4c2a;
  text-decoration: none;
  border-bottom: 1px solid #d4c4a8;
  transition: color 250ms ease, border-color 250ms ease;
}
.lg-link-piano a:hover {
  color: #8b6914;
  border-bottom-color: #8b6914;
}

.piede {
  text-align: center;
  padding: 2rem 0 0;
  font-size: 0.85rem;
  color: #8b6b45;
  padding-bottom: 5rem;
}
.piede a {
  color: #6b4c2a;
  text-decoration: none;
  border-bottom: 1px solid #d4c4a8;
}
.piede p { margin-bottom: 0.5rem; }
.piede .privacy { margin-top: 0.75rem; }
.piede .privacy svg { opacity: 0.4; transition: opacity 250ms ease; cursor: help; }
.piede .privacy svg:hover { opacity: 0.7; }
.collegamento-segnala {
  font-size: 0.8rem;
  color: #8b6b45;
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
}
.collegamento-segnala:hover { color: #3a2a14; }
.sviluppato-da {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #a08860;
}
/* Barra inferiore, menu, modali, condivisione: in /static/barra.css (condiviso) */
.cornice-pagina { touch-action: pan-x pan-y; transition: font-size 100ms ease; }

/* ── Skip link ── */
.skip-link-landing {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: #f5eed6;
  color: #3a2a14;
  padding: 0.5rem 1rem;
  z-index: 10000;
  border-radius: 0 0 4px 4px;
  text-decoration: none;
  font-size: 0.85rem;
}
.skip-link-landing:focus {
  top: 0;
}
@media (prefers-reduced-motion: reduce) {
  .comparsa { animation: none; opacity: 1; }
  .filtro-tema:hover, .filtro-libro:hover { transform: none; }
  .passo-card { transition: none; }
  .lg-nav-btn { transition: none; }
  .lg-data-selettore { transition: none; }
  .filtro-tema, .filtro-libro { transition: none; }
  .piede .privacy svg { transition: none; }
}
@media (max-width: 600px) {
  .cornice-pagina { margin: 0.5rem auto; padding: 0 0.5rem calc(48px + env(safe-area-inset-bottom, 0px)); }
  .bordo-manoscritto { padding: 1.5rem 1.25rem; box-shadow: none; border: 1.5px solid #c8a96e; }
  .angolo-ornamento { width: 60px; height: 60px; }
  .tralcio-wrap.alto, .tralcio-wrap.basso { left: 50px; right: 50px; }
  .tralcio-wrap.sx, .tralcio-wrap.dx { top: 50px; bottom: 50px; }
  .tralcio-wrap { opacity: 0.3; }
  .intestazione h1 { font-size: 2rem; }
  .fregio-divisore { width: 180px; }
  .lampada-illustrata { width: 48px; height: 48px; }
}