/* ==========================================================================
   Fonts
   ========================================================================== */

@font-face {
  font-family: 'FKDisplay';
  src: url('../fonts/FKDisplay-Regular.woff2') format('woff2');
  font-display: swap;
}

@font-face {
  font-family: 'FKDisplay Alt';
  src: url('../fonts/FKDisplay-RegularAlt.woff2') format('woff2');
  font-display: swap;
}

/* ==========================================================================
   Tokens
   ========================================================================== */

:root {
  --color-text: #000;
  --color-bg: #fff;
  --color-muted: whitesmoke;
  --color-subtle: #c4c4c4;
  --color-accent: #301240;

  --font-body: 'FKDisplay', sans-serif;
  --font-display: 'FKDisplay Alt', sans-serif;

  --gap-s: 0.3125rem;   /* 5 */
  --gap-m: 0.625rem;    /* 10 */
  --gap-l: 0.9375rem;   /* 15 */
  --gap-xl: 1.25rem;    /* 20 */
  --gap-xxl: 2.1875rem; /* 35 */
  --gap-3xl: 3.75rem;   /* 60 */
  --gap-4xl: 6.25rem;   /* 100 */

  --container: 84.375rem; /* 1350 */
  --gutter: var(--gap-xl);

  --ease: cubic-bezier(0.76, 0, 0.24, 1);

  /* type scale, same steps as the live Gatsby site */
  --type-headline: 2rem;
  --type-subline: 1.875rem;
  --type-tertiary: 1.375rem;
  --type-paragraph: 1.0625rem;
  --type-body: 0.9375rem;
  --type-small: 0.8125rem;
  --type-xsmall: 0.6875rem;
}

@media (min-width: 36em) {
  :root {
    --type-headline: 2.5rem;
    --type-subline: 2.125rem;
    --type-tertiary: 1.5rem;
    --type-paragraph: 1.125rem;
    --type-body: 1rem;
    --type-xsmall: 0.75rem;
  }
}

@media (min-width: 48em) {
  :root {
    --gutter: var(--gap-xxl);
    --type-headline: 3rem;
    --type-subline: 3rem;
    --type-tertiary: 1.625rem;
    --type-paragraph: 1.1875rem;
    --type-body: 1.0625rem;
  }
}

@media (min-width: 62em) {
  :root {
    --type-headline: 4rem;
    --type-subline: 3.5rem;
    --type-tertiary: 2rem;
    --type-paragraph: 1.25rem;
    --type-body: 1.125rem;
    --type-small: 0.9375rem;
    --type-xsmall: 0.8125rem;
  }
}

@media (min-width: 75em) {
  :root {
    --gutter: var(--gap-3xl);
    --type-headline: 6rem;
    --type-subline: 4rem;
    --type-paragraph: 1.625rem;
    --type-body: 1.25rem;
    --type-small: 1.0625rem;
    --type-xsmall: 0.9375rem;
  }
}

/* ==========================================================================
   Base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.45;
}

h1, h2, h3, h4, p {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
}

main { overflow-x: clip; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
svg { fill: currentColor; }

:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ==========================================================================
   Type utilities
   ========================================================================== */

.type-headline  { font-size: var(--type-headline); line-height: 1.1; }
.type-subline   { font-size: var(--type-subline); line-height: 1.15; }
.type-tertiary  { font-size: var(--type-tertiary); line-height: 1.35; }
.type-paragraph { font-size: var(--type-paragraph); line-height: 1.65; }
.type-body      { font-size: var(--type-body); line-height: 1.65; }
.type-small     { font-size: var(--type-small); }
.type-xsmall    { font-size: var(--type-xsmall); }

.uppercase { text-transform: uppercase; letter-spacing: 0.1rem; }
.color-subtle { color: var(--color-subtle); }
.underline { text-decoration: underline; text-underline-offset: 0.2em; }

.rich-text a { text-decoration: underline; text-underline-offset: 0.2em; }
.rich-text p + p,
.rich-text p + ul,
.rich-text ul + p { margin-top: 1em; }
.rich-text h1, .rich-text h2, .rich-text h3, .rich-text h4 { margin: 1.5em 0 0.5em; font-size: var(--type-tertiary); }

/* ==========================================================================
   Components
   ========================================================================== */

.tag {
  display: inline-block;
  margin-right: var(--gap-m);
  padding: 0.25rem var(--gap-s) 0.125rem;
  border: 1px solid rgb(255 255 255 / 0.64);
  background: rgb(0 0 0 / 0.16);
  color: #fff;
  font-size: var(--type-xsmall);
  line-height: 1.4;
  text-transform: none;
  letter-spacing: 0;
}

.tag--inverted {
  border-color: rgb(0 0 0 / 0.32);
  background: none;
  color: var(--color-text);
}

.button-round {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  overflow: hidden;
  background: var(--color-muted);
  color: var(--color-text);
  line-height: 0;
}

.button-round::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--color-text);
  transform: scale(0);
  transition: transform 0.15s ease-in-out;
}

.button-round svg {
  position: relative;
  z-index: 1;
  width: 75%;
  transition: fill 0.25s ease;
}

.button-round:hover::after,
a:hover > .button-round::after,
.pill-button:hover .button-round::after { transform: scale(1); }
.button-round:hover svg,
a:hover > .button-round svg,
.pill-button:hover .button-round svg { fill: #fff; }

@media (min-width: 768px) {
  .button-round { width: 3rem; height: 3rem; }
}

.button-round--small { width: 1.5rem; height: 1.5rem; }
@media (min-width: 768px) {
  .button-round--small { width: 2rem; height: 2rem; }
}

.button-round--white { background: #fff; }
.button-round--transparent { background: transparent; color: #fff; }
.button-round--outline-inverted { background: transparent; border: 1px solid #fff; color: #fff; }
.button-round--outline-inverted::after { background: #fff; }
.button-round--outline-inverted:hover svg,
a:hover > .button-round--outline-inverted svg { fill: #000; }
.button-round--shadow { box-shadow: 0 0 1.5rem rgb(0 0 0 / 0.16); }

.pill-button {
  display: inline-flex;
  align-items: center;
  gap: var(--gap-xl);
  padding: var(--gap-s) var(--gap-m) var(--gap-s) var(--gap-xl);
  border: 0;
  border-radius: 2rem;
  background: var(--color-muted);
  font-family: var(--font-display);
  line-height: 1;
}

.button-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap-m);
  margin: var(--gap-xl) 0 var(--gap-m);
}

@media (min-width: 768px) {
  .button-row { flex-direction: row; justify-content: flex-start; gap: var(--gap-xl); }
}

.outline-link {
  display: inline-block;
  margin-top: var(--gap-xxl);
  padding: var(--gap-l) var(--gap-xl) var(--gap-m);
  border: 1px solid currentColor;
  transition: background 0.25s, color 0.25s;
}

.outline-link:hover { background: #fff; color: #000; }

/* ==========================================================================
   Header + menu
   ========================================================================== */

.site-header {
  position: relative;
  z-index: 11;
  padding: var(--gap-l) 0;
}

@media (min-width: 992px) {
  .site-header { padding: var(--gap-xl) 0; }
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header__logo img {
  width: 100%;
  max-width: 8.75rem;
  height: auto;
}

@media (min-width: 768px) { .site-header__logo img { max-width: 11.25rem; } }
@media (min-width: 992px) { .site-header__logo img { max-width: 12.5rem; } }

.menu-toggle {
  position: relative;
  z-index: 12;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--gap-s);
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 2px solid var(--color-muted);
  border-radius: 50%;
  background: none;
  transition: border-color 0.4s var(--ease);
}

.menu-toggle:hover { border-color: var(--color-accent); }

.menu-toggle__bar {
  width: 65%;
  height: 1px;
  background: var(--color-text);
  transition: transform 0.4s var(--ease);
}

@media (min-width: 992px) {
  .menu-toggle { width: 3rem; height: 3rem; gap: var(--gap-m); }
  .menu-toggle__bar { height: 2px; }
}

[aria-expanded='true'] .menu-toggle__bar:first-child { transform: translateY(calc(var(--gap-s) / 2 + 0.5px)) rotate(45deg); }
[aria-expanded='true'] .menu-toggle__bar:last-child { transform: translateY(calc(var(--gap-s) / -2 - 0.5px)) rotate(-45deg); }

@media (min-width: 992px) {
  [aria-expanded='true'] .menu-toggle__bar:first-child { transform: translateY(calc(var(--gap-m) / 2 + 1px)) rotate(45deg); }
  [aria-expanded='true'] .menu-toggle__bar:last-child { transform: translateY(calc(var(--gap-m) / -2 - 1px)) rotate(-45deg); }
}

.menu {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  padding: var(--gap-xl);
  overflow-y: auto;
  background: var(--color-muted);
  animation: fade-in 0.5s var(--ease);
}

.menu[hidden] { display: none; }

.menu__inner {
  display: flex;
  flex-direction: column;
  gap: var(--gap-3xl);
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
}

.menu__links { display: flex; flex: 1; flex-direction: column; gap: var(--gap-xxl); }

.menu__link {
  animation: slide-up 0.6s var(--ease) both;
  animation-delay: calc(var(--i) * 0.06s + 0.1s);
}

.menu__link:hover,
.menu__link[aria-current] { color: var(--color-accent); }

.menu__info { display: flex; gap: var(--gap-xl); line-height: 1.75; font-size: var(--type-xsmall); }
.menu__info .rich-text p + p { margin-top: 0; }

@media (min-width: 576px) {
  .menu { padding: var(--gap-3xl); }
  .menu__inner { flex-direction: row; }
  .menu__info { flex-direction: column; font-size: var(--type-small); }
}

@media (min-width: 992px) {
  .menu { padding: var(--gap-4xl); }
}

html.menu-open { overflow: hidden; }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero__image {
  height: calc(100svh - 10rem);
  min-height: 20rem;
  overflow: hidden;
}

.hero__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: fade-in 0.8s var(--ease);
}

.hero__header { padding-top: var(--gap-xxl); padding-bottom: var(--gap-3xl); }
@media (min-width: 992px) { .hero__header { padding-top: var(--gap-4xl); } }

.hero__duration { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap-m) 0; }
.hero h1 { margin-top: var(--gap-xxl); }
.hero h1 span { display: block; }

/* ==========================================================================
   Stage (home)
   ========================================================================== */

.stage {
  position: relative;
  height: calc(100svh - 5rem);
  min-height: 80vh;
  overflow: hidden;
  background: #000;
  color: #fff;
}

.stage__slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: 8rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.55s var(--ease), visibility 0s 0.55s;
}

.stage__slide.is-active { opacity: 1; visibility: visible; transition: opacity 0.55s var(--ease); }

.stage__slide::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 0.24);
}

.stage__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.05);
  transition: transform 0.8s var(--ease);
}

.stage__slide.is-active .stage__image { transform: scale(1); }

.stage__content { position: relative; z-index: 2; }
.stage__content > * { opacity: 0; transform: translateY(20%); transition: opacity 0.55s var(--ease), transform 0.55s var(--ease); }
.stage__slide.is-active .stage__content > * { opacity: 1; transform: none; }
.stage__slide.is-active .stage__content > :nth-child(2) { transition-delay: 0.05s; }
.stage__slide.is-active .stage__content > :nth-child(3) { transition-delay: 0.1s; }
.stage__slide.is-active .stage__content > :nth-child(4) { transition-delay: 0.15s; }
.stage__content .type-body { margin-bottom: var(--gap-xxl); }
.stage__content h2 { margin-bottom: var(--gap-s); }

.stage__timeline {
  position: absolute;
  z-index: 5;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  overflow: hidden;
  background: #fff;
}

.stage__timeline-bar {
  display: block;
  height: 100%;
  background: #000;
  transform: translateX(-100%);
}

.stage.is-playing .stage__timeline-bar { animation: timeline var(--stage-duration, 8s) linear; }

.stage__nav {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 4rem;
  display: flex;
  justify-content: space-between;
  max-width: none;
}

.stage__nav .button-round { width: 2.75rem; height: 2.75rem; }

/* ==========================================================================
   Exhibition tiles
   ========================================================================== */

.tiles {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  padding-top: var(--gap-4xl);
  padding-bottom: var(--gap-3xl);
}

.tile { display: block; width: 100%; padding-bottom: var(--gap-3xl); }

@media (min-width: 576px) { .tile { width: 48%; } }
@media (min-width: 992px) {
  .tile { width: 30%; }
  .tiles::after { content: ''; width: 30%; }
}

.tile__image { position: relative; height: 12.5rem; overflow: hidden; background: var(--color-muted); }
@media (min-width: 768px) { .tile__image { height: 15rem; } }
@media (min-width: 992px) { .tile__image { height: 20rem; } }

.tile__image .tag { position: absolute; z-index: 2; top: var(--gap-l); left: var(--gap-l); }

.tile__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.65s var(--ease);
}

a.tile:hover .tile__image img { transform: scale(1.1); }

.tile__duration { padding: var(--gap-3xl) 0 var(--gap-m); }
.tile__headline { line-height: 1.2; }
.tile__artist { padding-top: var(--gap-s); line-height: 1.2; }

/* ==========================================================================
   Blocks
   ========================================================================== */

/* About / text */
.block-about { padding-top: var(--gap-xl); padding-bottom: var(--gap-xxl); }
.block-about__subline { padding-bottom: var(--gap-3xl); }
.block-about .rich-text p { max-width: 50rem; }
.block-about .rich-text p + p { margin-top: 0; padding-top: var(--gap-xl); }
.block-about .rich-text :is(h2, h3, h4, h5, h6) { margin: 0; line-height: 1.2; }
/* rich text headings are rendered one level down (see shiftHeadings), sizes follow the editor's level */
.block-about .rich-text h2 { font-size: 2rem; }
.block-about .rich-text h3 { font-size: 1.5rem; }
.block-about .rich-text h4 { font-size: 1.17rem; }
.block-about .rich-text :is(h5, h6) { font-size: 1rem; }

/* Read more: the text itself fades out over its last lines (a mask, no white overlay),
   the toggle picks up the gallery's language: spaced capitals on a hairline, a thin plus */
.read-more {
  --collapsed-h: 16em;
  max-width: 50rem;
}

.read-more__content { overflow: hidden; transition: max-height 0.6s var(--ease); }

.read-more.is-collapsed .read-more__content {
  max-height: var(--collapsed-h);
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 4.5em), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 4.5em), transparent);
}

.read-more__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-xl);
  width: 100%;
  max-width: 50rem;
  margin-top: var(--gap-xl);
  padding: var(--gap-l) 0;
  border: 0;
  border-top: 1px solid #e6e6e6;
  background: none;
  color: inherit;
  font-size: var(--type-small);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  cursor: pointer;
  transition: border-color 0.4s var(--ease);
}

.read-more__toggle:hover { border-color: var(--color-text); }
.read-more__toggle[hidden] { display: none; }

/* a thin plus that turns into a minus */
.read-more__icon { position: relative; width: 0.9rem; height: 0.9rem; flex: none; }
.read-more__icon::before,
.read-more__icon::after {
  content: '';
  position: absolute;
  inset: 50% 0 auto;
  height: 1px;
  background: currentColor;
  transition: transform 0.5s var(--ease);
}
.read-more__icon::after { transform: rotate(90deg); }
.read-more__toggle[aria-expanded='true'] .read-more__icon::after { transform: rotate(0deg); }

/* Images: a filmstrip of artworks at their own proportions.
   Images share one height and sit on a common baseline, so captions line up.
   The strip bleeds to both screen edges, the first image aligns with the text column. */
.gallery {
  --gallery-h: clamp(15rem, 52vh, 38rem);
  --gallery-gap: clamp(1.25rem, 3vw, 3rem);
  /* distance from the screen edge to the text column */
  --bleed: calc((100vw - min(100vw, var(--container))) / 2 + var(--gutter));
  padding-top: var(--gap-xxl);
  padding-bottom: var(--gap-3xl);
}

.gallery__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-xl);
  min-height: 2.75rem;
  margin-bottom: var(--gap-xl);
}

.gallery__title {
  font-size: var(--type-small);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.gallery__controls {
  display: flex;
  align-items: center;
  gap: var(--gap-s);
  margin-left: auto;
}

.gallery__count {
  margin-right: var(--gap-m);
  font-size: var(--type-small);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  color: #8a8a8a;
}

.gallery__count [data-gallery-current] { color: var(--color-text); }

.gallery__arrow {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: none;
  transition: border-color 0.3s var(--ease), opacity 0.3s var(--ease);
}

.gallery__arrow svg { width: 1.25rem; }
.gallery__arrow:hover:not(:disabled) { border-color: currentColor; }
.gallery__arrow:disabled { opacity: 0.2; cursor: default; }

.gallery__viewport {
  margin-inline: calc(-1 * var(--bleed));
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--bleed);
  scrollbar-width: none;
}

.gallery__viewport::-webkit-scrollbar { display: none; }
.gallery--single .gallery__viewport { overflow: visible; }

.gallery__track {
  display: flex;
  gap: var(--gallery-gap);
  width: max-content;
  margin: 0;
  padding: 0 var(--bleed);
  list-style: none;
}

.gallery__item {
  width: min(calc(var(--gallery-h) * var(--ratio)), 85vw);
  scroll-snap-align: start;
}

.gallery__image {
  display: flex;
  align-items: flex-end;
  width: 100%;
  height: var(--gallery-h);
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}

.gallery__image img {
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  object-position: left bottom;
  background: var(--color-muted);
  transition: opacity 0.4s var(--ease);
}

.gallery__image:hover img { opacity: 0.88; }

.gallery.is-dragging .gallery__viewport { cursor: grabbing; scroll-snap-type: none; }
.gallery.is-dragging .gallery__image { cursor: grabbing; }
.gallery.is-dragging img { user-select: none; }

.gallery__caption {
  max-width: 32rem;
  padding-top: var(--gap-l);
  font-size: var(--type-xsmall);
  line-height: 1.5;
}

.gallery__caption-title { font-family: var(--font-body); }
.gallery__caption-details { margin-top: 0.25em; color: #8a8a8a; }
.gallery__caption-details p { font-family: inherit; }

.gallery__progress {
  position: relative;
  height: 1px;
  margin-top: var(--gap-xxl);
  background: #e6e6e6;
}

.gallery__progress span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  background: var(--color-text);
  transform: scaleX(var(--progress, 0));
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}

/* phones show one image at a time: no shared baseline needed, images keep their natural height */
@media (max-width: 767px) {
  .gallery { --gallery-h: clamp(14rem, 46vh, 26rem); }
  .gallery .gallery__arrow { display: none; }
  .gallery__track { align-items: flex-start; }
  .gallery__image { height: auto; }
}

/* Text + images */
.block-textimages {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-xl);
  padding-top: var(--gap-xxl);
  padding-bottom: var(--gap-xxl);
}

.block-textimages__text { font-size: 1rem; }

.block-textimages__images { display: flex; gap: var(--gap-l); }
.block-textimages__images img { width: 7.5rem; }

/* Teaser */
.teaser {
  position: relative;
  display: flex;
  align-items: center;
  height: 70vh;
  min-height: 25rem;
  overflow: hidden;
  color: #fff;
}

.teaser::after { content: ''; position: absolute; inset: 0; background: rgb(0 0 0 / 0.64); }
.teaser__image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.teaser__content { position: relative; z-index: 2; }
.teaser__content > * { transition: transform 0.5s var(--ease); }
.teaser:hover .teaser__content > * { transform: translateY(-30px); }
.teaser__duration { padding-bottom: var(--gap-xxl); }
.teaser__artist { opacity: 0.48; padding-bottom: var(--gap-xxl); }

/* ==========================================================================
   Overlay (video, documentation, lightbox)
   ========================================================================== */

.overlay {
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #000;
}

.overlay[open] { display: flex; align-items: center; justify-content: center; animation: fade-in 0.5s var(--ease); }
.overlay::backdrop { background: rgb(0 0 0 / 0.6); }
.overlay--white { background: #fff; }

.overlay__close { position: absolute; z-index: 3; top: var(--gap-xxl); right: var(--gap-xxl); }
.overlay__close svg { width: 60%; }

.overlay__content { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; overflow: auto; }

.overlay__video { position: relative; width: min(100%, 177.78vh); aspect-ratio: 16 / 9; }
.overlay__video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.overlay__document {
  align-self: flex-start;
  width: 100%;
  max-width: 45rem;
  padding: var(--gap-4xl) var(--gutter);
  font-size: var(--type-body);
}

.overlay__document h4 { color: var(--color-subtle); }
.overlay__document ul { padding: 0 0 var(--gap-xl) var(--gap-l); list-style: none; }
.overlay__document li { padding-bottom: var(--gap-m); }

/* Lightbox: white like the gallery walls, image as large as possible, caption + counter below */
.lightbox {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #fff;
  color: var(--color-text);
}

.lightbox[open] {
  display: grid;
  grid-template-rows: 1fr auto;
  animation: fade-in 0.4s var(--ease);
}

.lightbox::backdrop { background: #fff; }

.lightbox__stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  padding: clamp(3.5rem, 7vh, 5rem) clamp(1rem, 6vw, 6rem) var(--gap-3xl);
  overflow: hidden;
  touch-action: pan-y pinch-zoom;
}

.lightbox__image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: opacity 0.3s var(--ease);
}

.lightbox__image.is-loading { opacity: 0; }

.lightbox__bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--gap-xl);
  padding: 0 var(--gutter) var(--gap-xl);
  font-size: var(--type-xsmall);
  line-height: 1.5;
}

.lightbox__caption { max-width: 40rem; }
.lightbox__caption .gallery__caption-details { margin-top: 0.25em; }
.lightbox__nav { display: flex; align-items: center; gap: var(--gap-s); flex: none; }

.lightbox__close {
  position: absolute;
  z-index: 2;
  top: var(--gap-l);
  right: var(--gap-l);
}

/* big invisible click areas on both halves of the image */
.lightbox__prev,
.lightbox__next {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  padding: 0;
  border: 0;
  background: none;
}

.lightbox__prev { left: 0; cursor: w-resize; }
.lightbox__next { right: 0; cursor: e-resize; }
.lightbox__prev:disabled,
.lightbox__next:disabled { cursor: default; }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  display: flex;
  justify-content: space-between;
  max-width: none;
  padding-top: var(--gap-3xl);
  padding-bottom: var(--gap-3xl);
}

.private-viewing {
  position: fixed;
  z-index: 9;
  right: var(--gap-xl);
  bottom: var(--gap-xl);
  padding: var(--gap-l) var(--gap-xl);
  border-radius: 2rem;
  background: #000;
  color: #fff;
  font-size: var(--type-small);
  text-transform: uppercase;
  letter-spacing: 0.05rem;
  box-shadow: 0 0 1.5rem rgb(0 0 0 / 0.16);
}

.error-page { padding-top: var(--gap-4xl); padding-bottom: var(--gap-4xl); }
.error-page p { margin-top: var(--gap-xxl); }

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes fade-in { from { opacity: 0; } }
@keyframes slide-up { from { opacity: 0; transform: translateY(1.5rem); } }
@keyframes timeline { from { transform: translateX(-100%); } to { transform: translateX(0); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
