/* ============================================================================
   GALLERY PAGE — Markcon layout extensions
   Builds on css/home-markcon.css (the `.markcon-home` design tokens are in
   scope because the gallery content is wrapped in `.markcon-home`). Contains
   the bento mosaic, category filter, and a restyled lightbox.
   ============================================================================ */

/* ----- Hero tuning ----- */
.gallery-markcon .mc-hero {
  min-height: 720px;
}

.gallery-markcon .mc-hero__inner {
  align-items: center;
}

.gl-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 26px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.gl-breadcrumb a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color 0.25s ease;
}

.gl-breadcrumb a:hover {
  color: var(--mc-gold-2);
}

.gl-breadcrumb span {
  color: var(--mc-gold-2);
}

.gl-breadcrumb__icon {
  width: 14px;
  height: 14px;
  color: rgba(255, 255, 255, 0.5);
}

/* ===================== THE COLLECTION ===================== */
.gl-collection {
  padding: clamp(80px, 9vw, 150px) 0;
  color: #fff;
  background: #030812;
}

.gl-collection .mc-section-head {
  margin-bottom: 48px;
  align-items: end;
}

.gl-collection .mc-section-head h2 {
  color: #fff;
}

.gl-lead {
  max-width: 560px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 1.08rem;
  line-height: 1.7;
}

.gl-count {
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.gl-count strong {
  color: var(--mc-gold-2);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 900;
}

.gl-count span {
  margin: 0 6px;
  color: rgba(255, 255, 255, 0.3);
}

/* ----- Filter pills ----- */
.gl-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.gl-filter__btn {
  padding: 12px 22px;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.25s ease, background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.gl-filter__btn:hover {
  transform: translateY(-2px);
  border-color: rgba(217, 173, 69, 0.5);
}

.gl-filter__btn.is-active {
  color: #07111f;
  background: var(--mc-gold-2);
  border-color: var(--mc-gold-2);
}

/* ----- Bento mosaic grid ----- */
.gl-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 220px;
  grid-auto-flow: dense;
  gap: 16px;
}

.gl-tile {
  position: relative;
  display: block;
  overflow: hidden;
  padding: 0;
  border: none;
  border-radius: 20px;
  background: var(--mc-blue);
  cursor: pointer;
  isolation: isolate;
}

.gl-tile--lg {
  grid-column: span 2;
  grid-row: span 2;
}

.gl-tile--tall {
  grid-row: span 2;
}

.gl-tile--wide {
  grid-column: span 2;
}

.gl-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.gl-tile:hover img {
  transform: scale(1.06);
}

.gl-tile__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  padding: 22px;
  text-align: left;
  background: linear-gradient(to top, rgba(3, 8, 18, 0.86) 0%, rgba(3, 8, 18, 0.18) 48%, transparent 78%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gl-tile:hover .gl-tile__overlay,
.gl-tile:focus-visible .gl-tile__overlay {
  opacity: 1;
}

.gl-tile__tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mc-gold-2);
}

.gl-tile__tag-icon {
  width: 14px;
  height: 14px;
}

.gl-tile__caption {
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
}

.gl-tile__zoom {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: #07111f;
  background: var(--mc-gold-2);
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.gl-tile:hover .gl-tile__zoom,
.gl-tile:focus-visible .gl-tile__zoom {
  opacity: 1;
  transform: scale(1);
}

.gl-tile__zoom-icon {
  width: 18px;
  height: 18px;
}

.gl-tile.is-hidden {
  display: none;
}

.gl-empty {
  margin: 40px 0 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 600;
}

/* ===================== LIGHTBOX ===================== */
.gl-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(20px, 5vw, 64px);
  background: rgba(2, 5, 11, 0.95);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.gl-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.gl-lightbox__content {
  max-width: 1040px;
  width: 100%;
  margin: 0;
  text-align: center;
}

.gl-lightbox__img {
  width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 18px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
}

.gl-lightbox__caption {
  margin-top: 20px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.98rem;
  font-weight: 600;
}

.gl-lightbox__close,
.gl-lightbox__nav {
  position: fixed;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  cursor: pointer;
  transition: color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}

.gl-lightbox__close:hover,
.gl-lightbox__nav:hover {
  color: #07111f;
  background: var(--mc-gold-2);
  border-color: var(--mc-gold-2);
}

.gl-lightbox__close {
  top: clamp(18px, 3vw, 32px);
  right: clamp(18px, 3vw, 32px);
}

.gl-lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
}

.gl-lightbox__nav:hover {
  transform: translateY(-50%) scale(1.06);
}

.gl-lightbox__nav--prev {
  left: clamp(14px, 3vw, 32px);
}

.gl-lightbox__nav--next {
  right: clamp(14px, 3vw, 32px);
}

.gl-lightbox__icon {
  width: 22px;
  height: 22px;
}

body.gl-lightbox-open {
  overflow: hidden;
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 1024px) {
  .gl-grid {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 200px;
  }
}

@media (max-width: 720px) {
  .gallery-markcon .mc-hero {
    min-height: auto;
  }

  .gl-collection .mc-section-head--split {
    align-items: start;
  }

  .gl-filter {
    justify-content: flex-start;
  }

  .gl-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 160px;
    gap: 12px;
  }

  /* Keep the mosaic readable on small screens: large tiles span the row,
     wide tiles collapse to a single column. */
  .gl-tile--lg {
    grid-column: span 2;
    grid-row: span 2;
  }

  .gl-tile--wide {
    grid-column: span 2;
  }
}

@media (max-width: 460px) {
  .gl-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 240px;
  }

  .gl-tile--lg,
  .gl-tile--wide,
  .gl-tile--tall {
    grid-column: auto;
    grid-row: auto;
  }
}
