.hero-image-wrap {
  position: relative;
}

.hero-image-wrap::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background: linear-gradient(180deg, transparent 55%, rgba(8, 28, 33, 0.34));
}

.hero-image-wrap img {
  object-position: center;
  transform: scale(1.01);
}

.photo-chip {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 1;
  padding: 9px 13px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  background: rgba(9, 35, 41, 0.5);
  backdrop-filter: blur(12px);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.gallery-section {
  padding-block: 120px;
  overflow: hidden;
  background: var(--ink-dark);
  color: #fff;
}

.gallery-heading,
.event-intro {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: end;
  gap: 70px;
}

.gallery-heading {
  margin-bottom: 46px;
}

.gallery-heading h2 {
  max-width: 700px;
  margin: 14px 0 0;
  font-size: clamp(36px, 4.5vw, 58px);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.gallery-heading > p,
.event-intro > p {
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 16px;
  line-height: 1.7;
}

.aerial-gallery {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr 0.75fr;
  grid-template-rows: 260px 260px;
  gap: 12px;
}

.gallery-item {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 20px;
  background: #244a52;
  color: #fff;
  cursor: zoom-in;
  text-align: left;
}

.gallery-item::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, transparent 52%, rgba(6, 24, 29, 0.72));
}

.gallery-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-item:hover img,
.gallery-item:focus-visible img {
  transform: scale(1.035);
}

.gallery-item:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.86);
  outline-offset: 3px;
}

.gallery-item span {
  position: absolute;
  right: 18px;
  bottom: 16px;
  left: 18px;
  z-index: 1;
  font-size: 14px;
  font-weight: 700;
}

.aerial-feature {
  grid-row: 1 / 3;
}

.event-intro {
  margin: 80px 0 30px;
}

.event-intro h3 {
  margin: 10px 0 0;
  font-size: clamp(28px, 3.2vw, 42px);
  letter-spacing: -0.045em;
}

.event-gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 235px;
  gap: 12px;
}

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

.event-gallery .gallery-item:nth-child(4),
.event-gallery .gallery-item:nth-child(8) {
  grid-column: span 2;
}

.dialog-close {
  z-index: 2;
}

.gallery-dialog {
  width: min(1100px, calc(100vw - 34px));
  padding: 0;
  overflow: hidden;
  background: #0b242a;
  color: #fff;
}

.gallery-dialog figure {
  margin: 0;
}

.gallery-dialog img {
  width: 100%;
  height: min(75vh, 740px);
  max-height: none;
  object-fit: contain;
  background: #081c21;
}

.gallery-dialog figcaption {
  min-height: 58px;
  padding: 18px 24px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 14px;
  line-height: 1.5;
}

@media (max-width: 1080px) {
  .site-header nav {
    gap: 15px;
  }

  .site-header nav a {
    font-size: 11px;
  }
}

@media (max-width: 980px) {
  .gallery-heading,
  .event-intro {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .aerial-gallery {
    grid-template-columns: 1.2fr 0.8fr;
    grid-template-rows: 240px 240px 220px;
  }

  .aerial-feature {
    grid-row: 1 / 3;
  }

  .event-gallery {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 220px;
  }
}

@media (max-width: 760px) {
  .gallery-section {
    padding-block: 85px;
  }

  .aerial-gallery {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 320px 180px 180px;
  }

  .aerial-feature {
    grid-row: auto;
    grid-column: 1 / 3;
  }

  .event-intro {
    margin-top: 64px;
  }

  .event-gallery {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: 190px;
  }

  .event-gallery .event-wide {
    grid-row: span 2;
    grid-column: 1 / 3;
  }

  .event-gallery .gallery-item:nth-child(4),
  .event-gallery .gallery-item:nth-child(8) {
    grid-column: auto;
  }

  .gallery-dialog img {
    height: auto;
    max-height: 74vh;
  }
}

@media (max-width: 480px) {
  .photo-chip {
    right: 12px;
    bottom: 12px;
    font-size: 9px;
  }

  .aerial-gallery {
    grid-template-columns: 1fr;
    grid-template-rows: 280px;
    grid-auto-rows: 190px;
  }

  .aerial-feature {
    grid-column: auto;
  }

  .event-gallery {
    grid-template-columns: 1fr;
    grid-auto-rows: 230px;
  }

  .event-gallery .event-wide,
  .event-gallery .gallery-item:nth-child(4),
  .event-gallery .gallery-item:nth-child(8) {
    grid-row: auto;
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-item img {
    transition: none;
  }
}
