/* projet.css — page d'étude de cas (views/projet.ejs). PROPRIÉTAIRE : dev « projets ».
   S'appuie sur tokens.css, base.css (grille, .measure), components.css (.frame, .fig, .figures, .checklist, .sec-num,
   .dim, .marks, .tags, .band) et motion.css (signature .hero, révélations, A9). Structure : DESIGN.md § 7. */

/* ---------- 00. En-tête : signature du hero, cadre principal + téléphone ---------- */
.projet-hero {
  position: relative;
  padding-block: clamp(2.5rem, 1.5rem + 3vw, 4rem) clamp(3rem, 2rem + 4vw, 5rem);
}

.projet-hero__text {
  max-width: 56rem;
}

.projet-hero__text > * + * {
  margin-top: var(--s-5);
}

.projet-hero__text .dim {
  margin-bottom: var(--s-6);
}

.projet-hero__title {
  max-width: 24ch;
}

.projet-hero__subtitle {
  max-width: var(--measure);
}

.projet-hero__tags {
  margin-top: var(--s-5);
}

/* Le cadre principal porte les repères de coin ; le téléphone est posé À CÔTÉ à partir de 900 px (jamais dessus :
   il amputait la capture principale et masquait le repère de coin bas droit), empilé dessous en deçà. */
.projet-hero__visual {
  margin-top: var(--s-8);
}

.projet-hero__stage {
  display: grid;
  grid-template-columns: 1fr;
}

.projet-hero__primary {
  grid-column: 1;
  grid-row: 1;
}

.projet-hero__phone {
  width: 240px;
  max-width: 100%;
  margin: var(--s-6) auto 0;
  z-index: 2;
}

.projet-hero__phone .frame--phone {
  width: 100%;
}

.projet-hero__caption {
  flex-direction: column;
  align-items: stretch;
  gap: var(--s-2);
  margin-top: var(--s-4);
}

.projet-hero__cap {
  display: flex;
  gap: var(--s-3);
  align-items: baseline;
}

.projet-hero__visual > .dim {
  margin-top: var(--s-7);
}

@media (min-width: 56.25rem) {
  .projet-hero__stage {
    grid-template-columns: minmax(0, 1fr) var(--s-5) 200px;
    align-items: start;
  }
  .projet-hero__primary {
    grid-column: 1 / 2;
  }
  .projet-hero__phone {
    grid-column: 3 / 4;
    grid-row: 1;
    width: 100%;
    margin: 3.5rem 0 0;
    justify-self: end;
  }
  .projet-hero__caption {
    flex-direction: row;
    gap: var(--s-6);
  }
  .projet-hero__cap {
    flex: 1 1 0;
  }
}

/* ---------- 01 / 02. Contexte et problème, deux colonnes ---------- */
.projet-context__col > h2 + p {
  margin-top: var(--s-5);
}

@media (max-width: 56.24rem) {
  .projet-context__col + .projet-context__col {
    margin-top: var(--s-7);
  }
}

/* ---------- Titres de section : le h2 suit le numéro ---------- */
.section > .container > .sec-num + h2 + .lead,
.section > .container > .sec-num + h2 + .measure,
.section > .container > .sec-num + h2 + .how,
.section > .container > .sec-num + h2 + .figures,
.section > .container > .sec-num + h2 + .checklist,
.section > .container > .sec-num + h2 + .shots {
  margin-top: var(--s-7);
}

.projet-built__p + .projet-built__p {
  margin-top: var(--s-4);
}

/* ---------- 03. Ce que j'ai construit : blocs illustrés ---------- */
.projet-block {
  margin-top: var(--s-8);
  padding-top: var(--s-6);
  border-top: 1px solid var(--line);
}

.projet-block__num {
  margin-right: var(--s-3);
  font-weight: var(--fw-ui);
  font-size: 1rem;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.projet-block__text > * + * {
  margin-top: var(--s-4);
}

.projet-block__list li + li {
  margin-top: var(--s-3);
}

.projet-block__list strong {
  font-weight: var(--fw-title);
}

.projet-block--side {
  display: grid;
  gap: var(--s-6) var(--gap);
}

@media (min-width: 56.25rem) {
  .projet-block--side {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    align-items: start;
  }
  .projet-block--side .projet-block__text {
    grid-column: 1 / span 6;
  }
  .projet-block--side .projet-block__aside {
    grid-column: 8 / -1;
  }
}

/* ---------- Rangées de captures (.shots) : largeur d'affichage par figure ---------- */
.shots {
  display: grid;
  gap: var(--s-6) var(--gap);
  margin-top: var(--s-6);
  align-items: start;
}

.shots > * {
  min-width: 0;
}

.fig--phone .frame--phone,
.how__fig .frame--phone {
  width: 100%;
  max-width: 300px;
  margin-inline: auto;
}

.fig--phone figcaption {
  max-width: 300px;
  margin-inline: auto;
}

@media (min-width: 40rem) {
  .shots {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }
  .fig--phone { grid-column: span 6; }
  .fig--half { grid-column: span 6; }
  .fig--third { grid-column: span 6; }
  .fig--wide { grid-column: span 12; }
  .fig--full { grid-column: span 12; }
}

@media (min-width: 56.25rem) {
  .fig--phone { grid-column: span 3; }
  .fig--half { grid-column: span 6; }
  .fig--third { grid-column: span 4; }
  .fig--wide { grid-column: span 8; }
  .fig--full { grid-column: span 12; }
  .shots .fig--wide + .fig--phone .frame--phone {
    max-width: 260px;
  }
}

/* Capture coupée sur une ligne de tableau ouverte (réserve centrale) : fondu vers le papier en bas. */
.frame--fade img {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 3rem), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 3rem), transparent);
}

/* ---------- Comment ça marche (sous « Ce que j'ai fait ») : liste numérotée, captures alignées sur le point ---------- */
.projet-how__title {
  margin-top: var(--s-8);
  margin-bottom: var(--s-5);
}

.how {
  margin: 0;
}

.how__item {
  padding-block: var(--s-6);
  border-top: 1px solid var(--line);
}

.how__item:last-child {
  padding-bottom: 0;
}

.how__num {
  display: block;
  margin-bottom: var(--s-2);
  font-size: 1.25rem;
  font-weight: var(--fw-ui);
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--accent);
}

.how__text {
  max-width: var(--measure);
}

.how__title {
  font-size: var(--fs-h3);
  line-height: var(--lh-h3);
}

.how__title + p {
  margin-top: var(--s-3);
}

.how__fig {
  margin-top: var(--s-5);
}

@media (min-width: 56.25rem) {
  .how__item {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: var(--gap);
    align-items: start;
    padding-block: var(--s-7);
  }
  .how__text {
    grid-column: 1 / span 5;
  }
  .how__item--nofig .how__text {
    grid-column: 1 / span 7;
  }
  .how__fig {
    grid-column: 7 / -1;
    margin-top: 0;
  }
}

/* ---------- 05. En chiffres (quatre cellules : 2 × 2 sur téléphone, une rangée dès 900 px) ---------- */
.figures--8 .figures__cell:nth-child(n+3) {
  border-top: 1px solid var(--line);
}

@media (min-width: 56.25rem) {
  .figures--8 .figures__cell:nth-child(n+3) {
    border-top: 0;
  }
  .figures--8 .figures__cell:nth-child(n+5) {
    border-top: 1px solid var(--line);
  }
}

/* ---------- 06. Ce que ça change ---------- */
.projet-changes__list li + li {
  margin-top: var(--s-3);
}

/* ---------- 07. Galerie ---------- */
.shots--gallery {
  margin-top: var(--s-7);
}

/* ---------- Navigation entre projets ---------- */
.projet-nav__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s-5) var(--s-6);
  border-top: 1px solid var(--line-strong);
  padding-top: var(--s-6);
}

.projet-nav__link {
  gap: var(--s-3);
  padding-block: var(--s-2);
}

.projet-nav__body {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
}

.projet-nav__link--next {
  margin-left: auto;
  text-align: right;
}

.projet-nav__name {
  font-size: var(--fs-h4);
  line-height: var(--lh-h4);
}

.projet-nav__link .icon-arrow {
  width: 1.25rem;
  height: 1.25rem;
}

/* ---------- Captures pleine page ----------
   Plus de `cursor: pointer` ni de bascule à l'appui : le cadre n'est pas un bouton, c'est une région
   défilante (components.css, `.frame--tall .frame__scroll`). Le curseur promettait une interaction
   que seule la souris tenait ; le défilement natif la tient pour tout le monde. */
