/* ==========================================================================
   FESTIVAL GALLERY STYLING
   ========================================================================== */
.festival-gallery {
  min-height: 700px;
  padding: 82px 0 110px;
  border-top: 1px solid rgba(211, 165, 40, 0.12);
  background:
    radial-gradient(
      circle at 50% 0%,
      rgba(195, 142, 20, 0.08),
      transparent 30%
    ),
    #050501;
}

.festival-gallery__container {
  width: min(1000px, calc(100% - 40px));
  margin: 0 auto;
}

/* Year Filter tabs */
.gallery-filter {
  display: flex;
  margin-bottom: 34px;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.gallery-filter__button {
  min-height: 40px;
  padding: 0 22px;
  border: 1px solid rgba(215, 169, 48, 0.24);
  border-radius: 999px;
  color: rgba(225, 211, 174, 0.65);
  background: rgba(13, 11, 3, 0.82);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition:
    color 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease;
}

.gallery-filter__button:hover {
  color: #efce61;
  border-color: rgba(231, 185, 56, 0.5);
  transform: translateY(-2px);
}

.gallery-filter__button.is-active {
  color: #1a1403;
  border-color: transparent;
  background:
    linear-gradient(
      135deg,
      #d6a832,
      #f0ce5a
    );
  box-shadow:
    0 8px 22px rgba(214, 160, 31, 0.26),
    0 0 20px rgba(218, 168, 42, 0.12);
}

/* Masonry grid via CSS columns */
.festival-gallery__grid {
  columns: 4;
  column-gap: 10px;
}

.gallery-item {
  width: 100%;
  margin: 0 0 10px;
  break-inside: avoid;
  opacity: 1;
  transform: scale(1);
  transition:
    opacity 260ms ease,
    transform 260ms ease;
}

.gallery-item.is-hidden {
  display: none;
}

.gallery-item.is-filtering {
  opacity: 0;
  transform: scale(0.97);
}

/* Image blocks */
.gallery-item__button {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: #0d0b03;
  cursor: zoom-in;
  min-height: 120px;
  background:
    linear-gradient(
      110deg,
      #0a0902 25%,
      #171204 38%,
      #0a0902 52%
    );
  background-size: 200% 100%;
  animation: gallerySkeleton 1.5s linear infinite;
}

.gallery-item__button.is-loaded {
  min-height: 0;
  animation: none;
}

.gallery-item__image {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  opacity: 0;
  transition:
    opacity 420ms ease,
    transform 500ms ease,
    filter 300ms ease;
}

.gallery-item__image.is-loaded {
  opacity: 1;
}

.gallery-item__button:hover .gallery-item__image {
  filter: brightness(0.72);
  transform: scale(1.045);
}

@keyframes gallerySkeleton {
  to {
    background-position-x: -200%;
  }
}

/* Overlays and Zoom triggers */
.gallery-item__overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #f0c94f;
  background: rgba(5, 4, 0, 0.2);
  opacity: 0;
  transition:
    opacity 220ms ease,
    background-color 220ms ease;
}

.gallery-item__overlay i {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(238, 198, 74, 0.7);
  border-radius: 50%;
  background: rgba(7, 6, 1, 0.62);
  font-size: 16px;
  transform: scale(0.8);
  transition: transform 220ms ease;
}

.gallery-item__button:hover .gallery-item__overlay {
  opacity: 1;
  background: rgba(4, 4, 0, 0.38);
}

.gallery-item__button:hover .gallery-item__overlay i {
  transform: scale(1);
}

/* ==========================================================================
   LIGHTBOX DIALOG STYLING
   ========================================================================== */
.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  padding: 30px;
  place-items: center;
}

.gallery-lightbox[hidden] {
  display: none;
}

.gallery-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at center,
      rgba(45, 32, 4, 0.18),
      transparent 45%
    ),
    rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(5px);
}

.gallery-lightbox__content {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(1100px, 94vw);
  max-height: 92vh;
  grid-template-columns: 52px minmax(0, 1fr) 52px;
  align-items: center;
  gap: 18px;
}

.gallery-lightbox__figure {
  margin: 0;
  text-align: center;
}

.gallery-lightbox__image {
  display: block;
  max-width: 100%;
  max-height: 82vh;
  margin: 0 auto;
  border: 1px solid rgba(222, 177, 49, 0.22);
  border-radius: 10px;
  object-fit: contain;
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.65),
    0 0 34px rgba(207, 153, 25, 0.08);
}

.gallery-lightbox__caption {
  margin-top: 12px;
  color: rgba(229, 214, 177, 0.65);
  font-size: 12px;
  line-height: 1.6;
}

.gallery-lightbox__close {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 2;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(229, 188, 66, 0.42);
  border-radius: 50%;
  color: #efcb57;
  background: rgba(8, 7, 1, 0.72);
  cursor: pointer;
  transition:
    background-color 180ms ease,
    transform 180ms ease;
}

.gallery-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: scale(1.06);
}

.gallery-lightbox__navigation {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(222, 178, 49, 0.34);
  border-radius: 50%;
  color: #e9c64d;
  background: rgba(14, 11, 2, 0.76);
  cursor: pointer;
  transition:
    transform 180ms ease,
    background-color 180ms ease;
}

.gallery-lightbox__navigation:hover {
  background: rgba(39, 29, 5, 0.92);
  transform: scale(1.06);
}

.gallery-lightbox__counter {
  position: fixed;
  bottom: 22px;
  left: 50%;
  display: flex;
  padding: 8px 14px;
  gap: 5px;
  border: 1px solid rgba(216, 169, 44, 0.24);
  border-radius: 999px;
  color: rgba(236, 218, 170, 0.72);
  background: rgba(7, 6, 1, 0.72);
  font-size: 11px;
  font-weight: 800;
  transform: translateX(-50%);
}

body.is-gallery-lightbox-open {
  overflow: hidden;
}

/* ==========================================================================
   TABLET RESPONSIVE RULES
   ========================================================================== */
@media (max-width: 1000px) {
  .festival-gallery {
    padding: 68px 0 88px;
  }

  .festival-gallery__container {
    width: calc(100% - 30px);
  }

  .festival-gallery__grid {
    columns: 3;
  }
}

@media (max-width: 760px) {
  .festival-gallery__grid {
    columns: 2;
  }
}

/* ==========================================================================
   MOBILE RESPONSIVE RULES
   ========================================================================== */
@media (max-width: 520px) {
  .festival-gallery {
    padding: 50px 0 64px;
  }

  .festival-gallery__container {
    width: calc(100% - 20px);
  }

  .gallery-filter {
    margin-bottom: 24px;
    gap: 8px;
  }

  .gallery-filter__button {
    min-height: 38px;
    padding: 0 15px;
    font-size: 10px;
  }

  .festival-gallery__grid {
    columns: 1;
    column-gap: 0;
  }

  .gallery-item {
    margin-bottom: 12px;
  }

  .gallery-lightbox {
    padding: 12px;
  }

  .gallery-lightbox__content {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .gallery-lightbox__navigation {
    position: fixed;
    top: 50%;
    width: 40px;
    height: 40px;
    transform: translateY(-50%);
    z-index: 5;
  }

  .gallery-lightbox__navigation:hover {
    transform: translateY(-50%) scale(1.04);
  }

  .gallery-lightbox__navigation--previous {
    left: 10px;
  }

  .gallery-lightbox__navigation--next {
    right: 10px;
  }

  .gallery-lightbox__image {
    max-height: 76vh;
  }

  .gallery-lightbox__caption {
    padding: 0 44px;
  }
}
