/* ==========================================================================
   pages/gallery.css
   Eccezioni della pagina gallery.
   Caricato da 1 pagina.
   ========================================================================== */

.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  z-index: 9999;
  padding: .6rem 1.2rem;
  font-weight: 700;
  text-decoration: none;
  border-bottom-right-radius: 4px;
  transition: top .15s ease;
}

.skip-link:focus {
  top: 0;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid rgba(255,255,255,.9);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

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

.subtitle {
  margin-bottom: 28px;
  padding: 0 16px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px 32px;
}

.ph img {
  transition: transform .3s;
}

.ph:hover img {
  transform: scale(1.03);
}

.lightbox.active {
  display: flex;
}

.lightbox img {
  box-shadow: var(--shadow-lg);
}

.lightbox-close {
  transition: opacity .2s;
}

.lightbox-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--r-pill);
  line-height: 1;
  transition: background .2s,opacity .2s,transform .2s;
}

.cta-box-section {
  background: linear-gradient(135deg,var(--blu-notte) 0%,var(--blu-accent) 100%);
  padding: 48px 16px;
  text-align: center;
}

.cta-box-inner {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.cta-box-text {
  width: 100%;
  font-weight: 600;
  color: #fff;
  margin: 0 0 10px;
}

.gallery-intro {
  margin: 0 auto 1.1rem;
}

a.glb-pill {
  text-decoration: none;
}

a.glb-pill:hover {
  filter: brightness(.88);
}

body.page-gallery .gal-event-title {
  padding: 0 1rem;
}

body.page-gallery .grid {
  grid-template-columns: repeat(auto-fill,minmax(260px,1fr));
}

body.page-gallery .ph {
  position: relative;
  cursor: pointer;
  transition: transform .2s,box-shadow .2s;
  aspect-ratio: 4/3;
  padding: 0;
  margin: 0;
  width: 100%;
}

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

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

body.page-gallery .ph figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 14px;
  text-align: left;
}

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

body.page-gallery .lightbox.active {
  display: flex;
}

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

body.page-gallery .lightbox-close {
  position: fixed;
  top: 16px;
  right: 20px;
  color: #fff;
  font-size: 2.2rem;
  cursor: pointer;
  background: none;
  border: none;
  line-height: 1;
  opacity: .85;
}

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

body.page-gallery .lightbox-prev {
  left: 12px;
}

body.page-gallery .lightbox-next {
  right: 12px;
}

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

body.page-gallery .grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  max-width: 1100px;
  margin: 1rem auto 0;
  padding: 0 1rem;
}

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

body.page-gallery .glb-axis-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 1rem;
}

body.page-gallery .glb-axis-grid>* {
  flex: 0 1 220px;
  max-width: 220px;
}

@media (max-width: 600px) {
  .cta-box-inner {
    flex-direction: column;
    gap: 10px;
  }
}

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

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

@media (max-width: 768px) {
  body.page-gallery .glb-axis-grid {
    gap: .85rem;
  }
  body.page-gallery .glb-axis-grid>* {
    flex-basis: 100%;
    max-width: 100%;
  }
}

/* R5.42: native Gallery control; figure and caption keep their semantics. */
body.page-gallery .ph > .gallery-open {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
body.page-gallery .ph > .gallery-open:focus-visible {
  outline: 3px solid var(--v2-blue-accent, #2c5080);
  outline-offset: -3px;
}
