.sentipai-gallery {
  --gallery-cream: #f6f1eb;
  --gallery-dark: #1e1418;
  --gallery-paper: #ede3d9;
  --gallery-pink: #f4bcc8;
}

.gallery-intro {
  position: relative;
  isolation: isolate;
  background: var(--gallery-dark);
  color: #fff8f0;
  overflow: hidden;
}
.gallery-intro::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: #501929;
  clip-path: polygon(53% 0, 100% 0, 100% 100%, 29% 100%);
}
.gallery-intro-layout {
  min-height: clamp(420px, 49vw, 630px);
  padding-block: clamp(50px, 7.5vw, 112px);
  display: grid;
  align-items: center;
  gap: clamp(30px, 6vw, 94px);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.19fr);
}
.gallery-intro .story-kicker,
.gallery-intro h1 em { color: var(--gallery-pink); }
.gallery-intro h1 {
  font-size: clamp(3rem, 6.6vw, 6.8rem);
  text-wrap: normal;
}
.gallery-intro h1 em,
.gallery-chapter h2 em,
.gallery-finish h2 em { font-style: normal; }
.gallery-intro-copy > p:not(.story-kicker) {
  max-width: 38ch;
  margin-top: 1.4rem;
  font-size: clamp(1.02rem, 1.32vw, 1.24rem);
  color: #f4dfe3;
}
.gallery-intro-art { position: relative; }
.gallery-intro-art picture {
  display: block;
  background: #382126;
  clip-path: polygon(5% 0, 100% 8%, 95% 100%, 0 91%);
}
.gallery-intro-art img {
  width: 100%;
  height: auto;
}
.gallery-intro-art figcaption {
  color: #ecdce0;
  font-size: .78rem;
  margin-top: .9rem;
  text-align: end;
}

.gallery-index {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding-block: 1rem;
  gap: clamp(8px, 2vw, 34px);
}
.gallery-index a {
  min-height: 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  font-size: clamp(.86rem, 1.3vw, 1.08rem);
  font-weight: 760;
  text-decoration: none;
  border-bottom: 1px solid var(--story-line);
}
.gallery-index a:hover,
.gallery-index a:focus-visible,
.gallery-index a span { color: var(--story-red); }

.gallery-chapter {
  position: relative;
  isolation: isolate;
  padding-block: clamp(52px, 6.4vw, 110px);
}
.gallery-chapter::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: var(--gallery-paper);
  clip-path: polygon(0 12%, 100% 0, 100% 95%, 0 100%);
}
.gallery-chapter:nth-of-type(odd)::before { clip-path: polygon(0 2%, 100% 15%, 100% 100%, 0 92%); background: #fff9f2; }
.gallery-chapter-layout {
  display: grid;
  grid-template-columns: minmax(240px, .73fr) minmax(0, 1.35fr);
  align-items: center;
  gap: clamp(24px, 6vw, 104px);
}
.gallery-chapter:nth-of-type(even) .gallery-chapter-layout {
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, .73fr);
}
.gallery-chapter:nth-of-type(even) .gallery-chapter-copy { grid-column: 2; grid-row: 1; }
.gallery-chapter:nth-of-type(even) .gallery-montage { grid-column: 1; grid-row: 1; }
.gallery-chapter h2 {
  text-wrap: balance;
  font-size: clamp(2.26rem, 4.08vw, 4rem);
}
.gallery-chapter h2 em { display: block; }
.gallery-chapter-copy .gallery-description {
  color: #57484c;
  margin-top: 1.2rem;
  max-width: 38ch;
  font-size: clamp(1rem, 1.18vw, 1.15rem);
}
.gallery-montage {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: clamp(155px, 20vw, 330px) auto;
  align-items: start;
}
.gallery-photo {
  position: relative;
  grid-row: 1 / span 2;
  grid-column: 1 / span 10;
  isolation: isolate;
}
.gallery-photo::before {
  position: absolute;
  z-index: -1;
  content: "";
  inset: 4% 4% -4% -3%;
  background: #721e3a;
  clip-path: polygon(0 6%, 98% 0, 100% 94%, 11% 100%);
}
.gallery-photo img {
  width: 100%;
  height: auto;
  aspect-ratio: 1.55;
  object-fit: cover;
  clip-path: polygon(1% 6%, 100% 0, 96% 96%, 0 100%);
}
.gallery-preview {
  position: relative;
  grid-row: 2;
  grid-column: 4 / -1;
  min-width: 0;
}
.gallery-preview-link {
  position: relative;
  display: block;
  padding: 6px;
  background: #32222a;
  border: 1px solid #a27d8c;
  border-radius: .5rem;
  box-shadow: 0 16px 32px #32111f46;
  text-decoration: none;
}
.gallery-preview-link img {
  width: 100%;
  height: auto;
  aspect-ratio: 136 / 87;
  object-fit: contain;
  border-radius: .23rem;
  background: #f3eff1;
}
.gallery-enlarge {
  position: absolute;
  inset: auto .6rem .6rem auto;
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  background: #46182c;
  color: white;
  font-weight: 800;
}
.gallery-preview-link:hover .gallery-enlarge { background: #910024; }
.gallery-preview figcaption {
  display: flex;
  justify-content: space-between;
  gap: .5rem 1rem;
  flex-wrap: wrap;
  margin-top: .72rem;
  font-size: .75rem;
  color: #57484c;
}
.gallery-chapter:nth-of-type(even) .gallery-photo { grid-column: 3 / -1; }
.gallery-chapter:nth-of-type(even) .gallery-preview { grid-column: 1 / span 9; }

.gallery-finish {
  padding-block: clamp(58px, 8vw, 125px);
  isolation: isolate;
  position: relative;
  background: var(--gallery-dark);
  color: #fff6ee;
}
.gallery-finish::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background: #511b2d;
  clip-path: polygon(82% 0, 100% 0, 100% 100%, 70% 100%);
}
.gallery-finish-layout {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2rem;
}
.gallery-finish h2 {
  font-size: clamp(2.6rem, 6.45vw, 6.8rem);
  text-wrap: normal;
}
.gallery-finish h2 em { color: var(--gallery-pink); }
.gallery-finish p {
  margin-top: 1.3rem;
  max-width: 50ch;
  color: #f1dfe4;
  font-size: clamp(1rem, 1.27vw, 1.14rem);
}
.gallery-finish .gallery-finish-cta {
  padding-inline: 1.4rem;
  min-width: 11rem;
  background: #f7e6e8;
  color: #4d1427;
}
.gallery-finish .gallery-finish-cta:hover { background: #fff7ed; color: #4d1427; }

.gallery-dialog {
  width: min(94vw, 1250px);
  max-height: 92dvh;
  border: 1px solid #a27d8c;
  padding: .65rem;
  color: #fdf2ec;
  background: #271923;
  overflow: auto;
}
.gallery-dialog::backdrop { background: #160e14d9; }
.gallery-dialog-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .7rem;
  margin-bottom: .65rem;
  font-size: .9rem;
}
.gallery-dialog-bar button {
  border: 1px solid #b895a3;
  background: #f6e8ed;
  color: #371625;
  font: inherit;
  padding: .38rem .62rem;
  cursor: pointer;
}
.gallery-dialog .gallery-dialog-image {
  max-height: 81dvh;
  width: 100%;
  object-fit: contain;
  background: #f5eff3;
}

.gallery-reveals [data-gallery-reveal] {
  opacity: .25;
  transform: translate3d(0, 28px, 0);
  transition: transform .7s cubic-bezier(.21, .79, .22, 1), opacity .55s ease;
}
.gallery-reveals .gallery-photo[data-gallery-reveal] { transition-delay: .07s; }
.gallery-reveals .gallery-preview[data-gallery-reveal] { transition-delay: .12s; }
.gallery-reveals [data-gallery-reveal].is-visible,
.gallery-reveals [data-gallery-reveal]:focus-within {
  opacity: 1;
  transform: none;
}

@media (max-width: 800px) {
  .gallery-intro-layout,
  .gallery-chapter-layout,
  .gallery-chapter:nth-of-type(even) .gallery-chapter-layout { grid-template-columns: minmax(0, 1fr); }
  .gallery-intro-copy > p:not(.story-kicker) { margin-top: .9rem; }
  .gallery-intro-layout { gap: 28px; }
  .gallery-intro-art { max-width: 32rem; }
  .gallery-chapter:nth-of-type(even) .gallery-chapter-copy,
  .gallery-chapter:nth-of-type(even) .gallery-montage { grid-column: auto; grid-row: auto; }
  .gallery-chapter h2 { max-width: 20ch; }
  .gallery-montage { grid-template-rows: clamp(108px, 34vw, 226px) auto; }
  .gallery-preview { grid-column: 3 / -1; }
  .gallery-chapter:nth-of-type(even) .gallery-preview { grid-column: 1 / span 10; }
  .gallery-chapter::before { clip-path: polygon(0 5%, 100% 0, 100% 97%, 0 100%); }
  .gallery-chapter:nth-of-type(odd)::before { clip-path: polygon(0 1%, 100% 5%, 100% 100%, 0 98%); }
}

@media (max-width: 560px) {
  .gallery-index { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery-intro h1 { letter-spacing: -.064em; }
  .gallery-intro::after { clip-path: polygon(90% 0, 100% 0, 100% 100%, 25% 100%); }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-reveals [data-gallery-reveal] { opacity: 1; transform: none; transition: none; }
}
