/* Belle Mariage — galerie privée des mariés (reprise de la maquette « Galerie privée ») */
:root {
  --fond: #F7F3EE;
  --encre: #1E1A17;
  --gris: #5C534B;
  --gris-clair: #8A8077;
  --trait: #DDD3C6;
  --sable: #EDE6DC;
  --sable-trait: #CFC2B1;
  --champ: #BFB2A2;
  --champ-fond: #FBF9F6;
  --accent: #7E5E33;
  --nuit: #14110F;
  --nuit-texte: #B9AFA3;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Jost', system-ui, -apple-system, sans-serif;
  --marge: clamp(16px, 4vw, 56px);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--encre); font-family: var(--sans); font-size: 16px; line-height: 1.5; }
body.verrou { overflow: hidden; }
a { color: var(--encre); }
a:hover { color: var(--accent); }
button { font-family: var(--sans); color: inherit; }
[hidden] { display: none !important; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --------------------------------------------------------------- éléments communs */
.logo { text-decoration: none; display: inline-flex; flex-direction: column; line-height: 1; color: var(--encre); }
.logo span { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 32px; }
.logo small { font-size: 10px; letter-spacing: .34em; text-transform: uppercase; margin-top: 6px; color: var(--gris); }
.logo-clair, .logo-clair small { color: #fff; }
.logo-clair:hover { color: #fff; }
.bouton-noir { min-height: 56px; padding: 0 26px; border: 0; background: var(--encre); color: var(--fond); display: inline-flex; align-items: center; justify-content: center; gap: 12px; font-size: 12px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; cursor: pointer; text-decoration: none; }
.bouton-noir:hover { background: #000; color: var(--fond); }
.bouton-noir[disabled] { opacity: .45; cursor: not-allowed; }
.bouton-contour { min-height: 50px; padding: 0 24px; border: 1px solid var(--encre); background: transparent; color: var(--encre); display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-size: 12px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; cursor: pointer; text-decoration: none; }
.pastille { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--accent); color: #fff; font-size: 11px; letter-spacing: 0; display: inline-flex; align-items: center; justify-content: center; }
.pastille-claire { background: var(--fond); color: var(--encre); font-size: 12px; }
.erreur { margin: 0; padding: 12px 14px; background: #F6E7E3; color: #7A2E22; font-size: 14px; line-height: 1.5; }
.petit { margin: 0; font-size: 14px; line-height: 1.6; color: var(--gris); }

/* --------------------------------------------------------------- chargement */
.chargement { min-height: 100vh; display: grid; place-items: center; }
.chargement span { font-family: var(--serif); font-style: italic; font-size: 34px; color: var(--gris); animation: respire 1.6s ease-in-out infinite; }
@keyframes respire { 50% { opacity: .35; } }

/* --------------------------------------------------------------- écran du code */
.entete { border-bottom: 1px solid var(--trait); padding: 24px var(--marge); }
.acces { max-width: 640px; margin: 0 auto; padding: clamp(48px, 9vh, 96px) var(--marge) 96px; }
.surtitre { margin: 0; font-size: 12px; font-weight: 500; letter-spacing: .24em; text-transform: uppercase; color: var(--accent); }
.acces h1 { margin: 16px 0 0; font-family: var(--serif); font-weight: 300; font-size: clamp(44px, 7vw, 72px); line-height: 1; }
.acces h1 em { font-weight: 400; }
.intro { margin: 24px 0 0; font-size: 17px; line-height: 1.75; color: var(--gris); }
.carte-code { margin-top: 36px; background: #fff; border: 1px solid var(--trait); padding: clamp(24px, 4vw, 44px); display: flex; flex-direction: column; gap: 20px; }
.carte-code h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 32px; line-height: 1.05; }
.carte-code label { display: flex; flex-direction: column; gap: 8px; font-size: 13px; font-weight: 500; }
.carte-code input { height: 56px; border: 1px solid var(--champ); background: var(--champ-fond); padding: 0 16px; font-family: var(--sans); font-size: 20px; letter-spacing: .12em; text-transform: uppercase; color: var(--encre); border-radius: 0; }
.carte-code input::placeholder { letter-spacing: 0; text-transform: none; font-size: 16px; color: var(--gris-clair); }
.cadenas { margin: 20px 0 0; display: flex; gap: 10px; font-size: 14px; line-height: 1.6; color: var(--gris); }
.cadenas svg { flex: 0 0 auto; margin-top: 3px; }

/* --------------------------------------------------------------- couverture */
.couverture { position: relative; height: min(88vh, 900px); min-height: 520px; overflow: hidden; color: #fff; display: flex; flex-direction: column; background: var(--nuit); }
.couverture > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 45%; }
.voile { position: absolute; inset: 0; background: linear-gradient(to top, rgba(18,14,11,.78) 0%, rgba(18,14,11,.30) 45%, rgba(18,14,11,.12) 70%, rgba(18,14,11,.45) 100%); }
.couverture-haut { position: relative; padding: 24px clamp(16px, 3vw, 40px); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.couverture-haut .logo span { font-size: 30px; }
.lien-clair { border: 0; background: transparent; color: #fff; min-height: 44px; display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; cursor: pointer; }
.couverture-bas { position: relative; margin-top: auto; padding: 0 24px clamp(56px, 10vh, 88px); text-align: center; display: flex; flex-direction: column; align-items: center; }
.lieu-date { margin: 0; font-size: 13px; font-weight: 500; letter-spacing: .26em; text-transform: uppercase; }
.couverture h1 { margin: 20px 0 0; font-family: var(--serif); font-weight: 300; font-size: clamp(52px, 8vw, 120px); line-height: .95; }
.couverture h1 em { font-weight: 400; }
.bouton-clair { margin-top: 40px; border: 1px solid rgba(255,255,255,.85); color: #fff; text-decoration: none; padding: 17px 32px; font-size: 13px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; min-height: 44px; display: inline-flex; align-items: center; gap: 12px; }
.bouton-clair:hover { color: #fff; background: rgba(255,255,255,.1); }

/* --------------------------------------------------------------- barre de la galerie */
.barre { position: sticky; top: 0; z-index: 20; background: rgba(247,243,238,.97); border-bottom: 1px solid var(--trait); }
.barre-actions { max-width: 1600px; margin: 0 auto; padding: 14px var(--marge) 2px; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.action { min-height: 44px; padding: 0 14px; border: 0; background: transparent; color: var(--encre); display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; cursor: pointer; }
.action:hover, .action[aria-expanded="true"], .action[aria-pressed="true"] { background: var(--sable); }
.action-noire { margin-left: 14px; padding: 0 18px; background: var(--encre); color: var(--fond); gap: 10px; }
.action-noire:hover, .action-noire[aria-expanded="true"] { background: #000; color: var(--fond); }
.libelle-court { display: none; }
.chapitres { max-width: 1600px; margin: 0 auto; padding: 4px var(--marge) 0; display: flex; gap: 36px; overflow-x: auto; scrollbar-width: none; }
.chapitres::-webkit-scrollbar { display: none; }
.chapitres button { flex: 0 0 auto; min-height: 50px; padding: 0 2px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--gris); display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; cursor: pointer; }
.chapitres button[aria-pressed="true"] { color: var(--encre); border-bottom-color: var(--encre); }
.chapitres button span { font-weight: 400; letter-spacing: 0; color: var(--gris-clair); }

/* panneaux (télécharger, partager, commander, panier) */
.panneau { position: absolute; right: var(--marge); top: calc(100% + 8px); z-index: 30; width: min(400px, calc(100vw - 24px)); max-height: calc(100vh - 150px); overflow-y: auto; background: #fff; border: 1px solid var(--trait); box-shadow: 0 18px 40px rgba(30,26,23,.14); padding: 26px; display: flex; flex-direction: column; gap: 20px; }
.panneau-large { width: min(460px, calc(100vw - 24px)); }
.panneau-tete { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.panneau h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1; }
.croix { width: 44px; height: 44px; margin: -10px -10px 0 0; border: 0; background: transparent; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: 0 0 auto; }
.groupe { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 8px; }
.groupe legend, .sous-titre { padding: 0 0 10px; font-size: 11px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--gris); }
.choix { min-height: 56px; padding: 10px 14px; border: 1px solid var(--trait); background: #fff; display: flex; align-items: center; gap: 14px; text-align: left; cursor: pointer; width: 100%; }
.choix[aria-pressed="true"] { border-color: var(--encre); background: var(--fond); }
.choix .rond-choix { flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--encre); display: inline-flex; align-items: center; justify-content: center; }
.choix[aria-pressed="true"] .rond-choix::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--encre); }
.choix .textes { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; }
.choix .textes span:first-child { font-size: 15px; }
.choix .textes span + span { font-size: 13px; color: var(--gris); }
.choix .prix { font-size: 15px; font-weight: 500; white-space: nowrap; }
.statut { margin: 0; padding: 14px 16px; background: var(--sable); display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.55; }
.statut svg { flex: 0 0 auto; margin-top: 2px; color: var(--accent); }
.progression { height: 4px; background: var(--sable); overflow: hidden; }
.progression span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.lien-partage { margin: 0; padding: 14px; border: 1px solid var(--champ); background: var(--champ-fond); font-size: 15px; overflow-wrap: anywhere; }
.quantite { display: inline-flex; align-items: center; gap: 12px; }
.quantite button { width: 36px; height: 36px; border: 1px solid var(--trait); background: #fff; font-size: 18px; line-height: 1; cursor: pointer; }
.quantite output { min-width: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.ligne-qte { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.commande-photo { display: flex; align-items: center; gap: 16px; font-size: 14px; color: var(--gris); }
.commande-photo img { width: 88px; height: 110px; object-fit: cover; display: block; flex: 0 0 auto; background: var(--sable); }
.lignes { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--trait); }
.lignes li { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--trait); }
.lignes img, .lignes .vignette-album { width: 56px; height: 70px; object-fit: cover; display: block; flex: 0 0 auto; background: var(--sable); }
.lignes .vignette-album { display: grid; place-items: center; color: var(--accent); }
.lignes .detail { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.lignes .haut { display: flex; justify-content: space-between; gap: 10px; font-size: 15px; }
.lignes .haut strong { font-weight: 500; white-space: nowrap; }
.lignes .sous { font-size: 13px; color: var(--gris); }
.lignes .bas { display: flex; align-items: center; gap: 10px; }
.retirer { margin-left: auto; min-height: 36px; padding: 0 4px; border: 0; background: transparent; color: var(--gris); font-size: 13px; text-decoration: underline; cursor: pointer; }
.ensemble { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--trait); }
.ensemble .textes { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; }
.ensemble .textes span:first-child { font-size: 15px; }
.ensemble .textes span + span { font-size: 13px; color: var(--gris); }
.ensemble .prix { font-size: 15px; font-weight: 500; white-space: nowrap; }
.ensemble button { min-height: 40px; padding: 0 14px; border: 1px solid var(--encre); background: #fff; font-size: 12px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; cursor: pointer; }
.totaux { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.totaux div { display: flex; justify-content: space-between; font-size: 14px; }
.totaux dt { color: var(--gris); }
.totaux dd { margin: 0; }
.totaux .total { padding-top: 10px; border-top: 1px solid var(--trait); font-size: 16px; font-weight: 500; }
.totaux .total dt { color: var(--encre); }
.note-livraison { font-size: 13px; color: var(--accent); }

/* --------------------------------------------------------------- contenu */
.contenu { max-width: 1600px; margin: 0 auto; padding: 56px var(--marge) 0; }
.titre-chapitre { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; padding-bottom: 32px; }
.titre-chapitre h2 { margin: 0; font-family: var(--serif); font-weight: 300; font-size: clamp(30px, 3vw, 42px); line-height: 1; }
.titre-chapitre span { font-size: 14px; color: var(--gris); }
.bandeau-selection { margin-bottom: 20px; padding: clamp(20px, 3vw, 32px); background: var(--sable); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.bandeau-selection .textes { max-width: 640px; display: flex; flex-direction: column; gap: 8px; }
.bandeau-selection .textes span:first-child { font-size: 12px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); }
.bandeau-selection .textes span + span { font-size: 16px; line-height: 1.6; }
.favoris-vides { padding: 80px 24px; border: 1px dashed var(--sable-trait); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; color: var(--gris); }
.favoris-vides svg { color: var(--accent); }
.favoris-vides p { margin: 0; max-width: 470px; font-size: 16px; line-height: 1.65; }
.favoris-vides .grand { font-family: var(--serif); font-size: 32px; line-height: 1.1; color: var(--encre); }

/* grille mosaïque */
.grille { column-count: 4; column-gap: 16px; }
.tuile { position: relative; break-inside: avoid; margin: 0 0 16px; }
.tuile > button { display: block; width: 100%; padding: 0; border: 0; background: var(--sable); cursor: zoom-in; }
.tuile img { display: block; width: 100%; height: auto; }
.tuile-actions { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 8px; opacity: 0; transition: opacity .2s ease; }
.tuile:hover .tuile-actions, .tuile:focus-within .tuile-actions, .tuile-actions.allume { opacity: 1; }
@media (hover: none) { .tuile-actions { opacity: 1; } }
.petit-rond { width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(247,243,238,.94); color: var(--encre); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.petit-rond[aria-pressed="true"] { color: var(--accent); }
.petit-rond[aria-pressed="true"] svg { fill: currentColor; }

/* films */
.films { max-width: 1200px; margin: 0 auto; padding: 96px 0 0; }
.films .entete-films { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.films h2 { margin: 0; font-family: var(--serif); font-weight: 300; font-size: clamp(34px, 3.4vw, 46px); line-height: 1.05; }
.films h2 em { font-weight: 400; }
.lecteur { margin-top: 24px; position: relative; aspect-ratio: 16 / 9; background: var(--nuit); }
.lecteur video, .lecteur img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.lecteur video { object-fit: contain; background: #000; }
.lecteur .lancer { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(18,14,11,.22); cursor: pointer; }
.lecteur .lancer span { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 96px; height: 96px; border-radius: 50%; background: rgba(247,243,238,.94); display: flex; align-items: center; justify-content: center; color: var(--encre); }
.films .sous-films { margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 28px; }
.films .liste-films { display: flex; flex-wrap: wrap; gap: 10px; }
.films .liste-films button { min-height: 46px; padding: 0 18px; border: 1px solid var(--champ); background: transparent; display: inline-flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.films .liste-films button[aria-pressed="true"] { border-color: var(--encre); }
.films .telecharger-film { min-height: 46px; display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; text-decoration: none; }

/* pied */
.pied { margin-top: 96px; border-top: 1px solid var(--trait); background: var(--sable); }
.pied-grille { max-width: 1600px; margin: 0 auto; padding: 52px var(--marge) 60px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 36px; }
.pied h3 { margin: 0 0 10px; font-size: 11px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--gris); }
.pied p { margin: 8px 0 0; font-size: 15px; line-height: 1.65; }
.logo-pied { text-decoration: none; font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 32px; line-height: 1; }

/* --------------------------------------------------------------- visionneuse */
.visionneuse { position: fixed; inset: 0; z-index: 100; background: var(--nuit); color: var(--fond); display: flex; flex-direction: column; }
.vis-haut { padding: 12px clamp(12px, 3vw, 32px); padding-top: max(12px, env(safe-area-inset-top)); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.vis-titre { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.vis-titre span:first-child { font-family: var(--serif); font-size: 24px; line-height: 1.1; }
.vis-titre span + span { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--nuit-texte); }
.vis-boutons { display: flex; align-items: center; gap: 4px; }
.rond { width: 48px; height: 48px; border: 0; border-radius: 50%; background: transparent; color: var(--fond); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.rond:hover { background: rgba(247,243,238,.1); color: var(--fond); }
.rond[aria-pressed="true"] { color: #E9B7A8; }
.rond[aria-pressed="true"] svg { fill: currentColor; }
#vis-diaporama .ico-pause, #vis-diaporama.en-cours .ico-lecture { display: none; }
#vis-diaporama.en-cours .ico-pause { display: inline; }
.fermer { margin-left: 8px; min-height: 48px; padding: 0 16px; border: 1px solid rgba(247,243,238,.45); background: transparent; color: var(--fond); display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; cursor: pointer; }
.vis-scene { position: relative; flex: 1 1 auto; min-height: 0; touch-action: pan-y pinch-zoom; }
.vis-scene img { position: absolute; top: 0; left: clamp(0px, 7vw, 100px); width: calc(100% - 2 * clamp(0px, 7vw, 100px)); height: calc(100% - 24px); object-fit: contain; display: block; user-select: none; -webkit-user-drag: none; transition: opacity .15s; }
.vis-scene img.charge { opacity: .55; }
.fleche { position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border-radius: 50%; border: 0; background: rgba(247,243,238,.14); color: var(--fond); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.fleche-g { left: clamp(8px, 2vw, 28px); }
.fleche-d { right: clamp(8px, 2vw, 28px); }

/* message flottant */
.message-flottant { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 200; max-width: calc(100vw - 32px); padding: 14px 20px; background: var(--encre); color: var(--fond); font-size: 14px; line-height: 1.5; box-shadow: 0 12px 30px rgba(0,0,0,.2); }

/* --------------------------------------------------------------- écrans moyens et petits */
@media (max-width: 1200px) { .grille { column-count: 3; } }
@media (max-width: 800px) {
  .grille { column-count: 2; column-gap: 10px; }
  .tuile { margin-bottom: 10px; }
  .tuile-actions { right: 6px; bottom: 6px; gap: 6px; }
  .petit-rond { width: 38px; height: 38px; }
  .petit-rond svg { width: 18px; height: 18px; }
  .barre-actions { justify-content: space-between; gap: 2px; padding-top: 10px; }
  .action { padding: 0 8px; letter-spacing: .08em; font-size: 11px; gap: 6px; }
  .action-noire { margin-left: 0; padding: 0 12px; }
  .libelle-long { display: none; }
  .libelle-court { display: inline; }
  .chapitres { gap: 24px; }
  .panneau, .panneau-large { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: 100%; max-height: 85vh; border: 0; border-top: 1px solid var(--trait); box-shadow: 0 -12px 40px rgba(30,26,23,.18); padding: 22px 18px max(22px, env(safe-area-inset-bottom)); z-index: 60; }
  .vis-titre span:first-child { font-size: 20px; }
  .fermer span { display: none; }
  .fermer { padding: 0 12px; margin-left: 2px; }
  .rond { width: 44px; height: 44px; }
  .vis-scene img { left: 0; width: 100%; }
  .fleche { display: none; }
  .couverture { min-height: 480px; height: 78vh; }
}
@media (max-width: 600px) {
  .barre-actions { flex-wrap: nowrap; }
  #btn-telecharger .libelle, #btn-partager .libelle { display: none; }
  #btn-telecharger, #btn-partager { padding: 0 10px; }
  .couverture-haut { flex-wrap: nowrap; align-items: flex-start; }
  .couverture-haut .logo span { font-size: 26px; }
  .couverture-haut .logo small { letter-spacing: .24em; white-space: nowrap; }
  .lien-clair { flex: 0 0 auto; }
  .lien-clair .long { display: none; }
}
/* Sur écran tactile : seulement le cœur sur les photos ; commander et télécharger sont dans la vue plein écran */
@media (hover: none) {
  .tuile-actions [data-action="commander"], .tuile-actions a { display: none; }
}

/* « Retirer » dans le panier : simple lien, pas un bouton carré */
.quantite .retirer { width: auto; height: auto; min-height: 36px; border: 0; background: transparent; font-size: 13px; }
