/* Gallery page — hero, filters, scalable masonry grid, lightbox */

.gallery-page {
  padding-top: 4.25rem;
  background: #f9f9f9;
  min-height: 100vh;
  overflow-x: clip;
}

.gallery-page__container {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
}

/* Hero — matches services / about inner pages */
.gallery-page-hero {
  position: relative;
  min-height: 280px;
  max-height: 420px;
  overflow: hidden;
  background: #014d33;
}

.gallery-page-hero__image {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
}

.gallery-page-hero__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(2rem, 4vw, 2.75rem) 0;
  background: linear-gradient(180deg, rgba(1, 30, 20, 0.25) 0%, rgba(1, 77, 51, 0.92) 100%);
  color: #ffffff;
}

.gallery-page-hero__label {
  display: inline-block;
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #f7af28;
  margin-bottom: 0.75rem;
}

.gallery-page-hero__title {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: clamp(1.875rem, 4vw, 2.75rem);
  line-height: 1.1;
  font-weight: 600;
  color: #ffffff;
  margin: 0 0 0.75rem;
  max-width: 28rem;
}

.gallery-page-hero__lead {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.88);
  max-width: 40rem;
  margin: 0 0 1.75rem;
}

.gallery-page__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 28rem;
}

@media (min-width: 768px) {
  .gallery-page__stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
  }
}

.gallery-page__stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 0.875rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-left: 3px solid #f7af28;
  backdrop-filter: blur(8px);
}

.gallery-page__stat-num {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  font-weight: 700;
  line-height: 1;
  color: #ffffff;
}

.gallery-page__stat-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.75);
}

/* Gallery body */
.gallery-page__body {
  padding: clamp(2rem, 4vw, 3rem) 0 clamp(3rem, 6vw, 5rem);
}

.gallery-page__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin-bottom: clamp(1.5rem, 3vw, 2rem);
  padding: 1.25rem 1.35rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 20px rgba(1, 102, 68, 0.04);
}

.gallery-page__count {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #016644;
  margin: 0;
}

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.gallery-filters__btn {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #3f4947;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.gallery-filters__btn:hover {
  color: #016644;
  border-color: rgba(1, 102, 68, 0.35);
}

.gallery-filters__btn.is-active {
  color: #ffffff;
  background: #016644;
  border-color: #016644;
  box-shadow: 0 4px 14px rgba(1, 102, 68, 0.22);
}

/* Page gallery grid — extends homepage gallery-grid */
.gallery-grid--page {
  transition: min-height 0.35s ease;
}

.gallery-grid--page.is-shuffling {
  pointer-events: none;
}

.gallery-grid__empty {
  grid-column: 1 / -1;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  color: #3f4947;
  text-align: center;
  padding: 3.5rem 1.5rem;
  background: #ffffff;
  border: 1px dashed #e2e8f0;
}

/* Interactive card buttons (lightbox) */
button.gallery-card--btn {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  padding: 0;
  font: inherit;
  text-align: left;
  cursor: zoom-in;
  background: #014d33;
}

button.gallery-card--btn:focus-visible {
  outline: 2px solid #f7af28;
  outline-offset: 3px;
}

.gallery-card__media--img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: center center;
  transition: transform 0.8s ease;
  will-change: transform;
}

button.gallery-card--btn:hover .gallery-card__media--img {
  transform: scale(1.06);
}

.gallery-card__cat {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 2;
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #251a00;
  background: #f7af28;
  padding: 0.35rem 0.55rem;
  line-height: 1;
  pointer-events: none;
}

.gallery-card__zoom {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  font-size: 1.125rem;
  color: #f7af28;
  background: rgba(1, 45, 30, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(6px);
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.35s ease, transform 0.35s ease, background 0.35s ease;
  pointer-events: none;
}

button.gallery-card--btn:hover .gallery-card__zoom,
button.gallery-card--btn:focus-visible .gallery-card__zoom {
  opacity: 1;
  transform: scale(1);
}

/* Initial hidden state before GSAP entrance */
@media (prefers-reduced-motion: no-preference) {
  .gallery-grid--page .gallery-card {
    opacity: 0;
  }
}

/* Lightbox */
.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.gallery-lightbox[hidden] {
  display: none;
}

.gallery-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(1, 20, 14, 0.92);
  backdrop-filter: blur(6px);
  border: none;
  cursor: pointer;
}

.gallery-lightbox__dialog {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
  max-height: min(90vh, 720px);
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

.gallery-lightbox__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
}

.gallery-lightbox__title {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 1.0625rem;
  font-weight: 600;
  color: #014d33;
  margin: 0;
}

.gallery-lightbox__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #016644;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.gallery-lightbox__close:hover {
  background: #e8f5ef;
  border-color: rgba(1, 102, 68, 0.25);
}

.gallery-lightbox__body {
  background: #0f1110;
  line-height: 0;
}

.gallery-lightbox__img {
  display: block;
  width: 100%;
  max-height: min(62vh, 520px);
  object-fit: contain;
  margin: 0 auto;
}

.gallery-lightbox__caption {
  font-family: 'Inter', sans-serif;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #3f4947;
  margin: 0;
  padding: 1rem 1.25rem 1.25rem;
}

.gallery-page .nav-link--active {
  color: #014d33;
}

@media (prefers-reduced-motion: reduce) {
  .gallery-grid--page .gallery-card {
    opacity: 1 !important;
  }

  button.gallery-card--btn,
  .gallery-card__media--img {
    transition: none !important;
    transform: none !important;
  }
}
