/* ==========================================================
   Galeries clients — espace client (côté visiteur)
   Noir, crème, verre flouté et pilules : les couleurs du thème Tala Niang quand il est là
   (ses variables --fond, --texte, --police…), sinon des valeurs équivalentes.
   ========================================================== */

.tg {
  --tg-fond: var(--fond, #000);
  --tg-texte: var(--texte, #e8e6dd);
  --tg-doux: var(--texte-doux, rgba(232, 230, 221, .62));
  --tg-police: var(--police, "Inter Tight", "Helvetica Neue", Arial, sans-serif);
  --tg-ease: var(--ease, cubic-bezier(.22, .61, .21, 1));
  --tg-pad: var(--pad, clamp(20px, 2.6vw, 44px));
  width: min(1320px, 100%); margin: 0 auto; box-sizing: border-box;
  padding: clamp(40px, 6vw, 96px) var(--tg-pad) calc(var(--barre, 0px) + clamp(56px, 7vw, 110px));
  background: var(--tg-fond); color: var(--tg-texte); font-family: var(--tg-police);
}
.tg *, .tg *::before, .tg *::after { box-sizing: border-box; }
.tg-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* le verre */
.tg-verre {
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, 0) 50%), rgba(255, 255, 255, .035);
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 30px 70px rgba(0, 0, 0, .45);
  -webkit-backdrop-filter: blur(24px) saturate(150%); backdrop-filter: blur(24px) saturate(150%);
}

/* ---------- l'en-tête ---------- */
.tg-tete { max-width: 760px; margin-bottom: clamp(36px, 5vw, 64px); }
.tg-tete > * { margin: 0; }
.tg-etiquette { display: flex; align-items: center; gap: 18px; font-size: 12px; letter-spacing: .3em; text-transform: uppercase; }
.tg-etiquette::before { content: ""; width: 48px; height: 1px; background: var(--tg-doux); }
.tg-titre { margin-top: 24px !important; font: 300 clamp(48px, 7vw, 116px)/.95 var(--tg-police); letter-spacing: -.03em; text-transform: uppercase; color: var(--tg-texte); }
.tg-texte { margin-top: 24px !important; max-width: 30em; font-size: clamp(17px, 1.3vw, 20px); line-height: 1.6; color: var(--tg-doux); }
.tg-texte strong, .tg-date strong { color: var(--tg-texte); font-weight: 400; }
.tg-date { margin-top: 14px !important; font-size: 15px; color: var(--tg-doux); }
.tg-quitter { display: inline-flex; align-items: center; min-height: 44px; margin-top: 8px; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--tg-doux); text-decoration: none; }
.tg-quitter:hover { color: var(--tg-texte); }
.tg-actions { margin-top: 26px !important; }

/* ---------- les pilules en verre ---------- */
.tg-pilule {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 26px; border-radius: 999px;
  color: #fff; font: 400 16px/1 var(--tg-police); letter-spacing: .01em; text-decoration: none; white-space: nowrap; cursor: pointer;
  background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 55%), rgba(255, 255, 255, .2);
  border: 1px solid rgba(255, 255, 255, .42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 6px 20px rgba(0, 0, 0, .22);
  -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%);
  transition: background-color .25s var(--tg-ease), border-color .25s var(--tg-ease), box-shadow .25s var(--tg-ease), transform .25s var(--tg-ease);
}
.tg-pilule:hover { background: linear-gradient(180deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, .02) 55%), rgba(255, 255, 255, .28); border-color: rgba(255, 255, 255, .6); transform: translateY(-2px); }
.tg-pilule:disabled { opacity: .55; cursor: wait; transform: none; }
.tg-pilule.petite { min-height: 44px; padding: 0 20px; font-size: 15px; }
.tg-ico { width: 19px; height: 19px; flex: none; }
.tg-pilule:hover .tg-ico { transform: translateX(2px); transition: transform .25s var(--tg-ease); }

/* ---------- l'accueil : deux cartes ---------- */
.tg-acces { scroll-margin-top: 90px; }
.tg-alerte { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px; margin-bottom: 22px; border-color: rgba(232, 230, 221, .4); }
.tg-alerte p { margin: 0; font-size: 16px; line-height: 1.5; }
.tg-cartes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 2.2vw, 30px); }
.tg-carte { display: flex; flex-direction: column; gap: 14px; padding: clamp(26px, 3vw, 44px); margin: 0; }
.tg-carte-ico { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .16); }
.tg-carte-ico .tg-ico { width: 23px; height: 23px; }
.tg-carte h2 { margin: 10px 0 0; font: 300 clamp(26px, 2.3vw, 36px)/1.1 var(--tg-police); letter-spacing: -.015em; color: var(--tg-texte); }
.tg-carte p { margin: 0; font-size: 16px; line-height: 1.55; color: var(--tg-doux); }
.tg-barre-code { display: flex; gap: 10px; margin-top: 12px; padding: 6px; border-radius: 999px; background: rgba(255, 255, 255, .045); border: 1px solid rgba(255, 255, 255, .14); transition: border-color .25s, box-shadow .25s; }
.tg-barre-code:focus-within { border-color: var(--tg-texte); box-shadow: 0 0 0 4px rgba(232, 230, 221, .1), 0 0 24px rgba(232, 230, 221, .12); }
.tg-barre-code input {
  flex: 1; min-width: 0; min-height: 50px; padding: 0 18px; border: 0; background: none; outline: none;
  color: var(--tg-texte); font: 400 18px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .22em; text-transform: uppercase;
}
.tg-barre-code input::placeholder { font-family: var(--tg-police); letter-spacing: .04em; text-transform: none; color: rgba(232, 230, 221, .4); }
.tg-barre-code .tg-pilule { min-height: 50px; }

/* ---------- les grilles de photos ---------- */
.tg-grille { columns: 3 280px; column-gap: clamp(10px, 1.4vw, 18px); }
.tg-tuile { position: relative; break-inside: avoid; margin: 0 0 clamp(10px, 1.4vw, 18px); border-radius: 18px; overflow: hidden; background: #111; }
.tg-tuile .tg-ouvrir { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.tg-tuile img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* 1.4.0 : jamais de case vide — la miniature floutée à la place exacte de la photo, puis la photo en fondu court */
.tg-tuile::before { content: ""; position: absolute; inset: -20px; pointer-events: none; background: var(--tg-flou, var(--flou, none)) 50% 50% / cover no-repeat; filter: blur(14px); }
.tg-tuile .tg-ouvrir { position: relative; }
html.js .tg-tuile img { opacity: 0; transition: opacity .25s var(--tg-ease); }
html.js .tg-tuile img.tg-la { opacity: 1; }
html.js .tg-tuile img.tg-deja { transition: none; }
.tg-tuile.choisie { box-shadow: 0 0 0 2px var(--tg-texte); }
.tg-sans { display: grid; place-items: center; height: 100%; min-height: 180px; padding: 16px; color: var(--tg-doux); font-size: 14px; word-break: break-all; }
.tg-coeur, .tg-dl {
  position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 46px; height: 46px; padding: 0; border-radius: 50%; color: #fff; cursor: pointer;
  background: rgba(0, 0, 0, .28); border: 1px solid rgba(255, 255, 255, .4); text-decoration: none;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); transition: background-color .2s, transform .2s;
}
.tg-coeur:hover, .tg-dl:hover { background: rgba(255, 255, 255, .22); transform: scale(1.06); }
.tg-tuile.choisie .tg-coeur { background: var(--tg-texte); color: #111; border-color: var(--tg-texte); }
.tg-tuile.choisie .tg-coeur svg { fill: currentColor; }
.tg-dl { top: auto; bottom: 10px; }

/* ---------- la fin de la sélection ---------- */
.tg-fin { max-width: 760px; margin: clamp(40px, 5vw, 70px) auto 0; padding: clamp(24px, 3vw, 40px); display: flex; flex-direction: column; gap: 14px; }
.tg-fin h2 { margin: 0; font: 300 clamp(28px, 2.6vw, 40px)/1.1 var(--tg-police); color: var(--tg-texte); }
.tg-fin p { margin: 0; }
.tg-compteur-texte { font-size: 20px; }
.tg-supplement { color: var(--tg-texte); font-size: 15px; }
.tg-fin label { font-size: 11.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--tg-doux); margin-top: 6px; }
.tg-fin textarea {
  width: 100%; min-height: 120px; padding: 14px 18px; border-radius: 16px; resize: vertical;
  font: 300 16px/1.5 var(--tg-police); color: var(--tg-texte); background: rgba(255, 255, 255, .045); border: 1px solid rgba(255, 255, 255, .14);
}
.tg-fin textarea:focus { outline: none; border-color: var(--tg-texte); box-shadow: 0 0 0 4px rgba(232, 230, 221, .1); }
.tg-fin .tg-valider { align-self: flex-start; margin-top: 6px; }
.tg-note { font-size: 13px; color: var(--tg-doux); }
.tg-fin-verrou { margin-top: 30px; font-size: 16px; color: var(--tg-doux); }

/* le compteur flottant, au-dessus de la barre du bas du téléphone */
.tg-compteur {
  position: fixed; z-index: 60; left: 50%; bottom: calc(var(--barre, 0px) + 14px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 16px; padding: 8px 8px 8px 22px; border-radius: 999px; max-width: calc(100vw - 24px);
  background: linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, 0) 55%), rgba(10, 10, 10, .6);
  transition: opacity .3s, transform .3s;
}
.tg-compteur > span { display: flex; flex-direction: column; font-size: 15px; white-space: nowrap; }
.tg-compteur small { font-size: 12px; color: var(--tg-texte); white-space: normal; }
.tg-compteur.cache { opacity: 0; transform: translate(-50%, 16px); pointer-events: none; }

/* ---------- plein écran ---------- */
.tg-vue { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; background: rgba(0, 0, 0, .9); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); color: #fff; font-family: var(--police, sans-serif); }
.tg-vue[hidden] { display: none; }
.tg-vue img { max-width: calc(100vw - 32px); max-height: calc(100dvh - 160px); object-fit: contain; border-radius: 8px; }
.tg-vue-nom { position: absolute; top: max(18px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); margin: 0; font-size: 13px; letter-spacing: .14em; opacity: .75; }
.tg-vue .tg-rond { position: absolute; display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border-radius: 50%; color: #fff; font-size: 22px; cursor: pointer; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .28); }
.tg-vue-fermer { top: max(12px, env(safe-area-inset-top)); right: 14px; font-size: 16px !important; }
.tg-vue-prec { left: 14px; top: 50%; transform: translateY(-50%); }
.tg-vue-suiv { right: 14px; top: 50%; transform: translateY(-50%); }
.tg-vue-actions { position: absolute; bottom: max(20px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); }
.tg-vue-coeur.oui { background: var(--texte, #e8e6dd); color: #111; }
html.tg-vue-ouverte { overflow: hidden; }

/* ---------- apparitions ---------- */
html.js .tg-apparait, html.js .tg-tuile { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--tg-ease), transform .8s var(--tg-ease); }
html.js .tg-tuile { transition-duration: .25s; }   /* 1.4.0 : apparition courte des photos */
html.js .tg-apparait.vu, html.js .tg-tuile.vu { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html.js .tg-apparait, html.js .tg-tuile { opacity: 1; transform: none; transition: none; }
  .tg-pilule, .tg-coeur, .tg-dl, .tg-compteur { transition: none; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .tg-verre, .tg-pilule, .tg-compteur { background: rgba(20, 20, 20, .85); }
}

/* ---------- téléphone ---------- */
@media (max-width: 900px) {
  .tg { padding-top: 30px; }
  .tg-titre { font-size: clamp(44px, 13vw, 64px); }
  .tg-cartes { grid-template-columns: minmax(0, 1fr); }
  .tg-carte { padding: 24px 20px; border-radius: 24px; }
  .tg-barre-code { flex-direction: column; border-radius: 20px; }
  .tg-barre-code .tg-pilule { width: 100%; }
  .tg-grille { columns: 2; column-gap: 10px; }
  .tg-tuile { margin-bottom: 10px; border-radius: 14px; }
  .tg-coeur, .tg-dl { width: 44px; height: 44px; top: 6px; right: 6px; }
  .tg-dl { top: auto; bottom: 6px; }
  .tg-fin .tg-valider { align-self: stretch; }
  .tg-alerte .tg-pilule { width: 100%; }
}

/* ---------- pilule discrète, messages et confirmation dans la page ---------- */
.tg-pilule.discret, .tg-dialogue .tg-pilule.discret {
  background: linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, 0) 55%), rgba(255, 255, 255, .07);
  border-color: rgba(255, 255, 255, .24); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2);
}
.tg-dialogue-fond {
  position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; padding: 20px;
  background: rgba(0, 0, 0, .62); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  animation: tg-fondu .25s ease both;
}
.tg-dialogue {
  width: min(460px, 100%); padding: 30px 28px 26px; color: var(--texte, #e8e6dd); font-family: var(--police, sans-serif);
  background: linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .02) 55%), rgba(18, 18, 18, .82);
  animation: tg-monte .3s cubic-bezier(.22, .61, .21, 1) both;
}
.tg-dialogue h2 { margin: 0 0 12px; font: 300 clamp(26px, 6vw, 32px)/1.1 var(--police, sans-serif); letter-spacing: -.015em; }
.tg-dialogue p { margin: 0 0 24px; font-size: 16px; line-height: 1.55; color: var(--texte-doux, rgba(232, 230, 221, .7)); }
.tg-dialogue-boutons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.tg-dialogue-boutons .tg-pilule { min-height: 48px; padding: 0 22px; }
.tg-annonce {
  position: fixed; z-index: 10001; left: 50%; top: max(16px, env(safe-area-inset-top)); width: min(560px, calc(100vw - 24px));
  display: flex; align-items: flex-start; gap: 12px; padding: 16px 14px 16px 20px; color: var(--texte, #e8e6dd); font-family: var(--police, sans-serif);
  background: linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .02) 55%), rgba(18, 18, 18, .86);
  border-color: rgba(232, 230, 221, .45);
  opacity: 0; transform: translate(-50%, -14px); pointer-events: none; transition: opacity .3s, transform .3s;
}
.tg-annonce.visible { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.tg-annonce p { flex: 1; margin: 0; font-size: 15px; line-height: 1.5; }
.tg-annonce-fermer { flex: none; width: 36px; height: 36px; margin: -6px 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .1); color: inherit; cursor: pointer; }
.tg-merci { text-align: left; border-color: rgba(232, 230, 221, .45); }
.tg-merci h2 { font-size: clamp(34px, 4vw, 48px); }
.tg-merci p { font-size: 17px; line-height: 1.55; }
.tg-merci:focus { outline: none; }
@keyframes tg-fondu { from { opacity: 0; } }
@keyframes tg-monte { from { opacity: 0; transform: translateY(14px); } }
@media (prefers-reduced-motion: reduce) {
  .tg-dialogue-fond, .tg-dialogue { animation: none; }
  .tg-annonce { transition: none; }
}
@media (max-width: 900px) {
  .tg-dialogue-boutons { flex-direction: column-reverse; }
  .tg-dialogue-boutons .tg-pilule { width: 100%; }
}

/* ---------- téléchargement : téléphone (écran tactile) ou ordinateur ---------- */
.tg-mobile-seul { display: none; }
@media (pointer: coarse) {
  .tg-mobile-seul { display: block; }
  .tg-ordi-seul { display: none; }
}
html.tg-tel .tg-mobile-seul { display: block; }   /* téléphone reconnu par le script (iPhone, Android) */
html.tg-tel .tg-ordi-seul { display: none; }
.tg-mobile-actions { margin-top: 24px; }
.tg-enregistrer { width: 100%; max-width: 420px; min-height: 56px; font-size: 17px; }
.tg-enregistrer:disabled { cursor: progress; }
.tg-lot { margin: 12px 0 0; font-size: 15px; line-height: 1.5; color: var(--tg-texte); }
.tg-sans-partage { margin: 0 0 6px; padding: 14px 16px; border-radius: 16px; font-size: 15px; line-height: 1.5; background: rgba(255, 255, 255, .05); border: 1px solid rgba(232, 230, 221, .3); }
.tg-wifi { display: flex; align-items: flex-start; gap: 10px; margin: 16px 0 0; font-size: 14px; line-height: 1.5; color: var(--tg-doux); }
.tg-wifi .tg-ico { width: 18px; height: 18px; margin-top: 1px; }
.tg-zip-option { margin-top: clamp(30px, 6vw, 60px); padding: 24px 20px; border-radius: 24px; }
.tg-zip-option h2 { margin: 0 0 8px; font: 300 26px/1.1 var(--tg-police); color: var(--tg-texte); }
.tg-zip-option p { margin: 0 0 16px; font-size: 15px; color: var(--tg-doux); }
.tg-zip-option .tg-pilule { width: 100%; }
.tg-zip-option ul { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; font-size: 14px; line-height: 1.55; color: var(--tg-doux); }
.tg-zip-option strong { color: var(--tg-texte); font-weight: 400; }
.tg-vue-enregistrer { min-width: 200px; }

/* ---------- la préparation du ZIP : un panneau en verre, la page reste affichée ---------- */
.tg-progression {
  position: fixed; z-index: 10001; left: 50%; bottom: calc(var(--barre, 0px) + 16px + env(safe-area-inset-bottom));
  width: min(480px, calc(100vw - 24px)); padding: 18px 20px; color: var(--texte, #e8e6dd); font-family: var(--police, sans-serif);
  background: linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .02) 55%), rgba(18, 18, 18, .88);
  border-color: rgba(232, 230, 221, .4);
  opacity: 0; transform: translate(-50%, 14px); pointer-events: none; transition: opacity .3s, transform .3s;
}
.tg-progression.visible { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.tg-prog-titre { margin: 0 0 10px; font-size: 17px; }
.tg-prog-barre { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .14); overflow: hidden; }
.tg-prog-barre span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--texte, #e8e6dd); transition: width .4s ease; }
.tg-prog-texte { margin: 10px 0 0; font-size: 14px; line-height: 1.5; color: var(--texte-doux, rgba(232, 230, 221, .7)); }
.tg-prog-boutons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tg-prog-boutons [hidden] { display: none; }
.tg-progression.erreur .tg-prog-titre { color: #fff; }
@media (prefers-reduced-motion: reduce) { .tg-progression, .tg-prog-barre span { transition: none; } }
.tg-prog-relancer { margin: 8px 0 0; font-size: 13px; color: rgba(232, 230, 221, .5); }
.tg-prog-relancer button { padding: 0; border: 0; background: none; color: rgba(232, 230, 221, .78); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 32px; }
.tg-prog-relancer button:hover { color: var(--texte, #e8e6dd); }
.tg-prog-relancer[hidden], .tg-prog-boutons[hidden] { display: none; }

/* le champ piège anti-robots et la vérification Turnstile (facultative) */
.tg-piege { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.tg .cf-turnstile { margin-top: 8px; }
