.home-gallery-board {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 180px;
  gap: 18px;
}

.home-gallery-board figure,
.gallery-mosaic figure {
  position: relative;
  overflow: hidden;
  margin: 0;
  border-radius: 26px;
  background: #f7f9ff;
  box-shadow: 0 22px 55px rgba(10, 35, 75, 0.13);
}

.home-gallery-board .feature-photo {
  grid-column: span 3;
  grid-row: span 2;
}

.home-gallery-board figure:not(.feature-photo) {
  grid-column: span 2;
}

.home-gallery-board img,
.gallery-mosaic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.01);
  transition: transform .55s ease, filter .55s ease;
}

.gallery-open {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.home-gallery-board figure::after,
.gallery-mosaic figure::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 21, 45, 0) 35%, rgba(7, 21, 45, .75));
  opacity: .86;
}

.home-gallery-board figcaption,
.gallery-mosaic figcaption {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 16px;
  z-index: 2;
  color: #fff;
  font-weight: 800;
  letter-spacing: .02em;
}

.home-gallery-board figcaption span {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 13px;
  background: rgba(255, 255, 255, .18);
  backdrop-filter: blur(8px);
}

.home-gallery-board figure:hover img,
.gallery-mosaic figure:hover img {
  transform: scale(1.08);
  filter: saturate(1.08) contrast(1.04);
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 46px);
  background: rgba(3, 12, 29, .92);
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s ease, visibility .22s ease;
}

.gallery-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.gallery-lightbox img {
  max-width: min(100%, 1500px);
  max-height: calc(100vh - 120px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 22px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .45);
}

.gallery-lightbox-caption {
  position: absolute;
  left: clamp(18px, 4vw, 46px);
  bottom: 22px;
  max-width: calc(100% - 120px);
  color: #fff;
  font-weight: 800;
  letter-spacing: .02em;
}

.gallery-lightbox-close,
.gallery-lightbox-prev,
.gallery-lightbox-next {
  position: absolute;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, .12);
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition: transform .2s ease, background .2s ease;
}

.gallery-lightbox-close:hover,
.gallery-lightbox-prev:hover,
.gallery-lightbox-next:hover {
  transform: scale(1.06);
  background: #e83d3d;
}

.gallery-lightbox-close {
  top: 20px;
  right: 22px;
}

.gallery-lightbox-prev,
.gallery-lightbox-next {
  top: 50%;
  transform: translateY(-50%);
}

.gallery-lightbox-prev:hover,
.gallery-lightbox-next:hover {
  transform: translateY(-50%) scale(1.06);
}

.gallery-lightbox-prev {
  left: 22px;
}

.gallery-lightbox-next {
  right: 22px;
}

body.lightbox-lock {
  overflow: hidden;
}

.gallery-page {
  background: #fffaf3;
}

.gallery-hero {
  position: relative;
  min-height: 540px;
  display: flex;
  align-items: center;
  overflow: hidden;
  color: #fff;
  background-image: linear-gradient(90deg, rgba(10, 32, 72, .92), rgba(178, 24, 32, .72), rgba(10, 32, 72, .35)), var(--gallery-hero);
  background-size: cover;
  background-position: center;
}

.gallery-hero::before {
  content: "";
  position: absolute;
  inset: auto -8% -28% 36%;
  height: 55%;
  border-radius: 999px;
  background: rgba(255, 206, 68, .24);
  filter: blur(52px);
}

.gallery-hero .container {
  position: relative;
  z-index: 1;
}

.gallery-hero-copy {
  max-width: 820px;
  padding: 80px 0;
}

.gallery-hero-copy h1 {
  margin: 18px 0 18px;
  font-size: clamp(3rem, 7vw, 6.5rem);
  line-height: .92;
  letter-spacing: -.06em;
  font-weight: 900;
}

.gallery-hero-copy p {
  max-width: 720px;
  font-size: 1.18rem;
  line-height: 1.8;
  color: rgba(255, 255, 255, .88);
}

.gallery-hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
}

.gallery-hero-stats span,
.gallery-filter-bar a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 999px;
  padding: 12px 17px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .24);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  backdrop-filter: blur(12px);
}

.gallery-hero-stats strong {
  color: #ffce44;
}

.section-note {
  max-width: 520px;
  margin: 0;
  color: #5e6b82;
}

.gallery-filter-bar {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 0 28px;
  margin-bottom: 14px;
}

.gallery-filter-bar a {
  flex: 0 0 auto;
  background: #fff;
  color: #0f2d5c;
  border-color: rgba(15, 45, 92, .11);
  box-shadow: 0 12px 30px rgba(10, 35, 75, .08);
}

.gallery-filter-bar span {
  color: #e83d3d;
}

.gallery-category-block {
  padding: 42px 0 22px;
}

.gallery-category-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.gallery-category-head h2 {
  margin: 5px 0 0;
  color: #0a234b;
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 900;
  letter-spacing: -.04em;
}

.gallery-category-head a {
  color: #b21820;
  text-decoration: none;
  font-weight: 800;
}

.gallery-mosaic {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 240px;
  gap: 18px;
}

.gallery-mosaic .wide {
  grid-column: span 2;
  grid-row: span 2;
}

@media (max-width: 991px) {
  .home-gallery-board,
  .gallery-mosaic {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 210px;
  }

  .home-gallery-board .feature-photo,
  .home-gallery-board figure:not(.feature-photo),
  .gallery-mosaic .wide {
    grid-column: span 1;
    grid-row: span 1;
  }
}

@media (max-width: 575px) {
  .home-gallery-board,
  .gallery-mosaic {
    grid-template-columns: 1fr;
    grid-auto-rows: 235px;
    gap: 14px;
  }

  .gallery-hero {
    min-height: 470px;
  }

  .gallery-hero-copy {
    padding: 52px 0;
  }

  .gallery-category-head {
    display: block;
  }
}
