/* Lecteur éditorial partagé ; couleurs et focus hérités de lib/theme et lib/ui. */
* { box-sizing: border-box; }
body { margin: 0; background: var(--color-bg); color: var(--color-text); font-family: var(--font-family); line-height: 1.7; }
a { color: var(--color-accent); text-underline-offset: .22em; }
a:hover { color: var(--color-accent-hover); }
button { color: var(--color-text); background: var(--color-bg-secondary); border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: .45rem .8rem; cursor: pointer; min-height: 44px; }
.skip-link { position: absolute; top: .5rem; left: .5rem; transform: translateY(-180%); padding: .6rem 1rem; background: var(--color-bg-secondary); z-index: 20; }
.skip-link:focus { transform: none; }
.guide-header, .guide-footer { max-width: 1240px; margin: auto; padding: 1.25rem 2rem; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.guide-header { border-bottom: 1px solid var(--color-border); }
.guide-brand { font-weight: 750; font-size: 1.2rem; color: var(--color-text); text-decoration: none; }
.guide-brand span { font-weight: 400; color: var(--color-text-muted); font-size: .9rem; margin-left: .6rem; }
.guide-header nav { display: flex; align-items: center; flex-wrap: wrap; gap: .8rem 1.5rem; }
.guide-header nav a { display: inline-flex; align-items: center; min-height: 44px; font-size: .9rem; }
.reader-layout { max-width: 1240px; margin: 0 auto; padding: 2.5rem 2rem 4rem; display: grid; grid-template-columns: minmax(180px, 250px) minmax(0, 1fr); gap: 3rem; }
.reader-layout main { min-width: 0; }
.reader-home { display: block; max-width: 1120px; }
.reader-sidebar { min-width: 0; }
.reader-plan { position: sticky; top: 1.5rem; font-size: .875rem; }
.reader-plan summary, .guide-reference summary { cursor: pointer; font-weight: 650; min-height: 44px; padding: .6rem 0; }
.reader-plan ol { list-style: none; padding: 0; margin: .6rem 0; max-height: 75vh; overflow-y: auto; }
.reader-plan li { margin: .4rem 0; }
.reader-plan a { display: block; padding: .25rem .2rem; color: var(--color-text-muted); overflow-wrap: anywhere; }
.reader-plan .toc-depth-3 { padding-left: 1rem; }
.reader-breadcrumb { font-size: .85rem; color: var(--color-text-muted); margin-bottom: 1.8rem; overflow-wrap: anywhere; }
.guide-prose { max-width: 76ch; font-size: 1.05rem; overflow-wrap: anywhere; }
.guide-prose h1, .guide-intro h1 { line-height: 1.15; letter-spacing: -.035em; font-size: clamp(2rem, 4vw, 3.6rem); margin: 0 0 1.5rem; }
.guide-prose h2 { margin: 3rem 0 1rem; line-height: 1.35; font-size: 1.65rem; letter-spacing: -.02em; }
.guide-prose h3 { margin: 2rem 0 .8rem; line-height: 1.4; font-size: 1.2rem; }
.guide-prose h4 { margin-top: 1.8rem; }
.guide-prose :is(h1, h2, h3, h4, h5, h6) { scroll-margin-top: 1.5rem; }
.heading-anchor { display: inline-block; margin-left: .45em; font-size: .7em; font-weight: 400; opacity: .65; text-decoration: none; }
.guide-prose p, .guide-prose ul, .guide-prose ol { margin: 1rem 0 1.5rem; }
.guide-prose li { margin: .4rem 0; }
.guide-prose code { font-family: var(--font-mono); font-size: .85em; background: var(--color-bg-secondary); padding: .12em .3em; border-radius: 3px; }
.guide-prose pre { max-width: 100%; overflow-x: auto; padding: 1.2rem; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-bg-secondary); line-height: 1.6; }
.guide-prose pre code { padding: 0; white-space: pre; overflow-wrap: normal; }
.guide-prose blockquote { margin: 1.5rem 0; padding: .2rem 1.4rem; border-left: 3px solid var(--color-accent); color: var(--color-text-muted); }
.guide-prose img { display: block; max-width: 100%; height: auto; }
.guide-prose hr { border: 0; border-top: 1px solid var(--color-border); margin: 2rem 0; }
.table-scroll { max-width: 100%; overflow-x: auto; margin: 1.5rem 0; border: 1px solid var(--color-border); border-radius: var(--radius-sm); }
.table-scroll table { border-collapse: collapse; width: 100%; font-size: .9rem; }
.table-scroll th, .table-scroll td { padding: .75rem 1rem; border-bottom: 1px solid var(--color-border); text-align: left; min-width: 100px; }
.table-scroll th { background: var(--color-bg-secondary); }
.source-label { color: var(--color-text-muted); font-size: .8em; }
.guide-intro { max-width: 760px; padding: 1.5rem 0 3rem; }
.guide-eyebrow { font-size: .75rem; letter-spacing: .12em; font-weight: 700; color: var(--color-text-muted); }
.guide-intro > p:not(.guide-eyebrow) { font-size: 1.15rem; color: var(--color-text-muted); }
.guide-start { display: inline-block; font-weight: 650; padding: .75rem 0; }
.guide-intro .guide-learning { font-size: .95rem !important; }
.guide-group { padding: 2rem 0 3rem; border-top: 1px solid var(--color-border); }
.guide-group > h2 { font-size: 1.65rem; letter-spacing: -.02em; margin: 0 0 .35rem; line-height: 1.3; }
.guide-group > p { margin-top: 0; color: var(--color-text-muted); }
.guide-grid { padding: 0; margin: 1.8rem 0 0; list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.guide-grid li { min-width: 0; }
.guide-card { display: flex; flex-direction: column; height: 100%; padding: 1.5rem; border: 1px solid var(--color-border); border-radius: var(--radius-md); text-decoration: none; color: var(--color-text); background: var(--color-bg-secondary); }
.guide-card:hover { border-color: var(--color-accent); color: var(--color-text); }
.guide-card h3 { margin: 0; line-height: 1.4; font-size: 1.1rem; }
.guide-card p { font-size: .95rem; color: var(--color-text-muted); flex: 1; }
.guide-card > span { font-size: .85rem; color: var(--color-accent); font-weight: 600; }
.guide-reference { border-top: 1px solid var(--color-border); padding-top: 1rem; }
.guide-reference ul { columns: 2; padding-left: 1.3rem; }
.guide-reference li { margin-bottom: .5rem; break-inside: avoid; }
.guide-footer { border-top: 1px solid var(--color-border); font-size: .85rem; color: var(--color-text-muted); }
@media (max-width: 959px) {
  .reader-layout { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; padding-top: 1.5rem; }
  .reader-plan { position: static; border-bottom: 1px solid var(--color-border); padding-bottom: .5rem; }
  .reader-plan ol { max-height: none; }
  .guide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 540px) {
  .guide-header, .guide-footer { padding: 1rem; gap: .5rem; }
  .guide-brand span { display: none; }
  .guide-header nav { gap: .4rem .9rem; }
  .reader-layout { padding: 1.5rem 1rem 3rem; }
  .guide-grid { grid-template-columns: minmax(0, 1fr); }
  .guide-prose { font-size: 1rem; }
  .guide-prose pre { padding: .9rem; }
  .guide-prose h2 { font-size: 1.45rem; }
  .guide-reference ul { columns: 1; }
  .guide-card { padding: 1.25rem; }
}
