/* Florska V2 — /projet/<slug>/ : couverture collante + fiche, galerie masonry, visionneuse. */

/* Présentation : couverture 2:3 collante + récit (MK C1) */
.fl-immersive { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); column-gap: clamp(32px, 5vw, 80px); align-items: start; padding-top: 24px; padding-bottom: clamp(56px, 7vw, 104px); }
.fl-immersive__media { position: sticky; top: 16px; margin: 0; }
.fl-immersive__media > * { view-transition-name: fl-cover; }
.fl-immersive__text { max-width: 62ch; }
/* Couverture horizontale (Institutionnel) : pleine largeur, récit dessous */
.fl-immersive--land { grid-template-columns: minmax(0, 1fr); row-gap: 32px; }
.fl-immersive--land .fl-immersive__media { position: relative; top: auto; }
@media (max-width: 899px) {
  .fl-immersive { grid-template-columns: minmax(0, 1fr); row-gap: 32px; }
  .fl-immersive__media { position: relative; top: auto; width: min(100%, 560px); margin: 0 auto; }
  .fl-immersive--land .fl-immersive__media { width: 100%; }
}

.pj-title { margin-top: 24px; font-size: clamp(34px, 4.2vw, 68px); overflow-wrap: anywhere; }
.pj-lead { margin-top: 28px; }
.pj-h2 { font-size: 22px; margin-top: 40px; }
.pj-p { margin: 16px 0 0; color: var(--fl-text-2); }
.pj-p a { color: var(--fl-text); text-decoration: underline; text-underline-offset: 3px; }
.pj-body { margin-top: 40px; color: var(--fl-text-2); }
.pj-body :is(h2, h3) { font-stretch: 75%; text-transform: uppercase; letter-spacing: .02em; font-size: 22px; margin-top: 40px; color: var(--fl-text); }
.pj-jump { margin-top: 40px; }

@media (prefers-reduced-motion: no-preference) {
  .fl-enter { animation: pj-enter var(--fl-t-m) var(--fl-ease-out) both; animation-delay: calc(var(--i, 0) * 40ms); }
}
@keyframes pj-enter { from { opacity: 0; translate: 0 12px; } to { opacity: 1; translate: 0 0; } }

/* Fiche */
.facts { margin: 36px 0 0; padding: 8px 0; border-top: 1px solid var(--fl-line); border-bottom: 1px solid var(--fl-line); }
.facts > div { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--fl-line-soft); }
.facts > div:last-child { border-bottom: 0; }
.facts dt { margin: 0; font-family: var(--fl-mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--fl-muted); }
.facts dd { margin: 0; font-size: 15px; line-height: 1.4; }
@media (max-width: 599px) { .facts > div { grid-template-columns: minmax(0, 1fr); gap: 4px; } }

/* Galerie : 4 colonnes serrées (3 sur tablette, 2 sur mobile), images horizontales et verticales mélangées,
   chaque image garde son format ; les colonnes se remplissent sans trou, 2 px d'espace. */
.pj-gal { padding-bottom: clamp(64px, 8vw, 112px); scroll-margin-top: 16px; }
.pj-gal__head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 32px; }
.pj-gal__head .pj-h2 { margin-top: 0; }
.fl-gal { column-count: 4; column-gap: 2px; }
.fl-gal .thumb { display: block; margin: 0 0 2px; break-inside: avoid; overflow: hidden; background: var(--fl-surface); }
.fl-gal .thumb img { display: block; width: 100%; height: auto; }
@media (max-width: 1024px) { .fl-gal { column-count: 3; } }
@media (max-width: 600px) { .fl-gal { column-count: 2; } }
.thumb { display: block; color: var(--fl-text); }
@media (pointer: fine) { .thumb { cursor: zoom-in; } }
.thumb img { outline: 1px solid transparent; outline-offset: -1px; transition: outline-color var(--fl-t-s); }
.thumb:is(:hover, :focus-visible) img { outline-color: var(--fl-bone); }

/* Voisins + CTA */
.pj-nav { padding-top: 32px; padding-bottom: 32px; }
.pn { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.pn__next { margin-left: auto; text-align: right; }
.pj-back { margin-top: 16px; }
.pj-cta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 32px; }
.pj-cta__title { max-width: 16ch; }

/* ==========================================================================
   Visionneuse (lightbox.js) : dialog modal, image contenue jamais recadrée
   ========================================================================== */
.lb { position: fixed; inset: 0; z-index: 80; width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 16px clamp(16px, 3vw, 24px) 20px; border: 0; background: rgb(11 11 12 / .96); color: var(--fl-text); display: none; flex-direction: column; align-items: center; gap: 14px; overflow: auto; overscroll-behavior: contain; }
.lb[open] { display: flex; }
.lb::backdrop { background: rgb(11 11 12 / .96); }
.lb-top { width: 100%; max-width: 1200px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.lb-count { font-size: 14px; }
.lb-stage { flex: 1 1 auto; min-height: 0; margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; width: 100%; touch-action: pan-y pinch-zoom; }
.lb-img { display: block; width: auto; height: auto; max-width: 100%; max-height: calc(100dvh - 260px); object-fit: contain; background: var(--fl-surface); transition: opacity var(--fl-t-s) var(--fl-ease-out); }
.lb-img.is-loading { opacity: .35; }
.lb-cap { margin: 0; max-width: 72ch; text-align: center; }
.lb-bar { display: flex; gap: 12px; justify-content: center; }
.lb-btn { min-width: 48px; min-height: 48px; }
.lb-thumbs { display: flex; gap: 8px; max-width: 1200px; width: 100%; overflow-x: auto; padding: 4px; justify-content: safe center; scrollbar-width: thin; }
.lb-th { flex: none; width: 64px; height: 64px; padding: 0; border: 0; background: var(--fl-surface); cursor: pointer; opacity: .6; transition: opacity var(--fl-t-s); }
.lb-th img { width: 64px; height: 64px; object-fit: cover; }
.lb-th:is(:hover, :focus-visible) { opacity: 1; }
.lb-th[aria-current="true"] { opacity: 1; box-shadow: 0 0 0 2px var(--fl-bone); }
html.fl-lb-open { overflow: hidden; }
html.fl-lb-open body { padding-right: var(--fl-sbw, 0px); }
@media (prefers-reduced-motion: no-preference) {
  .lb[open] { animation: lb-in var(--fl-t-s) var(--fl-ease-out) both; }
}
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 899px) {
  .lb-thumbs { display: none; }
  .lb-img { max-height: calc(100dvh - 190px); }
}

/* Sous-projets d'un événement */
.pj-sub { padding-top: clamp(40px, 6vw, 80px); padding-bottom: clamp(24px, 4vw, 56px); }
.pj-sub .h2 { margin: 0 0 clamp(20px, 3vw, 40px); }
.pj-sub__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(24px, 3vw, 48px) clamp(12px, 2vw, 32px); align-items: start; }
.pj-sub__grid .fl-card__media > img, .pj-sub__grid .fl-card__media > .ph { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; }
@media (max-width: 899px) { .pj-sub__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 12px; } }
