/* ZODDIAK Foundation – Program Gallery Styles
   - Gallery grids, rows, and layouts
   - Gallery thumbnails and lightbox
   - Gallery swiper (for ProgramGallery plugin)
   - Shared styles for use on both program and event pages
*/

/* ---------------------------------------------
   Program Gallery & Lightbox
--------------------------------------------- */
.program-gallery-grid {
  display: block;
  margin-top: 32px;
}

.program-gallery-grid-full {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  width: 100%;
  padding: 0 50px;
}

@media (max-width: 991px) {
  .program-gallery-grid-full {
    grid-template-columns: 1fr;
  }
}

.program-gallery-grid-stacked {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.program-gallery-row {
  display: grid;
  gap: 20px;
  width: 100%;
}

.program-gallery-row--2 {
  grid-template-columns: repeat(2, 1fr);
  padding: 0 50px;
}

.program-gallery-row--3 {
  grid-template-columns: repeat(3, 1fr);
  padding: 0 50px;
}

@media (max-width: 991px) {
  .program-gallery-row--2,
  .program-gallery-row--3 {
    grid-template-columns: 1fr;
    padding: 0 20px;
  }
}

.program-gallery-thumb {
  position: relative;
  border: none;
  padding: 0;
  background: transparent;
  border-radius: 24px;
  overflow: hidden;
  cursor: pointer;
}

.program-gallery-thumb-full {
  position: relative;
  border: none;
  padding: 0;
  background: transparent;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 16 / 10;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.program-gallery-thumb-full:hover {
  opacity: 0.9;
  transform: scale(1.02);
}

.program-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--dur) var(--ease);
}

.program-gallery-thumb-full img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.program-gallery-thumb:hover img,
.program-gallery-thumb:focus img {
  transform: scale(1.04);
}

.program-gallery-item {
  text-align: center;
}

.program-gallery-meta {
  margin-top: 18px;
}

.program-gallery-title {
  font-family: var(--font-secondary);
  font-size: 16px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-500);
}

.program-gallery-subtitle {
  margin-top: 12px;
  font-family: var(--font-secondary);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #d9d9d9;
}

.program-gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: auto;
}

.program-gallery-lightbox[hidden] {
  display: none !important;
  pointer-events: none;
}

.program-gallery-lightbox:not([hidden]) {
  display: block !important;
}

.program-gallery-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
  cursor: pointer;
}

.program-gallery-lightbox__dialog {
  position: relative;
  z-index: 2;
  max-width: min(1080px, 90vw);
  margin: 0 auto;
  height: 100%;
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  pointer-events: none;
}

.program-gallery-lightbox__close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
}

.program-gallery-lightbox__viewport {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.program-gallery-lightbox__slide {
  position: absolute;
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
  text-align: center;
}

.program-gallery-lightbox__slide img {
  max-height: 70vh;
  width: auto;
  max-width: 100%;
  border-radius: 0;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
}

.program-gallery-lightbox__slide figcaption {
  margin-top: 16px;
  text-align: center;
}

.program-gallery-lightbox__title {
  color: var(--gold-500);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 12px;
  margin-bottom: 8px;
}

.program-gallery-lightbox__subtitle {
  color: #f5f5f5;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.program-gallery-lightbox__slide.is-active {
  position: relative;
  opacity: 1;
}

.program-gallery-lightbox__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
}

.program-gallery-lightbox__nav {
  width: 52px;
  height: 52px;
  border-radius: 0;
  border: 1px solid rgba(255,255,255,0.3);
  background: transparent;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.program-gallery-lightbox__nav:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--gold-500);
  color: var(--gold-500);
}

.program-gallery-lightbox__indicator {
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-size: 13px;
  color: var(--gold-500);
}

body.gallery-open {
  overflow: hidden;
}

/* ---------------------------------------------
   Program Gallery Swiper (for ProgramGallery plugin)
--------------------------------------------- */
.program-gallery-swiper {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding-bottom: 3rem;
}

.program-gallery-swiper--full-width {
  max-width: 1440px;
  margin: 0 auto;
}

.program-gallery--full-width {
  padding-left: 0;
  padding-right: 0;
}

.program-gallery-swiper .swiper-wrapper {
  align-items: center;
}

.program-gallery-swiper .swiper-slide {
  display: flex;
  justify-content: center;
}

.program-gallery-swiper .program-gallery-item {
  width: 100%;
}

.program-gallery-swiper .program-gallery-thumb-full {
  width: 100%;
  height: 350px;
}

.program-gallery-swiper--full-width .program-gallery-thumb-full {
  height: auto;
}

.program-gallery-swiper .program-gallery-thumb-full img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.program-gallery-swiper--full-width .program-gallery-thumb-full img {
  height: auto;
}

.program-gallery-swiper .program-gallery-meta {
  margin-top: 24px;
}

.program-gallery-swiper .swiper-pagination-bullets {
  bottom: 0;
}

.program-gallery-swiper .swiper-pagination-bullet {
  background: rgba(203, 162, 92, 0.4);
  opacity: 1;
}

.program-gallery-swiper .swiper-pagination-bullet-active {
  background: var(--gold-500);
}

/* Full width wrapper gallery styles */
.program-full-width-wrapper .program-gallery-grid-full {
  width: 100%;
  display: block;
}

.program-full-width-wrapper .program-gallery-thumb-full {
  aspect-ratio: unset;
  height: 520px;
}

.program-full-width-wrapper .program-gallery-thumb-full img {
  max-height: 520px;
  object-fit: cover;
}

@media (max-width: 767.98px) {
  .program-gallery-swiper .program-gallery-thumb-full {
    height: 250px;
  }

  .program-gallery-swiper--full-width .program-gallery-thumb-full {
    height: auto;
  }

  .program-gallery-swiper--full-width .program-gallery-thumb-full img {
    height: auto;
  }
}

