/* ============================================================
   LOXLEY FOREST — GALLERY PAGE STYLES
   ============================================================ */

/* --- Gallery Header --- */
.gallery-header {
  padding-top: 160px;
  padding-bottom: 48px;
  background-color: var(--linen);
}

/* --- Filters --- */
.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 36px;
}

.gallery-filter {
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--stone);
  background: none;
  border: 1px solid var(--parchment);
  padding: 10px 20px;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.gallery-filter:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.gallery-filter.active {
  background-color: var(--forest-deep);
  border-color: var(--forest-deep);
  color: var(--linen);
}

/* --- Masonry Grid --- */
.gallery-grid {
  columns: 3;
  column-gap: 16px;
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
  border-radius: 2px;
  cursor: pointer;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.gallery-item .placeholder-img {
  aspect-ratio: 4 / 3;
  width: 100%;
  transition: transform 0.5s var(--ease-natural);
}

.gallery-item--tall .placeholder-img {
  aspect-ratio: 3 / 4;
}

.gallery-item:hover .placeholder-img {
  transform: scale(1.04);
}

/* Hover overlay with caption */
.gallery-item__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(26, 46, 26, 0.8) 0%, transparent 50%);
  display: flex;
  align-items: flex-end;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.4s ease;
}

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

.gallery-item__caption {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 17px;
  font-style: italic;
  color: var(--linen);
  line-height: 1.5;
}

/* --- Lightbox --- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(26, 46, 26, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

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

.lightbox__close {
  position: absolute;
  top: 24px;
  right: 32px;
  font-size: 36px;
  color: var(--linen);
  background: none;
  border: none;
  cursor: pointer;
  z-index: 2;
  line-height: 1;
  transition: color 0.3s ease;
}

.lightbox__close:hover {
  color: var(--gold);
}

.lightbox__prev,
.lightbox__next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 48px;
  color: var(--linen);
  background: none;
  border: none;
  cursor: pointer;
  z-index: 2;
  padding: 16px;
  line-height: 1;
  transition: color 0.3s ease;
}

.lightbox__prev:hover,
.lightbox__next:hover {
  color: var(--gold);
}

.lightbox__prev {
  left: 24px;
}

.lightbox__next {
  right: 24px;
}

.lightbox__content {
  max-width: 85vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox__image-wrap {
  max-width: 100%;
  max-height: 75vh;
  overflow: hidden;
  border-radius: 2px;
}

.lightbox__image {
  width: 70vw;
  height: 50vh;
  max-width: 1000px;
}

.lightbox__caption {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 19px;
  font-style: italic;
  color: var(--linen);
  margin-top: 20px;
  text-align: center;
  opacity: 0.85;
}

/* ============================================================
   RESPONSIVE — GALLERY
   ============================================================ */

@media (max-width: 1199px) {
  .gallery-grid {
    columns: 2;
  }
}

@media (max-width: 767px) {
  .gallery-header {
    padding-top: 120px;
    padding-bottom: 36px;
  }

  .gallery-grid {
    columns: 2;
    column-gap: 10px;
  }

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

  .gallery-filters {
    gap: 6px;
  }

  .gallery-filter {
    font-size: 10px;
    padding: 8px 14px;
    letter-spacing: 1px;
    min-height: 36px;
  }

  /* Lightbox mobile */
  .lightbox__content {
    max-width: 96vw;
    max-height: 90vh;
  }

  .lightbox__image-wrap {
    max-height: 70vh;
  }

  .lightbox__image {
    width: 96vw;
    height: auto;
    max-height: 65vh;
  }

  .lightbox__prev,
  .lightbox__next {
    font-size: 28px;
    padding: 12px;
    min-width: 44px;
    min-height: 44px;
  }

  .lightbox__prev {
    left: 4px;
  }

  .lightbox__next {
    right: 4px;
  }

  .lightbox__close {
    top: 12px;
    right: 12px;
    font-size: 32px;
    min-width: 44px;
    min-height: 44px;
  }

  .lightbox__caption {
    font-size: 16px;
    padding: 0 16px;
  }

  /* Touch-friendly overlay always visible on mobile */
  .gallery-item__overlay {
    opacity: 0;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    columns: 1;
  }

  .gallery-item .placeholder-img {
    aspect-ratio: 3 / 2;
  }
}

@media (max-width: 380px) {
  .gallery-header {
    padding-top: 110px;
  }

  .gallery-filter {
    font-size: 9px;
    padding: 7px 10px;
  }
}
