/* ============================================================
   projet.css — études de cas : galeries, agrandissement des images, nuanciers
   Une seule page qui défile par projet (Contexte → Démarche → Choix → Résultat),
   pas d'onglets : chaque projet n'a pas les mêmes sections développées.
   Couleurs : toujours les variables du thème (var(--ink), var(--mid)…), jamais
   de hex en dur, sinon le texte devient illisible dans l'un des deux thèmes.
   Exception : les couleurs fixes des marques présentées.
   ============================================================ */

.proj {
  max-width: 760px;
  margin-inline: auto;
  padding: clamp(32px, 5vw, 64px) clamp(24px, 5vw, 64px) clamp(64px, 8vw, 96px);
}

.proj-meta {
  font-size: 13px;
  color: var(--stone);
  margin-bottom: clamp(20px, 3vw, 28px);
}

/* Sommaire de la page : la structure du contenu est visible avant de défiler */
.proj-toc {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  padding: 14px 0;
  margin-bottom: clamp(32px, 5vw, 56px);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  font-size: 13px;
}
.proj-toc a {
  color: var(--mid);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  padding: 0;
}
.proj-toc a:hover { color: var(--ink); }
.proj-toc-live {
  margin-left: auto;
  color: var(--accent) !important;
  font-weight: 700;
  white-space: nowrap;
}
.proj-toc-live:hover { text-decoration: underline; }

.proj-img {
  display: block;   /* aussi en <span> dans un bouton « page complète » (HTML valide : pas de <div> dans <button>) */
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--s2);
  border: 1px solid var(--rule2);
  margin-bottom: clamp(32px, 5vw, 56px);
  overflow: hidden;
}
.proj-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Hero en capture large (ratio navigateur, ~21:9) : évite de rogner les bords */
.proj-img-wide { aspect-ratio: 21 / 9; }

/* Livrables empilés plutôt qu'un carrousel : tout reste visible sans interaction.
   Un carrousel cache la majorité du contenu derrière des flèches (NN/g : la
   1re diapositive capte l'essentiel des clics). */
.proj-gallery {
  display: flex;
  flex-direction: column;
  gap: clamp(28px, 4vw, 44px);
  margin-bottom: clamp(32px, 5vw, 56px);
}
.proj-gallery-figure { margin: 0; }
.proj-gallery-figure .proj-img { margin-bottom: 0; }
.proj-gallery-figure figcaption {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--stone);
}
/* Formats adaptés au livrable : une carte de visite pleine largeur aurait l'air disproportionnée */
.proj-gallery-wide .proj-img  { aspect-ratio: 21 / 9; }
.proj-gallery-board .proj-img { aspect-ratio: 4 / 3; }

.proj-gallery-mobile .proj-img {
  aspect-ratio: 9 / 16;
  max-width: 260px;
}
/* Le bouton suit la largeur de l'image, sinon son badge (positionné par rapport au
   bouton) sort du cadre visible d'une vignette étroite. */
.proj-gallery-mobile .proj-img-expand {
  max-width: 260px;
}

/* Mascotte animée : l'explication avant le visuel (on dit ce que c'est avant de le montrer) */
.proj-motion-intro {
  font-size: 15px;
  color: var(--stone);
  margin-bottom: var(--space-4);
}
.proj-motion-block {
  margin-bottom: var(--space-5);
}
.proj-motion-block:last-of-type {
  margin-bottom: var(--space-4);
}
.proj-motion-lead {
  font-size: 14px;
  color: var(--stone);
  max-width: 60ch;
  margin: 0 0 var(--space-2);
}
.proj-motion-lead strong {
  color: var(--ink);
}

/* GIF au clic plutôt qu'en lecture automatique : un GIF ne peut pas être mis en pause
   en CSS, et le mouvement ne doit démarrer que sur un geste explicite. */
.proj-motion-hero { margin: 0; }
.proj-gif-play {
  position: relative;
  width: 110px;
  height: 110px;
  padding: 0;
  border: 1px solid var(--rule2);
  background: var(--s2);
  cursor: pointer;
  display: block;
}
.proj-gif-play img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.proj-gif-play-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.05);
}
.proj-gif-play.is-playing {
  cursor: default;
}
.proj-gif-play.is-playing .proj-gif-play-icon {
  display: none;
}
.proj-motion-hero figcaption {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}

/* Suite d'images côte à côte (ex. les humeurs de la mascotte) : la variation se lit d'un coup d'œil */
.proj-motion-strip {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(12px, 2vw, 20px);
  margin: 0;
}
.proj-motion-strip figure {
  margin: 0;
  width: 96px;
  text-align: center;
}
.proj-motion-strip img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--rule2);
  background: var(--s2);
  display: block;
}
.proj-motion-strip figcaption {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}
.proj-motion-strip figcaption span {
  display: block;
  font-weight: 400;
  color: var(--stone);
  text-transform: none;
  letter-spacing: normal;
}
.proj-credit {
  font-size: 12px;
  font-style: italic;
  color: var(--stone);
  margin-bottom: clamp(32px, 5vw, 56px);
}
.proj-gallery > .proj-credit { margin: calc(-1 * var(--space-2)) 0 0; }

/* ── BOD|am : logo en code, 3 usages. Couleurs fixes de la marque, pas les jetons du
   thème : le logo reste identique en clair et en sombre. ── */
.proj-bodam-logos {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 1fr 1fr;
  aspect-ratio: 16 / 9;
  font-family: 'Inter', system-ui, sans-serif;
  overflow: hidden;
  border: 1px solid var(--rule2);
}
.pbl-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pbl-light { background: #F2F2F0; color: #0A0A0A; }
.pbl-dark  { background: #0A0A0A; color: #F2F2F0; }
.pbl-wood  { background: #8B6F47; color: #F2F2F0; grid-column: 2; grid-row: 1 / 3; }
.pbl-logo {
  display: flex;
  align-items: baseline;
  white-space: nowrap;
  font-size: clamp(1.4rem, 5vw, 3rem);
}
.pbl-compact { font-size: clamp(2rem, 8vw, 4.5rem); }
.pbl-logo .b { font-weight: 900; letter-spacing: .12em; }
.pbl-logo .d { font-weight: 300; color: #7A7570; margin: 0 .08em; }
.pbl-logo .a { font-weight: 300; font-style: italic; letter-spacing: -.04em; }
.pbl-wood .pbl-logo .d { color: #F2F2F0; opacity: .7; }
.pbl-tag {
  position: absolute;
  left: 12px;
  bottom: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.pbl-light .pbl-tag { color: #5A5755; }
.pbl-dark .pbl-tag  { color: #9B948D; }
.pbl-wood .pbl-tag  { color: #FFFFFF; }

/* ── BOD|am : moodboard en 3 pôles (BOD · jonction · am), 2 photos par pôle ── */
/* Sous-grille : les colonnes partagent les mêmes rangées, des mots-clés plus longs
   ne décalent pas les photos. */
.proj-mood {
  --pm-gap: clamp(8px, 1.5vw, 16px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto auto auto auto;
  column-gap: var(--pm-gap);
  row-gap: 0;
}
.pm-col {
  display: grid;
  grid-row: span 4;
  grid-template-rows: subgrid;
}
.pm-col img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
  border: 1px solid var(--rule2);
  background: var(--s2);
  margin-bottom: var(--pm-gap);
}
.pm-col img:last-child { margin-bottom: 0; }
.pm-pole {
  margin: 0 0 4px;
  font-size: 12px;
  color: var(--ink);
  letter-spacing: .04em;
}
.pm-pole strong { font-weight: 900; letter-spacing: .12em; }
.pm-kw {
  margin: 0 0 var(--pm-gap);
  font-size: 12px;
  color: var(--stone);
  line-height: 1.4;
}
@media (max-width: 520px) { .pm-kw { display: none; } }

/* ── BOD|am : palette (pastille + nom + hex : l'information n'est jamais portée par la couleur seule) ── */
.proj-section .proj-swatches {
  list-style: none;
  padding: 0;
  margin: var(--space-4) 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: var(--space-1);
}
.proj-section .proj-swatches li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  font-size: inherit;
  line-height: 1.3;
}
.sw-chip {
  display: block;
  height: 44px;
  border: 1px solid var(--rule2);
}
.sw-name { font-size: 13px; font-weight: 700; color: var(--ink); }
.sw-hex { font-size: 12px; color: var(--stone); font-variant-numeric: tabular-nums; }

/* Groupe cliquable (les planches d'un brandboard) : une vignette, un badge « N planches »,
   tout le contenu en un clic. Pas de carrousel à flèches (faible interaction, NN/g). */
.proj-gallery-group { margin: 0; }

.proj-gallery-cover {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--s2);
  border: 1px solid var(--rule2);
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  font: inherit;
}
.proj-gallery-cover:hover,
.proj-gallery-cover:focus-visible {
  border-color: var(--accent);
}
/* Focus clavier : le contour global (le bord est à 0 dans un tirage .print, il ne suffisait pas — 05/10) */
.proj-gallery-cover:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

/* Planches dans la vignette : la première sert de couche de base (jamais animée).
   Le fondu enchaîné est piloté par v2.js (voir v2.css) ; mouvement réduit : immobile. */
.proj-gallery-cover-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
}
.proj-gallery-cover-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.proj-gallery-cover-slide:first-child { opacity: 1; }

@media (prefers-reduced-motion: no-preference) {
  .proj-gallery-cover-slide:not(:first-child) { animation: projGalleryCycle 36s; }
  .proj-gallery-cover-slide:nth-child(2) { animation-delay: 4.5s; }
  .proj-gallery-cover-slide:nth-child(3) { animation-delay: 9s; }
  .proj-gallery-cover-slide:nth-child(4) { animation-delay: 13.5s; }
  .proj-gallery-cover-slide:nth-child(5) { animation-delay: 18s; }
  .proj-gallery-cover-slide:nth-child(6) { animation-delay: 22.5s; }
  .proj-gallery-cover-slide:nth-child(7) { animation-delay: 27s; }
  .proj-gallery-cover-slide:nth-child(8) { animation-delay: 31.5s; }
}
@keyframes projGalleryCycle {
  0%             { opacity: 0; }
  1.5%, 11%      { opacity: 1; }
  12.5%, 100%    { opacity: 0; }
}

.proj-gallery-cover-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 10px;
  background: var(--bg);
  border: 1px solid var(--rule2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink);
  pointer-events: none;
}

/* Vignette cliquable : elle ne montre que le haut de la maquette, le clic ouvre la page
   complète dans une fenêtre qui défile. */
.proj-img-expand {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.proj-img-expand:hover .proj-gallery-cover-badge,
.proj-img-expand:focus-visible .proj-gallery-cover-badge {
  border-color: var(--accent);
}

.proj-lightbox-scroll {
  padding: clamp(20px, 3vw, 28px);
  overflow-y: auto;
}
.proj-lightbox-scroll img {
  width: 100%;
  height: auto;
  display: block;
}
/* Maquette mobile (402px) : pas étirée au-delà de sa résolution réelle */
.proj-lightbox-scroll-narrow img {
  width: auto;
  max-width: 100%;
  margin: 0 auto;
}

/* <dialog> natif : piège du focus et fermeture par Échap gérés par le navigateur */
/* Recentre le dialog : le reset global (* { margin:0 }) écrase le margin:auto natif */
.proj-lightbox {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(880px, 92vw);
  max-height: 86vh;
  padding: 0;
  border: 1px solid var(--rule2);
  background: var(--bg);
  color: var(--ink);
}
.proj-lightbox::backdrop { background: rgba(10, 10, 10, .6); }
.proj-lightbox-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px clamp(20px, 3vw, 28px);
  border-bottom: 1px solid var(--rule2);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--stone);
}
.proj-lightbox-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: var(--mid);
  line-height: 1;
  padding: 4px;
}
.proj-lightbox-close:hover { color: var(--ink); }
.proj-lightbox-grid {
  padding: clamp(20px, 3vw, 28px);
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: clamp(16px, 2.5vw, 24px);
}
.proj-lightbox-grid figure { margin: 0; }
.proj-lightbox-grid .proj-img { margin-bottom: 8px; aspect-ratio: 4/3; }
.proj-lightbox-grid figcaption {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--stone);
}

.proj-section {
  margin-bottom: clamp(32px, 5vw, 56px);
  /* dégage la barre de navigation collante (var(--nav-h), pas de valeur en dur) */
  scroll-margin-top: calc(var(--nav-h) + var(--space-2));
}
.proj-section h2 {
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 700;
  color: var(--ink);
  margin-bottom: clamp(12px, 1.5vw, 16px);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule2);
}
.proj-section p {
  font-size: 15px;
  line-height: 1.7;
  font-weight: 300;
  color: var(--mid);
  margin-bottom: 1em;
}
.proj-section ul {
  margin: 0 0 1em 1.2em;
  padding: 0;
}
.proj-section li {
  font-size: 15px;
  line-height: 1.7;
  font-weight: 300;
  color: var(--mid);
  margin-bottom: 0.5em;
}
.proj-section strong {
  color: var(--ink);
  font-weight: 700;
}

.proj-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1em;
}
.proj-table th,
.proj-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule2);
  font-size: 14px;
  color: var(--mid);
}
.proj-table th {
  color: var(--ink);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.proj-table strong { color: var(--ink); }
/* À 320 px (WCAG 1.4.10), on resserre le tableau, on ne cache rien */
@media (max-width: 400px) {
  .proj-table th, .proj-table td { padding: 8px 6px; font-size: 13px; }
  .proj-table th { font-size: 11px; letter-spacing: .04em; }
}
/* Icônes alignées d'une ligne à l'autre : le nombre occupe une largeur fixe. Pas de
   display:flex sur le td, qui casserait la largeur partagée des colonnes. */
.proj-metric-value {
  display: inline-block;
  width: 3.4em;
  text-align: right;
}
.proj-metric-icon {
  display: inline-block;
  margin-left: 6px;
}

