/* ==========================================================================
   Rapport — gabarit de chapitre : ouverture, phrase-clé, texte de lecture avec lettrine,
   glossaire (bulle mobile, note de marge desktop), citation, « En pratique », conseil,
   renvois, « Chapitre suivant ». Corps Cormorant 19,5 px mobile (≈ 46 car./ligne),
   21 px dans une colonne de 650 px sur desktop (≈ 62 car.).
   Référence : design/maquettes/rapport/03-chapitre.html.
   ========================================================================== */

.rp { --font-read: "Cormorant Garamond", "Noto Serif KR", "Times New Roman", serif; }
.chapter { padding: 56px 16px 28px; }
.chapter + .chapter { border-top: 1px solid var(--line-soft); }
.chapter__part { display: flex; align-items: center; gap: 10px; }
.chapter__part::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.chapter__open { margin-top: 22px; display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; align-items: end; }
.chapter__num { grid-row: span 2; font: 300 84px/0.8 var(--font-display); color: var(--accent-ink); letter-spacing: -0.02em; }
.chapter__title { font: 600 34px/1.05 var(--font-read); letter-spacing: -0.005em; text-wrap: balance; }
.chapter__time { font-size: 13px; color: var(--ink-3); }
.chapter__key { margin-top: 26px; padding: 2px 0 2px 18px; border-left: 2px solid var(--accent); font: italic 400 var(--rd-lead)/1.35 var(--font-read); color: var(--ink); }

.prose { margin-top: 26px; font: 450 var(--rd-size)/var(--rd-lh) var(--font-read); hanging-punctuation: first; }
.prose > p + p, .prose > .has-side + p, .prose > p + .has-side, .prose > .has-side + .has-side { margin-top: 0.9em; }
.prose strong { font-weight: 650; }
.prose .ko { font-size: 0.86em; }
.dropcap::first-letter { float: left; font: 500 4.25em/0.82 var(--font-display); margin: 0.06em 0.09em 0 -0.02em; color: var(--accent-ink); }
.chapter .prose + .prose, .chapter > .prose:last-of-type { margin-top: 20px; }

/* Renvois et liens de chapitre */
.xlink { color: var(--accent-ink); font: 600 0.78em/1 var(--font-ui); text-underline-offset: 3px; }
.xref { margin-top: 18px; display: flex; gap: 10px; align-items: baseline; font-size: 14px; color: var(--ink-2); }
.xref a { color: var(--accent-ink); font-weight: 600; text-underline-offset: 3px; }
.xref .i { color: var(--ink-3); width: 14px; height: 14px; transform: translateY(2px); }

/* Glossaire : le terme est un bouton ; bulle sous le paragraphe (mobile), note de marge (desktop) */
.term { all: unset; box-sizing: border-box; cursor: help; white-space: nowrap; text-decoration: underline dotted var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.term:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.term sup { font: 700 0.5em/1 var(--font-ui); color: var(--accent-ink); margin-left: 1px; }
.gloss-pop { position: relative; margin: 14px 0 4px; padding: 14px 16px; border-radius: var(--r-md); background: var(--ink-block); color: var(--btn-light-bg); font: 400 14.5px/1.5 var(--font-ui); box-shadow: var(--shadow-2); }
.gloss-pop[hidden] { display: none; }
.gloss-pop::before { content: ""; position: absolute; top: -7px; left: var(--x, 64px); width: 14px; height: 14px; background: var(--ink-block); transform: rotate(45deg); border-radius: 2px; }
.gloss-pop b { display: block; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: color-mix(in srgb, var(--btn-light-bg) 70%, var(--accent)); margin-bottom: 4px; }
.gloss-pop a { color: inherit; font-weight: 600; text-underline-offset: 3px; white-space: nowrap; }
.sidenote { display: none; }

/* Citation partageable */
.pull { margin: 34px 0 30px; padding: 4px 4px 18px; text-align: center; border-bottom: 1px solid var(--line-strong); }
.pull::before { content: "\201C"; display: block; height: 40px; font: 400 72px/1 var(--font-display); color: var(--accent-ink); }
.pull blockquote { font: italic 500 29px/1.22 var(--font-read); letter-spacing: -0.005em; text-wrap: balance; }
.pull figcaption { margin-top: 14px; display: flex; justify-content: center; align-items: center; gap: 14px; font-size: 13px; color: var(--ink-3); flex-wrap: wrap; }
.share-mini { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: var(--surface); font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; }
.share-mini:hover { background: var(--surface-2); }

/* Encadré « En pratique » */
.practice { margin: 30px 0 6px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); overflow: hidden; box-shadow: var(--shadow-1); }
.practice__head { display: grid; gap: 2px; padding: 16px 18px 12px; border-bottom: 1px solid var(--line-soft); }
.practice__head h3 { font: 600 24px/1.15 var(--font-display); }
.practice__head .meta { font-size: 13px; }
.practice__row { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 14px 18px; }
.practice__row + .practice__row { border-top: 1px solid var(--line-soft); }
.practice__ico { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); }
.practice__row h4 { font: 650 12px/1.3 var(--font-ui); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); }
.practice__row p { margin-top: 3px; font: 450 18.5px/1.45 var(--font-read); }
.practice__src { padding: 10px 18px 12px; font-size: 12.5px; color: var(--ink-3); background: var(--surface-2); border-top: 1px solid var(--line-soft); }

/* Conseil : une seule fois dans le rapport (chapitre « Ton remède »), repris en court sur la carte */
.advice { margin: 32px 0 8px; padding: 22px 20px 20px; border-radius: var(--r-md); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.advice h3 { display: flex; align-items: center; gap: 10px; font: 600 25px/1.15 var(--font-display); }
.advice h3 .ko-b { width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 6px; background: var(--seal); color: var(--on-seal); font-size: 16px; }
.advice__lead { margin-top: 10px; font: 450 19px/1.5 var(--font-read); }
.advice ol { margin-top: 14px; display: grid; gap: 12px; counter-reset: a; }
.advice li { counter-increment: a; display: grid; grid-template-columns: 30px 1fr; gap: 6px; font: 450 18.5px/1.45 var(--font-read); }
.advice li::before { content: counter(a) "."; font-style: italic; color: var(--accent-ink); font-size: 20px; }
.advice li b { display: block; font: 650 12px/1.4 var(--font-ui); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); }
.advice__note { margin-top: 14px; font-size: 12.5px; color: var(--ink-2); }

/* Fin de chapitre et chapitre suivant */
.chapter__end { margin-top: 36px; text-align: center; color: var(--accent-ink); font-size: 18px; letter-spacing: 0.5em; }
.next { margin-top: 22px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 16px 18px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--ink); }
.next:hover { background: var(--surface-2); }
.next .kicker { font-size: 11px; color: var(--ink-3); }
.next strong { display: block; margin-top: 4px; font: 600 22px/1.15 var(--font-display); }
.next .meta { margin-top: 2px; font-size: 12.5px; }
.next__arrow { width: 44px; height: 44px; border-radius: 50%; background: var(--accent-fill); display: grid; place-items: center; color: var(--ink-on-accent); }
.next__arrow .i { width: 20px; height: 20px; }

@media (min-width: 1024px) {
  .chapter { padding: 72px 0 36px; }
  .prose { font-size: 21px; line-height: 1.66; }
  .chapter__num { font-size: 112px; }
  .chapter__title { font-size: 46px; }
  .chapter__key { font-size: 26px; }
  .pull blockquote { font-size: 36px; }
  .pull { margin: 44px -40px 40px; padding: 4px 40px 22px; }
  /* notes de marge : le glossaire vit dans la marge droite */
  .has-side { position: relative; }
  .sidenote { display: block; position: absolute; top: 0.4em; left: calc(100% + 48px); width: 232px; font: 400 13.5px/1.5 var(--font-ui); color: var(--ink-2); padding-left: 14px; border-left: 2px solid var(--accent); }
  .sidenote b { display: block; font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 3px; }
  .gloss-pop { display: none !important; }
  .practice__row { grid-template-columns: 34px 92px 1fr; align-items: baseline; }
  .practice__row > div { display: contents; }
  .practice__row h4 { padding-top: 4px; }
  .practice__row p { margin-top: 0; }
  .practice__ico { align-self: start; }
}
