/* Shared layout for the "Visite interactive" and "C'est quoi le plan ?" case studies.
   Same grid as KLAP (styles.css): sidebar 256 + 60 + 884 content, 40px side padding.
   Each page sets its colour theme on .page--<name> and adds its own sections. */

:root {
  --gutter: 40px;
  --content-pb: 120px;

  --ink: #000;
  --blue: #5186b4;
  --accent: #3a5ce8;

  --font-sans: "Inter", system-ui, sans-serif;
  --font-mono: "Intel One Mono", ui-monospace, monospace;
}

.page--visite {
  --top-fade: linear-gradient(180deg, #fff 0, #fffaf2 718px);
  --band-mid: #d3cabb;
  --band-dark: #6a5f4d;
  --tint: #fffaf2;
  --stroke: #e6e5d3;
  --tag-ink: #74603c;
  --accent-ink: #74603c;
  --accent-ink-dark: #4f4127;
  --tags-indent: 2px;
  --sidebar-gap: 19px;
}

.page--plan {
  --top-fade: linear-gradient(180deg, #fff 385px, #fff4f0 1186px);
  --band-mid: #d1b9b0;
  --band-dark: #674a40;
  --tint: #fff4f0;
  --stroke: #e6d8d3;
  --tag-ink: #8a5a4a;
  --accent-ink: #8a4a37;
  --accent-ink-dark: #5e3022;
  --tags-indent: 0px;
  --sidebar-gap: 17px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
}

h1, h2, h3, h4, h5, p, ul, ol, figure {
  margin: 0;
  padding: 0;
}

ul {
  list-style: none;
}

img {
  display: block;
  max-width: none;
}

a {
  color: inherit;
  text-decoration: none;
}

/* The dark band is sized by script.js (--band-h): it starts 440px above the conclusion
   and eases into its darkest colour where the white text begins. */
.page {
  position: relative;
  z-index: 0;
  background:
    linear-gradient(in oklab 180deg, var(--tint) 0, color-mix(in oklab, var(--tint), var(--band-mid) 50%) 110px, var(--band-mid) 200px, color-mix(in oklab, var(--band-mid), var(--band-dark) 55%) 320px, var(--band-dark) 440px, var(--band-dark) 100%) bottom / 100% var(--band-h, 1100px) no-repeat,
    var(--top-fade) top / 100% 1200px no-repeat,
    var(--tint);
}

.canvas {
  position: relative;
  display: flex;
  gap: 60px;
  align-items: flex-start;
  justify-content: flex-end;
  width: 1280px;
  margin: 0 auto;
  padding: 0 40px;
  overflow-x: clip;
}

/* ---------- Typography (Figma text styles) ---------- */

.h1 {
  font-weight: 700;
  font-size: 100px;
  line-height: 100px;
  white-space: nowrap;
}

.h2 {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 60px;
  line-height: 83px;
  letter-spacing: -3px;
}

.h3 {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 36px;
  line-height: 42px;
  letter-spacing: -1.8px;
}

.h4 {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 22px;
  line-height: 30px;
  letter-spacing: -1.1px;
}

.h5 {
  font-weight: 600;
  font-size: 18px;
  line-height: 22px;
}

.p {
  font-weight: 500;
  font-size: 17px;
  line-height: 27px;
}

.p2 {
  font-weight: 400;
  font-size: 16px;
  line-height: 19px;
}

/* Notes: 14px (was 13px in Figma) so the key findings stay readable. */
.p3 {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 14px;
  line-height: 20px;
}

.p3 strong { font-weight: 700; }

/* Bulleted / numbered lists in the mono notes: marker hangs 1.5em to the left. */
.list {
  list-style: disc;
}

ol.list {
  list-style: decimal;
}

.list li {
  margin-left: 19.5px;
}

.list li + li {
  margin-top: 6px;
}

/* ---------- Sidebar ---------- */

.sidebar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: var(--sidebar-gap);
  align-items: flex-start;
  flex-shrink: 0;
  width: 256px;
  padding: 90px 0;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.brand__title {
  font-weight: 400;
  font-size: 30px;
  line-height: 36px;
}

.brand__tags {
  display: flex;
  gap: 10px;
  padding-left: var(--tags-indent);
}

/* Line-height equals Inter's cap height: the label sits optically centred,
   like the cap-trimmed text box in Figma. */
.tag {
  padding: 7px 8px;
  border-radius: 30px;
  background: var(--tint);
  color: var(--tag-ink);
  font-weight: 600;
  font-size: 11px;
  line-height: 8px;
  white-space: nowrap;
}

/* Sommaire: shared styles live in common.css. */

/* ---------- Content column ---------- */

.content {
  position: relative;
  display: flex;
  flex: 1 0 0;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  padding: 120px 0 var(--content-pb);
}

.content [id] {
  scroll-margin-top: 40px;
}

.stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.row {
  display: flex;
  align-items: flex-start;
}

.pills {
  display: flex;
  gap: 19px;
  align-items: center;
}

.pill {
  padding: 8px 10px;
  border: 1px solid var(--ink);
  border-radius: 100px;
  font-weight: 600;
  font-size: 20px;
  line-height: 24px;
  white-space: nowrap;
}

.lead {
  width: 461.771px;
  font-weight: 600;
  font-size: 16px;
  line-height: 25px;
}

/* Image slot: optional 1px stroke drawn inside the box, like Figma's inside strokes. */
.frame {
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
}

.frame--stroke {
  border: 1px solid var(--stroke);
}

.frame > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.frame--crop > img {
  inset: auto;
  top: var(--crop-top, 0);
  left: var(--crop-left, 0);
  width: var(--crop-w, 100%);
  height: var(--crop-h, 100%);
}

.frame--paper {
  background: #fff;
}

.note {
  flex-shrink: 0;
  padding: 10px;
  background: #fff;
}

.card {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  padding: 20px;
  border: 1px solid var(--stroke);
  background: linear-gradient(180deg, #fff, var(--tint));
}

.cards {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.cards > .card { min-height: 190px; }

.reco-label {
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 12px;
  line-height: 15px;
  text-transform: uppercase;
}

.context-card {
  padding: 20px;
  border: 1px solid var(--stroke);
  background: linear-gradient(180deg, #fff, var(--tint));
}

.context-card .p {
  width: 378px;
}

/* Body copy shares one measure. */
.measure {
  width: 540px;
}

.conclusion {
  position: relative;
  display: flex;
  align-items: flex-start;
  color: #fff;
  font-weight: 500;
  font-size: 17px;
  line-height: 27px;
}

.conclusion strong {
  font-weight: 700;
}

.conclusion ol {
  list-style: decimal;
}

.conclusion li {
  margin-left: 25.5px;
}

.conclusion__gap {
  margin-top: 27px;
}

/* =========================================================
   Responsive — same breakpoints as the KLAP page.
   ========================================================= */

@media (max-width: 1279px) {
  :root {
    --gutter: 32px;
    --bleed-left: calc(-1 * (var(--gutter) + 296px));
  }

  .canvas {
    width: 100%;
    padding: 0 var(--gutter);
    gap: 40px;
  }

  /* Fixed Figma widths become maxima so nested blocks never exceed the column. */
  .content > *,
  .content .stack,
  .content .row,
  .content .note { max-width: 100%; }

  .h1 { white-space: normal; }
  .lead { width: auto; max-width: 461.771px; }
  .pills { flex-wrap: wrap; row-gap: 12px; }

  .cards { height: auto; }

  .card {
    flex: 1 1 200px;
    width: auto;
    max-width: 263.5px;
    height: auto;
    min-height: 190px;
  }

  .conclusion {
    flex-wrap: wrap;
    align-self: stretch;
    row-gap: 32px;
  }

  .conclusion > * {
    flex: 1 1 300px;
    width: auto;
    max-width: 417.879px;
  }
}

@media (max-width: 1023px) {
  :root {
    --gutter: 24px;
    --content-pb: 96px;
    --bleed-left: calc(-1 * var(--gutter));
  }

  .canvas {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  /* Sidebar becomes a sticky top bar: back arrow, progress, section chips. */
  .sidebar {
    z-index: 20;
    flex-direction: row;
    align-items: center;
    width: auto;
    margin: 0 calc(-1 * var(--gutter));
    padding: 0;
    gap: 0;
    border-bottom: 1px solid var(--stroke);
    background: rgba(255, 255, 255, 0.9);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }

  .sidebar .back-button { align-self: center; }

  .brand { display: none; }

  .toc {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    min-width: 0;
    width: auto;
    height: auto;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
  }

  .toc__header {
    position: static;
    display: flex;
    flex: none;
    align-items: center;
    gap: 8px;
    width: auto;
    height: 52px;
    padding: 0 12px;
    border-bottom: 0;
    border-right: 1px solid #000;
    background: none;
  }

  .toc__header::after,
  .toc__connector,
  .toc__marker,
  .toc__marker-active,
  .toc__halo,
  .toc__arrow,
  .toc__title,
  .toc__item--sub { display: none; }

  .toc__header-marker,
  .toc__progress { position: static; }

  .toc__list {
    position: static;
    display: flex;
    flex: 1 1 auto;
    gap: 4px;
    min-width: 0;
    padding: 10px var(--gutter) 10px 12px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .toc__list::-webkit-scrollbar { display: none; }

  .toc .toc__list > .toc__item {
    flex: none;
    margin-top: 0;
  }

  .toc .toc__item > a {
    height: 32px;
    padding: 0 12px;
    border: 1px solid transparent;
    line-height: 30px;
    transition: color 0.2s ease, background-color 0.2s ease;
  }

  .toc .toc__item.is-current > a,
  .toc .toc__item--section.is-active > a { border-color: #000; color: #000; box-shadow: none; }

  .content { padding-top: 40px; }
  .content [id] { scroll-margin-top: 72px; }
}

@media (max-width: 767px) {
  :root {
    --gutter: 16px;
    --content-pb: 80px;
  }

  .h1 { font-size: 56px; line-height: 58px; }
  .h2 { font-size: 44px; line-height: 56px; letter-spacing: -2.2px; }
  .h3 { font-size: 28px; line-height: 34px; letter-spacing: -1.4px; }

  .pills { gap: 10px; }
  .pill { padding: 6px 10px; font-size: 16px; line-height: 20px; }

  .context-card .p,
  .content .note p,
  .content .note .p3 { width: auto; }

  .content .note {
    flex-shrink: 1;
    min-width: 0;
  }

  .card { flex-basis: 100%; max-width: none; }

  .conclusion > * { flex-basis: 100%; max-width: none; }
}
