/* =========================================================================
   FLAEI — Photogallery statica (cartelle / album / lightbox)
   ========================================================================= */

.pg-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px 16px 60px;
}

/* Titolo pagina (blocco page-title) coerente con le altre pagine: leggero. */
body.page-node-type-photogallery-v2 #block-pagetitle h1,
body.page-node-type-photogallery-v2 #block-pagetitle h2 {
  font-weight: 300;
}

/* Intestazione + breadcrumb ------------------------------------------------ */
.pg-page h1.pg-title {
  font-weight: 300;
  font-size: 2.1rem;
  color: #1a1a1a;
  margin: 18px 0 4px;
}
.pg-title-rule {
  width: 64px;
  height: 4px;
  background: #009640;
  border-radius: 3px;
  margin: 8px 0 6px;
}
.pg-subtitle {
  color: #6a6a6a;
  font-weight: 300;
  margin: 0 0 22px;
}

.pg-trail {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: .92rem;
  margin: 6px 0 22px;
  color: #8a8a8a;
}
.pg-trail a { color: #009640; text-decoration: none; }
.pg-trail a:hover { text-decoration: underline; }
.pg-trail .sep { color: #c4c4c4; }

/* Griglia di cartelle / album --------------------------------------------- */
.pg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 22px;
}

.pg-card {
  position: relative;
  display: block;
  border-radius: 12px;
  overflow: hidden;
  background: #f3f4f6;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease;
  aspect-ratio: 4 / 3;
}
.pg-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .18);
}
.pg-card__cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pg-card__cover--empty {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #d7dee2, #b9c4ca);
}
.pg-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .72) 0%, rgba(0, 0, 0, .15) 45%, rgba(0, 0, 0, 0) 75%);
}
.pg-card__body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px 16px;
  color: #fff;
}
.pg-card__title {
  font-weight: 400;
  font-size: 1.02rem;
  line-height: 1.25;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .5);
}
.pg-card__meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: .8rem;
  font-weight: 300;
  opacity: .92;
}
.pg-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(0, 150, 64, .92);
  color: #fff;
  font-size: .76rem;
  font-weight: 400;
  padding: 4px 9px;
  border-radius: 999px;
  backdrop-filter: blur(2px);
}
.pg-card__badge svg { width: 13px; height: 13px; fill: #fff; }

/* Griglia delle foto dentro un album -------------------------------------- */
.pg-album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}
.pg-photo {
  position: relative;
  display: block;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: #eceef0;
  cursor: zoom-in;
  border: 0;
  padding: 0;
}
.pg-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .25s ease;
}
.pg-photo:hover img { transform: scale(1.06); }

.pg-empty {
  color: #8a8a8a;
  font-weight: 300;
  padding: 30px 0;
}

/* Lightbox ----------------------------------------------------------------- */
.pg-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(8, 10, 12, .94);
}
.pg-lightbox.is-open { display: flex; }
.pg-lightbox__img {
  max-width: 92vw;
  max-height: 84vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, .6);
}
.pg-lightbox__caption {
  position: absolute;
  bottom: 18px;
  left: 0;
  right: 0;
  text-align: center;
  color: #e8e8e8;
  font-weight: 300;
  font-size: .95rem;
  padding: 0 60px;
}
.pg-lb-btn {
  position: absolute;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  border: 0;
  cursor: pointer;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 1.7rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease;
}
.pg-lb-btn:hover { background: rgba(0, 150, 64, .9); }
.pg-lb-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.pg-lb-next { right: 18px; top: 50%; transform: translateY(-50%); }
.pg-lb-close { top: 18px; right: 18px; width: 44px; height: 44px; font-size: 1.4rem; }
.pg-lb-counter {
  position: absolute;
  top: 26px;
  left: 24px;
  color: #cfcfcf;
  font-weight: 300;
  font-size: .9rem;
}

@media (max-width: 600px) {
  .pg-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
  .pg-album-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
  .pg-lb-prev { left: 6px; }
  .pg-lb-next { right: 6px; }
}
