/* ============================================================
   Collection — Jonas Hangartner site-v2
   Partagé entre lumina.html, otherworld.html, spectra.html.
   Dépend de tokens.css + home.css (nav, footer, btns, reveal).
   ============================================================ */

/* ── Header page collection ──────────────────────────────── */
.coll-header {
  padding: calc(120px + var(--nav-h, 72px)) clamp(32px, 6vw, 96px) 64px;
  max-width: 1400px;
  margin: 0 auto;
}

.coll-header__breadcrumb {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--ink-quiet);
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.coll-header__breadcrumb a {
  color: inherit;
  transition: color 0.16s;
}

.coll-header__breadcrumb a:hover {
  color: var(--ink);
}

.coll-header__breadcrumb span {
  opacity: 0.4;
}

.coll-header h1 {
  font-size: clamp(36px, 4.5vw, 64px);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: 0 0 28px;
  color: var(--ink);
}

.coll-header__lead {
  font-size: 15px;
  font-weight: 300;
  line-height: 1.75;
  color: var(--ink-muted);
  max-width: 52ch;
  margin-bottom: 28px;
}

.coll-header__meta {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  align-items: center;
}

.coll-header__tag {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--grad-from);
  border: 1px solid rgba(88, 123, 145, 0.4);
  padding: 4px 12px;
  border-radius: 999px;
}

.coll-header__info {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--ink-quiet);
}

/* ── Tirage hint ─────────────────────────────────────────── */
.tirage-hint {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 clamp(32px, 6vw, 96px) 32px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 20px;
  margin-bottom: 48px;
}

.tirage-hint__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--grad-from);
  flex-shrink: 0;
}

.tirage-hint__icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.6;
  color: var(--ink);
}

.tirage-hint__icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.tirage-hint p {
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.04em;
  color: var(--ink-quiet);
  margin: 0;
}

.tirage-hint a {
  color: var(--grad-from);
  transition: opacity 0.16s;
}

.tirage-hint a:hover {
  opacity: 0.7;
}

/* ── Grille photos ───────────────────────────────────────── */
.masonry-wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 clamp(32px, 6vw, 96px) 120px;
}

/* Flux masonry souple: les images s'empilent par colonne sans trous sous les formats horizontaux. */
.masonry {
  column-count: 2;
  column-gap: clamp(28px, 4vw, 56px);
}

.masonry figure {
  display: inline-block;
  width: min(100%, var(--masonry-w, 92%));
  break-inside: avoid;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  margin: 0 0 clamp(40px, 5vw, 72px);
  margin-left: var(--masonry-ml, 0);
  vertical-align: top;
  transform: translate3d(var(--masonry-x, 0), calc(var(--masonry-y, 0px) + var(--masonry-drift, 0px)), 0);
  transition: opacity 700ms var(--ease), transform 160ms linear;
  will-change: transform;
}

.masonry figure:nth-child(6n+1) {
  --masonry-w: 88%;
  --masonry-x: 4%;
  --masonry-y: 10px;
  --masonry-speed: -0.045;
}

.masonry figure:nth-child(6n+2) {
  --masonry-w: 96%;
  --masonry-x: -2%;
  --masonry-y: -16px;
  --masonry-speed: 0.035;
}

.masonry figure:nth-child(6n+3) {
  --masonry-w: 82%;
  --masonry-ml: auto;
  --masonry-y: 24px;
  --masonry-speed: -0.03;
}

.masonry figure:nth-child(6n+4) {
  --masonry-w: 90%;
  --masonry-x: 7%;
  --masonry-y: -8px;
  --masonry-speed: 0.05;
}

.masonry figure:nth-child(6n+5) {
  --masonry-w: 94%;
  --masonry-x: -4%;
  --masonry-y: 18px;
  --masonry-speed: -0.04;
}

.masonry figure:nth-child(6n) {
  --masonry-w: 86%;
  --masonry-ml: auto;
  --masonry-y: -4px;
  --masonry-speed: 0.04;
}

/* Wrapper image injecté par JS — isole le glow de la légende */
.masonry .figure-media {
  overflow: hidden;
  position: relative;
  isolation: isolate;
}

/* Lien plein-cadre (collections sans lightbox, ex: Living Frames) */
.masonry-figure-link {
  position: absolute;
  inset: 0;
  z-index: 4;
  text-decoration: none;
  color: transparent;
}

.masonry figure img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.55s var(--ease);
}

.masonry figure:hover img {
  transform: scale(1.04);
}

.masonry figcaption {
  position: absolute;
  inset: auto 0 0;
  z-index: 3;
  padding: clamp(18px, 2.4vw, 28px);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 18px;
  background: linear-gradient(to top, rgba(8, 10, 12, 0.72), rgba(8, 10, 12, 0));
  pointer-events: auto;
}

.masonry figcaption .title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-on-dark, #f5f2ec);
}

.figure-sale-indicator {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.figure-sale-icon {
  width: 12px;
  height: 12px;
  background-color: var(--fg-on-dark, #f5f2ec);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50.1 42.6'%3E%3Cpath d='M48.6,32H14.4c-2,0-2.1-1.6-2.1-2,0-1,.6-2.1,2.2-2.1h30.6c.7,0,1.4-.5,1.5-1.2l3.4-19.3c0-.4,0-.9-.3-1.2-.3-.3-.7-.5-1.1-.5H12.6c0,0-.8-4.4-.8-4.4-.1-.7-.7-1.2-1.5-1.2H1.5C.7,0,0,.7,0,1.5s.7,1.5,1.5,1.5h7.5l3.8,22.1c-2.3.7-3.5,2.8-3.5,4.9s1.7,5,5.1,5h2.1c-.4.7-.6,1.5-.6,2.4,0,2.9,2.4,5.3,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,2.3-2.3,2.3Z'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

.figure-sale-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translate(-50%, 6px);
  padding: 8px 10px;
  border: 1px solid rgba(245, 242, 236, 0.14);
  border-radius: 999px;
  background: rgba(8, 10, 12, 0.92);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
  color: var(--fg-on-dark, #f5f2ec);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity var(--dur-2) var(--ease),
    transform var(--dur-2) var(--ease),
    visibility 0s linear var(--dur-2);
}

.figure-sale-tooltip::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 100%;
  width: 8px;
  height: 8px;
  background: rgba(8, 10, 12, 0.92);
  border-right: 1px solid rgba(245, 242, 236, 0.14);
  border-bottom: 1px solid rgba(245, 242, 236, 0.14);
  transform: translate(-50%, -55%) rotate(45deg);
}

.figure-sale-indicator.is-tooltip-visible .figure-sale-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition-delay: 0s;
}

.masonry figcaption .meta {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: rgba(245, 242, 236, 0.62);
  text-align: right;
}

/* État loading (avant API) */
.masonry-loading {
  text-align: center;
  padding: 80px 0;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-quiet);
}

/* État erreur */
.masonry-error {
  text-align: center;
  padding: 80px 0;
}

.masonry-error p {
  font-size: 14px;
  font-weight: 300;
  color: var(--ink-muted);
  margin-bottom: 16px;
}

/* ── Continuer le voyage ─────────────────────────────────── */
.coll-continue {
  border-top: 1px solid var(--rule);
  padding: 80px clamp(32px, 6vw, 96px);
}

.coll-continue__inner {
  max-width: 1400px;
  margin: 0 auto;
}

.coll-continue__eyebrow {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-quiet);
  margin-bottom: 40px;
}

/* Réutilise .coll-list / .coll-item de home.css */

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
  .coll-header {
    padding-top: calc(80px + 72px);
    padding-bottom: 40px;
  }

  .coll-header h1 {
    font-size: clamp(28px, 7vw, 44px);
  }

  .masonry {
    column-gap: 18px;
  }

  .coll-continue {
    padding: 48px 24px;
  }

  .tirage-hint {
    padding-left: 24px;
    padding-right: 24px;
  }

  .masonry-wrap {
    padding-left: 24px;
    padding-right: 24px;
    padding-bottom: 64px;
  }
}

@media (max-width: 480px) {
  .masonry {
    column-count: 1;
  }

  .masonry figure {
    width: 100%;
    margin-left: 0;
    margin-bottom: 32px;
    transform: translate3d(0, var(--masonry-drift, 0px), 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .masonry figure {
    transform: none;
    transition: opacity 700ms var(--ease);
  }
}
