/* ─────────────────────────────────────────────
   Gallery — Rico layout, homepage paper theme
   ───────────────────────────────────────────── */

:root {
  --gr-sans: "Inter", "Helvetica Neue", Arial, sans-serif;
  --gr-glass: rgba(255, 255, 255, 0.72);
  --gr-glass-active: rgba(255, 255, 255, 0.95);
  --gr-border: rgba(26, 26, 26, 0.14);
  --gr-border-active: rgba(26, 26, 26, 0.32);
  --gr-text: var(--ink, #1a1a1a);
  --gr-text-dim: rgba(26, 26, 26, 0.52);
}

#section-gallery,
#section-prints,
#section-maquettes {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  scroll-snap-align: start;
  color: var(--gr-text);
  contain: layout style paint;
}

#section-gallery,
#section-prints {
  background: #1c1c1c;
  --gr-glass-blur: 14px;
  --gr-glass-saturate: 1;
  --gr-glass-bg: rgba(28, 28, 28, 0.72);
  --gr-glass-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

#section-maquettes {
  background: #1c1c1c;
  --gr-glass-blur: 14px;
  --gr-glass-saturate: 1;
  --gr-glass-bg: rgba(28, 28, 28, 0.72);
  --gr-glass-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

#section-maquettes .gallery-index__img,
#section-maquettes .gallery-rico__img {
  background: transparent;
}

#section-maquettes .gallery-rico--detail .gallery-rico__viewport {
  overflow: hidden;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-page,
:is(#section-gallery, #section-prints, #section-maquettes) #galleryGrid,
#section-prints #printsGrid,
#section-maquettes #maquettesGrid {
  z-index: 2;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-page,
#section-maquettes .gallery-page,
:is(#section-gallery, #section-prints, #section-maquettes) #galleryGrid,
#section-prints #printsGrid,
#section-maquettes #maquettesGrid {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: transparent;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--gr-sans);
  -webkit-font-smoothing: antialiased;
  background: transparent;
  --gr-step-ms: 240ms;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: stretch;
  padding:
    var(--site-nav-clearance, max(64px, calc(env(safe-area-inset-top) + 56px)))
    clamp(12px, 3vw, 32px)
    max(72px, calc(env(safe-area-inset-bottom, 0px) + 56px))
    clamp(12px, 3vw, 32px);
  box-sizing: border-box;
}

/* ── Thando-style grid + detail layout ── */

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-layout {
  width: 100%;
  height: 100%;
  min-height: 0;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-layout[data-mode="grid"] .gallery-rico--detail {
  display: none;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-layout[data-mode="detail"] .gallery-index {
  display: none;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail {
  overflow: visible;
}

/* ── Gallery grid index (before click) ── */

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-index {
  width: 100%;
  height: 100%;
  min-height: 0;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-index__scroller {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}

.prints-index__empty {
  grid-column: 1 / -1;
  align-self: center;
  justify-self: center;
  margin: 0;
  font-family: var(--gr-sans);
  font-size: clamp(0.95rem, 2.4vw, 1.1rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
  text-align: center;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-index__page {
  height: 100%;
  min-height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding:
    var(--site-nav-clearance, max(64px, calc(env(safe-area-inset-top) + 56px)))
    clamp(12px, 3vw, 32px)
    max(48px, calc(env(safe-area-inset-bottom, 0px) + 36px))
    clamp(12px, 3vw, 32px);
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-index__grid {
  display: grid;
  grid-template-columns: repeat(var(--gi-cols, 3), minmax(0, 1fr));
  grid-template-rows: repeat(var(--gi-rows, 2), minmax(0, 1fr));
  gap: clamp(12px, 2vw, 22px);
  width: min(100%, 980px);
  height: min(100%, 80vh);
  min-height: 0;
  max-height: 100%;
  margin: 0 auto;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-index__cell {
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transform: translateZ(0);
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: clamp(10px, 1.6vw, 16px);
  border: 0;
  border-radius: clamp(16px, 2.8vw, 24px);
  background: rgba(28, 28, 28, 0.72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-index__cell:hover,
:is(#section-gallery, #section-prints, #section-maquettes) .gallery-index__cell:focus-visible {
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.34);
  outline: none;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-index__img {
  position: relative;
  z-index: 1;
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  background: none;
  border: none;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-index__cell--diptych {
  grid-column: var(--diptych-col, 3);
  grid-row: 1 / span 2;
  padding: clamp(8px, 1.2vw, 12px);
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-index__diptych {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 1vw, 10px);
  width: 100%;
  height: 100%;
  min-height: 0;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-index__cell--diptych .gallery-index__img {
  flex: 1 1 0;
  min-height: 0;
  max-height: calc(50% - 0.35rem);
}

@media (max-width: 599px) {
  :is(#section-gallery, #section-prints) .gallery-index__cell--diptych .gallery-index__diptych {
    justify-content: space-between;
    gap: clamp(4px, 1.2vw, 8px);
  }

  :is(#section-gallery, #section-prints) .gallery-index__cell--diptych .gallery-index__img {
    width: 100%;
    max-height: calc(50% - 0.15rem);
  }
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__frame--diptych {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__diptych {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.2vh, 14px);
  width: 100%;
  height: 100%;
  min-height: 0;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__frame--diptych .gallery-rico__img {
  width: auto;
  height: auto;
  max-width: 100%;
  object-fit: contain;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__frame--diptych .gallery-rico__img--diptych-top,
:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__frame--diptych .gallery-rico__img--diptych-bottom {
  flex: 1 1 0;
  min-height: 0;
  max-height: calc(50% - 0.35rem);
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__head {
  grid-row: 1;
  text-align: center;
  z-index: 3;
  margin-bottom: clamp(6px, 1.2vh, 14px);
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail .gallery-rico__head {
  min-height: 3.5rem;
}

:is(#section-maquettes) .gallery-rico--detail .gallery-rico__counter {
  color: rgba(255, 255, 255, 0.58);
}

:is(#section-maquettes) .gallery-rico--detail .gallery-rico__title {
  color: #ffffff;
}

#section-gallery .gallery-rico--detail .gallery-rico__counter {
  color: rgba(255, 255, 255, 0.58);
}

#section-gallery .gallery-rico--detail .gallery-rico__title {
  color: #ffffff;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__body {
  grid-row: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.4fr) minmax(0, 1fr);
  gap: clamp(12px, 2vw, 28px);
  min-height: 0;
  align-items: stretch;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail .gallery-rico__stage {
  grid-row: unset;
  min-height: 0;
  min-width: 0;
  height: 100%;
  width: 100%;
  max-width: none;
  margin: 0;
  justify-self: stretch;
  overflow: visible;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail .gallery-rico__stage-wrap {
  overflow: visible;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__stage-wrap {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  justify-items: center;
  gap: clamp(6px, 1.2vw, 14px);
  min-height: 0;
  height: 100%;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail .gallery-rico__body {
  align-items: center;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail .gallery-rico__stage-wrap {
  align-self: stretch;
  height: 100%;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail .gallery-rico__stage {
  height: 100%;
}

@media (min-width: 769px) {
  :is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail {
    padding-top: max(56px, calc(env(safe-area-inset-top, 0px) + 48px));
  }

  :is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail .gallery-rico__body {
    transform: translateY(-3%);
  }

  :is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail .gallery-rico__viewport {
    position: relative;
    width: min(100%, 720px);
    height: min(62vh, 760px);
    max-height: min(68vh, 820px);
    min-height: min(42vh, 380px);
    flex-shrink: 0;
    margin: 0 auto;
    overflow: hidden;
  }

  /* Non-immersive detail: fixed CSS stage box — do not rely on JS px sizing. */
  :is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail:not(.is-immersive) .gallery-rico__viewport:not(.is-sized),
  :is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail:not(.is-immersive) .gallery-rico__viewport.is-sized {
    width: min(100%, 720px);
    height: min(62vh, 760px);
    max-width: min(100%, 720px);
    max-height: min(68vh, 820px);
    min-height: min(42vh, 380px);
    aspect-ratio: auto;
  }
}

@media (max-width: 768px) {
  :is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail:not(.is-immersive) .gallery-rico__viewport,
  :is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail:not(.is-immersive) .gallery-rico__viewport:not(.is-sized),
  :is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail:not(.is-immersive) .gallery-rico__viewport.is-sized {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    min-height: 0;
    flex-shrink: 1;
    margin: 0 auto;
    overflow: hidden;
  }
}

/* Immersive keeps JS-driven sizing. */
:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail.is-immersive .gallery-rico__viewport.is-sized {
  max-width: none;
  max-height: none;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__aside--left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(10px, 1.5vh, 14px);
  padding-left: clamp(4px, 1.5vw, 16px);
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__aside--right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-right: clamp(4px, 1.5vw, 16px);
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail .gallery-rico__enquire {
  margin: 0;
  pointer-events: auto;
  border: 0;
  border-radius: 18px;
  background: rgba(28, 28, 28, 0.72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  color: #ffffff;
  transform: translateZ(0);
  transition:
    box-shadow 0.2s ease,
    background 0.2s ease,
    color 0.2s ease;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail .gallery-rico__enquire:hover {
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.34);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

@media (min-width: 769px) {
  :is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail .gallery-rico__enquire {
    margin: 0 0 clamp(20px, 4vh, 40px) 0;
  }
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__details {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 2vh, 18px);
  padding: clamp(0.75rem, 2vh, 1rem) clamp(0.85rem, 2vw, 1.15rem);
  border: 0;
  border-radius: 18px;
  background: rgba(28, 28, 28, 0.72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  box-sizing: border-box;
  transform: translateZ(0);
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__detail dt {
  margin: 0 0 4px;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(9px, 2.2vw, 11px);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.58);
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__detail dd {
  margin: 0;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(11px, 2.4vw, 13px);
  font-weight: 500;
  line-height: 1.45;
  color: #ffffff;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__coa {
  width: 100%;
  max-width: min(100%, 280px);
  border: 0;
  border-radius: 18px;
  overflow: visible;
  box-sizing: border-box;
  background: rgba(28, 28, 28, 0.72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  transform: translateZ(0);
  transition: box-shadow 0.2s ease, background 0.2s ease;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__coa.is-open {
  overflow: hidden;
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.34);
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__coa-toggle {
  appearance: none;
  display: block;
  width: 100%;
  margin: 0;
  padding: clamp(10px, 1.5vh, 12px) clamp(12px, 2vw, 14px);
  border: 0;
  background: none;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(10px, 2.3vw, 12px);
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.45;
  text-align: left;
  text-decoration: none;
  color: #ffffff;
  cursor: pointer;
  transition: color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__coa-toggle:hover {
  color: rgba(255, 255, 255, 0.82);
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__coa-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.28s ease;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__coa.is-open .gallery-rico__coa-panel {
  grid-template-rows: 1fr;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__coa-panel-inner {
  overflow: hidden;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__coa.is-open .gallery-rico__coa-panel-inner {
  overflow-x: hidden;
  overflow-y: auto;
  max-height: calc(100vh - 380px);
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__coa.is-open .gallery-rico__coa-panel-inner::-webkit-scrollbar {
  width: 3px;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__coa.is-open .gallery-rico__coa-panel-inner::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.35);
  border-radius: 999px;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__coa-body {
  padding: 0 clamp(12px, 2vw, 14px) clamp(10px, 1.5vh, 12px);
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(10px, 2.2vw, 12px);
  font-weight: 400;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.82);
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__coa-body p {
  margin: 0 0 0.75em;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__coa-body p:last-child {
  margin-bottom: 0;
}

@media (prefers-reduced-motion: reduce) {
  :is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__coa-panel {
    transition: none;
  }
}

@media (min-width: 1024px) {
  :is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__detail dt {
    font-size: 10px;
    letter-spacing: 0.12em;
  }

  :is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__detail dd {
    font-size: 13px;
    line-height: 1.5;
  }
}

@media (min-width: 1024px) {
  :is(#section-gallery, #section-prints, #section-maquettes) {
    --gr-glass-blur: 20px;
    --gr-glass-saturate: 1.12;
  }
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__nav {
  isolation: isolate;
  transform: translateZ(0);
  appearance: none;
  position: relative;
  overflow: hidden;
  border: 0;
  border-radius: 18px;
  width: clamp(36px, 4.5vw, 44px);
  height: clamp(36px, 4.5vw, 44px);
  cursor: pointer;
  font-size: clamp(16px, 2.5vw, 20px);
  line-height: 1;
  color: rgba(255, 255, 255, 0.9);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(28, 28, 28, 0.72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: var(--gr-glass-shadow);
  transition: color 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__nav::before {
  display: none;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__nav span {
  position: relative;
  z-index: 1;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__nav:hover:not(:disabled) {
  color: #fff;
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.34);
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__nav:disabled {
  opacity: 0.38;
  cursor: default;
}

@media (min-width: 1024px) {
  :is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__nav {
    width: 44px;
    height: 44px;
    font-size: 20px;
    border-radius: 14px;
  }
}

@media (prefers-reduced-transparency: reduce) {
  :is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__nav {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: rgba(28, 28, 30, 0.94);
  }

  :is(#section-gallery, #section-prints, #section-maquettes) .gallery-index__cell {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: rgba(28, 28, 28, 0.94);
  }

  :is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__details,
  :is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail .gallery-rico__enquire,
  :is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__coa {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: rgba(28, 28, 28, 0.94);
  }
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail .gallery-rico__frame.is-active,
:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail .gallery-rico__frame.is-active .gallery-rico__diptych,
:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail .gallery-rico__frame.is-active .gallery-rico__img {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail.is-immersive {
  grid-template-rows: minmax(0, 1fr);
  padding:
    max(72px, calc(env(safe-area-inset-top, 0px) + 64px))
    clamp(56px, 7vw, 90px)
    max(24px, env(safe-area-inset-bottom, 0px))
    clamp(56px, 7vw, 90px);
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail.is-immersive .gallery-rico__head,
:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail.is-immersive .gallery-rico__aside--left,
:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail.is-immersive .gallery-rico__aside--right {
  display: none !important;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail.is-immersive .gallery-rico__body {
  grid-column: 1;
  grid-row: 1;
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  min-height: 0;
  height: 100%;
  align-self: stretch;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail.is-immersive .gallery-rico__stage-wrap {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  min-height: 0;
  height: 100%;
  align-self: stretch;
  gap: clamp(10px, 2vw, 14px);
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail.is-immersive .gallery-rico__stage {
  min-height: 0;
  height: 100%;
  width: 100%;
  max-width: none;
  align-self: stretch;
  align-items: stretch;
  justify-content: stretch;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail.is-immersive .gallery-rico__viewport,
:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail.is-immersive .gallery-rico__viewport.is-sized {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0;
  flex: 1 1 auto;
  align-self: stretch;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail.is-immersive .gallery-rico__viewport > .gallery-rico__frame {
  position: absolute;
  inset: 0;
  margin: 0;
  width: 100%;
  height: 100%;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail.is-immersive .gallery-rico__frame:not(.is-active):not(.is-enter-from-right):not(.is-enter-from-left):not(.is-leave-to-left):not(.is-leave-to-right) {
  display: none !important;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail.is-immersive .gallery-rico__frame.is-active,
:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail.is-immersive .gallery-rico__frame.is-active .gallery-rico__diptych {
  width: 100%;
  height: 100%;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail.is-immersive .gallery-rico__img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail.is-immersive.is-fit-pending .gallery-rico__viewport {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail.is-immersive.is-fit-pending .gallery-rico__viewport:not(.is-sized) .gallery-rico__img {
  opacity: 0.96;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail.is-immersive:not(.is-fit-pending) .gallery-rico__viewport {
  opacity: 1;
  visibility: visible;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail.is-immersive.is-fit-pending .gallery-rico__nav {
  visibility: visible;
}

#section-maquettes .gallery-rico--detail.is-immersive.is-fit-pending .gallery-rico__viewport {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Assamblage fullscreen: size to opaque artwork bounds (not full PNG canvas). */
#section-maquettes .gallery-rico--detail.is-immersive .gallery-rico__stage {
  align-items: center;
  justify-content: center;
}

#section-maquettes .gallery-rico--detail.is-immersive .gallery-rico__viewport.is-sized {
  width: var(--maq-fit-w, 100%) !important;
  height: var(--maq-fit-h, 100%) !important;
  max-width: 100% !important;
  max-height: 100% !important;
  flex: 0 0 auto !important;
  align-self: center !important;
  margin-inline: auto;
  overflow: hidden;
  position: relative;
  transform: translateY(var(--maq-viewport-offset-y, 0px));
}

@media (max-width: 768px) {
  :is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto auto;
    gap: 14px;
  }

  :is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__stage-wrap {
    grid-row: 1;
  }

  :is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail:not(.is-immersive) .gallery-rico__body {
    min-height: 0;
    overflow: hidden;
  }

  :is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail:not(.is-immersive) .gallery-rico__stage-wrap {
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
    gap: clamp(12px, 3.2vw, 18px);
  }

  :is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail .gallery-rico__stage-wrap {
    gap: clamp(12px, 3.2vw, 18px);
  }

  :is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail:not(.is-immersive) .gallery-rico__stage {
    box-sizing: border-box;
    padding-inline: clamp(2px, 0.6vw, 6px);
    overflow: hidden;
    max-height: 100%;
  }

  :is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail.is-immersive .gallery-rico__stage {
    box-sizing: border-box;
    padding-inline: clamp(2px, 0.6vw, 6px);
  }

  :is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail:not(.is-immersive) .gallery-rico__img {
    max-width: 100%;
    max-height: 100%;
  }

  :is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail:not(.is-immersive) .gallery-rico__frame--diptych,
  :is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail:not(.is-immersive) .gallery-rico__frame--diptych .gallery-rico__diptych {
    max-height: 100%;
    overflow: hidden;
  }

  :is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail:not(.is-immersive) .gallery-rico__frame--diptych .gallery-rico__img--diptych-top,
  :is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail:not(.is-immersive) .gallery-rico__frame--diptych .gallery-rico__img--diptych-bottom {
    max-height: calc(50% - 0.35rem);
    width: auto;
    height: auto;
    max-width: 100%;
    object-fit: contain;
  }

  :is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__aside--left,
  :is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__aside--right {
    position: relative;
    z-index: 2;
    flex-shrink: 0;
  }

  :is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail.is-immersive {
    padding:
      max(56px, calc(env(safe-area-inset-top, 0px) + 48px))
      clamp(8px, 2vw, 16px)
      max(12px, env(safe-area-inset-bottom, 0px))
      clamp(8px, 2vw, 16px);
  }

  :is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail.is-immersive .gallery-rico__stage-wrap {
    gap: clamp(12px, 3.2vw, 18px);
    min-height: 0;
  }

  :is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail.is-immersive .gallery-rico__stage {
    padding-inline: clamp(2px, 0.6vw, 6px);
  }

  :is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail.is-immersive .gallery-rico__body {
    min-height: 0;
  }

  :is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__aside--left {
    grid-row: 2;
    align-items: flex-start;
    padding-left: 0;
  }

  :is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__aside--right {
    grid-row: 3;
    padding-right: 0;
  }

  :is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__details {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px 24px;
  }
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__pills-wrap,
:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__pills {
  --gr-pill-visible: 3;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__pills {
  padding-block: 0;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__stage {
  background-color: transparent;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__viewport,
:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__frame,
:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__img {
  background: none;
  border: none;
  outline: none;
  box-shadow: none;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail:not(.is-immersive) .gallery-rico__frame.is-active {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail:not(.is-immersive) .gallery-rico__frame:not(.is-active):not(.is-enter-from-right):not(.is-enter-from-left):not(.is-leave-to-left):not(.is-leave-to-right) {
  display: none !important;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail:not(.is-immersive) .gallery-rico__img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(100%, 720px);
  max-height: 100%;
  margin: 0 auto;
  object-fit: contain;
  object-position: center center;
}

@media (min-width: 769px) {
  :is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail:not(.is-immersive) .gallery-rico__img {
    max-height: min(62vh, 760px);
  }
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__viewport:focus,
:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico__viewport:focus-visible,
:is(#section-gallery, #section-prints, #section-maquettes) img:focus,
:is(#section-gallery, #section-prints, #section-maquettes) img:focus-visible {
  outline: none;
  box-shadow: none;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-page,
#section-maquettes .gallery-page {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

:is(#section-gallery, #section-prints, #section-maquettes) #galleryGrid,
#section-prints #printsGrid,
:is(#section-gallery, #section-prints, #section-maquettes) #maquettesGrid {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

/* ── Artwork stage ── */

.gallery-rico__stage {
  grid-row: 2;
  position: relative;
  z-index: 2;
  inset: auto;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: pan-y;
}

:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail .gallery-rico__stage,
:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail .gallery-rico__viewport,
:is(#section-gallery, #section-prints, #section-maquettes) .gallery-rico--detail .gallery-rico__img {
  touch-action: manipulation;
}

.gallery-rico__viewport {
  position: relative;
  width: 100%;
  max-width: min(100%, 640px);
  margin: 0 auto;
  cursor: default;
  outline: none;
}

.gallery-rico__frame {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate3d(0, 0, 0) scale(1);
  will-change: transform, opacity;
}

.gallery-rico__frame.is-active {
  opacity: 1;
  visibility: visible;
  z-index: 1;
}

.gallery-rico__frame.is-enter-from-right {
  animation: gr-enter-right var(--gr-step-ms) linear forwards;
  z-index: 2;
}

.gallery-rico__frame.is-enter-from-left {
  animation: gr-enter-left var(--gr-step-ms) linear forwards;
  z-index: 2;
}

.gallery-rico__frame.is-leave-to-left {
  animation: gr-leave-left var(--gr-step-ms) linear forwards;
  z-index: 1;
}

.gallery-rico__frame.is-leave-to-right {
  animation: gr-leave-right var(--gr-step-ms) linear forwards;
  z-index: 1;
}

@keyframes gr-enter-right {
  from { opacity: 0.12; transform: translate3d(4.5%, 0, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes gr-enter-left {
  from { opacity: 0.12; transform: translate3d(-4.5%, 0, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes gr-leave-left {
  from { opacity: 1; transform: translate3d(0, 0, 0); }
  to { opacity: 0; transform: translate3d(-4.5%, 0, 0); }
}

@keyframes gr-leave-right {
  from { opacity: 1; transform: translate3d(0, 0, 0); }
  to { opacity: 0; transform: translate3d(4.5%, 0, 0); }
}

.gallery-rico__img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
  user-select: none;
  -webkit-user-drag: none;
}

/* ── Dock: meta + calendar-style list ── */

.gallery-rico__dock {
  display: contents;
}

.gallery-rico__foot {
  grid-row: 1;
  justify-self: center;
  position: relative;
  width: min(94vw, 420px);
  max-width: min(92vw, 420px);
  margin: 0 auto 10px;
  z-index: 3;
  text-align: center;
  pointer-events: none;
}

/* Calendar panel — matches #section-calendar .exhib-cal */

.gallery-rico__cal {
  grid-row: 3;
  justify-self: center;
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  padding: 0.55rem 0.65rem;
  box-sizing: border-box;
  width: min(94vw, 380px);
  margin: 10px auto 0;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

.gallery-rico__cal::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(28, 28, 28, 0.72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  z-index: 0;
  pointer-events: none;
}

.gallery-rico__cal > * {
  position: relative;
  z-index: 1;
}

/* ── Scroll list — exactly 3 visible bars ── */

.gallery-rico__pills-wrap {
  --gr-pill-h: 30px;
  --gr-pill-gap: 4px;
  --gr-pill-visible: 2;

  width: 100%;
  height: calc(
    var(--gr-pill-visible) * var(--gr-pill-h) +
    (var(--gr-pill-visible) - 1) * var(--gr-pill-gap)
  );
  overflow: hidden;
}

.gallery-rico__pills {
  --gr-pill-h: 30px;
  --gr-pill-gap: 4px;
  --gr-pill-visible: 2;

  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--gr-pill-gap);
  width: 100%;
  height: 100%;
  margin: 0;
  padding-block: calc(var(--gr-pill-h) + var(--gr-pill-gap));
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  touch-action: pan-y;
}

.gallery-rico__pills::-webkit-scrollbar {
  display: none;
}

.gallery-rico__pill {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 100%;
  min-height: var(--gr-pill-h);
  margin: 0;
  padding: 0 0.65rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(12px, 3.2vw, 14px);
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.gallery-rico__pill:hover {
  color: rgba(255, 255, 255, 0.88);
}

.gallery-rico__pill.is-active {
  background: transparent;
  color: rgba(255, 255, 255, 0.98);
  font-weight: 600;
}

.gallery-rico__pill-label {
  position: relative;
  z-index: 1;
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.gallery-rico__pill.is-active .gallery-rico__pill-label::after {
  content: "";
  display: block;
  width: 100%;
  height: 1px;
  margin-top: 3px;
  background: currentColor;
  opacity: 0.95;
}

.gallery-rico__pill-dot {
  display: none;
}

.gallery-rico__title {
  margin: 0;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(1.15rem, 4.5vw, 1.5rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  line-height: 1.08;
  color: var(--gr-text);
}

.gallery-rico__meta {
  margin: 0.35em 0 0;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(10px, 2.6vw, 12px);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.45;
  color: var(--gr-text-dim);
}

.gallery-rico__enquire {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0.75em auto 0;
  padding: 0.6em 1.15em;
  border: 1px solid var(--gr-border-active);
  border-radius: 999px;
  background: transparent;
  color: var(--gr-text);
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(9px, 2.2vw, 11px);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: auto;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.gallery-rico__enquire:hover {
  background: var(--gr-text);
  border-color: var(--gr-text);
  color: #ffffff;
}

.gallery-rico__counter {
  margin: 0 0 0.35em;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(10px, 2.6vw, 11px);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gr-text-dim);
}

@media (min-width: 641px) {
  .gallery-rico {
    padding:
      max(72px, calc(env(safe-area-inset-top) + 64px))
      clamp(16px, 4vw, 48px)
      max(14px, env(safe-area-inset-bottom))
      clamp(16px, 4vw, 48px);
  }

  .gallery-rico__viewport {
    max-width: min(100%, 720px);
  }

  .gallery-rico__foot {
    width: min(92vw, 420px);
    margin-bottom: 14px;
  }

  .gallery-rico__cal {
    width: min(92vw, 380px);
    margin-top: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-rico__frame.is-enter-from-right,
  .gallery-rico__frame.is-enter-from-left,
  .gallery-rico__frame.is-leave-to-left,
  .gallery-rico__frame.is-leave-to-right {
    animation: none;
  }
}
