/* =========================================================
   MaintMan — Gallery page
   ========================================================= */

/* ----- Page header (dark) ----- */
.gal-header {
  background: var(--ink);
  padding: 250px 38px 56px; /* clears the large (top-of-page) header */
}

.gal-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  animation: mm-rise 0.7s ease both;
}

.gal-header h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 64px;
  line-height: 1.04;
  letter-spacing: -0.015em;
  margin: 0 0 18px;
  color: #fff;
}

.gal-lead {
  color: rgba(245, 240, 235, 0.72);
  font-size: 18px;
  line-height: 1.6;
  max-width: 60ch;
  margin: 0;
}

/* ----- Filter bar (sticky) ----- */
.filter-bar {
  position: sticky;
  top: 130px;
  z-index: 40;
  background: rgba(246, 243, 238, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(22, 17, 15, 0.08);
}

.filter-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 38px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-pill {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 13.5px;
  padding: 9px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid rgba(22, 17, 15, 0.14);
  background: #fff;
  color: #3a332d;
}

.filter-pill:hover {
  border-color: rgba(22, 17, 15, 0.3);
}

.filter-pill.is-active {
  border-color: var(--brand-red);
  background: var(--brand-red);
  color: #fff;
}

/* ----- Grid (masonry) ----- */
.gal-grid-section {
  padding: 44px 38px 100px;
  background: var(--page);
}

.gal-grid-inner {
  max-width: 1280px;
  margin: 0 auto;
}

.mm-cols {
  column-count: 3;
  column-gap: 16px;
}

.gal-card {
  break-inside: avoid;
  width: 100%;
  display: block;
  margin: 0 0 16px;
  padding: 0;
  border: none;
  background: var(--dark-surface-alt);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  text-align: left;
  box-shadow: 0 1px 3px rgba(22, 17, 15, 0.08);
}

.gal-card img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.6s ease;
}

.gal-card:hover img {
  transform: scale(1.05);
}

.gal-card .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(18, 13, 11, 0) 45%,
    rgba(18, 13, 11, 0.86) 100%
  );
}

.gal-card .caption {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 16px;
  color: #fff;
  font-weight: 600;
  font-size: 14.5px;
  line-height: 1.45;
}

.gal-card .badge {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 12, 10, 0.72);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  padding: 6px 11px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.gal-card .badge i {
  font-size: 11px;
}

.gal-card.is-hidden {
  display: none;
}

/* ----- Contact CTA (dark) ----- */
.gal-cta {
  background: var(--ink);
  padding: 84px 38px;
}

.gal-cta-inner {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.gal-cta h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 42px;
  line-height: 1.1;
  margin: 0 0 16px;
  color: #fff;
}

.gal-cta p {
  color: rgba(245, 240, 235, 0.7);
  font-size: 17px;
  line-height: 1.6;
  margin: 0 0 30px;
}

.gal-cta-btns {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ----- Lightbox ----- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 30px;
  background: rgba(12, 9, 8, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lightbox.is-open {
  display: flex;
  animation: mm-fade 0.2s ease both;
}

.lb-close {
  position: absolute;
  top: 24px;
  right: 28px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  font-size: 17px;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-prev {
  left: 24px;
}

.lb-next {
  right: 24px;
}

/* Single-photo projects hide nav + counter */
.lightbox.single .lb-nav,
.lightbox.single .lb-counter {
  display: none;
}

.lb-stage {
  max-width: 1100px;
  width: 92%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.lb-img {
  max-width: 100%;
  max-height: 74vh;
  border-radius: 12px;
  object-fit: contain;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.lb-fade {
  animation: mm-fade 0.25s ease both;
}

.lb-meta {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
}

.lb-caption {
  color: #f2ede7;
  font-size: 15.5px;
  font-weight: 500;
  margin: 0;
  text-align: center;
  max-width: 60ch;
}

.lb-counter {
  display: inline-block;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.12);
  padding: 5px 12px;
  border-radius: 999px;
}

/* =========================================================
   Responsive — Gallery
   ========================================================= */
@media (max-width: 980px) {
  .mm-cols {
    column-count: 2;
  }
}

@media (max-width: 880px) {
  .gal-header {
    padding: 120px 22px 48px;
  }

  .gal-header h1 {
    font-size: 46px;
  }

  .filter-bar {
    top: 88px;
  }

  .filter-inner {
    padding: 14px 22px;
  }

  .gal-grid-section {
    padding: 56px 22px;
  }
}

@media (max-width: 560px) {
  .mm-cols {
    column-count: 1;
  }
}
