/* Misteratomic — standalone galleries only. G-09 desktop et mobile. */
body.gallery-standalone.is-gallery-motion {
  --gallery-motion-height: 78vh;
  --gallery-motion-height: 60svh;
  --gallery-motion-gap: .08;
  --gallery-motion-intensity: 1;
  --gallery-intro-mb: 28px;
  --gallery-intro-gap: 24px;
}
body.gallery-standalone.is-gallery-motion .licence-gallery__meta > * { min-width: 0; }
body.gallery-standalone.is-gallery-motion .licence-gallery__contact a { overflow-wrap: anywhere; }
body.gallery-standalone.is-gallery-motion .gallery-motion {
  position: relative; width: 100vw; margin-inline: calc(50% - 50vw); isolation: isolate;
}
body.gallery-standalone.is-gallery-motion .gallery-motion__stage {
  position: relative; display: block !important; width: 100% !important; height: var(--gallery-motion-height);
  min-height: 260px; overflow: hidden; overflow: clip; gap: 0 !important; isolation: isolate;
  touch-action: pan-y pinch-zoom; cursor: grab; user-select: none; -webkit-user-select: none;
}
body.gallery-standalone.is-gallery-motion .gallery-motion__stage.is-dragging,
body.gallery-standalone.is-gallery-motion .gallery-motion__stage.is-dragging * { cursor: grabbing !important; }
body.gallery-standalone.is-gallery-motion .gallery-motion__art {
  position: absolute; top: 0; left: 0; display: block; transform-origin: center; margin: 0;
}
body.gallery-standalone.is-gallery-motion .gallery-motion__art .licence-card {
  width: 100% !important; height: 100%; margin: 0; opacity: 1 !important; visibility: visible !important;
  pointer-events: auto !important; transform: none !important; transition: none !important; will-change: auto !important;
}
body.gallery-standalone.is-gallery-motion .gallery-motion__art .licence-card img {
  display: block; width: 100% !important; height: 100%; max-width: none; object-fit: contain; pointer-events: none;
}
body.gallery-standalone.is-gallery-motion .gallery-motion__controls {
  width: min(90vw, 1480px); margin: 0 auto; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center;
  gap: clamp(12px, 2.4vw, 36px); color: var(--white); padding: 8px 0 0;
}
.gallery-motion__nav { display: flex; gap: 4px; align-items: center; }
.gallery-motion__nav button { width: 44px; height: 44px; display: grid; place-items: center; color: var(--aqua); }
.gallery-motion__nav button::before { content: ''; width: 13px; height: 13px; border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor; transform: rotate(45deg); }
.gallery-motion__nav button[data-motion-prev]::before { transform: rotate(-135deg); }
.gallery-motion__nav button:disabled { opacity: .3; cursor: default; }
.gallery-motion__nav button:not(:disabled):hover { color: white; }
.gallery-motion__controls input { appearance: none; -webkit-appearance: none; width: 100%; height: 44px; background: transparent; cursor: pointer; margin: 0; accent-color: var(--aqua); }
.gallery-motion__controls input::-webkit-slider-runnable-track { height: 2px; background: #777; }
.gallery-motion__controls input::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; margin-top: -8px; border: 0; border-radius: 50%; background: var(--aqua); }
.gallery-motion__controls input::-moz-range-track { height: 2px; background: #777; }
.gallery-motion__controls input::-moz-range-thumb { width: 18px; height: 18px; border: 0; border-radius: 50%; background: var(--aqua); }
.gallery-motion__controls output { font: 13px/1.2 var(--mono); white-space: nowrap; font-variant-numeric: tabular-nums; }
.gallery-motion__hint { width: min(90vw,1480px); margin: 4px auto 0; color: #bdbdbd; font: 12px/1.4 var(--mono); }
body.gallery-standalone.is-gallery-motion .licence-gallery__pagination { margin-top: 30px; opacity: 1 !important; visibility: visible !important; pointer-events: auto !important; transform: none !important; }
.gallery-motion__stage:focus-visible, .gallery-motion__controls button:focus-visible, .gallery-motion__controls input:focus-visible { outline: 2px solid var(--aqua); outline-offset: -2px; }
@media (max-width: 760px) {
  body.gallery-standalone.is-gallery-motion { --gallery-motion-height: 66vh; --gallery-motion-height: 66svh; --gallery-motion-intensity: .5; --gallery-motion-gap: .055; --gallery-intro-mb: 18px; --gallery-intro-gap: 20px; }
  /* Le rail reste dans la largeur réelle de la page, sans dépendre de 100vw. */
  body.gallery-standalone.is-gallery-motion .gallery-motion { width: calc(100% + 24px); margin-inline: -12px; overflow-anchor: none; }
  body.gallery-standalone.is-gallery-motion .gallery-motion__stage { cursor: default; overflow-anchor: none; }
  body.gallery-standalone.is-gallery-motion .gallery-motion__controls input { touch-action: pan-y; }
  body.gallery-standalone.is-gallery-motion .gallery-motion__controls, .gallery-motion__hint { width: calc(100vw - 24px); }
  body.gallery-standalone.is-gallery-motion .gallery-motion__controls { gap: 10px; }
  .gallery-motion__nav { gap: 0; }
}

/* Desktop: the new wrappers do not generate boxes. */
.gallery-motion__pin { display: contents; }
.gallery-motion__runway { display: none; }
@media (max-width: 760px) {
  /* overflow-x:hidden creates a scroll container and breaks sticky on iOS. */
  html.gallery-motion-ready:not(.gallery-transition-leaving),
  html.gallery-motion-ready:not(.gallery-transition-leaving) body.gallery-standalone.is-gallery-motion {
    overflow-x: clip;
    overflow-y: visible;
  }
  body.gallery-standalone.is-gallery-motion {
    --gallery-scroll-step: 300px;
    --gallery-scroll-step: clamp(180px, 40svh, 380px);
    --gallery-pin-top: 60px;
  }
  body.gallery-standalone.is-gallery-motion .gallery-motion__pin {
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: sticky;
    top: var(--gallery-pin-top);
    min-height: calc(100svh - var(--gallery-pin-top));
    width: 100%;
    background: var(--black);
    z-index: 1;
    overflow-anchor: none;
  }
  /* Allow the last artwork to be reached even with Safari's chrome collapsed. */
  body.gallery-standalone.is-gallery-motion .gallery-motion {
    margin-bottom: max(0px, calc(100lvh - 100svh));
  }
  body.gallery-standalone.is-gallery-motion .gallery-motion__runway {
    display: block;
    height: calc(var(--gallery-scroll-steps, 0) * var(--gallery-scroll-step));
    pointer-events: none;
  }
  body.gallery-standalone.is-gallery-motion .gallery-motion__stage {
    min-height: 0;
    height: min(var(--gallery-motion-height), calc(100svh - var(--gallery-pin-top) - 60px));
    touch-action: pan-y pinch-zoom;
  }
  body.gallery-standalone.is-gallery-motion .gallery-motion__hint { display: none; }
}
