/* Selectors are grouped by gallery component to keep the visual states together. */
/* stylelint-disable no-descending-specificity, no-duplicate-selectors */

.gallery-page {
  --gallery-paper: #f2ede2;
  --gallery-ink: #111116;
  --gallery-coral: #f28c74;
  --gallery-blue: #8da2ff;
  --gallery-green: #7bd8bc;
  background:
    radial-gradient(circle at 12% 14%, rgba(242, 140, 116, 0.12), transparent 28rem),
    radial-gradient(circle at 88% 36%, rgba(141, 162, 255, 0.13), transparent 30rem),
    #07080b;
}

.gallery-page::after {
  opacity: 0.12;
}

.gallery-page button {
  font: inherit;
}

.gallery-page .page-shell {
  max-width: 1440px;
}

.gallery-page .topbar {
  top: 0.75rem;
}

.gallery-page .nav-links {
  font-size: 0.76rem;
}

.gallery-page .nav-links a {
  padding-inline: 0.62rem;
}

.gallery-main {
  padding: clamp(3.5rem, 8vw, 7.5rem) 0 clamp(4rem, 7vw, 7rem);
}

.gallery-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gallery-green);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.gallery-hero {
  min-height: min(780px, calc(100vh - 8rem));
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(440px, 1.1fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 7rem);
}

.gallery-hero-copy {
  position: relative;
  z-index: 2;
}

.gallery-hero h1,
.explorer-heading h2,
.place-feature h3,
.timeline-intro h3,
.map-story h3 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-weight: 400;
}

.gallery-hero h1 {
  max-width: 780px;
  margin: 1rem 0 1.25rem;
  font-size: clamp(3.4rem, 7vw, 7.4rem);
  line-height: 0.88;
  letter-spacing: -0.055em;
}

.gallery-hero h1 em {
  color: var(--gallery-coral);
  font-weight: 400;
}

.gallery-hero-copy > p {
  max-width: 57ch;
  margin: 0;
  color: var(--color-text-secondary);
  font-size: clamp(1rem, 1.4vw, 1.18rem);
}

.gallery-scroll-link {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 2rem;
  color: var(--color-text-primary);
  font-size: 0.84rem;
  font-weight: 700;
}

.gallery-scroll-link .bi {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border: 1px solid var(--border-default);
  border-radius: 50%;
  transition: transform 180ms ease, background 180ms ease;
}

.gallery-scroll-link:hover .bi,
.gallery-scroll-link:focus-visible .bi {
  transform: translateY(4px);
  background: var(--color-surface-hover);
}

.gallery-hero-frames {
  position: relative;
  min-height: 610px;
}

.hero-frame {
  position: absolute;
  display: grid;
  padding: 0;
  overflow: hidden;
  border: 0;
  color: var(--gallery-ink);
  background: var(--gallery-paper);
  box-shadow: 0 36px 100px rgba(0, 0, 0, 0.46);
  cursor: zoom-in;
  transition: transform 450ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 450ms ease;
}

.hero-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  pointer-events: none;
}

.hero-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-frame span {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  padding: 0.5rem 0.7rem;
  border-radius: 999px;
  background: rgba(9, 10, 14, 0.72);
  color: #fff;
  backdrop-filter: blur(12px);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-frame-primary {
  z-index: 2;
  top: 2.5rem;
  left: 0;
  width: min(68%, 420px);
  height: 520px;
  border: 14px solid var(--gallery-paper);
  transform: rotate(-4deg);
}

.hero-frame-primary img {
  object-position: 58% center;
}

.hero-frame-secondary {
  z-index: 1;
  right: 0;
  bottom: 0;
  width: min(58%, 350px);
  height: 430px;
  border: 10px solid #252a38;
  border-radius: 180px 180px 24px 24px;
  background: linear-gradient(180deg, #d9b2a5, #798cba);
  transform: rotate(5deg);
}

.hero-frame-secondary img {
  object-fit: cover;
  object-position: center;
}

.hero-frame:hover,
.hero-frame:focus-visible {
  z-index: 4;
  box-shadow: 0 46px 120px rgba(0, 0, 0, 0.6);
}

.hero-frame-primary:hover,
.hero-frame-primary:focus-visible { transform: rotate(-1deg) translateY(-8px); }
.hero-frame-secondary:hover,
.hero-frame-secondary:focus-visible { transform: rotate(2deg) translateY(-8px); }

.frame-note {
  position: absolute;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 0.85rem;
  color: var(--gallery-ink);
  background: #f6d572;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.26);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.frame-note-place {
  top: 0;
  right: 12%;
  transform: rotate(6deg);
}

.frame-note-year {
  bottom: 5%;
  left: 2%;
  color: #fff;
  background: var(--gallery-coral);
  transform: rotate(-7deg);
}

.gallery-explorer {
  scroll-margin-top: 7rem;
  padding-top: clamp(4rem, 8vw, 7rem);
}

.explorer-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-default);
}

.explorer-heading h2 {
  margin: 0.5rem 0 0;
  font-size: clamp(2.8rem, 5vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
}

.explorer-heading > p {
  max-width: 48ch;
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.gallery-tabs {
  position: sticky;
  top: 6.4rem;
  z-index: 12;
  display: flex;
  width: fit-content;
  gap: 0.35rem;
  margin: 1.5rem auto 3rem;
  padding: 0.4rem;
  border: 1px solid var(--border-default);
  border-radius: 999px;
  background: rgba(12, 13, 18, 0.82);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(18px);
}

.gallery-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.72rem 1rem;
  border: 0;
  border-radius: 999px;
  color: var(--color-text-muted);
  background: transparent;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.gallery-tab:hover,
.gallery-tab:focus-visible {
  color: var(--color-text-primary);
}

.gallery-tab.is-active {
  color: #0d1118;
  background: var(--gallery-paper);
  transform: translateY(-1px);
}

.gallery-panel[hidden] {
  display: none;
}

.gallery-panel {
  animation: gallery-panel-in 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.gallery-collection + .gallery-collection {
  margin-top: clamp(4rem, 8vw, 7rem);
}

.collection-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.collection-heading > div {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.collection-heading h3 {
  margin: 0.35rem 0 0;
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: clamp(2rem, 4vw, 3.7rem);
  font-weight: 400;
  line-height: 1;
}

.collection-heading > p {
  max-width: 52ch;
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.82rem;
}

.collection-index {
  display: grid;
  width: 3rem;
  height: 3rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--border-default);
  border-radius: 50%;
  color: var(--gallery-coral);
  font-size: 0.68rem;
  font-weight: 800;
}

.frame-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: 70px;
  grid-auto-flow: dense;
  gap: clamp(1rem, 2vw, 1.7rem);
}

.photo-card {
  position: relative;
  grid-column: span 4;
  grid-row: span 6;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border-default);
  border-radius: 24px;
  color: var(--color-text-primary);
  background: #111319;
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.24);
  cursor: zoom-in;
  text-align: left;
  transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1), border-color 300ms ease, box-shadow 300ms ease;
}

.photo-card:hover,
.photo-card:focus-visible {
  z-index: 2;
  transform: translateY(-8px);
  border-color: rgba(141, 162, 255, 0.32);
  box-shadow: 0 36px 80px rgba(0, 0, 0, 0.36);
}

.photo-card-portrait { grid-column: span 4; grid-row: span 7; }
.photo-card-landscape { grid-column: span 6; grid-row: span 6; }
.photo-card-panorama { grid-column: span 8; grid-row: span 6; }
.photo-card-square { grid-column: span 6; grid-row: span 7; }

.photo-visual {
  display: block;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: linear-gradient(145deg, #181b24, #0b0d12);
}

.photo-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.photo-card:hover .photo-visual img,
.photo-card:focus-visible .photo-visual img {
  transform: scale(1.035);
}

.photo-visual img.image-rotate-90 {
  object-fit: contain;
  transform: rotate(-90deg) scale(1.78);
}

.photo-card:hover .photo-visual img.image-rotate-90,
.photo-card:focus-visible .photo-visual img.image-rotate-90 {
  transform: rotate(-90deg) scale(1.83);
}

.photo-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
}

.photo-caption strong {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.18rem;
  font-weight: 400;
}

.photo-caption small {
  color: var(--color-text-muted);
  font-size: 0.68rem;
  text-align: right;
}

.frame-polaroid {
  padding: 0.85rem 0.85rem 0;
  border-radius: 3px;
  color: var(--gallery-ink);
  background: var(--gallery-paper);
  transform: rotate(-1deg);
}

.frame-polaroid .photo-caption small { color: #68645e; }
.frame-polaroid .photo-visual img { object-position: 58% center; }

.frame-soft {
  background: linear-gradient(135deg, rgba(242, 140, 116, 0.42), rgba(141, 162, 255, 0.38));
}

.frame-soft .photo-visual img,
.frame-arch .photo-visual img {
  object-fit: contain;
  object-position: center bottom;
}

.frame-circle .photo-visual {
  margin: 1.2rem 1.2rem 0;
  border: 8px solid #d9d1c2;
  border-radius: 50%;
}

.frame-circle .photo-visual img {
  object-position: 57% center;
}

.frame-arch .photo-visual {
  margin: 0.8rem 0.8rem 0;
  border-radius: 190px 190px 18px 18px;
  background: linear-gradient(180deg, #dbb3a6, #7087b8);
}

.frame-film {
  padding: 0.75rem 0;
  border-block: 14px dashed rgba(255, 255, 255, 0.28);
  border-radius: 4px;
  background: #050506;
}

.frame-film .photo-visual img {
  object-position: center 45%;
}

.frame-photo-cover .photo-visual img {
  object-fit: cover;
  object-position: center;
}

.frame-detail { background: linear-gradient(145deg, #33271f, #111319); }
.frame-memorial { background: linear-gradient(145deg, #25372d, #111319); }
.frame-night { background: linear-gradient(145deg, #171d2b, #07080b); }
.frame-journey { background: linear-gradient(145deg, #1d3340, #111319); }

.place-feature {
  display: grid;
  grid-template-columns: minmax(300px, 0.85fr) minmax(380px, 1.15fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 6rem);
  min-height: 560px;
  padding: clamp(1.5rem, 5vw, 5rem);
  overflow: hidden;
  border: 1px solid var(--border-default);
  border-radius: 38px;
  background:
    radial-gradient(circle at 80% 10%, rgba(123, 216, 188, 0.18), transparent 28rem),
    rgba(255, 255, 255, 0.025);
}

.place-feature + .place-feature {
  margin-top: 1.5rem;
}

.place-feature-copy {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem;
}

.place-number {
  display: grid;
  width: 3rem;
  height: 3rem;
  place-items: center;
  border: 1px solid var(--border-default);
  border-radius: 50%;
  color: var(--color-text-muted);
  font-size: 0.72rem;
}

.place-feature h3,
.timeline-intro h3,
.map-story h3 {
  margin: 0.6rem 0 1rem;
  font-size: clamp(2.5rem, 5vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.place-feature-copy p,
.timeline-intro p,
.map-story p {
  max-width: 46ch;
  margin: 0;
  color: var(--color-text-secondary);
}

.place-count {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  color: var(--gallery-green);
  font-size: 0.76rem;
  font-weight: 700;
}

.place-photo-stack {
  position: relative;
  min-height: 430px;
}

.place-photo-stack button,
.digital-place-art {
  position: absolute;
  padding: 0;
  overflow: hidden;
  border: 8px solid var(--gallery-paper);
  background: #1a1c24;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.36);
  cursor: zoom-in;
}

.place-photo-stack button:first-child {
  inset: 0 28% 4% 0;
  transform: rotate(-4deg);
}

.place-photo-stack button:last-child {
  inset: 12% 0 0 45%;
  border-color: #272c3a;
  transform: rotate(5deg);
}

.place-photo-stack img,
.digital-place-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.place-photo-stack button:first-child img { object-position: 58% center; }
.place-photo-stack button:last-child img { object-fit: contain; object-position: center bottom; background: linear-gradient(180deg, #d5ada3, #7386b8); }

.place-feature-delhi {
  background:
    radial-gradient(circle at 80% 10%, rgba(242, 140, 116, 0.2), transparent 28rem),
    rgba(255, 255, 255, 0.025);
}

.place-feature-sikkim {
  background:
    radial-gradient(circle at 82% 12%, rgba(141, 162, 255, 0.2), transparent 28rem),
    radial-gradient(circle at 18% 88%, rgba(123, 216, 188, 0.1), transparent 22rem),
    rgba(255, 255, 255, 0.025);
}

.place-photo-mosaic {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 130px;
  gap: 0.7rem;
}

.place-photo-mosaic button {
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 4px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: #111319;
  cursor: zoom-in;
  transition: transform 220ms ease, border-color 220ms ease;
}

.place-photo-mosaic button:hover,
.place-photo-mosaic button:focus-visible {
  z-index: 2;
  border-color: var(--gallery-coral);
  transform: translateY(-4px);
}

.place-photo-mosaic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.place-photo-mosaic img.image-rotate-90 {
  object-fit: contain;
  transform: rotate(-90deg) scale(1.8);
}

.place-feature-digital {
  min-height: 440px;
  background:
    radial-gradient(circle at 78% 20%, rgba(242, 140, 116, 0.22), transparent 24rem),
    rgba(255, 255, 255, 0.025);
}

.digital-place-art {
  position: relative;
  width: min(100%, 420px);
  height: 380px;
  justify-self: center;
  border: 0;
  border-radius: 50% 50% 18px 18px;
  background: linear-gradient(180deg, #d6afa3, #7388b8);
}

.digital-place-art img {
  object-fit: contain;
  object-position: center bottom;
}

.timeline-intro {
  margin: 0 auto 3rem;
  text-align: center;
}

.timeline-intro p {
  margin-inline: auto;
}

.photo-timeline {
  position: relative;
  max-width: 980px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.photo-timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: linear-gradient(var(--gallery-coral), var(--gallery-blue));
}

.photo-timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 80px 1fr;
  align-items: center;
  gap: 2rem;
  min-height: 360px;
}

.photo-timeline li:nth-child(even) .timeline-copy {
  grid-column: 1;
  grid-row: 1;
  text-align: right;
}

.timeline-marker {
  position: relative;
  z-index: 2;
  grid-column: 2;
  grid-row: 1;
  display: grid;
  width: 3rem;
  height: 3rem;
  place-self: center;
  place-items: center;
  border: 8px solid #090a0d;
  border-radius: 50%;
  color: var(--gallery-ink);
  background: var(--gallery-paper);
  font-size: 0.65rem;
  font-weight: 800;
}

.timeline-photo {
  width: 100%;
  height: 320px;
  padding: 0;
  overflow: hidden;
  border: 8px solid var(--gallery-paper);
  background: #13151b;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
  cursor: zoom-in;
  transform: rotate(-2deg);
}

.photo-timeline li:nth-child(even) .timeline-photo {
  grid-column: 3;
  border-color: #272c3a;
  transform: rotate(2deg);
}

.timeline-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-timeline li:first-child .timeline-photo img { object-position: 58% center; }
.timeline-photo-contain img { object-fit: contain; object-position: center bottom; background: linear-gradient(180deg, #d4ada2, #7589ba); }

.timeline-copy span {
  color: var(--gallery-coral);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.timeline-copy h4 {
  margin: 0.5rem 0;
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 2rem;
  font-weight: 400;
}

.timeline-copy p {
  margin: 0;
  color: var(--color-text-muted);
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(290px, 0.55fr);
  min-height: 600px;
  overflow: hidden;
  border: 1px solid var(--border-default);
  border-radius: 38px;
  background: rgba(255, 255, 255, 0.025);
}

.map-layout + .map-layout {
  margin-top: clamp(2rem, 5vw, 4rem);
}

.map-canvas {
  position: relative;
  min-height: 600px;
  background: #d8d5ca;
}

.map-canvas iframe {
  width: 100%;
  height: 100%;
  min-height: 600px;
  border: 0;
  filter: saturate(0.65) contrast(1.04);
}

.map-privacy {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 0.8rem;
  border-radius: 999px;
  color: #f7f7f8;
  background: rgba(11, 13, 17, 0.82);
  backdrop-filter: blur(12px);
  font-size: 0.7rem;
  font-weight: 700;
}

.map-story {
  align-self: center;
  padding: clamp(2rem, 4vw, 4rem);
}

.map-story h3 {
  font-size: clamp(3rem, 5vw, 5.4rem);
}

.map-story > a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 1.5rem;
  color: var(--gallery-green);
  font-size: 0.78rem;
  font-weight: 700;
}

.map-thumbnails {
  display: flex;
  margin-top: 1.5rem;
}

.map-thumbnails button {
  width: 78px;
  height: 78px;
  padding: 0;
  overflow: hidden;
  border: 4px solid #20232c;
  border-radius: 50%;
  background: #11131a;
  cursor: zoom-in;
}

.map-thumbnails button + button {
  margin-left: -1rem;
}

.map-thumbnails img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-note {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.2rem;
  margin-top: clamp(4rem, 8vw, 8rem);
  padding: 1.4rem 1.6rem;
  border: 1px solid var(--border-default);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.025);
}

.gallery-note > .bi {
  display: grid;
  width: 3rem;
  height: 3rem;
  place-items: center;
  border-radius: 50%;
  color: var(--gallery-ink);
  background: var(--gallery-paper);
}

.gallery-note span {
  font-weight: 700;
}

.gallery-note p {
  margin: 0.15rem 0 0;
  color: var(--color-text-muted);
  font-size: 0.78rem;
}

.gallery-note a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gallery-green);
  font-size: 0.8rem;
  font-weight: 700;
}

.gallery-footer .footer-main {
  grid-template-columns: minmax(0, 1.4fr) minmax(120px, 0.65fr) minmax(150px, 0.75fr) auto;
}

.photo-lightbox {
  width: min(94vw, 980px);
  max-width: none;
  max-height: 92vh;
  padding: 0;
  overflow: visible;
  border: 0;
  color: var(--color-text-primary);
  background: transparent;
}

.photo-lightbox::backdrop {
  background: rgba(2, 3, 5, 0.88);
  backdrop-filter: blur(16px);
}

.lightbox-inner {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  max-height: 92vh;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 28px;
  background: #0d0f14;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.68);
}

.lightbox-stage {
  position: relative;
  min-height: 0;
  max-height: calc(92vh - 94px);
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(45deg, #11141b 25%, transparent 25%),
    linear-gradient(-45deg, #11141b 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #11141b 75%),
    linear-gradient(-45deg, transparent 75%, #11141b 75%),
    #0a0c10;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  background-size: 24px 24px;
}

.lightbox-stage img {
  width: 100%;
  height: 100%;
  max-height: calc(92vh - 94px);
  object-fit: contain;
}

.lightbox-stage img.is-rotated-90 {
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(92vh - 94px);
  height: min(94vw, 980px);
  max-width: none;
  max-height: none;
  transform: translate(-50%, -50%) rotate(-90deg);
}

.photo-lightbox.has-rotated-image .lightbox-stage {
  height: calc(92vh - 94px);
}

.lightbox-caption {
  padding: 1rem 1.25rem 1.15rem;
}

.lightbox-caption h2 {
  margin: 0;
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 400;
}

.lightbox-caption p {
  margin: 0.2rem 0 0;
  color: var(--color-text-muted);
  font-size: 0.76rem;
}

.lightbox-close {
  position: absolute;
  z-index: 2;
  top: 0.8rem;
  right: 0.8rem;
  display: grid;
  width: 2.7rem;
  height: 2.7rem;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  color: #fff;
  background: rgba(8, 10, 14, 0.74);
  backdrop-filter: blur(10px);
  cursor: pointer;
}

.gallery-orb {
  position: fixed;
  z-index: -1;
  width: 26rem;
  height: 26rem;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.08;
  pointer-events: none;
}

.gallery-orb-one { top: 5%; left: -10rem; background: var(--gallery-coral); }
.gallery-orb-two { right: -10rem; bottom: 10%; background: var(--gallery-blue); }

@keyframes gallery-panel-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1120px) {
  .gallery-hero {
    grid-template-columns: minmax(0, 0.9fr) minmax(390px, 1.1fr);
    gap: 2rem;
  }

  .gallery-hero h1 { font-size: clamp(3.4rem, 6.5vw, 5.8rem); }
  .hero-frame-primary { width: 66%; }
  .hero-frame-secondary { width: 58%; }
}

@media (max-width: 980px) {
  .gallery-page .nav-links { font-size: 0.82rem; }
  .gallery-page .nav-links a { padding: 0.85rem 1rem; }

  .gallery-hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding-top: 1rem;
  }

  .gallery-hero-copy { max-width: 720px; }
  .gallery-hero-frames { width: min(100%, 680px); margin: 0 auto; }
  .place-feature { grid-template-columns: 1fr; }
  .place-photo-stack { min-height: 500px; }
  .map-layout { grid-template-columns: 1fr; }
  .map-canvas, .map-canvas iframe { min-height: 440px; }
}

@media (max-width: 760px) {
  .gallery-main { padding-top: 3rem; }
  .gallery-hero h1 { font-size: clamp(3rem, 14vw, 5.2rem); }
  .gallery-hero-frames { min-height: 520px; }
  .hero-frame-primary { height: 440px; }
  .hero-frame-secondary { height: 350px; }

  .explorer-heading {
    align-items: start;
    flex-direction: column;
  }

  .collection-heading {
    align-items: start;
    flex-direction: column;
  }

  .gallery-tabs {
    top: 5.6rem;
    width: 100%;
    justify-content: space-between;
    overflow-x: auto;
  }

  .gallery-tab {
    flex: 1 0 auto;
    justify-content: center;
    padding-inline: 0.75rem;
  }

  .frame-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 72px;
  }

  .photo-card,
  .photo-card-portrait,
  .photo-card-square {
    grid-column: span 1;
  }

  .photo-card-portrait { grid-row: span 6; }
  .photo-card-square { grid-row: span 5; }
  .photo-card-landscape { grid-column: span 2; grid-row: span 5; }
  .photo-card-panorama { grid-column: span 2; grid-row: span 4; }

  .place-feature {
    min-height: 0;
    padding: 1.25rem;
    border-radius: 26px;
  }

  .place-photo-stack { min-height: 400px; }

  .photo-timeline::before { left: 24px; }
  .photo-timeline li,
  .photo-timeline li:nth-child(even) {
    grid-template-columns: 48px 1fr;
    gap: 1rem;
    padding-bottom: 2rem;
  }

  .timeline-marker,
  .photo-timeline li:nth-child(even) .timeline-marker {
    grid-column: 1;
    grid-row: 1;
  }

  .timeline-photo,
  .photo-timeline li:nth-child(even) .timeline-photo {
    grid-column: 2;
    grid-row: 1;
    height: 300px;
  }

  .timeline-copy,
  .photo-timeline li:nth-child(even) .timeline-copy {
    grid-column: 2;
    grid-row: 2;
    text-align: left;
  }

  .gallery-note { grid-template-columns: auto 1fr; }
  .gallery-note a { grid-column: 2; }
}

@media (max-width: 520px) {
  .gallery-main { padding-top: 2.5rem; }
  .gallery-hero-frames { min-height: 430px; }
  .hero-frame-primary { top: 2rem; width: 68%; height: 350px; border-width: 9px; }
  .hero-frame-secondary { width: 58%; height: 290px; border-width: 7px; }
  .frame-note-place { right: 3%; }
  .frame-note-year { bottom: 0; }

  .gallery-tabs { border-radius: 18px; }
  .gallery-tab { min-width: 46px; padding: 0.72rem; font-size: 0; }
  .gallery-tab .bi { font-size: 1rem; }

  .frame-grid {
    display: flex;
    flex-direction: column;
  }

  .photo-card,
  .photo-card-portrait,
  .photo-card-landscape,
  .photo-card-panorama,
  .photo-card-square {
    min-height: 0;
  }

  .photo-card .photo-visual { flex: none; }
  .photo-card-portrait .photo-visual { aspect-ratio: 3 / 4; }
  .photo-card-landscape .photo-visual { aspect-ratio: 4 / 3; }
  .photo-card-panorama .photo-visual { aspect-ratio: 16 / 9; }
  .photo-card-square .photo-visual { aspect-ratio: 1; }

  .place-feature-copy { grid-template-columns: 1fr; }
  .place-photo-stack { min-height: 330px; }
  .place-photo-mosaic { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 120px; }
  .digital-place-art { height: 320px; }
  .map-layout { border-radius: 26px; }
  .map-canvas, .map-canvas iframe { min-height: 360px; }
  .map-story { padding: 1.5rem; }
  .photo-timeline li, .photo-timeline li:nth-child(even) { grid-template-columns: 38px 1fr; gap: 0.7rem; }
  .photo-timeline::before { left: 19px; }
  .timeline-marker { width: 2.5rem; height: 2.5rem; border-width: 6px; }
  .timeline-photo, .photo-timeline li:nth-child(even) .timeline-photo { height: 240px; border-width: 6px; }
  .gallery-note { padding: 1.1rem; }
  .gallery-footer .footer-main { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-panel { animation: none; }
}

.gallery-page {
  --gallery-paper: #f8f8f8;
  --gallery-ink: #0a0a0a;
  --gallery-coral: #d00000;
  --gallery-blue: #a00000;
  --gallery-green: #f0b0b0;
  background: #050505;
}

.gallery-page::before {
  background: linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: 0.18;
}

.gallery-page::after {
  background: radial-gradient(circle at 78% 14%, rgba(160, 0, 0, 0.14), transparent 30rem);
  opacity: 0.55;
}

.gallery-kicker,
.gallery-hero h1 em,
.collection-index,
.place-number,
.gallery-scroll-link:hover,
.gallery-scroll-link:focus-visible,
.gallery-tabs button[aria-selected="true"] {
  color: #d00000;
}

.gallery-scroll-link,
.gallery-tabs,
.gallery-panel,
.place-feature,
.timeline-intro,
.map-layout,
.gallery-note,
.photo-lightbox {
  border-color: #282828;
}

.gallery-tabs,
.gallery-panel,
.place-feature,
.timeline-intro,
.map-layout,
.gallery-note {
  background: #0d0d0d;
}

.gallery-tabs button[aria-selected="true"] {
  background: rgba(160, 0, 0, 0.14);
  border-color: #780000;
}

.photo-card,
.hero-frame,
.timeline-photo,
.map-thumbnails button {
  background: #111111;
  border-color: #303030;
}

.photo-card:hover,
.hero-frame:hover,
.timeline-photo:hover,
.map-thumbnails button:hover {
  border-color: #a00000;
  box-shadow: 0 16px 36px rgba(120, 0, 0, 0.18);
}

.photo-caption,
.timeline-copy,
.map-story,
.collection-heading p,
.gallery-hero-copy > p {
  color: #b2b2b2;
}

.photo-caption strong,
.timeline-copy h4,
.map-story h3,
.collection-heading h3,
.explorer-heading h2 {
  color: #f8f8f8;
}

.photo-lightbox {
  background: #0a0a0a;
}

@media (max-width: 520px) {
  .gallery-tabs {
    background: #0a0a0a;
  }
}

/* Motion polish and progressive interaction enhancements. */
.gallery-hero-copy > * {
  animation: gallery-hero-reveal 720ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.gallery-hero-copy > :nth-child(2) { animation-delay: 80ms; }
.gallery-hero-copy > :nth-child(3) { animation-delay: 150ms; }
.gallery-hero-copy > :nth-child(4) { animation-delay: 220ms; }

.gallery-hero-frames {
  animation: gallery-frames-reveal 900ms 140ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.gallery-tabs {
  --active-tab-width: 0px;
  --active-tab-x: 0px;
  isolation: isolate;
}

.gallery-tabs::before {
  content: '';
  position: absolute;
  z-index: -1;
  top: 0.4rem;
  left: 0;
  width: var(--active-tab-width);
  height: calc(100% - 0.8rem);
  border: 1px solid #780000;
  border-radius: 999px;
  background: rgba(160, 0, 0, 0.16);
  box-shadow: 0 8px 24px rgba(120, 0, 0, 0.14);
  transform: translateX(var(--active-tab-x));
  transition:
    width 420ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.gallery-tabs button[aria-selected="true"] {
  position: relative;
  z-index: 1;
  background: transparent;
}

.gallery-panel:not([hidden]) {
  view-transition-name: gallery-panel;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
}

::view-transition-old(gallery-panel) {
  animation: gallery-panel-out 180ms cubic-bezier(0.4, 0, 1, 1) both;
}

::view-transition-new(gallery-panel) {
  animation: gallery-panel-in 460ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.gallery-motion-ready .gallery-reveal {
  opacity: 0;
  filter: blur(5px);
  translate: 0 24px;
  scale: 0.985;
}

.gallery-motion-ready .gallery-reveal.is-revealed {
  animation: gallery-scroll-reveal 680ms var(--reveal-delay, 0ms) cubic-bezier(0.22, 1, 0.36, 1) both;
}

body.lightbox-open {
  overflow: hidden;
}

.photo-lightbox {
  opacity: 0;
  transform: translateY(18px) scale(0.97);
  transition:
    opacity 220ms ease,
    transform 360ms cubic-bezier(0.22, 1, 0.36, 1);
}

.photo-lightbox[open].is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.photo-lightbox.is-closing {
  pointer-events: none;
}

.photo-lightbox::backdrop {
  background: rgba(2, 3, 5, 0);
  backdrop-filter: blur(0);
  transition:
    background 260ms ease,
    backdrop-filter 260ms ease;
}

.photo-lightbox.is-open::backdrop {
  background: rgba(2, 3, 5, 0.88);
  backdrop-filter: blur(16px);
}

.lightbox-stage {
  touch-action: pan-y;
  will-change: opacity, transform;
}

.lightbox-nav,
.lightbox-close {
  transition:
    color 180ms ease,
    background 180ms ease,
    border-color 180ms ease,
    transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.lightbox-nav {
  position: absolute;
  z-index: 3;
  top: 50%;
  display: grid;
  width: 3rem;
  height: 3rem;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  color: #fff;
  background: rgba(8, 10, 14, 0.72);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
  cursor: pointer;
  transform: translateY(-50%);
}

.lightbox-previous { left: 1rem; }
.lightbox-next { right: 1rem; }

.lightbox-nav:hover,
.lightbox-nav:focus-visible,
.lightbox-close:hover,
.lightbox-close:focus-visible {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(160, 0, 0, 0.88);
  transform: translateY(-50%) scale(1.06);
}

.lightbox-close:hover,
.lightbox-close:focus-visible {
  transform: scale(1.06);
}

.lightbox-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.lightbox-counter {
  flex: 0 0 auto;
  color: #8f8f8f;
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.lightbox-progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.07);
}

.lightbox-progress span {
  display: block;
  width: var(--lightbox-progress, 0%);
  height: 100%;
  background: #d00000;
  transition: width 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes gallery-hero-reveal {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes gallery-frames-reveal {
  from { opacity: 0; transform: translateY(26px) scale(0.975); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes gallery-panel-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-8px) scale(0.995); }
}

@keyframes gallery-scroll-reveal {
  from { opacity: 0; filter: blur(5px); translate: 0 24px; scale: 0.985; }
  to { opacity: 1; filter: blur(0); translate: 0 0; scale: 1; }
}

@media (max-width: 620px) {
  .lightbox-nav {
    top: auto;
    bottom: 5.15rem;
    width: 2.75rem;
    height: 2.75rem;
    transform: none;
  }

  .lightbox-previous { left: 0.75rem; }
  .lightbox-next { right: 0.75rem; }

  .lightbox-nav:hover,
  .lightbox-nav:focus-visible {
    transform: scale(1.06);
  }

  .lightbox-caption {
    min-height: 5.25rem;
    padding-right: 4rem;
    padding-left: 4rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-hero-copy > *,
  .gallery-hero-frames,
  .gallery-motion-ready .gallery-reveal,
  .gallery-motion-ready .gallery-reveal.is-revealed {
    opacity: 1;
    animation: none;
    filter: none;
    transform: none;
    translate: none;
    scale: none;
  }

  .gallery-tabs::before,
  .photo-lightbox,
  .photo-lightbox::backdrop,
  .lightbox-progress span {
    transition: none;
  }

  ::view-transition-old(gallery-panel),
  ::view-transition-new(gallery-panel) {
    animation: none;
  }
}
