.section.festival-gallery {
  background: var(--navy);
  color: var(--white);
  padding-bottom: clamp(2rem, 4vw, 4rem);
  scroll-margin-top: 1rem;
}

.festival-gallery + .section.program-section {
  padding-top: 0;
}

.festival-gallery + .program-section .program-reveal {
  margin-top: 0;
  padding-top: clamp(2rem, 3.5vw, 3.5rem);
}

.festival-gallery__heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  margin-bottom: clamp(2rem, 5vw, 4rem);
}

.festival-gallery__heading h2 {
  margin: 0;
  font: 400 clamp(2.8rem, 7vw, 6rem)/0.94 var(--serif);
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.festival-gallery__heading p {
  margin: 0;
  color: var(--periwinkle-soft);
}

.festival-gallery__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: clamp(6rem, 14vw, 12rem);
  gap: clamp(0.375rem, 1vw, 0.8rem);
}

.festival-gallery__grid a {
  display: block;
  background: var(--ink);
  cursor: zoom-in;
  min-width: 0;
  min-height: 0;
  border-radius: 0.5rem;
  overflow: hidden;
}

.festival-gallery__grid a:is(:nth-child(8n+1), :nth-child(8n+2), :nth-child(8n+5), :nth-child(8n+6)) {
  grid-column: span 2;
}

.festival-gallery__grid a:is(:nth-child(8n+1), :nth-child(8n+6)) {
  grid-row: span 2;
}

.festival-gallery__grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.festival-gallery__grid a[href$="/05-1.webp"] img {
  object-position: center 28%;
}

.festival-gallery :is(a, button):focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 3px;
}

.festival-lightbox {
  inset: 0;
  width: min(95vw, 78rem);
  max-width: none;
  max-height: 96dvh;
  margin: auto;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 35%);
  background: var(--ink);
  color: var(--white);
}

.festival-lightbox::backdrop {
  background: rgb(15 18 29 / 92%);
}

html:has(.festival-lightbox[open]) {
  overflow: hidden;
}

.festival-lightbox__inner {
  display: grid;
  gap: 0.6rem;
  padding: clamp(0.6rem, 2vw, 1.25rem);
}

.festival-lightbox__top,
.festival-lightbox__controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.festival-lightbox figure {
  margin: 0;
}

.festival-lightbox__photo {
  width: 100%;
  height: min(68dvh, 55vw);
  object-fit: contain;
  background: #191d2a;
}

.festival-lightbox figcaption {
  padding-top: 0.55rem;
  color: var(--periwinkle-soft);
}

.festival-lightbox button {
  min-height: 44px;
  padding-inline: 0.9rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.festival-lightbox button:hover {
  background: var(--white);
  color: var(--ink);
}

@media (max-width: 700px) {
  .festival-gallery__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: auto;
  }

  .festival-gallery__grid a:nth-child(n) {
    grid-column: auto;
    grid-row: auto;
    aspect-ratio: 4 / 3;
  }

  .festival-gallery__grid a:nth-child(7n+1) {
    grid-column: span 2;
    aspect-ratio: 3 / 2;
  }
}
