/* ============================================================
   FUSION — CASE.CSS (page détail d'une réalisation)
============================================================ */

.case-top { padding: 150px 0 46px; text-align: center; }
.case-top h1 {
  font-family: var(--f-font-title); font-weight: 700; text-transform: uppercase;
  color: var(--f-blue); line-height: 1.3;
  font-size: clamp(22px, 1.85vw, 35px); letter-spacing: .02em;
}
.case-top h1 span { display: block; font-size: .62em; }

/* Hero (le fond contient déjà son voile sombre) */
.case-hero {
  position: relative; min-height: clamp(300px, 24vw, 470px);
  background-size: cover; background-position: center;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 18px 0 34px;
}
.case-hero.has-tags { min-height: clamp(330px, 26vw, 510px); }
.case-crumb { font-size: 14px; text-transform: uppercase; color: var(--f-white); }
.case-crumb a { color: var(--f-white); }
.case-crumb a:hover { color: var(--f-blue); }
.case-crumb b { color: var(--f-white); font-weight: 700; }
.case-hero-body { text-align: center; padding: 0 20px; }
.case-logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: clamp(100px, 11vw, 220px); aspect-ratio: 1; border-radius: 14px; background: #000;
}
.case-logo img { width: 72%; height: auto; }
.case-logo.is-plain { width: auto; aspect-ratio: auto; background: none; border-radius: 0; }
.case-logo.is-plain img { width: clamp(150px, 15.8vw, 340px); }
.case-tagline {
  margin: 22px auto 0; max-width: 900px; font-family: var(--f-font-body); font-weight: 800; line-height: 1.3;
  font-size: clamp(17px, 1.35vw, 25px); color: var(--f-white);
}
.case-hero-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 22px; }
.case-hero-tags .f-tag { margin: 0; font-family: var(--f-font-body); font-weight: 300; font-size: 15px; }

/* Sections */
.case-sec { padding: 12px 0 1px; }
.case-sec:first-of-type { padding-top: 80px; }
.case-line { display: block; width: 90px; height: 1px; background: #3a3a3a; margin-bottom: 26px; }
.case-h {
  font-family: var(--f-font-title); font-weight: 700; text-transform: uppercase;
  color: var(--f-blue); letter-spacing: .02em;
  font-size: clamp(11px, .93vw, 18px); line-height: 1.3; margin-bottom: 24px;
}
.case-sub { font-size: clamp(15px, 1.15vw, 26px); font-weight: 300; margin: 0 0 11px; color: var(--f-white); line-height: 1.5; }
.case-lead { font-size: clamp(19px, 1.35vw, 25px); font-weight: 300; color: var(--f-white); margin: 40px 0 14px; }
.case-text { font-size: clamp(15px, 1.15vw, 26px); line-height: 1.5; color: var(--f-silver); margin: 0 0 18px; max-width: 97%; }
.case-step > .case-text { max-width: 92%; }
.case-tags { margin: 8px 0 0; }
.case-tags .f-tag { font-family: var(--f-font-body); font-weight: 300; font-size: 15px; }

/* Visuels */
.case-media, .case-shot { position: relative; overflow: hidden; border-radius: 14px; background: #111; }
.case-media img, .case-shot img { display: block; width: 100%; height: 100%; object-fit: cover; }
.case-media, .case-shots { margin: 6px 0 30px; }
.case-shots { display: grid; gap: 14px; }
.case-shots + .case-shots, .case-mosaic + .case-shots, .case-shots + .case-mosaic { margin-top: calc(-16px + var(--mt, 0px)); }
.case-shots .case-shot img { height: auto; }
/* Mosaïque : grande + 2 petites à gauche, grande verticale à droite */
.case-mosaic { display: grid; gap: 14px; margin: 6px 0 30px; grid-template-rows: auto auto; }
.case-mosaic .big { grid-column: 1; grid-row: 1; }
.case-mosaic .sm-a { grid-column: 1; grid-row: 2; width: calc(50% - 7px); }
.case-mosaic .sm-b { grid-column: 1; grid-row: 2; width: calc(50% - 7px); justify-self: end; }
.case-mosaic .tall { grid-column: 2; grid-row: 1 / 3; }
.case-mosaic .tall img { height: 100%; }
.case-play {
  position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px;
  border: 0; border-radius: 50%; background: rgba(0,0,0,.85); cursor: pointer;
  transition: transform .25s ease, background .25s ease;
}
.case-play span {
  position: absolute; left: 50%; top: 50%; margin: -12px 0 0 -8px;
  border-style: solid; border-width: 12px 0 12px 20px; border-color: transparent transparent transparent #fff;
}
.case-play:hover { transform: scale(1.08); background: var(--f-blue); }

/* Challenge / rôle */
.case-brief-grid { display: grid; grid-template-columns: 65.9% minmax(0, 1fr); gap: 0; }
.case-brief .case-text { max-width: 30.5vw; }
.case-role { list-style: none; margin: 0; padding: 0; font-size: clamp(15px, 1.15vw, 26px); line-height: 1.55; color: var(--f-silver); }

/* Impact en chiffres */
.case-impact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 50px; align-items: center; }
.case-impact-grid .case-text { max-width: 420px; }
.case-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.case-stats.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.case-stats.n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.case-stat { text-align: center; padding: 22px 10px; border-left: 1px solid var(--f-line); }
.case-stat:first-child { border-left: 0; }
.case-stat .f-num { font-size: clamp(40px, 3.7vw, 70px); gap: 8px; }
.case-stats.n4 .f-num { font-size: clamp(32px, 2.9vw, 56px); }
.case-stat .f-num-label { margin-top: 14px; }

/* Blocs numérotés (retrait comme sur la maquette) */
.case-steps { padding-top: 0; }
.case-step { padding: 0 0 25px; }
/* maquette : textes décalés de 5,4 %, images sur toute la largeur du contenu */
.case-step > .case-line, .case-step > .case-h, .case-step > .case-sub, .case-step > .case-lead, .case-step > .case-text, .case-step > .case-tags { margin-left: var(--si, 4.7%); }
.case-step .case-h { font-size: clamp(14px, .9vw, 17px); }

.case-sec:last-of-type { padding-bottom: 130px; }

/* Lecteur vidéo */
.case-modal {
  position: fixed; inset: 0; z-index: 3000; background: rgba(0,0,0,.92);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 60px 20px;
  opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility .3s;
}
.case-modal.is-open { opacity: 1; visibility: visible; }
.case-modal-box { position: relative; overflow: hidden; width: min(1100px, 100%); aspect-ratio: 16 / 9; background: #000; flex: none; }
.case-modal-box[style] { aspect-ratio: auto; }
.case-modal-box video, .case-modal-box iframe { width: 100%; height: 100%; border: 0; }
.case-modal .f-lightbox-close { position: absolute; top: 18px; right: 22px; }

@media (max-width: 991px) {
  .case-shots, .case-media, .case-mosaic { width: auto !important; margin-left: 0 !important; }
  .case-top { padding: 110px 0 30px; }
  .case-sec { padding: 34px 0 10px; }
  .case-sec:first-of-type { padding-top: 50px; }
  .case-brief-grid { grid-template-columns: 1fr; gap: 44px; }
  .case-impact-grid { grid-template-columns: 1fr; gap: 26px; }
  .case-impact-grid .case-text { max-width: none; }
  .case-text, .case-brief .case-text { max-width: none; }
  .case-step > .case-line, .case-step > .case-h, .case-step > .case-sub, .case-step > .case-lead, .case-step > .case-text, .case-step > .case-tags { margin-left: 0; }
  .case-sec:last-of-type { padding-bottom: 80px; }
}
@media (max-width: 575px) {
  .case-shots { grid-template-columns: 1fr !important; }
  .case-shots.n4 { grid-template-columns: 1fr 1fr !important; }
  .case-mosaic { grid-template-columns: 1fr 1fr !important; }
  .case-mosaic .big { grid-column: 1 / 3; }
  .case-mosaic .sm-a { grid-column: 1; grid-row: 2; width: auto; }
  .case-mosaic .sm-b { grid-column: 2; grid-row: 2; width: auto; }
  .case-mosaic .tall { grid-column: 1 / 3; grid-row: 3; }
  .case-stat .f-num { font-size: 8.4vw; }
  .case-stats.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-stats.n4 .f-num { font-size: 9vw; }
  .case-stat .f-num-label { font-size: 11px; }
  .case-play { width: 60px; height: 60px; margin: -30px 0 0 -30px; }
}

/* Petit bouton lecture (images en grille : reels, posts) */
.case-play.is-sm { width: 52px; height: 52px; margin: -26px 0 0 -26px; }
.case-play.is-sm span { margin: -9px 0 0 -6px; border-width: 9px 0 9px 15px; }

/* Lecteur : format portrait pour Instagram / Facebook */
.case-modal-ext {
  position: static; flex: none;
  font-family: var(--f-font-ui); font-size: 14px; color: #fff; text-decoration: none;
  border: 1px solid #3c3c3c; border-radius: 6px; padding: 8px 16px; background: rgba(0,0,0,.6);
}
.case-modal-ext:hover { border-color: var(--f-blue); color: var(--f-blue); }

/* Chiffres groupés par produit (page Jaouda) */
.case-impact-grid.has-groups { grid-template-columns: 1fr; gap: 30px; }
.case-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px 40px; }
.case-group { text-align: center; }
.case-group-title { font-family: var(--f-font-title); font-weight: 700; text-transform: uppercase; color: var(--f-white); font-size: clamp(13px, .95vw, 18px); letter-spacing: .04em; margin: 0 0 14px; }
.case-group .case-stats { max-width: 560px; margin: 0 auto; }
.case-group .case-stat { padding: 16px 6px; }
.case-group .f-num { font-size: clamp(26px, 2.3vw, 44px); }
.case-group .f-num-label { font-size: 12px; margin-top: 10px; }
@media (max-width: 991px) {
  .case-groups { grid-template-columns: 1fr; gap: 40px; }
}
@media (max-width: 575px) {
  .case-group .f-num { font-size: 8vw; }
  .case-group .f-num-label { font-size: 10px; }
}

/* Chiffres seuls (sans texte à côté) : centrés sur toute la largeur */
.case-impact-grid.is-solo { grid-template-columns: 1fr; }
.case-impact-grid.is-solo .case-stats { max-width: 53vw; margin: 0 auto; width: 100%; }

/* ── Calage sur les maquettes (écarts mesurés à 1440 px de large) ── */
.case-step .case-h { margin-bottom: 17px; }
.case-media, .case-shots { margin-top: 24px; }
.case-impact .case-impact-grid { margin-top: 45px; }
.case-impact { padding-bottom: 41px; }
.case-stat .f-num-label, .f-num-label { font-size: clamp(12px, 1.18vw, 26px); }

/* largeur du contenu des maquettes : 75,1 % de la fenêtre (marges de 12,4 %) */
.case-sec .container, .case-hero .container { max-width: calc(75.1vw + 80px); }

/* Espacements propres à chaque maquette (variable --mt posée par case.php, en vw) */
.case-line { margin-top: var(--mt, 0px); }
.case-media, .case-shots, .case-mosaic { margin-top: calc(24px + var(--mt, 0px)); }
@media (max-width: 991px) {
  .case-line { margin-top: 0; }
  .case-media, .case-shots, .case-mosaic { margin-top: 24px; }
  .case-shots + .case-shots, .case-mosaic + .case-shots, .case-shots + .case-mosaic { margin-top: -16px; }
}

/* ── Hero : dimensions et positions relevées dans la maquette (bureau) ── */
@media (min-width: 992px) {
  .case-hero.is-fixed { min-height: 0; height: var(--h-h); display: block; padding: 18px 0 0; }
  .case-hero.is-fixed .case-hero-body { position: absolute; left: 0; right: 0; top: 0; bottom: 0; padding: 0; pointer-events: none; }
  .case-hero.is-fixed .case-logo { position: absolute; left: var(--h-lx); top: var(--h-lt); width: var(--h-lw); height: var(--h-lh); aspect-ratio: auto; }
  .case-hero.is-fixed .case-logo.is-plain img { width: 100%; height: 100%; }
  .case-hero.is-fixed .case-logo:not(.is-plain) { background: #000; border-radius: .8vw; }
  .case-hero.is-fixed .case-logo:not(.is-plain) img { position: absolute; left: var(--h-ix); top: var(--h-iy); width: var(--h-iw); height: var(--h-ih); }
  .case-hero.is-fixed .case-tagline { position: absolute; left: 0; right: 0; padding-left: .7vw; top: var(--h-tt); margin: 0; max-width: none; font-size: 1.83vw; line-height: 1.15; transform: translateY(-0.28em); }
  .case-hero.is-fixed .case-hero-tags { position: absolute; left: 0; right: 0; top: var(--h-gt); margin: 0; }
}

/* Chiffres clés : dimensions de la maquette (colonnes de 230 px à 1440, filets de 196 px) */
.case-stat .f-num { font-size: clamp(40px, 4.65vw, 96px); }
.case-impact-grid.is-solo .case-stats { max-width: 47.9vw; margin: 0 0 0 12.3vw; }
.case-impact-grid.is-solo .case-stat { height: 13.6vw; padding: 3vw 10px 0; }
@media (max-width: 991px) {
  .case-stat .f-num { font-size: clamp(34px, 8vw, 60px); }
  .case-impact-grid.is-solo .case-stats { max-width: none; margin: 0; }
  .case-impact-grid.is-solo .case-stat { height: auto; padding: 22px 10px; }
}

/* ── Chiffres clés positionnés comme sur la maquette (bureau) ── */
.case-sg { position: relative; height: var(--sh); }
.case-sg > * { position: absolute; margin: 0; }
.case-sg-v { width: 1px; background: var(--f-line); }
.case-sg-n { line-height: 1; white-space: nowrap; margin-top: -.7vw !important; }
.case-sg-l { text-align: center; line-height: 1.2; margin-top: -.28vw !important; }
.case-sg-t { text-align: center; color: var(--f-white); font-family: var(--f-font-title); font-weight: 700; text-transform: uppercase; line-height: 1; letter-spacing: .02em; }
@media (min-width: 992px) { .case-impact-grid.has-geom { display: none; } }
@media (max-width: 991px) { .case-sg { display: none; } }
.case-impact .case-h { margin-bottom: 0; }

/* retours à la ligne : la largeur de chaque paragraphe vient de la maquette (style en ligne) ; sur mobile, pleine largeur */
@media (max-width: 991px) { .case-text[style] { max-width: none !important; } }

/* Couleurs relevées dans les maquettes */
:root { --f-blue: #00AEFF; }
.case-sub { color: #c1c1c1; }
.case-text, .case-role { color: #cbcbcb; }
.f-num-label { color: #777; }

/* Mobile : chiffres sur une seule ligne */
.case-stat .f-num { white-space: nowrap; }
@media (max-width: 991px) {
  .case-group .case-stat .f-num { font-size: clamp(22px, 6.2vw, 40px); gap: 4px; }
  .case-stats.n4 .case-stat .f-num { font-size: clamp(24px, 7vw, 44px); }
}

/* Rangée dont les images ont chacune leur proportion (ex. captures de site) */
.case-shots .case-shot.has-ar img { height: 100%; object-fit: cover; }
.case-shots.is-square .case-shot { border-radius: 0; }

/* Instagram : on n'affiche que le média (l'en-tête et le pied de l'intégration sont masqués) */
.case-modal-box iframe.is-ig { position: absolute; left: 0; top: -54px; width: 100%; height: calc(100% + 218px); }

/* ── Visionneuse d'images (même principe que impact.co.ma) ── */
.case-media.is-zoomable, .case-shot.is-zoomable { cursor: zoom-in; }
.case-media.is-zoomable img, .case-shot.is-zoomable img { transition: opacity .2s; }
.case-media.is-zoomable:hover img, .case-shot.is-zoomable:hover img { opacity: .88; }
.case-media.is-video, .case-shot.is-video { cursor: pointer; }
.case-lb { flex-direction: column; z-index: 3000; }
.case-lb-stage { max-width: 90vw; max-height: 84vh; display: flex; align-items: center; justify-content: center; }
.case-lb-stage img { max-width: 90vw; max-height: 80vh; width: auto; height: auto; object-fit: contain; border-radius: 6px; box-shadow: 0 8px 48px rgba(0,0,0,.6); }
.case-lb-stage.is-tall { display: block; overflow-y: auto; height: 84vh; width: min(560px, 90vw); }
.case-lb-stage.is-tall img { max-height: none; width: 100%; }
.case-lb-count { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); margin: 0; color: rgba(255,255,255,.45); font-size: 13px; letter-spacing: .12em; }
.case-lb .f-lightbox-nav { z-index: 2; }
@media (max-width: 575px) {
  .case-lb .f-lightbox-nav { width: 40px; height: 40px; }
  .case-lb .f-lightbox-nav.prev { left: 8px; }
  .case-lb .f-lightbox-nav.next { right: 8px; }
}

/* Maquettes du 29/10/2026 : sous-titres en gras (faux gras dans le PSD) */
.case-sub { font-weight: 700; }

/* ── Tailles de police alignées sur la page « À propos » (demande du client, 03/11/2026) ──
   titres de section = .sec-title-sm, sous-titres = .sec-sub, texte courant = .sec-text, libellés des chiffres = 15 px.
   Les grands chiffres et l'accroche du haut de page gardent leur taille de maquette. */
.case-h, .case-step .case-h, .case-group-title { font-size: clamp(14px, .9vw, 17px); }
.case-sg-t { font-size: clamp(14px, .9vw, 17px) !important; }
.case-sub, .case-lead { font-size: clamp(18px, 1.25vw, 23px); line-height: 1.35; }
.case-text, .case-role { font-size: 16px; line-height: 1.75; }
.case-stat .f-num-label, .case-group .f-num-label, .f-num-label, .case-sg-l { font-size: 15px !important; }

/* ── Espace régulier entre les visuels (demande du client, 03/11/2026 : visuels trop collés) ──
   même écart entre images d'une rangée et entre rangées / image principale, sur toutes les études de cas.
   (la marge basse de 30 px du visuel précédent se combine avec la marge haute négative : écart = --case-vg) */
.case-sec { --case-vg: clamp(14px, 1.45vw, 28px); }
.case-shots { column-gap: var(--case-vg) !important; row-gap: var(--case-vg) !important; }
.case-mosaic { gap: var(--case-vg); }
.case-mosaic .sm-a, .case-mosaic .sm-b { width: calc(50% - var(--case-vg) / 2); }
:is(.case-media, .case-shots, .case-mosaic) + :is(.case-media, .case-shots, .case-mosaic) { margin-top: calc(var(--case-vg) - 30px) !important; }
