/* =============================================
   GALLERY PAGE STYLES
   ============================================= */

/* --- GALLERY HERO --- */
.gallery-hero {
  position: relative;
  height: 60vh;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: url('../images/gallery/01-exterior-signage.jpg') center/cover no-repeat;
  background-attachment: fixed;
}

.gallery-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(45,42,38,0.85) 0%, rgba(45,42,38,0.7) 100%);
}

.gallery-hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 20px;
}

.gallery-hero__title {
  font-family: 'Refrigerator Deluxe', sans-serif;
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 900;
  color: var(--cj-cream);
  line-height: 1.1;
  margin: 0 0 20px 0;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.gallery-hero__subtitle {
  font-family: 'Brandon Grotesque', sans-serif;
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 300;
  color: var(--cj-yellow);
  margin: 0;
  letter-spacing: 3px;
  text-transform: uppercase;
}

/* --- FILTER TABS --- */
.gallery-filter {
  position: sticky;
  top: 70px;
  z-index: 100;
  background: var(--cj-black);
  padding: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  border-bottom: 2px solid var(--cj-red);
}

.gallery-filter__btn {
  font-family: 'Brandon Grotesque', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--cj-cream);
  background: transparent;
  border: 1px solid var(--cj-cream);
  padding: 10px 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.gallery-filter__btn:hover,
.gallery-filter__btn--active {
  background: var(--cj-red);
  border-color: var(--cj-red);
  color: var(--cj-white);
}

/* --- GALLERY GRID --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 4px;
  padding: 4px;
  background: var(--cj-black);
}

.gallery-item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.gallery-item:hover {
  transform: scale(1.02);
}

.gallery-item__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-item:hover .gallery-item__img {
  transform: scale(1.1);
}

.gallery-item__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(45,42,38,0.9) 0%, transparent 60%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.gallery-item__caption {
  font-family: 'Brandon Grotesque', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  color: var(--cj-cream);
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
}

/* Hide filtered items */
.gallery-item.hidden {
  display: none;
}

/* --- LIGHTBOX --- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(45,42,38,0.95);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lightbox.active {
  display: flex;
}

.lightbox__img {
  max-width: 90%;
  max-height: 80vh;
  object-fit: contain;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.lightbox__close,
.lightbox__prev,
.lightbox__next {
  position: absolute;
  font-size: 3rem;
  color: var(--cj-cream);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.3s ease;
  font-family: Georgia, serif;
}

.lightbox__close:hover,
.lightbox__prev:hover,
.lightbox__next:hover {
  color: var(--cj-red);
}

.lightbox__close {
  top: 20px;
  right: 30px;
  font-size: 4rem;
  line-height: 1;
}

.lightbox__prev {
  left: 20px;
}

.lightbox__next {
  right: 20px;
}

.lightbox__caption {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Brandon Grotesque', sans-serif;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--cj-cream);
  text-transform: uppercase;
  letter-spacing: 2px;
  text-align: center;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
  .gallery-hero {
    height: 50vh;
    min-height: 300px;
    background-attachment: scroll;
  }

  .gallery-hero__title {
    font-size: clamp(2rem, 8vw, 3rem);
  }

  .gallery-filter {
    top: 60px;
    padding: 15px;
  }

  .gallery-filter__btn {
    font-size: 0.75rem;
    padding: 8px 15px;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 2px;
  }

  .lightbox__prev,
  .lightbox__next {
    font-size: 2.5rem;
    padding: 10px;
  }

  .lightbox__caption {
    font-size: 0.9rem;
    bottom: 20px;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-item__caption {
    font-size: 0.8rem;
  }
}
