/* =========================================================
   GOLDEN BRICK AWARDS — GALLERY PAGE
   Premium Black & Gold Gallery
   ========================================================= */

/* =========================================================
   PAGE
   ========================================================= */

.gallery-page {
  position: relative;
  min-height: 100vh;

  background:
    linear-gradient(rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.25)),
    url("./assets/gallery-page-bg.webp") center center / cover no-repeat fixed;

  color: #f4ecd8;
  padding-top: var(--nav-h, 76px);

  overflow: hidden;
}

/* Fixed decorative background layer */

.gallery-page::before {
  content: "";
  position: fixed;
  inset: 0;

  pointer-events: none;

  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(212, 170, 73, 0.035) 50%,
    transparent 100%
  );

  z-index: 0;
}

/* Subtle gold frame */

.gallery-page::after {
  content: "";

  position: fixed;
  inset: 0;

  pointer-events: none;

  border: 1px solid rgba(210, 169, 72, 0.12);

  z-index: 0;
}

/* =========================================================
   EDITION SECTION
   ========================================================= */

.gallery-page__edition {
  position: relative;
  z-index: 1;

  min-height: 100vh;

  padding: 110px 0 120px;

  border-bottom: 1px solid rgba(210, 169, 72, 0.14);

  display: flex;
  align-items: center;
}

.gallery-page__edition:last-child {
  border-bottom: none;
}

/* =========================================================
   CONTAINER
   ========================================================= */

.gallery-page__edition .container {
  position: relative;
  z-index: 2;

  width: min(1400px, 92%);

  margin: 0 auto;
}

/* =========================================================
   HEADING
   ========================================================= */

.gallery-page__heading {
  width: 100%;

  display: flex;
  flex-direction: column;

  align-items: center;
  justify-content: center;

  text-align: center;

  margin: 0 0 55px;

  gap: 0;
}

/* =========================================================
   YEAR
   ========================================================= */

.gallery-page__year {
  display: block;

  margin: 0 0 8px;

  font-family: "Jost", sans-serif;

  font-size: clamp(70px, 8vw, 70px);

  font-weight: 700;

  line-height: 1;

  letter-spacing: 0.12em;

  color: #c9a23d;

  text-transform: uppercase;
}

/* =========================================================
   HEADING TEXT
   ========================================================= */

.gallery-page__heading-text {
  display: flex;

  flex-direction: column;

  align-items: center;

  justify-content: center;

  padding: 0;

  border: none;

  gap: 6px;
}

/* =========================================================
   MAIN TITLE
   ========================================================= */

.gallery-page__title {
  margin: 0;

  font-family: "Jost", sans-serif;

  font-size: clamp(34px, 4vw, 40px);

  font-weight: 700;

  line-height: 1.05;

  letter-spacing: -0.025em;

  color: #ffffff;
}

/* =========================================================
   SUBTITLE
   ========================================================= */

.gallery-page__subtitle {
  margin: 4px 0 0;

  font-family: "Jost", sans-serif;

  font-size: clamp(14px, 1.2vw, 17px);

  font-weight: 700;

  line-height: 1.5;

  letter-spacing: 0.12em;

  color: rgba(244, 236, 216, 0.55);

  text-transform: uppercase;
}

/* =========================================================
   GOLD DECORATIVE LINE
   ========================================================= */

.gallery-page__heading::after {
  content: "";

  width: 70px;
  height: 1px;

  margin-top: 22px;

  background: linear-gradient(90deg, transparent, #c9a23d, transparent);
}

/* =========================================================
   GALLERY GRID
   ========================================================= */

.gallery-page__grid {
  position: relative;

  width: 100%;

  margin: 0;

  padding: 0;
}

/* =========================================================
   GALLERY ITEM
   ========================================================= */

.gallery-page__item {
  position: relative;

  aspect-ratio: 4 / 3;

  overflow: hidden;

  cursor: pointer;

  border-radius: 4px;

  border: 1px solid rgba(210, 169, 72, 0.22);

  background: #0c0c0c;

  box-shadow:
    0 15px 40px rgba(0, 0, 0, 0.35),
    inset 0 0 0 1px rgba(255, 255, 255, 0.015);

  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.35s ease,
    box-shadow 0.35s ease;
}

/* Gold corner glow */

.gallery-page__item::before {
  content: "";

  position: absolute;

  inset: 0;

  z-index: 1;

  pointer-events: none;

  background: linear-gradient(
    135deg,
    rgba(210, 169, 72, 0.12),
    transparent 25%
  );

  opacity: 0;

  transition: opacity 0.35s ease;
}

/* =========================================================
   IMAGE
   ========================================================= */

.gallery-page__item img {
  display: block;

  width: 100%;
  height: 100%;

  object-fit: cover;

  transform: scale(1);

  transition:
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.4s ease;
}

/* =========================================================
   HOVER
   ========================================================= */

.gallery-page__item:hover {
  transform: translateY(-6px);

  border-color: rgba(210, 169, 72, 0.75);

  box-shadow:
    0 25px 55px rgba(0, 0, 0, 0.55),
    0 0 30px rgba(210, 169, 72, 0.08);
}

.gallery-page__item:hover::before {
  opacity: 1;
}

.gallery-page__item:hover img {
  transform: scale(1.06);

  filter: brightness(1.06);
}

/* =========================================================
   FULL SCREEN LIGHTBOX
   ========================================================= */

.gallery-lightbox {
  position: fixed;

  inset: 0;

  z-index: 1000;

  display: none;

  align-items: center;
  justify-content: center;

  padding: 40px;

  /* allow vertical scroll gestures; JS handles horizontal swipes */
  touch-action: pan-y;
}

.gallery-lightbox.is-open {
  display: flex;
}

/* =========================================================
   LIGHTBOX BACKDROP
   ========================================================= */

.gallery-lightbox__backdrop {
  position: absolute;

  inset: 0;

  background: rgba(5, 5, 8, 0);

  backdrop-filter: blur(0);

  transition:
    background 0.45s ease,
    backdrop-filter 0.45s ease;
}

.gallery-lightbox.is-open .gallery-lightbox__backdrop {
  background: rgba(5, 5, 8, 0.94);

  backdrop-filter: blur(8px);
}

/* =========================================================
   LIGHTBOX IMAGE
   ========================================================= */

.gallery-lightbox__stage {
  position: relative;

  z-index: 2;

  display: flex;

  align-items: center;
  justify-content: center;

  max-width: 92vw;
  max-height: 88vh;
}

.gallery-lightbox__stage img {
  display: block;

  max-width: 90vw;
  max-height: 85vh;

  width: auto;
  height: auto;

  border-radius: 5px;

  border: 1px solid rgba(210, 169, 72, 0.3);

  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.75),
    0 0 50px rgba(210, 169, 72, 0.06);

  transition:
    transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.35s;
}

/* =========================================================
   LIGHTBOX CLOSE BUTTON
   ========================================================= */

.gallery-lightbox__close {
  position: fixed;

  top: 28px;
  right: 28px;

  z-index: 1001;

  display: inline-flex;

  align-items: center;
  justify-content: center;

  width: 44px;
  height: 44px;

  border-radius: 50%;

  border: 1px solid rgba(210, 169, 72, 0.4);

  background: #c9a23d;

  color: #050505;

  cursor: pointer;

  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.45);

  opacity: 0;

  transform: scale(0.7);

  transition:
    background 0.25s ease,
    transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.35s ease;
}

.gallery-lightbox.is-open .gallery-lightbox__close {
  opacity: 1;

  transform: scale(1);
}

.gallery-lightbox__close:hover {
  background: #e1bc5d;

  transform: rotate(90deg) scale(1.05);
}

.gallery-lightbox__close svg {
  width: 20px;
  height: 20px;
}

/* =========================================================
   LIGHTBOX NAV ARROWS
   ========================================================= */

.gallery-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;

  display: grid;
  place-items: center;

  width: 40px;
  height: 40px;
  padding: 0;

  border-radius: 50%;
  border: 1px solid rgba(210, 169, 72, 0.4);

  background: rgba(5, 5, 8, 0.6);
  color: #c9a23d;

  cursor: pointer;

  transition:
    background 0.25s ease,
    color 0.25s ease,
    transform 0.25s ease;
}

.gallery-lightbox__nav:hover {
  background: #c9a23d;
  color: #050505;
  transform: translateY(-50%) scale(1.08);
}

.gallery-lightbox__nav svg {
  width: 20px;
  height: 20px;
}

.gallery-lightbox__nav--prev {
  left: 20px;
}

.gallery-lightbox__nav--next {
  right: 20px;
}

/* needed because display:grid above would override the hidden attribute */
.gallery-lightbox__nav[hidden] {
  display: none;
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 768px) {
  .gallery-page {
    padding-top: var(--nav-h, 70px);
  }

  .gallery-page__edition {
    min-height: auto;

    padding: 80px 0 90px;
  }

  .gallery-page__edition .container {
    width: 90%;
  }

  .gallery-page__heading {
    margin-bottom: 38px;
  }

  .gallery-page__year {
    font-size: 20px;

    letter-spacing: 0.28em;
  }

  .gallery-page__title {
    font-size: clamp(30px, 9vw, 42px);
  }

  .gallery-page__subtitle {
    font-size: 12px;

    letter-spacing: 0.09em;
  }

  .gallery-page__heading::after {
    margin-top: 18px;

    width: 55px;
  }

  .gallery-page__grid {
    --bs-gutter-x: 14px;
    --bs-gutter-y: 14px;
  }

  .gallery-page__item {
    border-radius: 3px;
  }

  .gallery-lightbox {
    padding: 20px;
  }

  .gallery-lightbox__stage img {
    max-width: 94vw;
    max-height: 82vh;
  }

  .gallery-lightbox__close {
    top: 16px;
    right: 16px;

    width: 38px;
    height: 38px;
  }

  .gallery-lightbox__nav {
    width: 34px;
    height: 34px;
  }

  .gallery-lightbox__nav--prev {
    left: 8px;
  }

  .gallery-lightbox__nav--next {
    right: 8px;
  }
}

/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 480px) {
  .gallery-page__edition {
    padding: 65px 0 75px;
  }

  .gallery-page__heading {
    margin-bottom: 30px;
  }

  .gallery-page__title {
    font-size: 30px;
  }

  .gallery-page__subtitle {
    font-size: 11px;
  }

  .gallery-page__item {
    aspect-ratio: 1 / 1;
  }
}

/* ---------- Fixed back button (look comes from .custom-btn) ---------- */
.gallery-back {
  position: fixed;
  top: calc(var(--nav-h, 76px) + 16px); /* just below the fixed header */
  left: clamp(12px, 2vw, 28px);
  z-index: 50; /* below the lightbox */
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.gallery-back svg {
  width: 18px;
  height: 18px;
  flex: none;
}
