:root {
  --gallery-edge: min(1660px, calc(100vw - 64px));
  --gallery-reading: min(920px, calc(100vw - 48px));
}

body.gallery-editorial-page {
  overflow-x: clip;
  background-color: #17392f;
  background-image: linear-gradient(#f6f3ec, #f6f3ec);
}

.gallery-editorial-page main {
  background: var(--paper);
}

.gallery-hero {
  position: relative;
  min-height: clamp(620px, calc(100svh - 78px), 980px);
  display: grid;
  align-items: end;
  overflow: hidden;
  color: #fff;
  background: var(--pine);
}

.gallery-hero picture,
.gallery-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.gallery-hero img {
  object-fit: cover;
  object-position: var(--gallery-hero-position, 50% 50%);
}

.gallery-hero::after {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(7, 18, 15, .08) 28%, rgba(7, 18, 15, .7) 100%),
    linear-gradient(90deg, rgba(7, 18, 15, .32), transparent 62%);
  content: "";
}

.gallery-hero-copy {
  position: relative;
  z-index: 2;
  width: var(--gallery-edge);
  margin: 0 auto;
  padding: clamp(72px, 9vw, 136px) 0 clamp(58px, 7vw, 96px);
}

.gallery-hero-copy .eyebrow {
  margin-bottom: 16px;
  color: rgba(255, 255, 255, .78);
}

.gallery-hero h1 {
  max-width: 1100px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(58px, 8.3vw, 142px);
  font-weight: 400;
  letter-spacing: -.045em;
  line-height: .86;
  text-wrap: balance;
}

.gallery-hero p:not(.eyebrow) {
  max-width: 660px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, .84);
  font-family: var(--serif);
  font-size: clamp(18px, 1.7vw, 27px);
  line-height: 1.42;
}

.gallery-index {
  width: var(--gallery-edge);
  margin: 0 auto;
  padding: clamp(26px, 3vw, 44px) 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.gallery-index a {
  min-width: 0;
  padding: 8px clamp(12px, 2vw, 32px);
  border-left: 1px solid var(--line);
  color: var(--muted-text);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .13em;
  line-height: 1.45;
  text-transform: uppercase;
  transition: color .2s ease;
}

.gallery-index a:first-child {
  padding-left: 0;
  border-left: 0;
}

.gallery-index a:last-child {
  padding-right: 0;
}

.gallery-index a:hover,
.gallery-index a[aria-current="page"] {
  color: var(--forest);
}

.gallery-index a[aria-current="page"]::after {
  display: block;
  width: 34px;
  height: 1px;
  margin-top: 10px;
  background: var(--gold);
  content: "";
}

.gallery-intro {
  width: var(--gallery-reading);
  margin: 0 auto;
  padding: clamp(96px, 11vw, 184px) 0 clamp(82px, 9vw, 150px);
  text-align: center;
}

.gallery-intro h2,
.gallery-interlude blockquote {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(40px, 5.2vw, 78px);
  font-weight: 400;
  letter-spacing: -.03em;
  line-height: 1.02;
  text-wrap: balance;
}

.gallery-intro p {
  max-width: 680px;
  margin: 28px auto 0;
  color: var(--muted-text);
  font-size: clamp(14px, 1.15vw, 17px);
  line-height: 1.8;
}

.gallery-story {
  width: 100%;
  padding-bottom: clamp(110px, 12vw, 210px);
}

.gallery-frame,
.gallery-spread {
  width: var(--gallery-edge);
  margin: 0 auto clamp(84px, 10vw, 176px);
}

.gallery-frame {
  position: relative;
}

.gallery-frame picture,
.gallery-frame img {
  display: block;
  width: 100%;
}

.gallery-frame img {
  height: auto;
  background: #e8e2d7;
}

.gallery-frame--wide {
  width: min(1780px, calc(100vw - 24px));
}

.gallery-frame--portrait {
  width: min(780px, calc(100vw - 80px));
}

.gallery-frame--left {
  margin-left: max(32px, calc((100vw - min(1660px, calc(100vw - 64px))) / 2));
  margin-right: auto;
}

.gallery-frame--right {
  margin-right: max(32px, calc((100vw - min(1660px, calc(100vw - 64px))) / 2));
  margin-left: auto;
}

.gallery-spread {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, .76fr);
  gap: clamp(18px, 3.6vw, 70px);
  align-items: start;
}

.gallery-spread--reverse {
  grid-template-columns: minmax(0, .76fr) minmax(0, 1.04fr);
  align-items: end;
}

.gallery-spread .gallery-frame {
  width: auto;
  margin: 0;
}

.gallery-spread .gallery-frame:last-child {
  margin-top: clamp(58px, 9vw, 150px);
}

.gallery-spread--reverse .gallery-frame:last-child {
  margin-top: 0;
  margin-bottom: clamp(58px, 9vw, 150px);
}

.gallery-number {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 13px;
  color: rgba(23, 35, 31, .55);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.gallery-number::before {
  width: 32px;
  height: 1px;
  background: rgba(23, 35, 31, .28);
  content: "";
}

.gallery-interlude {
  width: var(--gallery-reading);
  margin: 0 auto clamp(100px, 13vw, 210px);
  padding: clamp(74px, 8vw, 126px) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.gallery-interlude blockquote {
  color: var(--forest);
}

.gallery-continue {
  position: relative;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(120deg, #17392f, #214d40 62%, #17392f);
}

.gallery-continue::after {
  position: absolute;
  top: -240px;
  right: -130px;
  width: 620px;
  height: 620px;
  border: 1px solid rgba(230, 199, 143, .16);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(213, 175, 106, .12), transparent 68%);
  content: "";
  pointer-events: none;
}

.gallery-continue-inner {
  position: relative;
  z-index: 1;
  width: var(--gallery-edge);
  min-height: clamp(420px, 48vw, 700px);
  margin: 0 auto;
  padding: clamp(78px, 9vw, 144px) 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.gallery-continue .eyebrow {
  color: rgba(255, 255, 255, .64);
}

.gallery-continue a {
  display: inline-flex;
  max-width: 1120px;
  align-items: center;
  gap: clamp(18px, 3vw, 52px);
  font-family: var(--serif);
  font-size: clamp(50px, 7vw, 112px);
  font-weight: 400;
  letter-spacing: -.04em;
  line-height: .92;
}

.gallery-continue a span:last-child {
  color: var(--gold);
  font-family: var(--sans);
  font-size: .48em;
  transition: transform .3s ease;
}

.gallery-continue a:hover span:last-child,
.gallery-continue a:focus-visible span:last-child {
  transform: translateX(8px);
}

.gallery-editorial-page[data-gallery="limited"] {
  --gallery-hero-position: 50% 46%;
}

.gallery-editorial-page[data-gallery="white"] {
  --gallery-hero-position: 50% 38%;
}

.gallery-editorial-page[data-gallery="italian"] {
  --gallery-hero-position: 50% 42%;
}

.gallery-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .75s cubic-bezier(.22, 1, .36, 1), transform .9s cubic-bezier(.22, 1, .36, 1);
}

.gallery-reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (max-width: 820px) {
  :root {
    --gallery-edge: calc(100vw - 32px);
    --gallery-reading: calc(100vw - 40px);
  }

  .gallery-hero {
    min-height: max(640px, calc(100svh - 70px));
  }

  .gallery-editorial-page[data-gallery="limited"] {
    --gallery-hero-position: 47% 50%;
  }

  .gallery-editorial-page[data-gallery="white"] {
    --gallery-hero-position: 58% 50%;
  }

  .gallery-editorial-page[data-gallery="italian"] {
    --gallery-hero-position: 50% 43%;
  }

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

  .gallery-hero h1 {
    max-width: 95%;
    font-size: clamp(54px, 16vw, 86px);
    line-height: .9;
  }

  .gallery-hero p:not(.eyebrow) {
    max-width: 92%;
    margin-top: 18px;
    font-size: 18px;
  }

  .gallery-index {
    grid-template-columns: 1fr;
    padding: 18px 0;
  }

  .gallery-index a,
  .gallery-index a:first-child,
  .gallery-index a:last-child {
    padding: 13px 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .gallery-index a:first-child {
    border-top: 0;
  }

  .gallery-index a[aria-current="page"]::after {
    display: inline-block;
    margin: 0 0 3px 12px;
  }

  .gallery-intro {
    padding: 84px 0 76px;
  }

  .gallery-frame,
  .gallery-frame--wide,
  .gallery-frame--portrait,
  .gallery-frame--left,
  .gallery-frame--right,
  .gallery-spread {
    width: var(--gallery-edge);
    margin: 0 auto 74px;
  }

  .gallery-spread,
  .gallery-spread--reverse {
    grid-template-columns: 1fr;
    gap: 58px;
  }

  .gallery-spread .gallery-frame,
  .gallery-spread .gallery-frame:last-child,
  .gallery-spread--reverse .gallery-frame:last-child {
    width: auto;
    margin: 0;
  }

  .gallery-spread .gallery-frame:nth-child(even) {
    width: 82%;
    margin-left: auto;
  }

  .gallery-spread--reverse .gallery-frame:nth-child(even) {
    margin-right: auto;
    margin-left: 0;
  }

  .gallery-frame--portrait {
    width: min(82vw, 620px);
  }

  .gallery-frame--right {
    margin-right: 16px;
    margin-left: auto;
  }

  .gallery-frame--left {
    margin-right: auto;
    margin-left: 16px;
  }

  .gallery-interlude {
    margin-bottom: 88px;
    padding: 72px 0;
  }

  .gallery-continue-inner {
    min-height: 430px;
  }

  .gallery-continue a {
    font-size: clamp(46px, 13vw, 72px);
  }
}

@media (max-width: 430px) {
  .gallery-hero {
    min-height: 690px;
  }

  .gallery-hero-copy {
    padding-bottom: 44px;
  }

  .gallery-hero h1 {
    font-size: clamp(50px, 15.5vw, 68px);
  }

  .gallery-hero p:not(.eyebrow) {
    font-size: 16px;
  }

  .gallery-intro h2,
  .gallery-interlude blockquote {
    font-size: clamp(38px, 11vw, 52px);
  }

  .gallery-frame,
  .gallery-frame--wide,
  .gallery-frame--portrait,
  .gallery-spread {
    margin-bottom: 64px;
  }

  .gallery-number {
    margin-top: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-reveal,
  .gallery-reveal.is-visible {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .gallery-continue a span:last-child {
    transition: none;
  }
}
