/* =========================================================
   Plateforme galerie photo — feuille de style
   Tout est piloté par des variables CSS injectées depuis
   theme.json → réhabillage d'un photographe = 1 fichier.
   ========================================================= */
:root {
  --bg: #14110f;
  --surface: #1e1a17;
  --line: #332c26;
  --text: #f3ede4;
  --muted: #a89f93;
  --accent: #c9a24b;
  --accent-text: #14110f;
  --font-head: Georgia, serif;
  --font-body: system-ui, sans-serif;
  --wm: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* ---------- Écran mot de passe ---------- */
.gate {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(201,162,75,.10), transparent 60%),
    var(--bg);
}
.gate-card {
  width: min(420px, 100%); text-align: center;
  padding: 44px 34px;
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface);
}
.gate-logo { color: var(--text); margin-bottom: 26px; display: flex; justify-content: center; }
.gate-logo svg { height: 42px; width: auto; }
.gate-logo img { height: 76px; width: auto; }
.gate-title { font-family: var(--font-head); font-weight: 500; font-size: 30px; margin: 0 0 10px; }
.gate-sub { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0 0 26px; }
.gate-form { display: flex; flex-direction: column; gap: 12px; }
.gate-form input {
  height: 48px; padding: 0 16px; font-size: 15px;
  color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 9px; outline: none;
}
.gate-form input:focus { border-color: var(--accent); }
.gate-form button[type="submit"] {
  height: 48px; border: none; border-radius: 9px;
  background: var(--accent); color: var(--accent-text);
  font-size: 14px; font-weight: 600; letter-spacing: .3px;
}
.gate-error { color: #e5807a; font-size: 13px; margin: 16px 0 0; }
/* champ mot de passe + œil afficher/masquer */
.pw-wrap { position: relative; display: flex; }
.pw-wrap input { flex: 1; padding-right: 48px !important; width: 100%; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; display: grid; place-items: center; border: none;
  background: transparent; color: var(--muted); cursor: pointer; border-radius: 8px; }
.pw-eye:hover, .pw-eye.on { color: var(--accent); }
.pw-eye svg { width: 20px; height: 20px; fill: currentColor; }

/* ---------- Barre du haut (2 étages) ---------- */
/* Volet tuto (guide) ancré à droite, pousse l'interface à gauche */
.tuto-open-btn{display:inline-flex;align-items:center;gap:7px;height:42px;padding:0 15px;color:var(--text);background:transparent;border:1px solid var(--line);border-radius:999px;font-size:13px;letter-spacing:.3px;cursor:pointer;font-family:inherit}
.tuto-open-btn:hover{border-color:var(--accent);color:var(--accent)}
.tuto-open-btn svg{width:17px;height:17px;stroke:var(--accent);fill:none}
body{transition:margin-right .3s ease}
body.tuto-open{margin-right:min(760px,50vw)}
.tuto-dock{position:fixed;top:0;right:0;bottom:0;width:min(760px,50vw);background:var(--surface);border-left:1px solid var(--line);z-index:80;display:flex;flex-direction:column;transform:translateX(100%);transition:transform .3s ease;box-shadow:-12px 0 34px rgba(0,0,0,.4)}
.tuto-dock.open{transform:none}
.tuto-dock-head{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid var(--line);flex:none}
.tuto-dock-head span{font-weight:600;font-size:15px;color:var(--text)}
.tuto-dock-head button{background:transparent;border:none;color:var(--muted);cursor:pointer;width:32px;height:32px;border-radius:8px;font-size:18px}
.tuto-dock-head button:hover{color:var(--accent)}
.tuto-dock iframe{flex:1;width:100%;border:0;background:var(--bg)}
@media(max-width:760px){body.tuto-open{margin-right:0}.tuto-dock{width:100vw}}

/* Étage 1 = marque du client (logo + nav optionnel + retour au site).
   Étage 2 = outils de la galerie (sélection). */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-brand { display: flex; align-items: center; gap: 22px; padding: 14px 24px; }
.topbar-brand .brand { margin-right: auto; }
.topbar-nav { display: flex; gap: 20px; flex-wrap: wrap; }
.topbar-nav a { color: var(--muted); text-decoration: none; font-size: 14px; letter-spacing: .2px; }
.topbar-nav a:hover { color: var(--accent); }
.back-link { color: var(--muted); text-decoration: none; font-size: 13px; white-space: nowrap; }
.back-link:hover { color: var(--accent); }
.topbar-tools { display: flex; justify-content: flex-end; padding: 9px 24px; border-top: 1px solid var(--line); }
.brand { color: var(--text); text-decoration: none; display: flex; }
.brand svg { height: 34px; width: auto; }
.brand img { height: 44px; width: auto; }
@media (max-width: 560px) {
  .topbar-brand { gap: 14px; padding: 12px 16px; }
  .topbar-nav { gap: 14px; font-size: 13px; }
  .topbar-tools { padding: 8px 16px; }
}
.sel-toggle {
  position: relative; display: flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 16px 0 14px;
  color: var(--text); background: transparent;
  border: 1px solid var(--line); border-radius: 999px;
  font-size: 13px; letter-spacing: .3px;
}
.sel-toggle:hover { border-color: var(--accent); color: var(--accent); }
.sel-toggle svg { color: var(--accent); }
.sel-count {
  min-width: 22px; height: 22px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--accent-text);
  border-radius: 999px; font-size: 12px; font-weight: 700;
}

/* ---------- En-tête galerie ---------- */
.gallery-head { text-align: center; padding: 54px 24px 30px; }
.gallery-head h1 { font-family: var(--font-head); font-weight: 500; font-size: clamp(38px, 6.5vw, 66px); letter-spacing: -0.025em; margin: 0; }
.gallery-head > p { color: var(--muted); margin: 12px 0 0; font-size: 14px; letter-spacing: .12em; text-transform: uppercase; }
.gallery-meta { color: var(--muted); font-size: 13px; margin: 14px 0 0; letter-spacing: .02em; }
.meta-retention { color: var(--muted); }
.meta-retention.urgent { color: #e5867a; font-weight: 600; }
.gallery-hint { font-size: 13px; margin-top: 24px !important; letter-spacing: 0 !important; text-transform: none !important; }
.hint-heart { color: var(--accent); }

/* ---------- Section Film ---------- */
.section-title {
  text-align: center; font-family: var(--font-head); font-weight: 500;
  font-size: 14px; letter-spacing: .28em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 22px;
}
.section-title::after {
  content: ""; display: block; width: 40px; height: 2px;
  background: var(--accent); margin: 14px auto 0;
}
.films { padding: 20px 24px 8px; }
.films-row { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; }
.film-card {
  position: relative; width: min(560px, 100%); aspect-ratio: 16/9;
  padding: 0; border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; background: var(--surface); color: #fff;
}
.film-card img { width: 100%; height: 100%; object-fit: cover; opacity: .9; }
.film-card:hover img { opacity: 1; }
.film-play {
  position: absolute; inset: 0; margin: auto;
  width: 74px; height: 74px; display: grid; place-items: center;
  border-radius: 999px; background: rgba(20,17,15,.55);
  border: 1.5px solid rgba(255,255,255,.8); font-size: 26px;
  backdrop-filter: blur(2px); transition: .18s;
}
.film-card:hover .film-play { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.film-meta {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: baseline; gap: 10px;
  padding: 26px 18px 14px; text-align: left;
  background: linear-gradient(transparent, rgba(9,7,6,.8));
}
.film-meta strong { font-family: var(--font-head); font-weight: 500; font-size: 19px; }
.film-meta em { color: var(--muted); font-style: normal; font-size: 12px; letter-spacing: .3px; }

/* ---------- Grille (masonry en colonnes) ---------- */
.grid {
  column-gap: 14px; padding: 8px 14px 60px;
  columns: 4 260px;
}
.photo {
  position: relative; break-inside: avoid; margin-bottom: 14px;
  border-radius: 8px; overflow: hidden; background: var(--surface);
  cursor: zoom-in;
}
.photo img { width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
/* lumière « sous verre » qui balaie doucement la photo */
.photo::before {
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: linear-gradient(105deg,
    transparent 38%, rgba(255,255,255,.06) 46%, rgba(255,255,255,.14) 50%,
    rgba(255,255,255,.06) 54%, transparent 62%);
  background-size: 260% 100%; background-position: 180% 0;
  mix-blend-mode: screen;
  animation: glasslight 7s linear infinite;
}
.photo:nth-child(2n)::before { animation-delay: -2.3s; }
.photo:nth-child(3n)::before { animation-delay: -4.6s; }
.photo:nth-child(5n)::before { animation-delay: -1.1s; }
@keyframes glasslight { to { background-position: -80% 0; } }
@media (prefers-reduced-motion: reduce) { .photo::before, .lb-imgwrap::before { animation: none; } }
/* filigrane répété et dense (thème) */
.photo::after {
  content: ""; position: absolute; inset: 0; z-index: 2;
  background-image: var(--wm); background-repeat: repeat;
  pointer-events: none;
}
.photo .heart {
  position: absolute; top: 12px; right: 12px; z-index: 4;
  width: 42px; height: 42px; display: grid; place-items: center;
  border: none; border-radius: 999px;
  background: rgba(20,17,15,.42); color: #fff;
  opacity: 0; transform: scale(.82);
  transition: opacity .2s ease, transform .22s cubic-bezier(.2,.85,.25,1), background .2s ease;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.photo:hover .heart, .photo .heart.on { opacity: 1; transform: none; }
.photo .heart:hover { background: rgba(20,17,15,.62); }
.photo .heart svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2; }
.photo .heart.on { background: var(--accent); }
.photo .heart.on:hover { background: var(--accent); }
.photo .heart.on svg { fill: var(--accent-text); stroke: var(--accent-text); }
.photo.selected { outline: 3px solid var(--accent); outline-offset: -3px; }

/* ---------- Pied ---------- */
.site-foot { text-align: center; color: var(--muted); font-size: 12px; padding: 30px 24px 46px; border-top: 1px solid var(--line); }

/* Signature Webbenprod (dorée, présente sur tous les sites clients) */
.wbp-credit { color: var(--accent); font-size: 12px; letter-spacing: .3px; margin: 0; }
.wbp-credit a { color: var(--accent); text-decoration: none; font-weight: 600; }
.wbp-credit a:hover { text-decoration: underline; }
.site-foot .wbp-credit { margin-top: 10px; }
.gate-credit { margin-top: 24px; }

/* ---------- Tiroir sélection ---------- */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.5); }
.drawer {
  position: fixed; top: 0; right: 0; z-index: 50;
  width: min(400px, 92vw); height: 100%;
  display: flex; flex-direction: column;
  background: var(--surface); border-left: 1px solid var(--line);
  box-shadow: -20px 0 60px rgba(0,0,0,.4);
}
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-family: var(--font-head); font-weight: 500; font-size: 22px; margin: 0; }
.icon-btn { background: transparent; border: none; color: var(--muted); font-size: 18px; }
.icon-btn:hover { color: var(--text); }
.drawer-list { flex: 1; overflow-y: auto; padding: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: start; }
.drawer-thumb { position: relative; border-radius: 6px; overflow: hidden; aspect-ratio: 1; background: var(--bg); }
.drawer-thumb img { width: 100%; height: 100%; object-fit: cover; }
.drawer-thumb button {
  position: absolute; top: 6px; right: 6px;
  width: 26px; height: 26px; border: none; border-radius: 999px;
  background: rgba(20,17,15,.7); color: #fff; font-size: 13px; line-height: 1;
}
.drawer-foot { padding: 18px 20px; border-top: 1px solid var(--line); }
.drawer-empty { color: var(--muted); font-size: 14px; text-align: center; margin: 6px 0 16px; }
.prints-opt { display: flex; align-items: center; gap: 10px; padding: 12px 14px; margin-bottom: 14px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--muted); font-size: 13px; }
.prints-ico { font-size: 18px; }
.cta {
  width: 100%; height: 50px; border: none; border-radius: 10px;
  background: var(--accent); color: var(--accent-text);
  font-size: 15px; font-weight: 700; letter-spacing: .3px;
}
.cta:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- Envoi de la sélection ---------- */
.checkout {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center; padding: 20px;
  background: rgba(9,7,6,.72); backdrop-filter: blur(4px);
}
.checkout-card {
  position: relative; width: min(440px, 100%);
  padding: 34px 30px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); text-align: center;
}
.co-x { position: absolute; top: 14px; right: 16px; font-size: 17px; }
.checkout-card h2 { font-family: var(--font-head); font-weight: 500; font-size: 26px; margin: 0 0 12px; }
.co-sub { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0 0 22px; }
.co-sub b, .co-done b { color: var(--text); }
#selForm { display: flex; flex-direction: column; gap: 12px; text-align: left; }
#selForm input, #selForm textarea {
  padding: 13px 15px; font-size: 15px; font-family: inherit;
  color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 9px; outline: none; resize: vertical;
}
#selForm input:focus, #selForm textarea:focus { border-color: var(--accent); }
#selForm .cta { margin-top: 6px; }
.co-error { margin: 0; padding: 10px 13px; border-radius: 9px; font-size: 13px;
  background: rgba(229,134,122,.12); border: 1px solid rgba(229,134,122,.4); color: #e5867a; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.co-done { padding: 8px 0; }
.co-check {
  width: 62px; height: 62px; margin: 4px auto 18px;
  display: grid; place-items: center; border-radius: 999px;
  background: var(--accent); color: var(--accent-text); font-size: 32px; font-weight: 700;
}
.co-done p { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0 0 22px; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 70;
  display: grid; grid-template-columns: 64px 1fr 64px; align-items: center;
  background: rgba(9,7,6,.96);
}
.lb-stage { grid-column: 2; margin: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; max-height: 100vh; padding: 20px 0 96px; }
.lb-imgwrap { position: relative; display: flex; isolation: isolate; }
.lb-imgwrap::after {
  content: ""; position: absolute; inset: 0;
  background-image: var(--wm); background-repeat: repeat; opacity: .72; pointer-events: none;
}
.lb-imgwrap::before {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(105deg,
    transparent 40%, rgba(255,255,255,.05) 47%, rgba(255,255,255,.12) 50%,
    rgba(255,255,255,.05) 53%, transparent 60%);
  background-size: 240% 100%; background-position: 170% 0;
  mix-blend-mode: screen;
  animation: glasslight 9s linear infinite;
}
.lb-stage img { max-height: calc(100vh - 150px); max-width: 100%; width: auto; border-radius: 4px; user-select: none; -webkit-user-drag: none; }
.lb-stage video { max-height: calc(100vh - 90px); max-width: 100%; width: auto; border-radius: 4px; background: #000; }
.lb-embed { width: min(90vw, 1280px); aspect-ratio: 16 / 9; max-height: calc(100vh - 90px); border: 0; border-radius: 4px; background: #000; }
/* mode vidéo : pas de filigrane, pas d'outils sélection/diaporama/nav */
.lightbox.video .lb-imgwrap::after,
.lightbox.video .lb-tools,
.lightbox.video .lb-cap,
.lightbox.video .lb-prev,
.lightbox.video .lb-next { display: none; }
.lb-cap { color: var(--muted); font-size: 13px; letter-spacing: .3px; }
.lb-btn { background: transparent; border: none; color: #fff; opacity: .7; will-change: transform; }
.lb-btn:hover { opacity: 1; }
.lb-close { position: absolute; top: 18px; right: 22px; font-size: 26px; z-index: 6; }
.lb-prev, .lb-next { font-size: 54px; line-height: 1; height: 100%; }
.lb-prev { grid-column: 1; } .lb-next { grid-column: 3; }
.lb-tools {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); will-change: transform;
  display: flex; gap: 12px;
}
.lb-heart, .lb-play {
  display: inline-flex; align-items: center; gap: 8px;
  height: 46px; padding: 0 20px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.06);
  color: #fff; font-size: 14px;
}
.lb-heart svg { fill: none; stroke: #fff; stroke-width: 2; }
.lb-heart:hover, .lb-play:hover { border-color: var(--accent); }
.lb-heart.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.lb-heart.on svg { fill: var(--accent-text); stroke: var(--accent-text); }

@media (max-width: 640px) {
  .lightbox { grid-template-columns: 40px 1fr 40px; }
  .lb-prev, .lb-next { font-size: 38px; }
  .gallery-head { padding-top: 34px; }
}
