﻿/* ==========================================================================
   GALLERY PAGE â€” gallery.css
   Gibeon Builders Construction | Exhibit 2
   ========================================================================== */


/* --------------------------------------------------------------------------
   1. HERO BANNER
   -------------------------------------------------------------------------- */

.gallery-hero {
  position: relative;
  min-height: 50vh;
  background: var(--color-stone);
  display: flex;
  align-items: center;
  overflow: hidden;
}

/* Ghost background text */
.gallery-hero-bg-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-size: clamp(120px, 16vw, 220px);
  font-weight: 700;
  line-height: 1;
  color: rgba(17, 17, 16, 0.04);
  letter-spacing: -0.04em;
  user-select: none;
  pointer-events: none;
  white-space: nowrap;
}

/* Breadcrumb â€” absolute, ink-colored */
.gallery-hero-breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
}

.gallery-hero-breadcrumb a,
.gallery-hero-breadcrumb .bc-current {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.gallery-hero-breadcrumb a {
  color: rgba(17, 17, 16, 0.35);
  text-decoration: none;
  transition: color 0.2s;
}

.gallery-hero-breadcrumb a:hover {
  color: var(--color-ink);
}

.gallery-hero-breadcrumb .bc-sep {
  color: var(--color-red);
  font-size: 13px;
}

.gallery-hero-breadcrumb .bc-current {
  color: rgba(17, 17, 16, 0.7);
}

/* Content block */
.gallery-hero-content {
  position: relative;
  z-index: 2;
  padding: 140px 0 100px;
}

/* Hero label */
.gallery-hero-content .hero-label {
  display: block;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--color-red);
  margin-bottom: 20px;
}

/* Hero heading */
.gallery-hero-title {
  font-family: var(--font-display);
  font-size: clamp(52px, 7vw, 96px);
  font-weight: 700;
  color: var(--color-ink);
  line-height: 0.92;
  letter-spacing: -0.02em;
  margin: 0;
}

/* Individual character spans injected by JS */
.gallery-hero-title .char {
  display: inline-block;
  overflow: hidden;
}

.gallery-hero-title .char-inner {
  display: inline-block;
  clip-path: inset(0 0 100% 0);
}

/* Hero subtext */
.gallery-hero-sub {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 300;
  color: var(--color-muted);
  max-width: 440px;
  margin: 24px 0 0;
  opacity: 0;
}

/* Count badge */
.gallery-count-badge {
  position: absolute;
  bottom: 40px;
  right: 80px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(17, 17, 16, 0.5);
  border: 1px solid rgba(17, 17, 16, 0.12);
  padding: 10px 20px;
}


/* --------------------------------------------------------------------------
   2. FILTER BAR
   -------------------------------------------------------------------------- */

.gallery-filter-bar {
  background: var(--color-white);
  padding: 28px 0;
  border-bottom: 1px solid rgba(17, 17, 16, 0.07);
  border-top: 1px solid rgba(17, 17, 16, 0.07);
  position: sticky;
  top: var(--nav-height);
  z-index: 50;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.gallery-filter-bar .filter-bar-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 80px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.filter-btns {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.gallery-filter-bar .filter-btn {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-ink);
  background: transparent;
  border: 1.5px solid rgba(0, 0, 0, 0.18);
  border-radius: 100px;
  padding: 9px 22px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}

.gallery-filter-bar .filter-btn:hover {
  border-color: var(--color-ink);
}

.gallery-filter-bar .filter-btn.active {
  background: var(--color-red);
  color: var(--color-white);
  border-color: var(--color-red);
  box-shadow: 0 4px 16px rgba(184, 19, 26, 0.3);
}

.filter-count {
  margin-left: auto;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: rgba(14, 14, 13, 0.45);
  white-space: nowrap;
}


/* --------------------------------------------------------------------------
   3. MASONRY GALLERY
   -------------------------------------------------------------------------- */

.gallery-section {
  background: var(--color-white);
  padding: 60px 0 120px;
}

.gallery-masonry {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 80px;
  column-count: 3;
  column-gap: 10px;
}

/* Each item */
.gallery-item {
  break-inside: avoid;
  margin-bottom: 10px;
  position: relative;
  overflow: hidden;
  border-radius: 2px;
  cursor: pointer;
  display: block;
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.4s ease;
}

.gallery-item:hover img {
  transform: scale(1.04);
  filter: brightness(1.08);
}

/* Hover overlay */
.gallery-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(184, 19, 26, 0.6) 0%,
    rgba(0, 0, 0, 0.5) 100%
  );
  opacity: 0;
  transition: opacity 0.35s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-item:hover .gallery-item-overlay {
  opacity: 1;
}

/* Plus icon circle */
.gallery-plus-circle {
  width: 52px;
  height: 52px;
  border: 1.5px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transform: scale(0.5);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-plus-circle svg {
  width: 20px;
  height: 20px;
}

.gallery-item:hover .gallery-plus-circle {
  transform: scale(1);
}

/* Category label â€” slides up from bottom */
.gallery-category-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(17, 17, 16, 0.75);
  padding: 8px 14px;
  font-family: var(--font-body);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-item:hover .gallery-category-label {
  transform: translateY(0);
}

/* Focus ring */
.gallery-item:focus-visible {
  outline: 3px solid var(--color-red);
  outline-offset: 3px;
}

/* Hidden (filtered) */
.gallery-item.filtered-out {
  display: none;
}


/* --------------------------------------------------------------------------
   4. DOWNLOAD BUTTON
   -------------------------------------------------------------------------- */

.gallery-download-wrap {
  max-width: var(--container-max);
  margin: 48px auto 0;
  padding: 0 80px;
  display: flex;
  justify-content: center;
}

.gallery-download-btn {
  display: inline-block;
  border: 1px solid rgba(17, 17, 16, 0.2);
  border-radius: 100px;
  padding: 14px 36px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted);
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.gallery-download-btn:hover {
  border-color: var(--color-red);
  color: var(--color-red);
  background: rgba(184, 19, 26, 0.04);
}


/* --------------------------------------------------------------------------
   5. LIGHTBOX
   -------------------------------------------------------------------------- */

#lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(0, 0, 0, 0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

#lightbox.open {
  opacity: 1;
  pointer-events: all;
}

/* Image wrap */
.lightbox-img-wrap {
  position: relative;
  max-width: 88vw;
  max-height: 86vh;
  transform: scale(0.92);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#lightbox.open .lightbox-img-wrap {
  transform: scale(1);
}

#lightbox-img {
  max-width: 88vw;
  max-height: 86vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 2px;
}

/* Close button */
#lb-close {
  position: fixed;
  top: 28px;
  right: 32px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: white;
  font-size: 22px;
  font-weight: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s, border-color 0.2s;
  line-height: 1;
}

#lb-close:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Prev / Next */
#lb-prev,
#lb-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

#lb-prev { left: 32px; }
#lb-next { right: 32px; }

#lb-prev:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-50%) scale(1.05);
}

#lb-next:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-50%) scale(1.05);
}

/* Counter */
#lb-counter {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

/* Category label */
#lb-category {
  position: fixed;
  bottom: 32px;
  left: 32px;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-red);
}


/* --------------------------------------------------------------------------
   6. RESPONSIVE
   -------------------------------------------------------------------------- */

@media (max-width: 1024px) {
  .gallery-masonry {
    column-count: 3;
    padding: 0 48px;
  }

  .gallery-filter-bar .filter-bar-inner {
    padding: 0 48px;
  }

  .gallery-download-wrap {
    padding: 0 48px;
  }

  .gallery-count-badge {
    right: 48px;
  }
}

@media (max-width: 768px) {
  .gallery-hero {
    min-height: 44vh;
  }

  .gallery-hero-content {
    padding: 100px 0 72px;
  }

  .gallery-hero-title {
    font-size: clamp(44px, 10vw, 72px);
  }

  .gallery-hero-bg-text {
    font-size: clamp(90px, 20vw, 140px);
  }

  .gallery-count-badge {
    bottom: 20px;
    right: 24px;
    font-size: 10px;
    padding: 8px 16px;
  }

  .gallery-filter-bar {
    position: static;
    padding: 16px 0;
  }

  .gallery-filter-bar .filter-bar-inner {
    padding: 0 24px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .gallery-filter-bar .filter-btn {
    gap: 6px;
    font-size: 10px;
    padding: 8px 14px;
  }

  .filter-count {
    margin-left: 0;
    width: 100%;
    order: 3;
  }

  .gallery-masonry {
    column-count: 2;
    column-gap: 6px;
    padding: 0 24px;
  }

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

  .gallery-download-wrap {
    padding: 0 24px;
  }

  #lb-prev { left: 16px; width: 44px; height: 44px; }
  #lb-next { right: 16px; width: 44px; height: 44px; }

  #lb-counter { bottom: 20px; }
}

@media (max-width: 480px) {
  .gallery-hero-title {
    font-size: clamp(38px, 10vw, 56px);
  }

  .gallery-masonry {
    column-count: 2;
    column-gap: 4px;
  }

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

  #lb-prev,
  #lb-next {
    width: 40px;
    height: 40px;
  }

  #lb-category {
    display: none;
  }
}
