:root {
  --gallery-surface: rgba(255, 255, 255, 0.94);
  --gallery-line: rgba(148, 163, 184, 0.35);
  --gallery-muted: #475569;
  --gallery-shadow: 0 22px 44px rgba(15, 23, 42, 0.12);
}

.gallery-page {
  padding-bottom: 4rem;
}

.gallery-hero {
  padding-bottom: 1rem;
}

.gallery-kicker {
  margin: 0 0 0.8rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9a3412;
}

.gallery-intro {
  max-width: 46rem;
  color: var(--gallery-muted);
}

.gallery-section {
  padding-top: 1rem;
}

.gallery-empty,
.gallery-filters {
  margin-bottom: 1rem;
}

.gallery-filters {
  display: grid;
  gap: 0.9rem;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.filter-label {
  font-weight: 700;
  color: #0f172a;
}

.filter-chip {
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #1e293b;
  padding: 0.6rem 0.9rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.filter-chip.is-active {
  background: #c2410c;
  border-color: #c2410c;
  color: #fff;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

.gallery-card {
  display: grid;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--gallery-line);
  border-radius: 20px;
  background: var(--gallery-surface);
  box-shadow: var(--gallery-shadow);
  content-visibility: auto;
}

.gallery-card[hidden] {
  display: none;
}

.gallery-trigger {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.gallery-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 16px;
  background: #dbe4f0;
  user-select: none;
}

.gallery-copy h2 {
  margin: 0 0 0.3rem;
  font-size: 1rem;
}

.gallery-copy p,
.gallery-status {
  margin: 0;
  color: var(--gallery-muted);
}

.gallery-status {
  padding-top: 0.8rem;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.88);
}

.lightbox-dialog {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
  max-height: 100%;
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35);
}

.lightbox-media {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
}

.lightbox-media img {
  display: block;
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  user-select: none;
}

.lightbox-close,
.lightbox-nav {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  cursor: pointer;
}

.lightbox-close {
  justify-self: end;
  width: 44px;
  height: 44px;
  font-size: 1.5rem;
}

.lightbox-nav {
  width: 44px;
  height: 44px;
  font-size: 1.6rem;
}

.lightbox-meta h2,
.lightbox-meta p {
  margin: 0;
}

.lightbox-counter {
  margin-bottom: 0.4rem;
  color: #cbd5e1;
}

@media (max-width: 720px) {
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lightbox-dialog {
    padding: 0.85rem;
  }

  .lightbox-media {
    grid-template-columns: 1fr;
  }

  .lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
  }

  .lightbox-nav.prev {
    left: 0.8rem;
  }

  .lightbox-nav.next {
    right: 0.8rem;
  }
}
