:root {
  --gallery-olive: #38452d;
  --gallery-gold: #b58a4a;
  --gallery-cream: #f7f2e9;
  --gallery-line: #ddd4c6;
  --gallery-text: #282822;
  --gallery-muted: #716d64;
}

.gallery-hero {
  position: relative;
  min-height: 430px;
  color: #fff;
  background: url("../imgs/shooting/gabizos.jpg") center 48% / cover no-repeat;
}

.gallery-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(20, 26, 18, .7), rgba(20, 26, 18, .45));
}

.gallery-hero .navbar,
.gallery-hero-content {
  position: relative;
  z-index: 2;
}

.gallery-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
}

.gallery-hero-content {
  padding-top: 105px;
  padding-bottom: 70px;
  text-align: center;
}

.gallery-hero h1 {
  margin: 8px 0 14px;
  font-family: "Playfair Display", serif;
  font-size: clamp(3.2rem, 8vw, 6.3rem);
  line-height: .95;
}

.gallery-hero-content p:last-child {
  max-width: 620px;
  margin: 0 auto;
  color: rgba(255, 255, 255, .88);
}

.gallery-section {
  padding: 70px 0;
  background: var(--gallery-cream);
}

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 38px;
}

.filter-button {
  padding: 10px 18px;
  border: 1px solid var(--gallery-line);
  border-radius: 999px;
  color: var(--gallery-olive);
  background: #fff;
  font: inherit;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  transition: .2s ease;
}

.filter-button:hover,
.filter-button.active {
  border-color: var(--gallery-olive);
  color: #fff;
  background: var(--gallery-olive);
}

.photo-grid {
  display: grid;
  grid-auto-flow: dense;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 220px;
  gap: 14px;
}

.photo-card {
  position: relative;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  background: #ddd;
  cursor: zoom-in;
}

.photo-card.hidden {
  display: none;
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}

.photo-card:hover img {
  transform: scale(1.045);
}

.photo-card::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(transparent 55%, rgba(16, 19, 13, .65));
}

.photo-card span {
  position: absolute;
  z-index: 2;
  right: 16px;
  bottom: 13px;
  left: 16px;
  color: #fff;
  font-size: .77rem;
  font-weight: 700;
  text-align: left;
}

.photo-large {
  grid-column: span 2;
  grid-row: span 2;
}

.photo-wide {
  grid-column: span 2;
}

.photo-tall {
  grid-row: span 2;
}

.gallery-help {
  margin: 22px 0 0;
  color: var(--gallery-muted);
  font-size: .76rem;
  text-align: center;
}

.gallery-lightbox {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: none;
  place-items: center;
  padding: 50px 85px;
  background: rgba(12, 14, 10, .94);
}

.gallery-lightbox.open {
  display: grid;
}

.gallery-lightbox figure {
  margin: 0;
  text-align: center;
}

.gallery-lightbox img {
  width: auto;
  max-width: min(1200px, 86vw);
  max-height: 82vh;
  border-radius: 8px;
}

.gallery-lightbox figcaption {
  margin-top: 12px;
  color: rgba(255,255,255,.85);
  font-size: .85rem;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: fixed;
  border: 0;
  color: #fff;
  background: transparent;
  cursor: pointer;
}

.lightbox-close {
  top: 17px;
  right: 24px;
  font-size: 2.5rem;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  font-size: 2rem;
  transform: translateY(-50%);
}

.lightbox-prev {
  left: 25px;
}

.lightbox-next {
  right: 25px;
}

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

@media (max-width: 560px) {
  .gallery-hero {
    min-height: 360px;
  }

  .gallery-hero .navbar {
    align-items: flex-start;
  }

  .gallery-back {
    margin-top: 12px;
  }

  .photo-grid {
    display: grid;
    grid-template-columns: 1fr;
    grid-auto-rows: 235px;
  }

  .photo-large,
  .photo-wide,
  .photo-tall {
    grid-column: auto;
    grid-row: auto;
  }

  .gallery-lightbox {
    padding: 55px 18px;
  }

  .gallery-lightbox img {
    max-width: 94vw;
  }

  .lightbox-prev,
  .lightbox-next {
    top: auto;
    bottom: 18px;
  }
}
