/* ---------- Galerie photos (/photos) ---------- */
.gallery-page { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 var(--space-4) var(--space-8); }
.gallery-head { max-width: 720px; margin: var(--space-4) 0 var(--space-6); display: flex; flex-direction: column; gap: var(--space-3); }
.gallery-back { align-self: flex-start; font-weight: 700; color: var(--rose-800); text-underline-offset: 3px; }
.gallery-title { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: clamp(36px, 6vw, 64px); line-height: 1.02; letter-spacing: -0.02em; color: var(--ink); }
.gallery-intro { margin: 0; font-size: 18px; line-height: 27px; color: var(--ink); max-width: 60ch; }
.gallery-count { margin: 0; font-weight: 700; font-size: 14px; color: var(--rose-800); }
.pill--draft { display: inline-block; vertical-align: middle; font-family: var(--font-sans); font-size: 13px; font-weight: 700; letter-spacing: 0; padding: 4px 10px; border-radius: var(--radius-pill); background: #fff1d6; color: #7a4a00; }

/* Grille justifiée « à la Apple Photos » : chaque vignette grandit en proportion de son format,
   donc toutes les vignettes d'une ligne ont la même hauteur et la ligne remplit la largeur. */
.gallery { --row: 240px; --gap: 6px; display: flex; flex-wrap: wrap; gap: var(--gap); }
.gallery::after { content: ""; flex-grow: 999999; } /* la dernière ligne ne s'étire pas */
@media (max-width: 720px) { .gallery { --row: 150px; --gap: 4px; } }
.g-item {
  position: relative; display: block; overflow: hidden; border-radius: 10px;
  flex-grow: calc(var(--w) / var(--h) * 100); flex-basis: calc(var(--w) / var(--h) * var(--row));
  aspect-ratio: var(--w) / var(--h); max-height: calc(var(--row) * 1.6);
  background-color: var(--c); background-size: cover; background-position: center; outline: none;
  transition: transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .35s;
}
.g-item img { display: block; width: 100%; height: 100%; object-fit: cover; transition: opacity .5s ease, transform .6s cubic-bezier(.2, .8, .2, 1); }
.js .g-item img:not(.is-loaded) { opacity: 0; }
.g-item:hover img { transform: scale(1.035); }
.g-item:focus-visible { box-shadow: var(--focus-ring); }
.g-item.is-source { visibility: hidden; } /* vignette « partie » dans la visionneuse */

.gallery-foot { margin-top: var(--space-8); display: flex; flex-direction: column; align-items: center; gap: var(--space-4); text-align: center; }
.gallery-donate { min-width: min(100%, 360px); }
.gallery-note { margin: 0; max-width: 60ch; font-size: 14px; line-height: 20px; color: var(--ink); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: rgba(255, 255, 255, .6); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.gallery-note a { color: var(--rose-800); font-weight: 700; }

/* ---------- Visionneuse plein écran ---------- */
.lb { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; touch-action: none; user-select: none; -webkit-user-select: none; }
.lb[hidden] { display: none; }
.lb__backdrop { position: absolute; inset: 0; background: rgba(28, 12, 20, .9); -webkit-backdrop-filter: blur(24px) saturate(1.3); backdrop-filter: blur(24px) saturate(1.3); opacity: 0; transition: opacity .35s ease; }
.lb.is-open .lb__backdrop { opacity: 1; }
.lb__track { position: absolute; inset: 0; display: flex; will-change: transform; }
.lb__slide { flex: 0 0 100%; height: 100%; display: grid; place-items: center; padding: max(64px, env(safe-area-inset-top)) 16px max(84px, env(safe-area-inset-bottom)); box-sizing: border-box; }
.lb__slide img { object-fit: contain; border-radius: 6px; box-shadow: 0 30px 80px rgba(0, 0, 0, .45); background-size: cover; }
.lb__fly { position: fixed; z-index: 101; border-radius: 10px; object-fit: cover; pointer-events: none; will-change: transform, width, height; }
.lb__bar { position: absolute; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: 12px max(16px, env(safe-area-inset-left)); color: #fff; opacity: 0; transition: opacity .3s ease .1s; pointer-events: none; }
.lb.is-open .lb__bar { opacity: 1; }
.lb.is-chrome-hidden .lb__bar { opacity: 0; }
.lb__bar--top { top: max(0px, env(safe-area-inset-top)); }
.lb__bar--bottom { bottom: max(0px, env(safe-area-inset-bottom)); justify-content: center; }
.lb__count { font-weight: 700; font-size: 14px; letter-spacing: .02em; font-variant-numeric: tabular-nums; padding: 6px 12px; border-radius: var(--radius-pill); background: rgba(255, 255, 255, .12); }
.lb__btn { pointer-events: auto; display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer; transition: background .2s; text-decoration: none; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.lb__btn:hover { background: rgba(255, 255, 255, .26); }
.lb__btn:focus-visible { outline: none; box-shadow: 0 0 0 3px #fff; }
.lb__nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 52px; height: 52px; }
.lb__nav--prev { left: 16px; }
.lb__nav--next { right: 16px; }
@media (hover: none), (max-width: 720px) { .lb__nav { display: none; } }
.lb__actions { display: flex; gap: var(--space-2); }

@media (prefers-reduced-motion: reduce) {
  .g-item, .g-item img, .lb__backdrop, .lb__bar { transition: none; }
}

/* ---------- Aperçu sur la page « inscriptions closes » ---------- */
.after { display: flex; flex-direction: column; gap: var(--space-4); width: 100%; text-align: left; }
.after__photos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; border-radius: var(--radius-md); overflow: hidden; text-decoration: none; position: relative; }
.after__photos img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.after__photos:hover img { transform: scale(1.04); }
.after__photos:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.after__more { position: absolute; right: 8px; bottom: 8px; padding: 4px 10px; border-radius: var(--radius-pill); background: rgba(28, 12, 20, .72); color: #fff; font-size: 13px; font-weight: 700; }
.after__actions { display: flex; flex-direction: column; gap: var(--space-2); }
/* Affiche à télécharger */
.poster-dl { display: grid; grid-template-columns: 120px 1fr; gap: var(--space-4); align-items: center; padding: var(--space-4); border-radius: var(--radius-md); background: rgba(255, 255, 255, .55); text-align: left; }
.poster-dl__thumb { display: block; border-radius: 8px; overflow: hidden; box-shadow: 0 8px 24px rgba(43, 22, 34, .25); transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.poster-dl__thumb:hover { transform: translateY(-2px) rotate(-1deg); }
.poster-dl__thumb:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.poster-dl__thumb img { display: block; width: 100%; height: auto; }
.poster-dl__body { display: flex; flex-direction: column; gap: var(--space-2); }
.poster-dl__body p { margin: 0; font-size: 14px; line-height: 20px; color: var(--ink); }
.poster-dl__title { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 20px; line-height: 26px; color: var(--ink); }
.poster-dl__pdf { font-size: 14px; font-weight: 700; color: var(--rose-800); text-align: center; text-underline-offset: 2px; }
.gallery-foot .poster-dl { width: min(100%, 560px); }
@media (max-width: 480px) { .poster-dl { grid-template-columns: 88px 1fr; gap: var(--space-3); } .poster-dl .or-btn { padding-inline: var(--space-3); } }

/* Appel au don après l'événement : encart rose bien visible. */
.after__donate { margin: var(--space-2) 0 0; padding: var(--space-6) var(--space-4) var(--space-4); border-radius: var(--radius-md); background: var(--rose-100); display: flex; flex-direction: column; gap: var(--space-3); text-align: center; }
.after__donate p { margin: 0; color: var(--ink); }
.after__donate-title { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 24px; line-height: 30px; color: var(--rose-800); }
.after__soon { margin: 0; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: rgba(255, 255, 255, .55); font-weight: 700; color: var(--ink); text-align: center; }
.gallery-donate-box { width: min(100%, 560px); padding: var(--space-6); border-radius: var(--radius-md); background: rgba(253, 227, 238, .9); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); display: flex; flex-direction: column; align-items: center; gap: var(--space-3); }
.gallery-donate-box h2 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 26px; line-height: 32px; color: var(--rose-800); }
.gallery-donate-box p { margin: 0; color: var(--ink); }
