/* =================================================================
   PRESEPE VIVENTE: galleria per anno + visualizzatore a schermo intero
   ================================================================= */

.page-presepe {
  --pv-night: #1f1a2e;
  --pv-night-2: #3a2b2a;
  --pv-gold: #e8c27a;
}
.page-presepe .content-area {
  padding-top: 0 !important;
}

/* ---------- Testata "notte di Natale" ---------- */
.pv-hero {
  position: relative;
  overflow: hidden;
  padding: 2.75rem 0 2.25rem;
  color: #fff;
  text-align: center;
  background:
    radial-gradient(60% 120% at 50% 0%, rgba(232, 194, 122, .28) 0%, rgba(232, 194, 122, 0) 60%),
    linear-gradient(180deg, var(--pv-night) 0%, var(--pv-night-2) 100%);
}
@media (min-width: 768px) {
  .pv-hero { padding: 4rem 0 3rem; }
}
/* Piccole stelle sparse, solo decorative */
.pv-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 22%, rgba(255,255,255,.8), transparent),
    radial-gradient(1px 1px at 28% 65%, rgba(255,255,255,.6), transparent),
    radial-gradient(1.5px 1.5px at 72% 18%, rgba(255,255,255,.8), transparent),
    radial-gradient(1px 1px at 86% 58%, rgba(255,255,255,.6), transparent),
    radial-gradient(1px 1px at 55% 80%, rgba(255,255,255,.5), transparent),
    radial-gradient(1.5px 1.5px at 40% 12%, rgba(255,255,255,.7), transparent);
  pointer-events: none;
}
.pv-hero .container {
  position: relative;
}
.pv-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-bottom: .5rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--pv-gold);
}
.pv-hero h1 {
  font-weight: 800;
  font-size: clamp(2rem, 6vw, 3.2rem);
  margin-bottom: .35rem;
}
.pv-edizione {
  margin: 0;
  font-size: 1.1rem;
  opacity: .85;
}

/* Scelta dell'anno: pillole, scorrevoli in orizzontale su telefono */
.pv-anni {
  display: flex;
  gap: .5rem;
  justify-content: center;
  margin-top: 1.5rem;
  padding: 0 .25rem .25rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.pv-anni::-webkit-scrollbar { display: none; }
@media (max-width: 575.98px) {
  .pv-anni { justify-content: flex-start; }
}
.pv-anno {
  flex: 0 0 auto;
  padding: .4rem 1rem;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 999px;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.pv-anno:hover {
  color: #fff;
  border-color: #fff;
}
.pv-anno.is-active {
  background: var(--pv-gold);
  border-color: var(--pv-gold);
  color: var(--pv-night);
}

/* ---------- Galleria a mosaico (rispetta le proporzioni delle foto) ---------- */
.pv-count {
  margin: 1.5rem 0 1rem;
  font-size: .9rem;
  color: #8a7f75;
  text-align: center;
}
.pv-gallery {
  columns: 2;
  column-gap: .6rem;
  margin-bottom: 2rem;
}
@media (min-width: 768px) {
  .pv-gallery { columns: 3; column-gap: 1rem; }
}
@media (min-width: 1200px) {
  .pv-gallery { columns: 4; }
}
.pv-item {
  display: block;
  width: 100%;
  margin: 0 0 .6rem;
  padding: 0;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #eee6df;
  cursor: zoom-in;
  break-inside: avoid;
  box-shadow: 0 4px 14px rgba(0,0,0,.08);
}
@media (min-width: 768px) {
  .pv-item { margin-bottom: 1rem; }
}
.pv-item img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform .35s ease, filter .35s ease;
}
.pv-item:hover img,
.pv-item:focus-visible img {
  transform: scale(1.04);
  filter: brightness(1.05);
}
.pv-item:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

/* ---------- Visualizzatore a schermo intero ---------- */
.pv-lightbox {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  overflow: hidden;
}
.pv-lightbox::backdrop {
  background: rgba(12, 10, 18, .94);
}
.pv-lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}
.pv-lightbox__img {
  max-width: calc(100vw - 2rem);
  max-height: calc(100dvh - 6rem);
  border-radius: 8px;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  user-select: none;
}
@media (min-width: 768px) {
  .pv-lightbox__img { max-width: calc(100vw - 10rem); }
}
.pv-lightbox__count {
  position: absolute;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  font-size: .9rem;
  letter-spacing: .08em;
  opacity: .8;
}
.pv-lightbox__btn {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  color: #fff;
  font-size: 1.2rem;
  transition: background-color .2s ease;
}
.pv-lightbox__btn:hover,
.pv-lightbox__btn:focus-visible {
  background: rgba(255,255,255,.25);
}
.pv-lightbox__close { top: 1rem; right: 1rem; }
.pv-lightbox__prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.pv-lightbox__next { right: 1rem; top: 50%; transform: translateY(-50%); }
/* Su telefono le frecce scendono in basso, dove arriva il pollice */
@media (max-width: 767.98px) {
  .pv-lightbox__prev,
  .pv-lightbox__next { top: auto; bottom: .75rem; transform: none; }
}
