.gallery [hidden] { display: none !important; }

.gallery .gallery-image { display: block; }
.gallery { --gallery-poster-height: 160rem; }
.gallery .gallery-image:focus-visible { outline-offset: -4px; }
.gallery .gallery-frames > figure { min-width: 0; }
.gallery .gallery-frames > .content-video { width: 100%; margin: 0; }
.gallery .gallery-frames > .content-video:only-child { grid-column: 1 / -1; }
.gallery-carrousel[data-gallery-ready] .gallery-frames .content-video-player {
  block-size: var(--gallery-poster-height);
  aspect-ratio: auto;
}
.gallery .gallery-frames figcaption { overflow-wrap: anywhere; }
.gallery .gallery-document-link {
  display: flex;
  align-items: center;
  gap: .75em;
  min-block-size: 3.25em;
  padding: .75em;
  border: 1px solid color-mix(in srgb, currentColor 25%, transparent);
  color: inherit;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.gallery .gallery-document-link:hover { text-decoration: underline; }
.gallery .gallery-document-link:focus-visible { outline-offset: -3px; }
.gallery .gallery-document-badge {
  flex: none;
  font-size: .75em;
  font-weight: 700;
  padding: .25em .5em;
  border: 1px solid currentColor;
}
.gallery-carrousel .gallery-document-link {
  justify-content: center;
  min-block-size: min(32vw, 11rem);
}

.gallery.gallery-logos { --gallery-poster-height: clamp(2.55rem, 7vw, 3.55rem); }
.gallery.gallery-logos > .gallery-frames {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 5.75rem), 1fr));
  align-items: start;
  gap: .85rem 1.15rem;
}
.gallery-logos .gallery-frames > figure {
  border: none;
  background: transparent;
}
.gallery-logos .gallery-image img {
  width: 100%;
  height: var(--gallery-poster-height);
  aspect-ratio: auto;
  object-fit: contain;
  background: transparent;
}
.gallery-logos .gallery-frames figcaption {
  margin-top: .42rem;
  padding: 0;
  text-align: center;
  line-height: 1.36;
}

.gallery.gallery-grand > .gallery-frames {
  grid-template-columns: minmax(0, 1fr);
  max-width: 56rem;
  margin-inline: auto;
}
.gallery-grand .gallery-image img {
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  background: transparent;
}

.gallery.gallery-carrousel[data-gallery-ready] {
  --gallery-poster-height: clamp(13.5rem, 56vw, 33rem);
  margin: 1.25rem auto 2.2rem;
}
.gallery.gallery-carrousel[data-gallery-ready] > .gallery-frames {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  margin: 0;
}
.gallery-carrousel[data-gallery-ready] .gallery-frames > figure {
  grid-area: 1 / 1;
  align-self: start;
  visibility: hidden;
  border: 0;
  background: none;
}
.gallery-carrousel[data-gallery-ready] .gallery-frames > [data-gallery-current] {
  visibility: visible;
}
.gallery-carrousel[data-gallery-ready] .gallery-image {
  block-size: var(--gallery-poster-height);
  display: grid;
  place-items: center;
  background: #eee9e5;
}
.gallery-carrousel[data-gallery-ready] .gallery-image img {
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: auto;
  object-fit: contain;
  background: transparent;
}
.gallery-carrousel .gallery-frames figcaption {
  padding: .5rem 0 0;
}

.gallery-controls {
  display: flex;
  align-items: center;
  gap: .65rem;
  font-family: system-ui, sans-serif;
  font-size: .88rem;
}
.gallery > .gallery-controls {
  justify-content: center;
  margin-top: .65rem;
}
.gallery-controls button,
.gallery-dialog button {
  min-block-size: 44px;
  min-inline-size: 44px;
  border: 1px solid #afa4b8;
  border-radius: .33rem;
  padding: .38rem .58rem;
  color: var(--ink, #211c24);
  background: #fff;
  cursor: pointer;
  font: 620 .94rem/1.1 system-ui, sans-serif;
}
.gallery-controls button { font-size: 1.22rem; }
.gallery-controls span { min-inline-size: 7rem; text-align: center; }
.gallery-controls button:hover, .gallery-dialog button:hover { background: #f1eaf6; }
.gallery-controls button:focus-visible, .gallery-dialog button:focus-visible {
  outline: 3px solid #6a57e5;
  outline-offset: 2px;
}
.gallery-dialog {
  --gallery-view-height: min(68vh, 52rem);
  --gallery-view-height: min(68dvh, 52rem);
  --gallery-poster-height: var(--gallery-view-height);
  width: min(calc(100% - 1.5rem), 72rem);
  max-height: calc(100vh - 1.5rem);
  max-height: calc(100dvh - 1.5rem);
  overflow-y: auto;
  border: 1px solid #d4cad5;
  border-radius: .5rem;
  padding: 0;
  color: #211c24;
  background: #faf7f2;
  overscroll-behavior: contain;
}
.gallery-dialog::backdrop { background: rgb(24 17 30 / .84); }
.gallery-dialog-content { padding: clamp(.8rem, 2vw, 1.3rem); }
.gallery-dialog-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: .6rem;
}
.gallery-dialog [data-gallery-large] { text-align: center; margin: 0; }
.gallery-dialog [data-gallery-large] img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: var(--gallery-view-height);
  margin-inline: auto;
  object-fit: contain;
}
.gallery-dialog figcaption {
  max-width: 72ch;
  margin: .65rem auto 0;
  overflow-wrap: anywhere;
  font: .93rem/1.5 system-ui, sans-serif;
}
.gallery-dialog-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: .7rem 1.25rem;
  padding-top: .8rem;
}
.gallery-dialog-footer a {
  color: #352763;
  font: 630 .91rem/1.4 system-ui, sans-serif;
}

/* Keep the same margins outside the Festival posters in every view. */
.festival-page :is(.photos .gallery-image, .gallery-dialog [data-gallery-large]) img:is(
  [src$="/b5c88facb-1.png"], [src$="/7b9395e6f-2.png"], [src$="/fb0c74cf3-3.png"],
  [src$="/a7a8e9ca2-4.png"], [src$="/f8bd356fb-5.png"], [src$="/405a9eada-6.png"]
) {
  width: min(100%, calc(var(--gallery-poster-height) * 1860 / 2687));
  height: auto;
  margin-inline: auto;
  aspect-ratio: 1860 / 2687;
  object-fit: cover;
  object-position: 49.82% 50%;
}
