/* Shared image carousel for all project pages. */
.page .unified-gallery,
.page #clipstage .unified-gallery {
  --gallery-columns: 3;
  --gallery-gap: 26px;
  display: flex !important;
  align-items: flex-start !important;
  gap: var(--gallery-gap) !important;
  width: 100% !important;
  height: auto !important;
  flex: 0 0 auto;
  box-sizing: border-box;
  padding: 24px !important;
  margin: 0 !important;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 24px;
  border: 1px solid var(--editorial-line);
  border-radius: 0;
  background: var(--process-bg);
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,.35) transparent;
}
.page .unified-gallery::before,
.page .unified-gallery::after { display: none !important; }
.page .unified-gallery > .image-card,
.page #clipstage .unified-gallery > .clipthumb {
  position: relative;
  box-sizing: border-box;
  flex: 0 0 calc((100% - 52px) / 3) !important;
  width: calc((100% - 52px) / 3) !important;
  min-width: 0;
  height: auto !important;
  aspect-ratio: 1 / 1.6 !important;
  margin: 0 !important;
  padding: 0;
  border-radius: 0;
  border: 1px solid var(--editorial-line);
  background: #000;
  box-shadow: none;
  overflow: hidden;
  scroll-snap-align: start;
}
.page #clipstage .unified-gallery > .clipthumb img {
  position: absolute; inset: 0; width: 100%; height: 100%;
}
.page #clipstage.gallery-stage {
  block-size: var(--gallery-stage-height, 600px) !important;
}
.page #clipstage.gallery-stage .view-process {
  display: flex !important; flex-direction: column; justify-content: flex-start;
  align-items: stretch; gap: 14px; background: transparent;
}
.gallery-toolbar {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 10px; min-height: 48px; margin-top: 14px;
}
.gallery-stage .gallery-toolbar { margin-top: 0; }
.page #clipstage .gallery-toolbar #btnBack {
  position: static !important; transform: none !important;
  margin: 0 auto 0 0; min-width: 0 !important; max-width: none !important;
}
.gallery-toolbar .btn:disabled { opacity: .35; cursor: default; pointer-events: none; }
@media (max-width: 980px) {
  .page .unified-gallery, .page #clipstage .unified-gallery { --gallery-columns: 2; }
  .page .unified-gallery > .image-card,
  .page #clipstage .unified-gallery > .clipthumb {
    flex-basis: calc((100% - 26px) / 2) !important;
    width: calc((100% - 26px) / 2) !important;
    aspect-ratio: 1 / 1.2 !important;
  }
}
@media (max-width: 640px) {
  .page .unified-gallery, .page #clipstage .unified-gallery {
    --gallery-columns: 1; --gallery-gap: 16px;
    padding: 16px !important; scroll-padding-inline: 16px;
  }
  .page .unified-gallery > .image-card,
  .page #clipstage .unified-gallery > .clipthumb {
    flex-basis: 100% !important; width: 100% !important;
  }
}
/* The new toolbar owns navigation; old edge overlays must not receive clicks. */
.page #clipstage.gallery-stage > .edge-scroll { display: none !important; pointer-events: none !important; }
.page #clipstage.gallery-stage .gallery-toolbar { position: relative; z-index: 4; flex-shrink: 0; }
.page #clipstage.gallery-stage.stage--process .view-final,
.page #clipstage.gallery-stage.stage--process .view-final * { pointer-events: none !important; }
/* Before/after preview stays visible on mouse, touch and keyboard. */
.comparison-preview { position: absolute; inset: 0; display: block; z-index: 2; pointer-events: none; background: #000; }
.comparison-preview-before,
.comparison-preview-after { position: absolute; inset: 0; background-color: #000; background-size: cover; background-position: center; background-repeat: no-repeat; }
.comparison-preview-before { clip-path: inset(0 50% 0 0); }
.comparison-preview-divider { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: #fff; color: transparent; transform: translateX(-50%); }
.comparison-preview-divider::after { content: '↔'; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: grid; place-items: center; width: 34px; height: 34px; background: #fff; border-radius: 50%; color: #111; font: 20px system-ui; }
.comparison-preview-label { position: absolute; top: 10px; padding: 4px 7px; color: white; background: #000b; font: 11px/1.4 system-ui; }
.comparison-label-before { left: 8px; }
.comparison-label-after { right: 8px; }
.comparison-preview-hint { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); padding: 8px 12px; background: #111e; border: 1px solid #ffffff80; color: #fff; white-space: nowrap; font: 700 12px/1.3 system-ui; }
.has-comparison:focus-visible { outline: 3px solid var(--editorial-pink); outline-offset: 3px; }
.has-comparison .image-title { display: none; }