/* ==========================================================================
   families/events.css
   Pagine di resoconto degli eventi.
   Caricato da 2 pagine.
   ========================================================================== */

p {
  margin-top: 0;
}

.post-hero {
  text-align: center;
}

.post-hero .soprattitolo {
  font-family: var(--font-corpo);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: .8rem;
}

.post-hero h1 {
  margin-bottom: 1rem;
}

.post-hero .hero-meta {
  margin-bottom: 2rem;
}

.post-hero-img {
  max-width: 860px;
  object-fit: cover;
  border-radius: var(--r);
  display: block;
  margin: 2rem auto 0;
  background: rgba(255,255,255,.08);
}

.resoconto {
  margin: 4rem auto;
}

.resoconto p {
  margin-bottom: 1.2rem;
}

.gallery-section {
  background: #f8f9fb;
}

.gallery-section h2 {
  text-align: center;
}

.gallery-grid {
  grid-template-columns: repeat(auto-fill,minmax(280px,1fr));
  max-width: 1100px;
  margin: 0 auto;
}

.ph {
  position: relative;
  cursor: pointer;
  transition: transform .2s,box-shadow .2s;
  aspect-ratio: 4/3;
}

.ph:hover {
  transform: translateY(-3px);
}

.ph img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ph figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 14px;
}

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.92);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lightbox.active {
  display: flex;
}

.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
}

.lightbox-caption {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 1rem;
  text-align: center;
  max-width: 600px;
}

.lightbox-close {
  position: fixed;
  top: 16px;
  right: 20px;
  color: #fff;
  font-size: 2.2rem;
  cursor: pointer;
  background: none;
  border: none;
  line-height: 1;
  opacity: .8;
  transition: opacity .2s;
}

.lightbox-close:hover {
  opacity: 1;
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  font-size: 2rem;
  background: none;
  border: none;
  cursor: pointer;
  opacity: .7;
  padding: 8px;
}

.lightbox-nav:hover {
  opacity: 1;
}

.lightbox-prev {
  left: 12px;
}

.lightbox-next {
  right: 12px;
}

.gallery-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
}

.gallery-grid>* {
  flex: 0 1 calc((100% - 2.4rem)/3);
  max-width: calc((100% - 2.4rem)/3);
}

@media (max-width: 768px) {
  .gallery-grid>* {
    flex-basis: calc((100% - 1.2rem)/2);
    max-width: calc((100% - 1.2rem)/2);
  }
}

@media (max-width: 520px) {
  .gallery-grid>* {
    flex-basis: 100%;
    max-width: 100%;
  }
}

@media (max-width: 700px) {
  body.page-post-evento-22maggio2026 .post-hero {
    grid-template-columns: minmax(0,1fr);
  }
  body.page-post-evento-22maggio2026 .post-hero>* {
    min-width: 0;
    max-width: 100%;
  }
  body.page-post-evento-22maggio2026 .soprattitolo {
    overflow-wrap: anywhere;
  }
}
