/* Page wrapper */
.gallery-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

/* Hero */
.gallery-hero {
  margin: 8px 0 16px;
}

.gallery-hero__inner {
  padding: 18px 16px;
  border-radius: 14px;
  background: #f6f7f9;
}

.gallery-hero h1 {
  margin: 0 0 6px;
  font-size: 32px;
  line-height: 1.1;
}

.gallery-hero p {
  margin: 0;
  opacity: 0.85;
}

/* Filters */
.gallery-controls {
  margin: 16px 0 18px;
}

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.gallery-filter {
  border: 1px solid rgba(0,0,0,0.18);
  background: #fff;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
}

.gallery-filter.is-active {
  border-color: rgba(0,0,0,0.55);
  font-weight: 600;
}

/* Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

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

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

/* Items */
.gallery-item {
  margin: 0;
}

.gallery-item__btn {
  width: 100%;
  text-align: left;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  display: block;
}

.gallery-item__btn img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  border-radius: 14px;
  display: block;
  box-shadow: 0 10px 20px rgba(0,0,0,0.08);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.gallery-item__btn:hover img {
  transform: scale(1.01);
  box-shadow: 0 14px 26px rgba(0,0,0,0.12);
}

.gallery-item__caption {
  margin-top: 8px;
  font-size: 14px;
  opacity: 0.9;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
}

.lightbox.is-open {
  display: block;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
}

.lightbox__dialog {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  align-items: center;
  padding: 18px;
}

@media (max-width: 700px) {
  .lightbox__dialog {
    grid-template-columns: 40px 1fr 40px;
    padding: 10px;
  }
}

.lightbox__content {
  background: #111;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0,0,0,0.35);
  max-height: calc(100vh - 60px);
}

.lightbox__img {
  width: 100%;
  height: auto;
  max-height: calc(100vh - 140px);
  object-fit: contain;
  display: block;
  background: #111;
}

.lightbox__caption {
  padding: 10px 12px;
  color: #fff;
  font-size: 14px;
  opacity: 0.9;
}

.lightbox__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(0,0,0,0.45);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.lightbox__nav {
  height: 52px;
  width: 52px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(0,0,0,0.45);
  color: #fff;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  justify-self: center;
}

@media (max-width: 700px) {
  .lightbox__nav {
    height: 42px;
    width: 42px;
    font-size: 26px;
  }
}