/*
=============================================================
TRILOGIX INSTITUTE WEBSITE
File: gallery-phase14-1.css
Purpose: Phase 14.1 responsive campus selector and album lightbox refinements.

Maintenance notes:
- This file intentionally loads after the legacy gallery CSS files.
- Mobile campus selector rules override older horizontal-scroll behavior.
- Lightbox rules are additive and preserve the existing visual language.
=============================================================
*/

/*
FEATURE: CAMPUS SELECTOR RESPONSIVENESS
Desktop/tablet (>= 768px): all campus choices remain in one horizontal row.
Small screens (< 768px): each campus choice becomes a full-width row.
*/
@media (min-width: 768px) {
  .gallery-catalog .gallery-campus-switch {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    width: max-content !important;
    max-width: 100% !important;
    overflow: visible !important;
  }

  .gallery-catalog .gallery-campus-switch button {
    flex: 0 0 auto !important;
    width: auto !important;
    justify-content: center !important;
  }
}

@media (max-width: 767.98px) {
  .gallery-catalog .gallery-campus-switch {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: .45rem !important;
    width: 100% !important;
    max-width: none !important;
    overflow: visible !important;
    padding: .42rem !important;
  }

  .gallery-catalog .gallery-campus-switch button,
  .gallery-catalog .gallery-campus-switch button:first-child {
    display: flex !important;
    width: 100% !important;
    min-width: 0 !important;
    justify-content: flex-start !important;
    padding: .84rem 1rem !important;
    font-size: .8rem !important;
  }

  .gallery-catalog .gallery-campus-switch button img {
    width: 24px !important;
    height: 16px !important;
  }
}

/*
FEATURE: ALBUM CARD CTA
Keeps the action readable now that gallery items represent albums/events.
*/
.photo-details > span:last-child {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

/*
FEATURE: ALBUM LIGHTBOX
The lightbox is viewport-fixed and supports single-photo albums today and
multi-photo albums later without changing the public card markup.
*/
.gallery-lightbox[hidden] {
  display: none !important;
}

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

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100000;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 3vw, 2.5rem);
  background: rgba(2, 12, 32, .92);
  backdrop-filter: blur(10px);
}

.gallery-lightbox .lightbox-content {
  width: min(1120px, calc(100vw - 7rem));
  max-height: calc(100vh - 4rem);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 22px;
  background: #071630;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .45);
}

.gallery-lightbox .lightbox-stage {
  display: grid;
  place-items: center;
  min-height: min(68vh, 720px);
  background: #020918;
}

.gallery-lightbox .lightbox-stage img {
  display: block;
  width: 100%;
  height: min(68vh, 720px);
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.gallery-lightbox .lightbox-information {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.15rem 1.35rem 1.3rem;
  color: #fff;
}

.gallery-lightbox #lightboxCategory {
  display: inline-block;
  margin-bottom: .3rem;
  color: #8db8ff;
  font-size: .73rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.gallery-lightbox #lightboxTitle {
  margin: 0;
  color: #fff;
  font-size: clamp(1.05rem, 2vw, 1.45rem);
}

.gallery-lightbox .lightbox-caption {
  margin: .35rem 0 .45rem;
  color: rgba(255, 255, 255, .68);
  font-size: .86rem;
  line-height: 1.55;
}

.gallery-lightbox #lightboxCampus {
  margin: 0;
  color: rgba(255, 255, 255, .72);
  font-size: .8rem;
}

.gallery-lightbox #lightboxCounter {
  flex: 0 0 auto;
  padding: .5rem .7rem;
  border-radius: 999px;
  background: rgba(255,255,255,.09);
  font-size: .78rem;
}

.gallery-lightbox .lightbox-close,
.gallery-lightbox .lightbox-nav {
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .16);
  color: #fff;
  background: rgba(5, 20, 48, .72);
  backdrop-filter: blur(10px);
  transition: background .2s ease, transform .2s ease;
}

.gallery-lightbox .lightbox-close:hover,
.gallery-lightbox .lightbox-nav:hover {
  background: #0754c5;
}

.gallery-lightbox .lightbox-close {
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

.gallery-lightbox .lightbox-nav {
  top: 50%;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  transform: translateY(-50%);
}

.gallery-lightbox .lightbox-prev { left: 1rem; }
.gallery-lightbox .lightbox-next { right: 1rem; }

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

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

@media (max-width: 767.98px) {
  .gallery-lightbox {
    padding: .7rem;
  }

  .gallery-lightbox .lightbox-content {
    width: 100%;
    max-height: calc(100vh - 1.4rem);
    border-radius: 17px;
  }

  .gallery-lightbox .lightbox-stage {
    min-height: 58vh;
  }

  .gallery-lightbox .lightbox-stage img {
    height: 58vh;
  }

  .gallery-lightbox .lightbox-information {
    padding: .95rem 1rem 1.05rem;
  }

  .gallery-lightbox .lightbox-nav {
    top: auto;
    bottom: 1rem;
    width: 42px;
    height: 42px;
  }

  .gallery-lightbox .lightbox-prev { left: 1rem; }
  .gallery-lightbox .lightbox-next { right: 1rem; }

  .gallery-lightbox .lightbox-close {
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
  }
}
