*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body { font-family: system-ui, -apple-system, sans-serif; background: #0f0f1a; color: #e2e2f0; min-height: 100vh;min-height: 100dvh; }

.gal-header { padding: 50px 20px 30px; text-align: center; background: linear-gradient(to bottom, rgba(0,0,0,.5), transparent); border-bottom: 1px solid rgba(255,255,255,.05); }
.gal-header h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 800; letter-spacing: -.03em; color: #fff; margin-bottom: 8px; }
.gal-header .count { font-size: .9rem; color: rgba(255,255,255,.4); }
.gal-container { max-width: 1400px; margin: 0 auto; padding: 28px 20px 50px; }

.gal-grid { display: flex; flex-wrap: wrap; gap: 15px; --h: clamp(110px, calc((min(100vw, 1400px) - 40px) / 3 * .8), 440px); }
.gal-grid::after { content: ''; flex-grow: 999999; }
.gal-item { position: relative; cursor: pointer; overflow: hidden; border-radius: 10px; border: 1px solid rgba(255,255,255,.05); box-shadow: none; transition: transform .2s, border-color .2s; min-width: 0; aspect-ratio: var(--r); flex: var(--r) var(--r) calc(var(--r) * var(--h)); }
.gal-item:hover { transform: scale(1.02); border-color: #f97316; }
.gal-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.gal-item:hover img { transform: scale(1.05); }
#lbVideo { max-width: 92vw; max-height: 82vh; border-radius: 8px; background:#000; }
.gal-play { position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); width:52px; height:52px; border-radius:50%; background:rgba(0,0,0,.5); border:2px solid rgba(255,255,255,.85); color:#fff; font-size:19px; display:flex; align-items:center; justify-content:center; padding-left:4px; pointer-events:none; }
.gal-duree { position:absolute; right:9px; bottom:9px; background:rgba(0,0,0,.72); color:#fff; font-size:.72rem; padding:3px 7px; border-radius:4px; pointer-events:none; }

.gal-item .caption { position: absolute; bottom: 0; left: 0; right: 0; padding: 14px 16px; background: linear-gradient(transparent, rgba(0,0,0,.85)); opacity: 0; transition: opacity .3s; }
.gal-item:hover .caption { opacity: 1; }
.caption h3 { font-size: .88rem; font-weight: 700; margin-bottom: 3px; color: #fff; }
.caption p  { font-size: .75rem; color: rgba(255,255,255,.6); }

.lightbox { position: fixed; inset: 0; background: #000; display: none; align-items: center; justify-content: center; z-index: 1000; }
.lightbox.show { display: flex; }
.lightbox img { width: 94vw; height: 86vh; height: 86dvh; object-fit: contain; animation: lbIn .2s ease; }
@media (max-width: 780px) { .lightbox img { width: 100vw; height: 100vh; height: 100dvh; } }
.lightbox:fullscreen img { width: 100vw; height: 100vh; height: 100dvh; }
.lightbox:fullscreen { background: #000; }
.lightbox:-webkit-full-screen img { width: 100vw; height: 100vh; height: 100dvh; }
.lightbox:-webkit-full-screen { background: #000; }
@keyframes lbIn { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.lb-info { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); text-align: center; color: #fff; white-space: nowrap; }
.lb-info h3 { font-size: 1.1rem; margin-bottom: 4px; }
.lb-info p  { color: rgba(255,255,255,.5); font-size: .88rem; }
@media (max-width: 780px) { .lb-info { bottom: 0; left: 0; right: 0; transform: none; width: 100%; padding: 10px 14px 14px; background: linear-gradient(transparent, rgba(0,0,0,.72) 45%); white-space: normal; } }
.lb-close { position: absolute; top: 18px; right: 20px; width: 42px; height: 42px; background: rgba(255,255,255,.1); border: none; border-radius: 50%; color: #fff; font-size: 1.4rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s; }
.lb-close:hover { background: rgba(255,255,255,.2); }
.lb-full { position: absolute; top: 18px; right: 72px; width: 42px; height: 42px; background: rgba(255,255,255,.1); border: none; border-radius: 50%; color: #fff; cursor: pointer; display: none; align-items: center; justify-content: center; padding: 0; }
.lb-full.dispo { display: flex; }
.lb-full:hover { background: rgba(255,255,255,.2); }
.lb-full svg { width: 19px; height: 19px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 50px; height: 50px; background: rgba(255,255,255,.1); border: none; border-radius: 50%; color: #fff; font-size: 1.6rem; cursor: pointer; transition: background .15s; display: flex; align-items: center; justify-content: center; }
.lb-nav:hover { background: rgba(255,255,255,.2); }
.lb-prev { left: 20px; }
.lb-next { right: 20px; }

.back-link { display: inline-flex; align-items: center; gap: 7px; margin: 16px 20px; padding: 8px 16px; background: rgba(255,255,255,.07); color: rgba(255,255,255,.7); text-decoration: none; border-radius: 7px; font-size: .85rem; border: 1px solid rgba(255,255,255,.08); transition: all .15s; }
.back-link:hover { background: rgba(255,255,255,.12); color: #fff; }

.back-link { background: rgba(0,0,0,.5); color: #fff; border-color: rgba(255,255,255,.18); }
.back-link:hover { background: rgba(0,0,0,.65); color: #fff; }
.gal-header h1 { text-shadow: 0 2px 10px rgba(0,0,0,.55); }
.gal-header .count { color: rgba(255,255,255,.9); text-shadow: 0 1px 4px rgba(0,0,0,.8); }
.gal-vue { display: none; margin: 14px auto 0; background: rgba(0,0,0,.5); border: 1px solid rgba(255,255,255,.2); border-radius: 10px; padding: 3px; gap: 3px; }
.gal-vue button { background: transparent; border: 0; border-radius: 7px; width: 46px; height: 34px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: rgba(255,255,255,.75); touch-action: manipulation; }
.gal-vue button.on { background: rgba(255,255,255,.22); color: #fff; }
.gal-vue svg { width: 20px; height: 20px; fill: currentColor; }
@media (max-width: 768px) {
  .lb-nav { width: 40px; height: 40px; font-size: 1.2rem; }
  .gal-vue { display: inline-flex; }
  .gal-header { padding: 34px 14px 18px; }
  .gal-container { padding: 10px 3px 40px; }
  .gal-grid { display: grid !important; grid-template-columns: repeat(3, 1fr) !important; column-count: auto !important; gap: 3px !important; }
  .gal-grid::after { display: none; }
  .gal-item { aspect-ratio: 1; flex: none !important; margin: 0 !important; border-radius: 3px !important; border-width: 0 !important; box-shadow: none !important; }
  .gal-item:hover, .gal-item:hover img { transform: none; }
  .gal-item img { width: 100%; height: 100%; object-fit: cover; }
  .gal-item .caption, .gal-duree { display: none; }
  .gal-play { width: 34px; height: 34px; font-size: 13px; }
  body.gal-grand .gal-grid { grid-template-columns: 1fr !important; gap: 14px !important; padding: 0 8px; }
  body.gal-grand .gal-item { aspect-ratio: auto; border-radius: 8px !important; }
  body.gal-grand .gal-item img { height: auto; object-fit: contain; }
  body.gal-grand .gal-duree { display: block; }
  body.gal-grand .gal-play { width: 52px; height: 52px; font-size: 19px; }
  body.gal-grand .gal-item .caption { display: block; opacity: 1; }
}
.wd-lancer { display: inline-flex; align-items: center; gap: 8px; margin: 14px 6px 0; padding: 10px 20px; background: #f97316; color: #000; border: 0; border-radius: 999px; font-size: .95rem; font-weight: 700; cursor: pointer; box-shadow: 0 4px 16px rgba(0,0,0,.35); touch-action: manipulation; }
.wd-lancer:hover { filter: brightness(1.08); }
.wd-lancer svg, .lb-diapo svg, .wd-barre svg { width: 16px; height: 16px; fill: currentColor; }
.lb-diapo { position: absolute; top: 18px; right: 124px; width: 42px; height: 42px; background: rgba(255,255,255,.1); border: none; border-radius: 50%; color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0 0 0 2px; z-index: 3; }
.lb-diapo:hover { background: rgba(255,255,255,.2); }
.lightbox.diapo .lb-diapo { display: none; }
.wd-progres { position: absolute; top: 0; left: 0; right: 0; height: 3px; background: rgba(255,255,255,.12); display: none; z-index: 4; }
.wd-progres i { display: block; height: 100%; width: 0; background: #f97316; }
.lightbox.wd-photos .wd-progres { display: block; }
.wd-barre { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); display: none; gap: 8px; z-index: 4; }
.wd-barre.show { display: flex; }
@media (max-width: 600px) { .wd-barre { left: 14px; transform: none; } .wd-barre button { width: 42px; height: 42px; } }
.wd-barre button { width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; touch-action: manipulation; }
.wd-barre button:hover { background: rgba(0,0,0,.75); }
/* LE PROGRAMME — le guide d'une télé : la liste de ce qui passe, on touche et on y va. */
.wd-prog { position: absolute; inset: 0; z-index: 6; display: none; align-items: stretch; justify-content: flex-end; background: rgba(0,0,0,.55); cursor: default; }
.wd-prog.show { display: flex; }
.wd-prog-boite { width: min(440px, 100vw); height: 100%; background: rgba(12,12,20,.96); display: flex; flex-direction: column; box-shadow: -10px 0 40px rgba(0,0,0,.5); }
.wd-prog-tete { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid rgba(255,255,255,.1); color: #fff; font-size: 1.05rem; }
.wd-prog-tete b { border-left: 4px solid #f97316; padding-left: 10px; }
.wd-prog-tete button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.1); color: #fff; font-size: 1.4rem; cursor: pointer; }
.wd-prog-liste { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 6px 0 20px; }
.wd-prog-ligne { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 18px; background: none; border: 0; border-left: 4px solid transparent; color: #e2e2f0; text-align: left; cursor: pointer; font: inherit; }
.wd-prog-ligne:hover { background: rgba(255,255,255,.06); }
.wd-prog-ligne.on { background: rgba(255,255,255,.1); border-left-color: #f97316; }
.wd-prog-n { flex: 0 0 26px; color: rgba(255,255,255,.45); font-size: .85rem; text-align: right; }
.wd-prog-im { flex: 0 0 96px; height: 54px; border-radius: 5px; background: #222 center/cover no-repeat; position: relative; }
.wd-prog-im.film::after { content: '\25B6'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 14px; text-shadow: 0 1px 4px #000; }
.wd-prog-t { flex: 1; min-width: 0; }
.wd-prog-t b { display: block; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wd-prog-t span { display: block; font-size: .78rem; color: rgba(255,255,255,.55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wd-son { position: absolute; bottom: 90px; left: 50%; transform: translateX(-50%); display: none; padding: 10px 18px; border-radius: 999px; border: 0; background: #f97316; color: #000; font-weight: 700; cursor: pointer; z-index: 5; }
.wd-son.show { display: block; }
.wd-entracte { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: rgba(0,0,0,.82); color: #fff; text-align: center; padding: 20px; z-index: 3; }
.wd-entracte.show { display: flex; }
.wd-entracte p { font-size: 1rem; color: rgba(255,255,255,.75); }
.wd-entracte b { color: #f97316; font-size: 1.3rem; }
.wd-entracte h3 { font-size: clamp(1.2rem, 4vw, 2rem); max-width: 90vw; }
.wd-entracte button { margin-top: 8px; padding: 10px 22px; border-radius: 999px; border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.1); color: #fff; font-size: .95rem; cursor: pointer; }
.lightbox .lb-nav, .lightbox .lb-close, .lightbox .lb-full, .lightbox .lb-diapo, .wd-barre { transition: opacity .4s; }
/* La photo prend tout l'écran : sans ceci, elle recouvre la flèche ‹ (placée avant elle dans la page). */
.lightbox .lb-nav, .lightbox .lb-close, .lightbox .lb-full { z-index: 3; }
.lightbox.wd-calme { cursor: none; }
.lightbox.wd-calme .lb-nav, .lightbox.wd-calme .lb-close, .lightbox.wd-calme .lb-full, .lightbox.wd-calme .wd-barre { opacity: 0; pointer-events: none; }
.lightbox.diapo #lbImg { width: 100vw; height: 100vh; height: 100dvh; animation: none; transition: opacity .45s ease, transform .45s ease; }
.lightbox.diapo #lbImg.wd-sort { opacity: 0; }
.lightbox.diapo #lbImg.wd-entre { opacity: 0; transition: none; }
.lightbox.tr-glisse #lbImg.wd-sort { transform: translateX(-8%); }
.lightbox.tr-glisse #lbImg.wd-entre { transform: translateX(8%); }
.lightbox.tr-sec #lbImg { transition: none; }
.lightbox.diapo #lbImg.wd-zoom { transform: scale(1.12); transition: opacity .45s ease, transform var(--wd-d, 6s) linear; }
.lightbox.diapo #lbVideo { width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; border-radius: 0; object-fit: contain; }
.lightbox.diapo #lbYoutube { width: min(100vw, 177.78vh) !important; border-radius: 0 !important; }
.lightbox.wd-sansleg .lb-info { display: none; }
.lightbox.wd-tv .lb-info { top: 74px; bottom: auto; transition: opacity .8s; background: rgba(0,0,0,.5); padding: 8px 16px; border-radius: 10px; }
.lightbox.wd-titre-cache .lb-info { opacity: 0; }
/* MODE TÉLÉ : rien à l'écran que l'image. Un capteur couvre tout : un toucher = pause / lecture. */
.wd-capteur { position: absolute; inset: 0; z-index: 2; display: none; cursor: none; }
.lightbox.wd-ecran-tv .wd-capteur { display: block; }
.lightbox.wd-ecran-tv .lb-nav, .lightbox.wd-ecran-tv .lb-close, .lightbox.wd-ecran-tv .lb-full, .lightbox.wd-ecran-tv .wd-barre, .lightbox.wd-ecran-tv .wd-progres, .lightbox.wd-ecran-tv .wd-entracte button { display: none !important; }
.lightbox.wd-ecran-tv { cursor: none; }
.wd-repos { position: absolute; inset: 0; z-index: 4; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,.35); cursor: default; }
.lightbox.wd-ecran-tv.wd-en-pause .wd-repos { display: flex; }
.wd-repos-lire { width: 96px; height: 96px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; display: flex; align-items: center; justify-content: center; padding-left: 6px; cursor: pointer; }
.wd-repos-lire svg { width: 44px; height: 44px; fill: currentColor; }
/* L'illusion d'une télévision (Rémy, 07/10) : le logo de la chaîne, le bandeau de titre, le fondu au noir. */
.wd-logo { display: none; position: absolute; top: 4vh; right: 4vw; z-index: 3; pointer-events: none; color: #fff; opacity: .55; font-weight: 800; font-size: clamp(.8rem, 1.8vw, 1.2rem); letter-spacing: .06em; text-transform: uppercase; text-shadow: 0 1px 4px rgba(0,0,0,.8); max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lightbox.wd-ecran-tv .wd-logo { display: block; }
.lightbox.wd-ecran-tv .lb-info { left: 4vw; right: auto; top: auto; bottom: 7vh; transform: none; width: auto; max-width: 70vw; text-align: left; white-space: normal; background: linear-gradient(90deg, rgba(0,0,0,.78), rgba(0,0,0,.4)); border-left: 4px solid #f97316; border-radius: 0 6px 6px 0; padding: 10px 20px; transition: opacity .8s; z-index: 3; }
.lightbox.wd-ecran-tv .wd-entracte { background: #000; }
.lightbox.wd-ecran-tv .wd-entracte > * { display: none !important; }
.lightbox.wd-ecran-tv .wd-entracte.show { animation: wdNoir .7s ease; }
@keyframes wdNoir { from { opacity: 0; } to { opacity: 1; } }
.wd-repos-sortir { position: absolute; top: 18px; right: 20px; width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 1.5rem; cursor: pointer; }
.gr-cherche { display: flex; align-items: center; gap: 8px; max-width: 420px; margin: 16px auto 0; padding: 0 14px; height: 44px; background: rgba(0,0,0,.5); border: 1px solid rgba(255,255,255,.22); border-radius: 999px; }
.gr-cherche:focus-within { border-color: #f97316; }
.gr-cherche svg { width: 18px; height: 18px; flex: 0 0 18px; fill: none; stroke: rgba(255,255,255,.7); stroke-width: 2.2; stroke-linecap: round; }
.gr-cherche input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: 0; color: #fff; font-size: 16px; }
.gr-cherche input::placeholder { color: rgba(255,255,255,.55); }
.gr-cherche input::-webkit-search-cancel-button { filter: invert(1); }
.gr-compte { color: rgba(255,255,255,.7); font-size: .8rem; white-space: nowrap; }
.gr-rien { display: none; margin: 14px auto 0; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.8); }
.lb-partage { position: absolute; top: 18px; right: 176px; width: 42px; height: 42px; background: rgba(255,255,255,.1); border: none; border-radius: 50%; color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; z-index: 3; transition: opacity .4s; }
.lb-partage:hover { background: rgba(255,255,255,.2); }
.lb-partage svg { width: 19px; height: 19px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.lightbox.diapo .lb-partage { right: 124px; }
.lightbox.wd-calme .lb-partage { opacity: 0; pointer-events: none; }
.lightbox.wd-ecran-tv .lb-partage { display: none !important; }
.gr-toast { position: absolute; left: 50%; bottom: 40px; transform: translateX(-50%); z-index: 7; background: #f97316; color: #000; font-weight: 700; padding: 10px 18px; border-radius: 999px; display: none; }
.gr-toast.show { display: block; }
