/* =========================================================================
   PHOTOBOOK — galerie client (thème piloté par les couleurs du photographe)
   ========================================================================= */
body.front { overflow-x: hidden; }
.btn.primary { --bg: var(--accent); --fg: var(--accent-ink); box-shadow: 0 10px 30px -12px rgba(var(--accent-rgb), .55); }
.front-logo { max-height: 42px; max-width: 180px; object-fit: contain; }
.front-name { font-weight: 800; letter-spacing: .02em; font-size: 17px; }

/* ---------- portail (mot de passe / identification) ---------- */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gate-bg { position: fixed; inset: -40px; background-size: cover; background-position: center; filter: blur(40px) brightness(.45) saturate(1.2); transform: scale(1.1); z-index: 0; animation: breathe 18s ease-in-out infinite alternate; }
@keyframes breathe { to { transform: scale(1.22) translate(-20px, 10px); } }
.gate-card { position: relative; z-index: 1; width: 100%; max-width: 440px; padding: 36px; border-radius: 28px; background: color-mix(in srgb, var(--surface) 82%, transparent); border: 1px solid var(--line-2); backdrop-filter: blur(24px); box-shadow: 0 40px 120px -30px rgba(0,0,0,.7); text-align: center; }
.gate-brand { margin-bottom: 26px; display: flex; justify-content: center; }
.gate-card h1 { font-size: 26px; margin-bottom: 8px; }
.gate-card form { text-align: left; margin-top: 22px; }
.gate-ic { width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 18px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); animation: float 4s ease-in-out infinite; }

/* ---------- hero ---------- */
.g-hero { position: relative; height: min(88vh, 820px); min-height: 460px; overflow: hidden; display: flex; align-items: flex-end; }
.g-hero .bgimg { position: absolute; inset: 0; background-size: cover; background-position: center; transform: scale(1.08); animation: heroIn 2.2s var(--ease) forwards; will-change: transform; }
@keyframes heroIn { from { transform: scale(1.25); filter: blur(10px) brightness(.6); } to { transform: scale(1.08); filter: none; } }
.g-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.35) 0%, transparent 30%, transparent 45%, var(--bg) 100%); }
.g-hero-nav { position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; padding: 22px clamp(16px, 4vw, 48px); color: #fff; }
.g-hero-nav .front-name { color: #fff; }
.g-hero-content { position: relative; z-index: 2; width: 100%; padding: 0 clamp(16px, 4vw, 48px) 48px; }
.g-hero h1 { font-size: clamp(34px, 6vw, 76px); font-weight: 500; letter-spacing: -.04em; line-height: .98; max-width: 14ch; }
.g-hero h1 .w { display: inline-block; opacity: 0; transform: translateY(40px) rotate(3deg); animation: wordIn 1s var(--ease) forwards; }
@keyframes wordIn { to { opacity: 1; transform: none; } }
.g-hero .sub { margin-top: 16px; color: var(--text-2); font-size: 16px; max-width: 560px; opacity: 0; animation: fadeUp 1s .5s var(--ease) forwards; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.g-hero .chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; opacity: 0; animation: fadeUp 1s .7s var(--ease) forwards; }
.g-hero .chips .badge { backdrop-filter: blur(10px); background: color-mix(in srgb, var(--surface) 70%, transparent); }
.g-hero .scroll { position: absolute; z-index: 3; right: clamp(16px, 4vw, 48px); bottom: 48px; width: 54px; height: 54px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; animation: bob 2s ease-in-out infinite; background: color-mix(in srgb, var(--surface) 60%, transparent); backdrop-filter: blur(8px); }
@keyframes bob { 50% { transform: translateY(8px); } }
.g-hero.no-cover { height: auto; min-height: 0; padding-top: 110px; }
.g-hero.no-cover::after { display: none; }

/* ---------- barre d'outils ---------- */
.g-wrap { padding: 0 clamp(12px, 3vw, 48px) 160px; position: relative; z-index: 1; }
.g-toolbar { position: sticky; top: 0; z-index: 40; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 0; margin-bottom: 14px; background: linear-gradient(var(--bg) 70%, transparent); }
.g-toolbar .search { max-width: 280px; min-width: 230px; }
.g-toolbar .search input { height: 40px; }
.g-toolbar .search .ic { top: 10px; }
.g-toolbar .spacer { flex: 1; }
.g-toolbar .select { min-height: 40px; padding: 6px 36px 6px 14px; border-radius: 999px; width: auto; font-size: 13px; font-weight: 600; background-color: var(--surface); }
.welcome { max-width: 760px; margin: 10px 0 30px; font-size: 16px; color: var(--text-2); }

/* ---------- grille ---------- */
.g-grid { --gap: 10px; }
.g-grid.masonry { column-count: var(--cols, 4); column-gap: var(--gap); }
.g-grid.masonry .tile { break-inside: avoid; margin-bottom: var(--gap); }
.g-grid.masonry .tile .ph { aspect-ratio: var(--ar); }
.g-grid.masonry .tile img { height: 100%; object-fit: cover; }
.g-grid.grid { display: grid; grid-template-columns: repeat(var(--cols, 4), 1fr); gap: var(--gap); }
.g-grid.grid .tile .ph { aspect-ratio: 1; }
.g-grid.grid .tile img { height: 100%; object-fit: cover; }
.g-grid.justified { display: flex; flex-wrap: wrap; gap: var(--gap); }
.g-grid.justified .tile { flex-grow: var(--r, 1); flex-basis: calc(var(--r, 1) * var(--row, 240px)); }
.g-grid.justified .tile .ph { height: var(--row, 240px); }
.g-grid.justified .tile img { height: 100%; object-fit: cover; }
.g-grid.justified::after { content: ""; flex-grow: 999; }
.thumb-s { --cols: 6; --row: 170px; } .thumb-m { --cols: 4; --row: 240px; } .thumb-l { --cols: 3; --row: 340px; }
.tile { position: relative; border-radius: 14px; overflow: hidden; background: var(--surface); cursor: zoom-in; opacity: 0; transform: translateY(26px) scale(.98); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.tile.in { opacity: 1; transform: none; }
.tile .ph { position: relative; overflow: hidden; background: var(--surface-3); }
.tile img { width: 100%; height: auto; transition: transform 1.2s var(--ease), filter .5s; -webkit-user-drag: none; user-select: none; }
.tile:hover img { transform: scale(1.045); }
.tile .shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.35), transparent 30%, transparent 62%, rgba(0,0,0,.55)); opacity: 0; transition: opacity .4s; pointer-events: none; }
.tile:hover .shade, .tile.sel .shade { opacity: 1; }
.tile .num { position: absolute; top: 10px; left: 10px; font-size: 11.5px; font-weight: 800; padding: 3px 9px; border-radius: 99px; background: rgba(0,0,0,.5); color: #fff; backdrop-filter: blur(6px); }
.tile .acts { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; opacity: 0; transform: translateY(-6px); transition: .35s var(--ease); }
.tile:hover .acts, .tile.sel .acts, .tile.carted .acts { opacity: 1; transform: none; }
.tbtn { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; border: 0; cursor: pointer; background: rgba(0,0,0,.45); color: #fff; backdrop-filter: blur(8px); transition: transform .35s var(--ease), background .25s; }
.tbtn:hover { transform: scale(1.1); background: rgba(0,0,0,.65); }
.tbtn.on { background: #fff; color: #e11d48; }
.tbtn.on.cart { color: #0a0a0b; }
.tbtn.pop { animation: heartPop .55s var(--ease); }
@keyframes heartPop { 30% { transform: scale(1.35); } 60% { transform: scale(.9); } }
.tile .info { position: absolute; left: 10px; right: 10px; bottom: 9px; display: flex; align-items: center; gap: 8px; color: #fff; font-size: 12px; font-weight: 600; opacity: 0; transition: .35s; pointer-events: none; }
.tile:hover .info, .tile.has-meta .info { opacity: 1; }
.tile .info .stars { color: #fbbf24; letter-spacing: 1px; }
.tile .info .cm { display: inline-flex; align-items: center; gap: 3px; background: rgba(0,0,0,.45); padding: 2px 7px; border-radius: 99px; }
.tile .fname { display: block; padding: 8px 10px; font-size: 12px; color: var(--text-2); background: var(--surface); }
.tile.sel { box-shadow: 0 0 0 2px var(--accent); }
.tile.sel::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 3px var(--accent); pointer-events: none; }
.tile .burst { position: absolute; left: 50%; top: 50%; pointer-events: none; color: #fff; transform: translate(-50%, -50%) scale(0); animation: burst .8s var(--ease) forwards; }
@keyframes burst { 40% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; } 100% { transform: translate(-50%, -50%) scale(1.6); opacity: 0; } }
.tile.vid .ph::after { content: ""; position: absolute; inset: 0; }
.tile .play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,.5); color: #fff; backdrop-filter: blur(6px); }
.g-empty { padding: 80px 20px; text-align: center; color: var(--muted); }

/* ---------- barre flottante ---------- */
.dock { position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(140%); z-index: 60; display: flex; align-items: center; gap: 14px; padding: 10px 10px 10px 18px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--line-2); backdrop-filter: blur(20px); box-shadow: 0 30px 80px -20px rgba(0,0,0,.65); transition: transform .8s var(--ease); max-width: calc(100vw - 24px); }
.dock.show { transform: translateX(-50%); }
.ring { position: relative; width: 44px; height: 44px; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 4; }
.ring .bgc { stroke: var(--line-2); }
.ring .fg { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 113; stroke-dashoffset: 113; transition: stroke-dashoffset .8s var(--ease), stroke .3s; }
.ring.done .fg { stroke: var(--ok); }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.dock .txt { min-width: 0; }
.dock .txt b { display: block; font-size: 14px; white-space: nowrap; }
.dock .txt span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.dock .btn { height: 46px; }
.dock .bump { animation: bump .5s var(--ease); }
@keyframes bump { 40% { transform: scale(1.18); } }

/* ---------- lightbox ---------- */
.lb { position: fixed; inset: 0; z-index: 150; display: grid; grid-template-columns: 1fr auto; background: color-mix(in srgb, var(--bg) 96%, black); opacity: 0; pointer-events: none; transition: opacity .45s var(--ease); }
.lb.open { opacity: 1; pointer-events: auto; }
.lb-stage { position: relative; display: grid; place-items: center; overflow: hidden; touch-action: pan-y; user-select: none; }
.lb-media { position: relative; max-width: calc(100% - 140px); max-height: calc(100vh - 150px); transition: transform .55s var(--ease), opacity .4s; }
.lb-media img, .lb-media video { max-width: 100%; max-height: calc(100vh - 150px); width: auto; height: auto; display: block; border-radius: 6px; -webkit-user-drag: none; }
.lb-media.zoom { cursor: zoom-out; }
.lb-media img { cursor: zoom-in; transition: transform .5s var(--ease); }
.lb-media.zoom img { transform: scale(2); }
.lb-media.placing img { cursor: crosshair; }
.lb.sliding-l .lb-media { transform: translateX(-60px); opacity: 0; }
.lb.sliding-r .lb-media { transform: translateX(60px); opacity: 0; }
.lb-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 10px; padding: 16px 18px; z-index: 3; }
.lb-top .t { flex: 1; min-width: 0; font-weight: 700; font-size: 14px; }
.lb-top .t span { color: var(--muted); font-weight: 600; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line-2); cursor: pointer; transition: .35s var(--ease); color: var(--text); }
.lb-nav:hover { transform: translateY(-50%) scale(1.08); background: var(--accent); color: var(--accent-ink); }
.lb-nav.prev { left: 18px; } .lb-nav.next { right: 18px; }
.lb-bottom { position: absolute; bottom: 0; left: 0; right: 0; z-index: 3; display: flex; justify-content: center; align-items: center; gap: 10px; padding: 16px; flex-wrap: wrap; }
.lb-bottom .btn { height: 46px; }
.lb-bottom .btn.on { --bg: #fff; --fg: #e11d48; }
.stars-in { display: inline-flex; gap: 2px; padding: 0 10px; height: 46px; align-items: center; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-2); }
.stars-in button { background: none; border: 0; cursor: pointer; padding: 3px; color: var(--muted); transition: transform .3s var(--ease), color .2s; }
.stars-in button:hover { transform: scale(1.25); }
.stars-in button.on { color: #fbbf24; }
.marker { position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 5px rgba(var(--accent-rgb), .25), 0 8px 20px rgba(0,0,0,.4); cursor: pointer; animation: pop .45s var(--ease); z-index: 2; transition: transform .25s var(--ease); }
.marker:hover, .marker.hl { transform: scale(1.25); }
.marker.retouch { background: #f43f5e; color: #fff; box-shadow: 0 0 0 5px rgba(244,63,94,.25); }
.marker.pending { animation: pulse2 1.2s infinite; }
@keyframes pulse2 { 50% { box-shadow: 0 0 0 12px rgba(var(--accent-rgb), 0); } }
.lb-side { width: 380px; max-width: 100vw; background: var(--surface); border-left: 1px solid var(--line); display: flex; flex-direction: column; transition: margin .5s var(--ease); }
.lb.side-closed .lb-side { margin-right: -380px; }
.lb-side-head { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.lb-side-body { flex: 1; overflow: auto; padding: 16px 20px; }
.lb-side-foot { padding: 14px 20px 18px; border-top: 1px solid var(--line); }
.cmt { padding: 12px 0; border-bottom: 1px solid var(--line); animation: slideUp .4s var(--ease); }
.cmt.reply { margin-left: 26px; padding-left: 12px; border-left: 2px solid var(--line-2); border-bottom: 0; }
.cmt .h { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.cmt .h b { font-size: 13px; }
.cmt .h .pin { width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 10.5px; font-weight: 800; display: grid; place-items: center; }
.cmt .h .pin.retouch { background: #f43f5e; color: #fff; }
.cmt p { margin: 6px 0 4px; color: var(--text); font-size: 14px; white-space: pre-line; }
.cmt .a { display: flex; gap: 12px; font-size: 12px; }
.cmt .a button { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; font-weight: 600; }
.cmt .a button:hover { color: var(--text); }
.cmt .pro { font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); }
.meta-list { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; margin-top: 10px; }
.meta-list dt { color: var(--muted); } .meta-list dd { margin: 0; }
.place-hint { position: absolute; top: 70px; left: 50%; transform: translateX(-50%); z-index: 4; padding: 10px 16px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 13px; animation: slideUp .4s var(--ease); box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.no-dl img, .no-dl video { -webkit-touch-callout: none; pointer-events: auto; }
.shield { position: absolute; inset: 0; z-index: 1; }

/* ---------- panier ---------- */
.cart-line { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); animation: slideUp .35s var(--ease); }
.cart-line img { width: 54px; height: 54px; border-radius: 10px; object-fit: cover; }
.price-box { padding: 14px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); margin: 12px 0; }
.price-box .row { justify-content: space-between; font-size: 13.5px; padding: 3px 0; }
.price-box .total { font-size: 18px; font-weight: 800; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; }

/* ---------- merci ---------- */
.thanks { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px; background: var(--bg); opacity: 0; pointer-events: none; transition: opacity .6s var(--ease); text-align: center; }
.thanks.open { opacity: 1; pointer-events: auto; }
.thanks .ok-ic { width: 96px; height: 96px; border-radius: 50%; margin: 0 auto 26px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); transform: scale(0); }
.thanks.open .ok-ic { animation: okIn .9s .2s var(--ease) forwards; }
@keyframes okIn { 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
.thanks h1 { font-size: clamp(30px, 5vw, 52px); max-width: 16ch; margin: 0 auto 14px; }
.confetti { position: fixed; top: -20px; width: 10px; height: 16px; z-index: 201; border-radius: 3px; animation: fall linear forwards; pointer-events: none; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* ---------- espace client ---------- */
.cs-wrap { max-width: 1180px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px) 80px; position: relative; z-index: 1; }
.cs-nav { display: flex; align-items: center; justify-content: space-between; padding: 22px 0 30px; gap: 12px; }

@media (max-width: 1100px) { .thumb-s { --cols: 5; } .thumb-m { --cols: 3; } .thumb-l { --cols: 2; } }
@media (max-width: 900px) {
  .lb { grid-template-columns: 1fr; }
  .lb-side { position: fixed; left: 0; right: 0; bottom: 0; width: auto; height: 58vh; border-left: 0; border-top: 1px solid var(--line-2); border-radius: 22px 22px 0 0; transform: translateY(0); transition: transform .55s var(--ease); z-index: 5; margin: 0 !important; box-shadow: 0 -30px 80px rgba(0,0,0,.5); }
  .lb.side-closed .lb-side { transform: translateY(105%); }
  .lb-media { max-width: 100%; }
  .lb-nav { display: none; }
}
@media (max-width: 640px) {
  .thumb-s { --cols: 3; --row: 120px; } .thumb-m { --cols: 2; --row: 160px; } .thumb-l { --cols: 1; --row: 260px; }
  .g-grid.justified.thumb-s { column-count: 3; }
  .g-grid { --gap: 6px; }
  .g-grid.justified { display: block; column-count: 2; column-gap: var(--gap); }
  .g-grid.justified .tile { margin-bottom: var(--gap); break-inside: avoid; }
  .g-grid.justified .tile .ph { height: auto; aspect-ratio: var(--ar); }
  .g-grid.masonry.thumb-l, .g-grid.justified.thumb-l { column-count: 1; }
  .tile .num { top: 6px; left: 6px; font-size: 10.5px; padding: 2px 7px; }
  .tile .acts { top: 5px; right: 5px; gap: 4px; }
  .tile { border-radius: 10px; }
  .tile .acts { opacity: 1; transform: none; }
  .tbtn { width: 34px; height: 34px; }
  .g-toolbar .search { max-width: none; flex: 1 1 100%; order: 3; }
  .dock { left: 12px; right: 12px; transform: translateY(140%); border-radius: 22px; padding: 10px; gap: 10px; }
  .dock.show { transform: none; }
  .dock .btn { padding: 0 14px; font-size: 13px; }
  .dock .txt span { display: none; }
  .g-hero { min-height: 420px; height: 72vh; }
  .lb-bottom { padding: 10px 10px max(10px, env(safe-area-inset-bottom)); gap: 6px; }
  .lb-bottom .btn .lbl { display: none; }
  .lb-bottom .btn { padding: 0 14px; }
  .lb-media img, .lb-media video { max-height: calc(100vh - 170px); border-radius: 0; }
  .gate-card { padding: 26px; }
}

/* Dasura : typographie fine côté client */
.gate-card h1 { font-weight: 500; }
.thanks h1 { font-weight: 500; }
.tile { border-radius: 16px; }
.g-toolbar .select, .g-toolbar .search input { font-weight: 500; }
.dock .txt b { font-weight: 600; }
