/* ==========================================================
   Kohn International — CGV v5.3
   TOC épinglé bullet-proof + alignement des marqueurs
   ========================================================== */


/* ──────────────────────────────────────────────────────────
   TOKENS
   ────────────────────────────────────────────────────────── */
:root {
  --ink-1:    hsl(221 52%  8%);
  --ink-2:    hsl(221 52% 16%);
  --ink-3:    hsl(221 52% 24%);
  --ink-4:    hsl(221 52% 38%);
  --ink-body: hsl(221 30% 42%);
  --ink-meta: hsl(221 28% 52%);
  --ink-soft: hsl(221 20% 62%);
  --ink-read: hsl(221 36% 30%);
  --accent:   hsl(221 55% 38%);

  --surface:   #f8f6f3;
  --surface-2: #f1efe9;
  --cgv-bg:    #eeece8;
  --bord:      rgba(34 76 169 / .09);
  --bord-2:    rgba(34 76 169 / .18);

  --cgv-font: 'mundial-narrow-variable', 'mundial-narrow',
              'Arial Narrow', ui-sans-serif, sans-serif;
  --marker-col: 1.9rem;
  --marker-gap: .82rem;
  --hang: calc(var(--marker-col) + var(--marker-gap));
  --scroll-offset: 24px;
  --cgv-toc-top: 0px;
  --cgv-toc-maxh: 100svh;
  --cgv-toc-col: 296px;
}

[data-theme="dark"] {
  --ink-1:    hsl(221 22% 90%);
  --ink-2:    hsl(221 20% 82%);
  --ink-3:    hsl(221 18% 73%);
  --ink-4:    hsl(221 24% 60%);
  --ink-body: hsl(221 18% 68%);
  --ink-meta: hsl(221 16% 54%);
  --ink-soft: hsl(221 14% 44%);
  --ink-read: hsl(221 26% 80%);
  --accent:   hsl(221 55% 62%);
  --surface:   hsl(221 18% 11%);
  --surface-2: hsl(221 16% 14%);
  --cgv-bg:    hsl(221 22%  7%);
  --bord:      rgba(100 135 210 / .10);
  --bord-2:    rgba(100 135 210 / .22);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --ink-1:    hsl(221 22% 90%);
    --ink-2:    hsl(221 20% 82%);
    --ink-3:    hsl(221 18% 73%);
    --ink-4:    hsl(221 24% 60%);
    --ink-body: hsl(221 18% 68%);
    --ink-meta: hsl(221 16% 54%);
    --ink-soft: hsl(221 14% 44%);
    --ink-read: hsl(221 26% 80%);
    --accent:   hsl(221 55% 62%);
    --surface:   hsl(221 18% 11%);
    --surface-2: hsl(221 16% 14%);
    --cgv-bg:    hsl(221 22%  7%);
    --bord:      rgba(100 135 210 / .10);
    --bord-2:    rgba(100 135 210 / .22);
  }
}


/* ──────────────────────────────────────────────────────────
   RESET
   ────────────────────────────────────────────────────────── */
html,
body {
  overflow-x: hidden !important;
  overflow-y: auto !important;
  height: auto !important;
  min-height: 100% !important;
}

#page,
.site,
.site-main,
#primary,
main.cgv-page,
.site-main.cgv-page,
#primary.cgv-page {
  height: auto;
  min-height: 100svh;
  background: var(--cgv-bg);
  transition: background .35s ease;
}

.cgv-body .wp-block-heading,
.cgv-body .wp-block-list,
.cgv-body .wp-block-paragraph,
.cgv-body .wp-block-table {
  margin-block: 0;
}


/* ──────────────────────────────────────────────────────────
   EN-TÊTE PAGE
   ────────────────────────────────────────────────────────── */
.cgv-ph {
  background: var(--surface);
  border-bottom: 1px solid var(--bord-2);
  padding: 64px 44px 52px;
  position: relative;
  overflow: hidden;
  transition: background .35s ease, border-color .35s ease;
}

.cgv-ph::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), hsl(221 40% 60%), transparent);
  opacity: .35;
  pointer-events: none;
}

.cgv-ph__inner {
  max-width: 1160px;
  margin: 0 auto;
}

h1.cgv-ph__title {
  font-family: var(--cgv-font);
  font-size: clamp(36px, 5vw, 60px);
  font-variation-settings: 'wght' 100;
  font-weight: 400;
  color: var(--ink-1);
  line-height: 1.02;
  letter-spacing: -.02em;
  margin: 0;
  transition: color .35s ease;
}


/* ──────────────────────────────────────────────────────────
   LAYOUT
   ────────────────────────────────────────────────────────── */
.cgv-wrap {
  position: relative;
  display: grid;
  grid-template-columns: var(--cgv-toc-col) minmax(0, 1fr);
  max-width: 1160px;
  margin: 0 auto;
  align-items: start;
  column-gap: 0;
}


/* ──────────────────────────────────────────────────────────
   TOC — desktop pinned by JS
   ────────────────────────────────────────────────────────── */
.cgv-toc {
  grid-column: 1;
  position: relative;
  align-self: start;
  width: 100%;
  height: var(--cgv-toc-maxh);
  max-height: var(--cgv-toc-maxh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--bord);
  background: transparent;
  transition: background .35s ease, border-color .35s ease;
}

.cgv-toc.is-fixed {
  position: fixed;
  top: var(--cgv-pin-top, 0px);
  left: var(--cgv-pin-left, 0px);
  width: var(--cgv-pin-width, var(--cgv-toc-col));
  height: var(--cgv-pin-height, 100svh);
  max-height: var(--cgv-pin-height, 100svh);
}

.cgv-toc.is-bottom {
  position: absolute;
  left: 0;
  bottom: 0;
  width: var(--cgv-toc-col);
  height: var(--cgv-pin-height, var(--cgv-toc-maxh));
  max-height: var(--cgv-pin-height, var(--cgv-toc-maxh));
}

.cgv-toc__btn {
  display: none;
}

.cgv-toc__panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow: visible;
  padding: 16px 14px 16px 24px;
}

.cgv-toc__label {
  display: block;
  font-family: var(--cgv-font);
  font-size: 8.5px;
  font-variation-settings: 'wght' 820;
  font-weight: 400;
  color: var(--ink-soft);
  letter-spacing: .22em;
  text-transform: uppercase;
  margin: 0 0 10px;
  pointer-events: none;
  transition: color .35s ease;
}

.cgv-toc__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.cgv-toc.is-balanced .cgv-toc__list {
  flex: 1 1 auto;
  justify-content: space-evenly;
}

.cgv-toc__link {
  display: grid;
  grid-template-columns: 2.2ch minmax(0, 1fr);
  align-items: start;
  column-gap: .55em;
  font-family: var(--cgv-font);
  font-size: 11.75px;
  font-variation-settings: 'wght' 500;
  font-weight: 400;
  color: var(--ink-meta);
  padding: 3px 10px 3px 8px;
  border-left: 2px solid transparent;
  line-height: 1.16;
  text-decoration: none;
  transition:
    color .15s ease,
    background .15s ease,
    border-left-color .15s ease,
    font-variation-settings .15s ease;
}

.cgv-toc__num {
  display: block;
  font-size: .96em;
  font-variation-settings: 'wght' 760;
  font-weight: 400;
  color: var(--ink-soft);
  text-align: right;
  font-variant-numeric: tabular-nums;
  min-width: 0;
  transition: color .15s ease;
}

.cgv-toc__text {
  min-width: 0;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.cgv-toc__link:hover {
  color: var(--ink-3);
  background: var(--surface-2);
}

.cgv-toc__link.is-active {
  color: var(--ink-2);
  border-left-color: var(--accent);
  font-variation-settings: 'wght' 740;
}

.cgv-toc__link.is-active .cgv-toc__num {
  color: var(--accent);
}

.cgv-toc__sep {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--bord);
}


/* ──────────────────────────────────────────────────────────
   CORPS
   ────────────────────────────────────────────────────────── */
.cgv-body {
  grid-column: 2;
  padding: 0 52px 80px 48px;
  font-family: var(--cgv-font);
  min-width: 0;
  overflow: visible;
}


/* ──────────────────────────────────────────────────────────
   SECTION
   ────────────────────────────────────────────────────────── */
.cgv-section {
  padding: 48px 0;
  border-bottom: 1px solid var(--bord);
  transition: border-color .35s ease;
  scroll-margin-top: var(--scroll-offset);
}

.cgv-section:last-of-type,
.cgv-section:last-child {
  border-bottom: none;
}

.cgv-section > * + * {
  margin-top: 14px;
}


/* ──────────────────────────────────────────────────────────
   H2 + NUMÉROS
   ────────────────────────────────────────────────────────── */
.cgv-body h2 {
  position: relative;
  padding-left: var(--hang);
  font-family: var(--cgv-font);
  font-size: clamp(20px, 2.3vw, 26px);
  font-variation-settings: 'wght' 200;
  font-weight: 400;
  color: var(--ink-2);
  line-height: 1.1;
  letter-spacing: -.01em;
  margin: 0 0 20px !important;
  transition: color .4s ease, font-variation-settings .4s ease;
}

.cgv-section.is-reading h2 {
  color: var(--ink-1);
  font-variation-settings: 'wght' 240;
}

.cgv-artno {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--marker-col);
  font-family: var(--cgv-font);
  font-size: 1em;
  font-variation-settings: 'wght' 240;
  font-weight: 400;
  color: var(--ink-soft);
  letter-spacing: 0;
  line-height: 1.1;
  text-align: right;
  white-space: nowrap;
  transition: color .4s ease, font-variation-settings .4s ease;
}

.cgv-section.is-reading .cgv-artno {
  color: var(--ink-meta);
  font-variation-settings: 'wght' 280;
}

.cgv-artno--note {
  top: .28em;
  width: var(--marker-col);
  font-size: .46em;
  font-variation-settings: 'wght' 620;
  color: var(--accent);
  letter-spacing: .03em;
  text-align: right;
}


/* ──────────────────────────────────────────────────────────
   H3
   ────────────────────────────────────────────────────────── */
.cgv-body h3 {
  position: relative;
  padding-left: var(--hang);
  font-family: var(--cgv-font);
  font-size: 10.5px !important;
  font-variation-settings: 'wght' 820 !important;
  font-weight: 400;
  color: var(--ink-meta);
  letter-spacing: .16em;
  text-transform: uppercase;
  margin: 20px 0 8px !important;
  line-height: 1.2;
  transition: color .35s ease;
}


/* ──────────────────────────────────────────────────────────
   PARAGRAPHES
   ────────────────────────────────────────────────────────── */
.cgv-body p {
  padding-left: var(--hang);
  font-family: var(--cgv-font);
  font-size: 16.5px;
  font-variation-settings: 'wght' 350;
  font-weight: 400;
  color: var(--ink-body);
  line-height: 1.68;
  margin: 0 !important;
  transition: color .4s ease;
}

.cgv-section.is-reading p {
  color: var(--ink-read);
}

.cgv-body p > strong:only-child {
  display: inline-block;
  font-size: 10px;
  font-variation-settings: 'wght' 840;
  color: var(--ink-meta);
  letter-spacing: .16em;
  text-transform: uppercase;
}


/* ──────────────────────────────────────────────────────────
   LISTES
   ────────────────────────────────────────────────────────── */
.cgv-body ul.wp-block-list,
.cgv-body ol.wp-block-list {
  list-style: none;
  padding: 0 !important;
  margin: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cgv-body ul.wp-block-list > li,
.cgv-body ol.wp-block-list > li {
  position: relative;
  padding-left: var(--hang);
  font-family: var(--cgv-font);
  font-size: 16.5px;
  font-variation-settings: 'wght' 350;
  font-weight: 400;
  color: var(--ink-body);
  line-height: 1.65;
  transition: color .4s ease;
}

.cgv-section.is-reading ul.wp-block-list > li,
.cgv-section.is-reading ol.wp-block-list > li {
  color: var(--ink-read);
}

.cgv-body ul.wp-block-list > li::before {
  content: '–';
  position: absolute;
  left: 0;
  top: 0;
  width: var(--marker-col);
  text-align: right;
  font-variation-settings: 'wght' 280;
  font-weight: 400;
  color: var(--ink-soft);
  transition: color .4s ease;
}

.cgv-section.is-reading ul.wp-block-list > li::before {
  color: var(--ink-meta);
}

.cgv-body ol.wp-block-list {
  counter-reset: cgv-ol;
}

.cgv-body ol.wp-block-list > li {
  counter-increment: cgv-ol;
}

.cgv-body ol.wp-block-list > li::before {
  content: counter(cgv-ol) '.';
  position: absolute;
  left: 0;
  top: 0;
  width: var(--marker-col);
  text-align: right;
  font-size: 13px;
  font-variation-settings: 'wght' 650;
  color: var(--ink-meta);
  transition: color .4s ease;
}

.cgv-body li > ul {
  list-style: none;
  padding: 7px 0 0 !important;
  margin: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.cgv-body li > ul > li {
  position: relative;
  padding-left: 1.1em;
  font-size: 15.5px;
  font-variation-settings: 'wght' 350;
  font-weight: 400;
  color: var(--ink-body);
  line-height: 1.6;
  transition: color .35s ease;
}

.cgv-body li > ul > li::before {
  content: '·';
  position: absolute;
  left: 0;
  top: 0;
  width: 1ch;
  text-align: right;
  font-variation-settings: 'wght' 300;
  color: var(--ink-soft);
}


/* ──────────────────────────────────────────────────────────
   TABLEAUX
   ────────────────────────────────────────────────────────── */
.cgv-body figure.wp-block-table {
  margin: 0 !important;
  padding-left: var(--hang);
  overflow-x: auto;
}

.cgv-body figure.wp-block-table table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--cgv-font);
}

.cgv-body figure.wp-block-table td,
.cgv-body figure.wp-block-table th {
  padding: 9px 16px;
  font-size: 15px;
  font-variation-settings: 'wght' 360;
  font-weight: 400;
  color: var(--ink-body);
  line-height: 1.5;
  border-bottom: 1px solid var(--bord);
  vertical-align: top;
  transition: color .35s ease, border-color .35s ease;
}

.cgv-body figure.wp-block-table tr:last-child td,
.cgv-body figure.wp-block-table tr:last-child th {
  border-bottom: none;
}

.cgv-body figure.wp-block-table td:first-child {
  font-size: 14px;
  font-variation-settings: 'wght' 720;
  font-weight: 400;
  color: var(--ink-3);
  width: 28%;
  white-space: nowrap;
}

.cgv-body figure.wp-block-table tbody > tr:first-child > td {
  font-size: 9.5px !important;
  font-variation-settings: 'wght' 830 !important;
  font-weight: 400;
  color: var(--ink-soft) !important;
  letter-spacing: .15em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--bord-2);
  padding-bottom: 7px;
  width: auto !important;
}


/* ──────────────────────────────────────────────────────────
   INLINE
   ────────────────────────────────────────────────────────── */
.cgv-body strong,
.cgv-body b {
  font-variation-settings: 'wght' 680;
  font-weight: 400;
  color: var(--ink-3);
}

.cgv-body em,
.cgv-body i {
  font-style: italic;
}

.cgv-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: opacity .15s ease;
}

.cgv-body a:hover {
  opacity: .72;
}


/* ──────────────────────────────────────────────────────────
   PIED
   ────────────────────────────────────────────────────────── */
.cgv-foot {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding-top: 32px;
  margin-top: 48px;
  border-top: 1px solid var(--bord-2);
  transition: border-color .35s ease;
}

.cgv-foot__logo {
  display: block;
  height: 32px;
  width: auto;
  opacity: .28;
  filter: grayscale(1);
  flex-shrink: 0;
  transition: opacity .3s ease, filter .3s ease;
}

.cgv-foot__logo:hover {
  opacity: .50;
  filter: grayscale(.3);
}

.cgv-foot__copy.cgv-foot__copy {
  font-family: var(--cgv-font);
  font-size: 12.5px !important;
  font-variation-settings: 'wght' 500 !important;
  font-weight: 400;
  color: var(--ink-meta) !important;
  line-height: 1.4 !important;
  padding-left: 0 !important;
  margin: 0 !important;
  transition: color .35s ease !important;
}


/* ──────────────────────────────────────────────────────────
   A11Y + MOTION
   ────────────────────────────────────────────────────────── */
.cgv-toc__link:focus-visible,
.cgv-toc__btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .cgv-body h2,
  .cgv-artno,
  .cgv-body p,
  .cgv-body ul.wp-block-list > li,
  .cgv-body ol.wp-block-list > li,
  .cgv-body ul.wp-block-list > li::before,
  .cgv-toc,
  .cgv-toc__link,
  .cgv-toc__panel,
  .cgv-toc__btn svg {
    transition: none !important;
  }
}


/* ══════════════════════════════════════════════════════════
   RESPONSIVE ≤ 900px
   ══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .cgv-ph {
    padding: 40px 20px 32px;
  }

  h1.cgv-ph__title {
    font-size: clamp(28px, 7vw, 40px);
  }

  .cgv-wrap {
    display: grid;
    grid-template-columns: 1fr;
  }

  .cgv-toc,
  .cgv-toc.is-fixed,
  .cgv-toc.is-bottom {
    grid-column: 1;
    position: static;
    top: auto;
    left: auto;
    bottom: auto;
    width: 100%;
    height: auto;
    max-height: none;
    display: block;
    overflow: visible;
    border-right: none;
    border-bottom: 1px solid var(--bord);
    background: var(--surface);
  }

  .cgv-toc__btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--cgv-font);
    font-size: 10px;
    font-variation-settings: 'wght' 780;
    font-weight: 400;
    color: var(--ink-meta);
    letter-spacing: .20em;
    text-transform: uppercase;
    gap: 10px;
    transition: color .2s ease;
  }

  .cgv-toc__btn svg {
    width: 10px;
    height: 6px;
    flex-shrink: 0;
    stroke: currentColor;
    transition: transform .25s ease;
  }

  .cgv-toc__btn[aria-expanded="true"] svg {
    transform: rotate(180deg);
  }

  .cgv-toc__panel {
    display: block;
    max-height: 0;
    min-height: 0;
    overflow: hidden;
    padding: 0 20px;
    transition: max-height .35s cubic-bezier(.4,0,.2,1), padding-bottom .2s ease;
  }

  .cgv-toc__btn[aria-expanded="true"] + .cgv-toc__panel {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 20px 16px;
  }

  .cgv-toc__label {
    margin-top: 12px;
  }

  .cgv-toc__list,
  .cgv-toc.is-balanced .cgv-toc__list {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 1px;
  }

  .cgv-toc__link {
    font-size: 11px;
    grid-template-columns: 2.1ch minmax(0, 1fr);
  }

  .cgv-body {
    grid-column: 1;
    padding: 0 20px 60px;
  }

  .cgv-section {
    padding: 36px 0;
    scroll-margin-top: var(--scroll-offset);
  }

  .cgv-body figure.wp-block-table {
    padding-left: 0;
  }

  .cgv-foot {
    padding-top: 24px;
    margin-top: 36px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}


/* ══════════════════════════════════════════════════════════
   IMPRESSION
   ══════════════════════════════════════════════════════════ */
@media print {
  .cgv-toc {
    display: none !important;
  }

  .cgv-wrap {
    grid-template-columns: 1fr !important;
  }

  .cgv-body {
    padding: 0 !important;
  }

  .cgv-ph {
    padding: 24px 0 !important;
  }

  .cgv-ph::after {
    display: none;
  }

  body,
  main.cgv-page,
  #primary.cgv-page,
  body * {
    background: #fff !important;
    color: #000 !important;
  }

  .cgv-section {
    page-break-inside: avoid;
    border-bottom: 1px solid #ccc;
  }

  .cgv-body a {
    text-decoration: none;
    color: #000 !important;
  }
}