body[data-page="gallery"] {
  background-color: #f3f7fb;
}

body[data-page="gallery"] main.site-shell {
  padding-top: max(var(--header-content-offset), 7.2rem);
}

.gallery-hero {
  margin-top: 0;
  margin-bottom: var(--space-7);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
  margin-top: 0;
}

.filter-btn {
  border: 1px solid rgba(24, 51, 84, 0.2);
  background: rgba(255, 255, 255, 0.92);
  color: #1d416d;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.52rem 0.86rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background 0.22s ease, color 0.22s ease, border-color 0.22s ease, transform 0.22s ease;
}

.filter-btn:hover,
.filter-btn.is-active {
  transform: translateY(-1px);
  background: linear-gradient(140deg, #214f82, #1b426f);
  color: var(--color-white);
  border-color: #173b63;
}

.gallery-grid {
  margin-top: var(--space-6);
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.gallery-grid--grouped {
  display: block;
}



.gallery-card {
  --gallery-frame: 5px;
  --gallery-inner-radius: calc(var(--radius-md) - var(--gallery-frame));
  border-radius: var(--radius-md);
  box-sizing: border-box;
  overflow: hidden;
  border: var(--gallery-frame) solid #ffffff;
  background: #ffffff;
  background-clip: padding-box;
  box-shadow: 0 0 10px rgba(15, 23, 42, 0.07);
  transition: transform 0.24s ease, box-shadow 0.24s ease;
}

.gallery-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 14px rgba(15, 23, 42, 0.1);
}

.gallery-card__button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  line-height: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  border-radius: var(--gallery-inner-radius);
  overflow: hidden;
}

.gallery-card__media {
  position: relative;
  border-radius: var(--gallery-inner-radius);
  overflow: hidden;
  /* shimmer skeleton */
  background: linear-gradient(110deg, #e8f0f8 8%, #f0f6fc 18%, #e8f0f8 33%);
  background-size: 200% 100%;
  animation: gallery-shimmer 1.6s ease-in-out infinite;
}

.gallery-card__media.is-loaded {
  animation: none;
  background: transparent;
}

@keyframes gallery-shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.gallery-card__media::before {
  content: "";
  display: block;
  aspect-ratio: 4 / 3;
}

.gallery-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s ease;
}

.gallery-card img.is-ready {
  opacity: 1;
}

.gallery-card:hover img.is-ready {
  transform: scale(1.03);
}



.gallery-empty {
  margin-top: var(--space-6);
  padding: 1rem;
  border-radius: 14px;
  border: 1px dashed rgba(22, 52, 95, 0.28);
  color: rgba(13, 31, 61, 0.76);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  padding: 1rem;
  background: rgba(8, 14, 26, 0.86);
  backdrop-filter: blur(8px);
}

.lightbox.is-open {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__inner {
  position: relative;
  width: min(1180px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
}

.lightbox__top {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  z-index: 3;
}

.lightbox__close {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.48);
  background: rgba(16, 29, 52, 0.58);
  border-radius: 999px;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  font-weight: 700;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: var(--color-white);
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: rgba(12, 24, 44, 0.52);
  border-radius: 999px;
  padding: 0;
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
  transition: background-color 0.22s ease, transform 0.22s ease;
}

.lightbox__close:hover,
.lightbox__nav:hover {
  background: rgba(17, 37, 67, 0.78);
  transform: translateY(-1px);
}

.lightbox__stage {
  position: relative;
}

.lightbox__media {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: rgba(4, 10, 20, 0.36);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 18px 56px rgba(0, 0, 0, 0.36);
}

.lightbox__media img {
  display: block;
  margin: 0 auto;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(100vh - 2.6rem);
  object-fit: contain;
}

#lightbox-prev {
  left: 0.7rem;
  transform: translateY(-50%);
}

#lightbox-next {
  right: 0.7rem;
  transform: translateY(-50%);
}



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


}

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



  .lightbox__nav {
    display: none;
  }

  .lightbox__media {
    border-radius: 16px;
  }

  .lightbox__media img {
    max-height: calc(100vh - 1.8rem);
  }
}

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


}