.gallery-page {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

.gallery-hero {
  text-align: center;
  padding: 2rem 1rem 2.5rem;
}

.gallery-kicker {
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #9fb3c8;
  margin-bottom: 0.75rem;
}

.gallery-hero h1 {
  font-size: clamp(2.4rem, 4vw, 4rem);
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: #f5f7fb;
}

.gallery-subtext {
  max-width: 620px;
  margin: 0 auto;
  color: #b7c0cc;
  font-size: 1.05rem;
  line-height: 1.7;
}

.gallery-feed-section {
  width: 100%;
}

.gallery-status {
  text-align: center;
  color: #9eabb8;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.gallery-masonry {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 220px;
  gap: 0.75rem;
}

.gallery-card {
  border-radius: 14px;
  overflow: hidden;
  background: #11161d;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  position: relative;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.gallery-card.wide { grid-column: span 2; }
.gallery-card.tall { grid-row: span 2; }
.gallery-card.big  { grid-column: span 2; grid-row: span 2; }

.gallery-card:hover {
  transform: scale(1.02);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.32);
  z-index: 1;
}

.gallery-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.35s ease, filter 0.35s ease;
}

.gallery-card:hover img {
  transform: scale(1.04);
  filter: brightness(1.05);
}

.gallery-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0));
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.gallery-card:hover::after {
  opacity: 1;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 12, 0.94);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 2rem;
}

.lightbox.active {
  display: flex;
}

.lightbox-inner {
  position: relative;
  max-width: 92vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox img {
  max-width: 92vw;
  max-height: 80vh;
  width: auto;
  height: auto;
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}

.lightbox-counter {
  margin-top: 1rem;
  color: #d9e1ea;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
}

.lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: none;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  font-size: 1.8rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: scale(1.05);
}

.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.lightbox-arrow:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-50%) scale(1.05);
}

.lightbox-prev {
  left: 1.5rem;
}

.lightbox-next {
  right: 1.5rem;
}

@media (max-width: 1100px) {
  .gallery-masonry {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 200px;
  }
}

@media (max-width: 680px) {
  .gallery-page {
    padding: 1.5rem 0.75rem 3rem;
  }

  .gallery-masonry {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 160px;
    gap: 0.5rem;
  }

  .gallery-card.wide,
  .gallery-card.big { grid-column: span 2; }
  .gallery-card.tall,
  .gallery-card.big { grid-row: span 2; }

  .gallery-card {
    border-radius: 12px;
  }

  .lightbox {
    padding: 1rem;
  }

  .lightbox-inner {
    max-height: 90vh;
    width: 100%;
  }

  .lightbox img {
    max-width: 100%;
    max-height: 68vh;
    border-radius: 14px;
  }

  .lightbox-arrow {
    width: 44px;
    height: 44px;
    font-size: 1.7rem;
  }

  .lightbox-prev {
    left: 0.75rem;
  }

  .lightbox-next {
    right: 0.75rem;
  }

  .lightbox-close {
    top: 0.75rem;
    right: 0.75rem;
    width: 42px;
    height: 42px;
  }
}

@media (hover: none) {
  .gallery-card:hover {
    transform: none;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  }

  .gallery-card:hover img {
    transform: none;
    filter: none;
  }

  .gallery-card:hover::after {
    opacity: 0;
  }
}