/* ==========================================================================
   WM Theme — Feuille de styles principale
   Structure : 1. Tokens  2. Reset  3. Base  4. Layout  5. Components
               6. Templates  7. Dark mode  8. Utilities  9. Print
   ========================================================================== */

/* ── 1. Design Tokens (valeurs par défaut, surchargées par PHP si ACF) ────── */
:root {
  /* Layout */
  --site-container-max-width: 1320px;
  --content-max-width: 760px;
  --archive-max-width: 1200px;
  --wide-block-max-width: 1100px;
  --section-spacing-mobile: 48px;
  --section-spacing-desktop: 80px;
  --grid-gap: 24px;
  --sticky-sidebar-offset: 96px;

  /* Typography */
  --font-family-base: 'Inter', system-ui, -apple-system, sans-serif;
  --font-family-headings: 'Inter', system-ui, -apple-system, sans-serif;
  --font-size-base: 17px;
  --font-size-base-mobile: 16px;
  --font-size-small: 14px;
  --font-size-h1: 40px;
  --font-size-h2: 30px;
  --font-size-h3: 22px;
  --line-height-body: 1.65;
  --line-height-headings: 1.2;
  --letter-spacing-headings: -0.01em;

  /* Shape */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --button-radius: 8px;
  --input-radius: 8px;
  --card-radius: 12px;
  --shadow-sm: 0 2px 8px rgba(15, 35, 65, .06);
  --shadow-md: 0 8px 24px rgba(15, 35, 65, .08);
  --shadow-lg: 0 12px 30px rgba(15, 35, 65, .10);

  /* Components */
  --button-padding-y: .625rem;
  --button-padding-x: 1.25rem;
  --input-padding-y: .625rem;
  --input-padding-x: .875rem;
  --card-padding: 1.5rem;
  --table-cell-padding: .75rem 1rem;
  --focus-ring-color: #1463C2;
  --focus-ring-width: 3px;
  --toc-width: 260px;

  /* Colors — Light mode (default) */
  --color-bg: #FAFCFE;
  --color-surface: #FFFFFF;
  --color-surface-alt: #F3F6FA;
  --color-text: #172033;
  --color-text-muted: #5C6B80;
  --color-border: #E4E9F0;
  --color-primary: #1463C2;
  --color-primary-hover: #0F4C99;
  --color-link: #1463C2;
  --color-link-hover: #0F4C99;
  --color-info-bg: #F3F8FF;
  --color-success: #15803D;
  --color-warning: #B45309;
  --color-danger: #B42318;
  --color-success-bg: #DCFCE7;
  --color-warning-bg: #FEF3C7;
  --color-danger-bg: #FEE4E2;

  /* Header */
  --header-height: 64px;
}

/* ── Dark mode ──────────────────────────────────────────────────────────── */
[data-theme="dark"] {
  --color-bg: #0B1120;
  --color-surface: #101827;
  --color-surface-alt: #182438;
  --color-text: #EAF2FF;
  --color-text-muted: #9FB0C8;
  --color-border: #2A3A54;
  --color-primary: #60A5FA;
  --color-primary-hover: #8BC4F6;
  --color-link: #60A5FA;
  --color-link-hover: #8BC4F6;
  --color-info-bg: #102C52;
  --color-success: #4ADE80;
  --color-warning: #FCD34D;
  --color-danger: #F87171;
  --color-success-bg: rgba(74, 222, 128, .1);
  --color-warning-bg: rgba(252, 211, 77, .1);
  --color-danger-bg: rgba(248, 113, 113, .1);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, .30);
  --shadow-lg: 0 12px 30px rgba(0, 0, 0, .35);
}

/* ── 2. Reset léger ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { font-size: var(--font-size-base-mobile); scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font-family-base); font-size: var(--font-size-base); line-height: var(--line-height-body); color: var(--color-text); background-color: var(--color-bg); -webkit-font-smoothing: antialiased; }

img, video, svg { max-width: 100%; display: block; }
img { height: auto; }
ul, ol { padding-left: 1.5em; margin: 0 0 1rem; }
p { margin: 0 0 1rem; }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-family-headings); line-height: var(--line-height-headings); letter-spacing: var(--letter-spacing-headings); color: var(--color-text); margin: 0 0 .75rem; }
a { color: var(--color-link); text-decoration: underline; text-underline-offset: 3px; transition: color .15s; }
a:hover { color: var(--color-link-hover); }
a:focus-visible { outline: var(--focus-ring-width) solid var(--focus-ring-color); outline-offset: 2px; border-radius: 2px; }
button { cursor: pointer; }
table { border-collapse: collapse; width: 100%; }

/* ── 3. Base typographique ──────────────────────────────────────────────── */
@media (min-width: 768px) {
  html { font-size: var(--font-size-base); }
}

h1 { font-size: clamp(28px, 5vw, var(--font-size-h1)); }
h2 { font-size: clamp(22px, 3.5vw, var(--font-size-h2)); }
h3 { font-size: clamp(19px, 2.5vw, var(--font-size-h3)); }

/* ── 4. Layout ──────────────────────────────────────────────────────────── */

.wm-container        { max-width: var(--site-container-max-width); margin-inline: auto; padding-inline: 1rem; }
.wm-container-wide   { max-width: var(--site-container-max-width); margin-inline: auto; padding-inline: 1.5rem; }
.wm-content-width    { max-width: var(--content-max-width); margin-inline: auto; }

@media (min-width: 768px) {
  .wm-container,
  .wm-container-wide { padding-inline: 2rem; }
}
@media (min-width: 1200px) {
  .wm-container-wide { padding-inline: 3rem; }
}

/* Accessibilité — Skip link */
.wm-skip-link { position: absolute; top: -100px; left: 1rem; z-index: 9999; padding: .5rem 1rem; background: var(--color-primary); color: #fff; border-radius: var(--radius-sm); text-decoration: none; transition: top .2s; }
.wm-skip-link:focus { top: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ── 5. Header ──────────────────────────────────────────────────────────── */

.wm-header { position: sticky; top: 0; z-index: 100; background: var(--color-surface); border-bottom: 1px solid var(--color-border); height: var(--header-height); }
.wm-header__inner { display: flex; align-items: center; gap: 1rem; height: 100%; }
.wm-header__brand { flex-shrink: 0; }
.wm-header__site-name { font-weight: 700; font-size: 1.125rem; color: var(--color-text); text-decoration: none; }
.wm-header__brand a { text-decoration: none; color: var(--color-text); }
.wm-nav { display: none; }
.wm-header__actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.wm-header__search-btn,
.wm-header__burger { background: none; border: none; padding: .5rem; color: var(--color-text); border-radius: var(--radius-sm); }
.wm-header__search-btn:hover,
.wm-header__burger:hover { background: var(--color-surface-alt); }
.wm-header__burger-bar { display: block; width: 22px; height: 2px; background: currentColor; margin: 4px 0; border-radius: 2px; transition: transform .2s, opacity .2s; }
@media (min-width: 992px) {
  .wm-nav { display: block; }
  .wm-nav__list { list-style: none; display: flex; gap: .25rem; padding: 0; margin: 0; }
  .wm-nav__list a { padding: .375rem .75rem; border-radius: var(--radius-sm); text-decoration: none; font-size: .9375rem; font-weight: 500; color: var(--color-text); transition: background .15s, color .15s; }
  .wm-nav__list a:hover { background: var(--color-surface-alt); color: var(--color-primary); }
  .wm-header__burger { display: none; }
}

/* Search overlay */
.wm-search-overlay { background: var(--color-surface); border-bottom: 1px solid var(--color-border); padding: 1rem 0; }
.wm-search-overlay__inner { display: flex; gap: 1rem; align-items: center; }
.wm-search-overlay__close { background: none; border: none; padding: .5rem; color: var(--color-text-muted); border-radius: var(--radius-sm); }

/* Mobile menu */
.wm-mobile-menu { background: var(--color-surface); border-top: 1px solid var(--color-border); padding: 1rem; }
.wm-mobile-menu__list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .25rem; }
.wm-mobile-menu__list a { display: block; padding: .625rem .75rem; border-radius: var(--radius-sm); text-decoration: none; color: var(--color-text); font-weight: 500; }
.wm-mobile-menu__list a:hover { background: var(--color-surface-alt); }

/* ── 5b. Footer ─────────────────────────────────────────────────────────── */

.wm-footer { border-top: 1px solid var(--color-border); background: var(--color-surface); margin-top: var(--section-spacing-mobile); padding: 3rem 0 1.5rem; }
.wm-footer__top { display: flex; flex-wrap: wrap; gap: 2rem; margin-bottom: 2rem; }
.wm-footer__brand { flex: 1 1 200px; }
.wm-footer__logo { font-weight: 700; font-size: 1.125rem; text-decoration: none; color: var(--color-text); display: inline-block; margin-bottom: .5rem; }
.wm-footer__desc { color: var(--color-text-muted); font-size: var(--font-size-small); }
.wm-footer__nav { flex: 1 1 200px; }
.wm-footer__nav-list { list-style: none; padding: 0; margin: 0; }
.wm-footer__nav-list li + li { margin-top: .375rem; }
.wm-footer__nav-list a { color: var(--color-text-muted); text-decoration: none; font-size: .9375rem; }
.wm-footer__nav-list a:hover { color: var(--color-link); }
.wm-footer__social { display: flex; gap: .5rem; align-items: center; }
.wm-footer__social-link { color: var(--color-text-muted); padding: .375rem; border-radius: var(--radius-sm); transition: color .15s; }
.wm-footer__social-link:hover { color: var(--color-primary); }
.wm-footer__bottom { border-top: 1px solid var(--color-border); padding-top: 1.25rem; }
.wm-footer__copy { color: var(--color-text-muted); font-size: var(--font-size-small); margin: 0; }

@media (min-width: 992px) {
  .wm-footer { margin-top: var(--section-spacing-desktop); }
}

/* ── 6. Boutons ─────────────────────────────────────────────────────────── */

.wm-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: var(--button-padding-y) var(--button-padding-x);
  border-radius: var(--button-radius);
  font-size: .9375rem; font-weight: 600; line-height: 1.4;
  text-decoration: none; border: 2px solid transparent;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
  cursor: pointer;
}
.wm-btn:focus-visible { outline: var(--focus-ring-width) solid var(--focus-ring-color); outline-offset: 2px; }
.wm-btn--primary  { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.wm-btn--primary:hover  { background: var(--color-primary-hover); border-color: var(--color-primary-hover); color: #fff; }
.wm-btn--secondary { background: transparent; color: var(--color-primary); border-color: var(--color-primary); }
.wm-btn--secondary:hover { background: var(--color-info-bg); }
.wm-btn--ghost { background: transparent; color: var(--color-text-muted); border-color: var(--color-border); }
.wm-btn--ghost:hover { background: var(--color-surface-alt); color: var(--color-text); }
.wm-btn--lg { padding: .875rem 1.75rem; font-size: 1rem; }

/* ── 7. Badges ──────────────────────────────────────────────────────────── */

.wm-badge {
  display: inline-flex; align-items: center;
  padding: .2rem .625rem;
  font-size: 12px; font-weight: 600;
  border-radius: 99px;
  text-decoration: none;
  transition: filter .15s;
  white-space: nowrap;
}
.wm-badge:hover { filter: brightness(.9); }
.wm-badge--univers { background: #EAF3FF; color: #0F4C99; }
.wm-badge--niveau  { background: var(--color-surface-alt); color: var(--color-text-muted); }
.wm-badge--format_intention { background: #F0FDF4; color: #15803D; }
[data-theme="dark"] .wm-badge--univers { background: #102C52; color: #8BC4F6; }
[data-theme="dark"] .wm-badge--niveau  { background: var(--color-surface-alt); color: var(--color-text-muted); }
[data-theme="dark"] .wm-badge--format_intention { background: rgba(74,222,128,.1); color: #4ADE80; }

/* ── 8. Carte définition ─────────────────────────────────────────────────── */

.wm-card-def {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--card-radius);
  padding: var(--card-padding);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, transform .2s, border-color .2s;
}
.wm-card-def:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--color-primary); }
.wm-card-def__link { display: flex; flex-direction: column; gap: .625rem; text-decoration: none; color: inherit; }
.wm-card-def__title { font-size: 1rem; font-weight: 700; margin: 0; color: var(--color-text); }
.wm-card-def__acronym { font-weight: 500; color: var(--color-primary); font-size: .875rem; margin-left: .375rem; }
.wm-card-def__summary { font-size: var(--font-size-small); color: var(--color-text-muted); margin: 0; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wm-card-def__footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .375rem; margin-top: auto; padding-top: .75rem; border-top: 1px solid var(--color-border); }
.wm-card-def__badges { display: flex; flex-wrap: wrap; gap: .25rem; }
.wm-card-def__date { font-size: 12px; color: var(--color-text-muted); }

.wm-cards-grid { display: grid; grid-template-columns: 1fr; gap: var(--grid-gap); }
@media (min-width: 576px) { .wm-cards-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .wm-cards-grid { grid-template-columns: repeat(3, 1fr); } }
.wm-cards-grid--compact { grid-template-columns: 1fr; }
@media (min-width: 576px) { .wm-cards-grid--compact { grid-template-columns: repeat(2, 1fr); } }

/* ── 9. Breadcrumb ──────────────────────────────────────────────────────── */

.wm-breadcrumb { margin-bottom: 1.25rem; }
.wm-breadcrumb__list { display: flex; flex-wrap: wrap; gap: .25rem; list-style: none; padding: 0; margin: 0; font-size: var(--font-size-small); }
.wm-breadcrumb__link { color: var(--color-text-muted); text-decoration: none; }
.wm-breadcrumb__link:hover { color: var(--color-link); text-decoration: underline; }
.wm-breadcrumb__current { color: var(--color-text); font-weight: 500; }
.wm-breadcrumb__sep { color: var(--color-text-muted); user-select: none; }

/* ── 10. Page définition — Layout ──────────────────────────────────────── */

.wm-single-definition { padding-block: 2rem var(--section-spacing-mobile); }
.wm-single-definition__layout { display: grid; grid-template-columns: 1fr; gap: 2.5rem; }
@media (min-width: 1024px) {
  .wm-single-definition__layout {
    grid-template-columns: minmax(0, 1fr) var(--toc-width);
    gap: 3rem;
    align-items: start;
  }
  .wm-single-definition__main { min-width: 0; }
  .wm-toc-mobile { display: none; }
}
@media (max-width: 1023px) {
  .wm-single-definition__sidebar { display: none; }
}

.wm-sidebar-sticky { position: sticky; top: calc(var(--header-height) + var(--sticky-sidebar-offset)); display: flex; flex-direction: column; gap: 1.5rem; }

/* ── 11. Hero définition ────────────────────────────────────────────────── */

.wm-def-hero { margin-bottom: 2rem; }
.wm-def-hero__badges { display: flex; flex-wrap: wrap; gap: .375rem; margin-bottom: .875rem; }
.wm-def-hero__title { font-size: clamp(26px, 4vw, 44px); font-weight: 800; margin: 0 0 .5rem; }
.wm-def-hero__acronym { font-size: .65em; color: var(--color-text-muted); font-weight: 500; }
.wm-def-hero__intro { color: var(--color-text-muted); font-size: 1.0625rem; margin-bottom: 1rem; }
.wm-def-hero__meta { display: flex; flex-wrap: wrap; gap: 1rem; font-size: var(--font-size-small); color: var(--color-text-muted); margin-top: .75rem; }
.wm-def-hero__meta-item { display: flex; align-items: center; gap: .375rem; }

/* ── 12. Définition courte ──────────────────────────────────────────────── */

.wm-def-short { background: var(--color-info-bg); border-left: 4px solid var(--color-primary); border-radius: 0 var(--radius-md) var(--radius-md) 0; padding: 1.25rem 1.5rem; margin-bottom: 2rem; }
.wm-def-short__text { font-size: 1.0625rem; line-height: 1.65; color: var(--color-text); margin: 0; font-weight: 500; }

/* ── 13. Sections éditoriaux ────────────────────────────────────────────── */

.wm-section { margin-bottom: var(--section-spacing-mobile); }
@media (min-width: 992px) { .wm-section { margin-bottom: var(--section-spacing-desktop); } }
.wm-section-title { font-size: clamp(20px, 2.5vw, var(--font-size-h2)); font-weight: 700; margin: 0 0 1.25rem; padding-bottom: .625rem; border-bottom: 2px solid var(--color-border); }
.wm-section-intro { color: var(--color-text-muted); margin-bottom: 1.25rem; }

/* Prose */
.wm-prose { max-width: var(--content-max-width); }
.wm-prose h2 { font-size: clamp(20px, 2.5vw, var(--font-size-h2)); margin: 1.75rem 0 .875rem; }
.wm-prose h3 { font-size: clamp(17px, 2vw, var(--font-size-h3)); margin: 1.5rem 0 .75rem; }
.wm-prose p  { margin: 0 0 1rem; }
.wm-prose ul, .wm-prose ol { margin: 0 0 1rem; padding-left: 1.5em; }
.wm-prose li + li { margin-top: .375rem; }
.wm-prose strong { font-weight: 700; color: var(--color-text); }
.wm-prose a { color: var(--color-link); }
.wm-prose a:hover { color: var(--color-link-hover); }
.wm-prose-lead { font-size: 1.0625rem; }

/* ── 14. Callouts ───────────────────────────────────────────────────────── */

.wm-callout {
  border-radius: var(--radius-md);
  padding: 1.125rem 1.25rem;
  margin-bottom: 1.5rem;
  border: 1px solid transparent;
}
.wm-callout__header { display: flex; align-items: center; gap: .5rem; margin-bottom: .625rem; }
.wm-callout__title  { font-weight: 700; font-size: .9375rem; }
.wm-callout--info    { background: var(--color-info-bg); border-color: var(--color-primary); }
.wm-callout--retenir { background: #FFFBEB; border-color: #F59E0B; }
.wm-callout--success { background: var(--color-success-bg); border-color: var(--color-success); }
.wm-callout--warning { background: var(--color-warning-bg); border-color: var(--color-warning); }
.wm-callout--danger  { background: var(--color-danger-bg); border-color: var(--color-danger); }
[data-theme="dark"] .wm-callout--retenir { background: rgba(245,158,11,.1); border-color: #F59E0B; }

/* ── 15. Lists ──────────────────────────────────────────────────────────── */

.wm-list { padding-left: 1.5em; margin: 0 0 1rem; }
.wm-list li + li { margin-top: .375rem; }
.wm-list--check { list-style: none; padding-left: 0; }
.wm-list--check li { padding-left: 1.75em; position: relative; }
.wm-list--check li::before { content: '✓'; position: absolute; left: 0; color: var(--color-success); font-weight: 700; }
.wm-list--arrow { list-style: none; padding-left: 0; }
.wm-list--arrow li { padding-left: 1.5em; position: relative; }
.wm-list--arrow li::before { content: '→'; position: absolute; left: 0; color: var(--color-primary); }

/* ── 16. FAQ Accordion ──────────────────────────────────────────────────── */

.wm-faq { display: flex; flex-direction: column; gap: .5rem; }
.wm-faq__item { border: 1px solid var(--color-border); border-radius: var(--radius-md); overflow: hidden; }
.wm-faq__question {
  width: 100%; background: var(--color-surface); border: none;
  padding: 1rem 1.25rem; display: flex; justify-content: space-between; align-items: center;
  font-size: 1rem; font-weight: 600; color: var(--color-text); text-align: left;
  cursor: pointer; transition: background .15s;
}
.wm-faq__question:hover { background: var(--color-surface-alt); }
.wm-faq__question[aria-expanded="true"] { background: var(--color-surface-alt); }
.wm-faq__chevron { width: 16px; height: 16px; flex-shrink: 0; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .2s; margin-left: 1rem; }
.wm-faq__question[aria-expanded="true"] .wm-faq__chevron { transform: rotate(-135deg); }
.wm-faq__answer { padding: 0 1.25rem 1.125rem; background: var(--color-surface-alt); }
.wm-faq__answer[hidden] { display: none; }

/* ── 17. Exemple block ──────────────────────────────────────────────────── */

.wm-example-block { border: 1px solid var(--color-border); border-radius: var(--radius-md); overflow: hidden; }
.wm-example-block__step { padding: 1rem 1.25rem; border-bottom: 1px solid var(--color-border); }
.wm-example-block__step:last-child { border-bottom: 0; }
.wm-example-block__label { display: inline-block; font-size: var(--font-size-small); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--color-primary); margin-bottom: .375rem; }
.wm-example-block__takeaway { border-radius: 0; border: none; border-top: 1px solid var(--color-border); }

/* ── 18. Insights / Ce qu'il faut savoir ───────────────────────────────── */

.wm-insight-list { display: flex; flex-direction: column; gap: 1rem; }
.wm-insight-item { border-left: 3px solid var(--color-primary); padding: .75rem 1rem; background: var(--color-surface-alt); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.wm-insight-item__title { font-weight: 700; font-size: .9375rem; margin: 0 0 .375rem; color: var(--color-text); }
.wm-insight-item__text { font-size: var(--font-size-small); color: var(--color-text-muted); margin: 0; }

/* ── 19. Erreurs fréquentes ─────────────────────────────────────────────── */

.wm-mistakes-list { display: flex; flex-direction: column; gap: .75rem; }
.wm-mistake-item { background: var(--color-danger-bg); border: 1px solid var(--color-danger); border-radius: var(--radius-md); padding: 1rem 1.25rem; }
.wm-mistake-item__header { display: flex; align-items: center; gap: .5rem; margin-bottom: .375rem; }
.wm-mistake-item__icon { color: var(--color-danger); flex-shrink: 0; }
.wm-mistake-item__title { font-weight: 700; font-size: .9375rem; margin: 0; color: var(--color-text); }
.wm-mistake-item__text { font-size: var(--font-size-small); color: var(--color-text-muted); margin: 0; }

/* ── 20. Métriques ──────────────────────────────────────────────────────── */

.wm-metrics-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 576px) { .wm-metrics-grid { grid-template-columns: repeat(2, 1fr); } }
.wm-metric-item { background: var(--color-surface-alt); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 1rem; }
.wm-metric-item__name { display: block; font-weight: 700; color: var(--color-primary); margin-bottom: .375rem; }
.wm-metric-item__desc { font-size: var(--font-size-small); color: var(--color-text-muted); margin: 0; }

/* ── 21. Différences ────────────────────────────────────────────────────── */

.wm-differences-list { display: flex; flex-direction: column; gap: .75rem; }
.wm-differences-item { padding: 1rem; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); }
.wm-differences-item__term { font-weight: 700; font-size: .9375rem; color: var(--color-primary); margin-bottom: .375rem; display: block; }
.wm-differences-item__text { color: var(--color-text-muted); font-size: var(--font-size-small); margin: 0; }

/* ── 22. Resources ──────────────────────────────────────────────────────── */

.wm-resources-tips, .wm-resources-tools, .wm-resources-external { margin-bottom: 1.5rem; }
.wm-resources-tips__title, .wm-resources-tools__title, .wm-resources-external__title { font-size: 1rem; font-weight: 700; margin: 0 0 .875rem; }
.wm-tools-grid { display: grid; grid-template-columns: 1fr; gap: .75rem; }
@media (min-width: 576px) { .wm-tools-grid { grid-template-columns: repeat(2, 1fr); } }
.wm-tool-card { display: flex; gap: .75rem; align-items: flex-start; padding: 1rem; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); }
.wm-tool-card__logo { width: 40px; height: 40px; object-fit: contain; border-radius: var(--radius-sm); flex-shrink: 0; }
.wm-tool-card__name { display: block; font-weight: 700; font-size: .9375rem; margin-bottom: .25rem; color: var(--color-text); }
.wm-tool-card__desc { font-size: var(--font-size-small); color: var(--color-text-muted); margin: 0 0 .5rem; }
.wm-tool-card__link { font-size: var(--font-size-small); color: var(--color-link); text-decoration: none; font-weight: 600; }
.wm-resources-list { list-style: none; padding: 0; margin: 0; }
.wm-resources-list__item { display: flex; align-items: baseline; gap: .5rem; padding: .625rem 0; border-bottom: 1px solid var(--color-border); }
.wm-resources-list__item:last-child { border-bottom: 0; }
.wm-resources-list__link { font-weight: 600; color: var(--color-link); }
.wm-resources-list__note { font-size: var(--font-size-small); color: var(--color-text-muted); }

/* ── 23. Termes liés ────────────────────────────────────────────────────── */

.wm-confused-block { background: var(--color-surface-alt); border-radius: var(--radius-md); padding: 1.25rem; margin-top: 1.5rem; }
.wm-confused-block__title { display: flex; align-items: center; gap: .5rem; font-size: .9375rem; font-weight: 700; margin: 0 0 .75rem; }
.wm-confused-block__list { display: flex; flex-wrap: wrap; gap: .5rem; }
.wm-confused-block__link { padding: .375rem .875rem; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 99px; font-size: var(--font-size-small); font-weight: 600; color: var(--color-text); text-decoration: none; transition: border-color .15s, color .15s; }
.wm-confused-block__link:hover { border-color: var(--color-primary); color: var(--color-link); }
.wm-confused-block__acronym { font-weight: 400; color: var(--color-text-muted); }

/* ── 24. CTA block ──────────────────────────────────────────────────────── */

.wm-cta-block { background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-hover) 100%); color: #fff; border-radius: var(--radius-lg); padding: 2rem; text-align: center; }
.wm-cta-block__title { font-size: clamp(20px, 2.5vw, 26px); font-weight: 800; margin: 0 0 .75rem; color: #fff; }
.wm-cta-block__text { color: rgba(255,255,255,.85); margin-bottom: 1.25rem; }
.wm-cta-block .wm-btn--primary { background: #fff; color: var(--color-primary); border-color: #fff; }
.wm-cta-block .wm-btn--primary:hover { background: #f0f8ff; }

.wm-cta-card { background: var(--color-info-bg); border: 1px solid var(--color-primary); border-radius: var(--radius-md); padding: 1.25rem; text-align: center; }
.wm-cta-card__title { font-weight: 700; font-size: .9375rem; margin: 0 0 .375rem; }
.wm-cta-card__text { font-size: var(--font-size-small); color: var(--color-text-muted); margin: 0 0 .875rem; }

/* ── 25. TOC ────────────────────────────────────────────────────────────── */

.wm-toc { background: var(--color-surface-alt); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 1rem; }
.wm-toc__toggle { width: 100%; background: none; border: none; display: flex; justify-content: space-between; align-items: center; padding: 0 0 .625rem; font-weight: 700; font-size: .9375rem; color: var(--color-text); cursor: pointer; }
.wm-toc__chevron { width: 12px; height: 12px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .2s; }
.wm-toc__toggle[aria-expanded="false"] .wm-toc__chevron { transform: rotate(-45deg); }
.wm-toc__list { list-style: none; padding: 0; margin: .5rem 0 0; border-top: 1px solid var(--color-border); padding-top: .625rem; display: flex; flex-direction: column; gap: .375rem; }
.wm-toc__list a { font-size: var(--font-size-small); color: var(--color-text-muted); text-decoration: none; display: block; padding: .25rem .5rem; border-radius: var(--radius-sm); transition: background .15s, color .15s; line-height: 1.4; }
.wm-toc__list a:hover,
.wm-toc__list a.is-active { color: var(--color-link); background: var(--color-info-bg); }
.wm-toc__list li.is-active > a { color: var(--color-link); font-weight: 600; }

/* ── 26. Sidebar méta ───────────────────────────────────────────────────── */

.wm-sidebar-meta { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 1rem; }
.wm-sidebar-meta__row { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .5rem 0; border-bottom: 1px solid var(--color-border); font-size: var(--font-size-small); }
.wm-sidebar-meta__row:last-child { border-bottom: 0; padding-bottom: 0; }
.wm-sidebar-meta__label { color: var(--color-text-muted); }
.wm-sidebar-meta__value { font-weight: 600; text-align: right; }

/* ── 27. Theme toggle ───────────────────────────────────────────────────── */

.wm-theme-toggle {
  background: none; border: 1px solid var(--color-border);
  width: 38px; height: 38px;
  border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center;
  color: var(--color-text-muted); cursor: pointer; transition: background .15s, border-color .15s;
}
.wm-theme-toggle:hover { background: var(--color-surface-alt); border-color: var(--color-primary); color: var(--color-primary); }
.wm-theme-toggle:focus-visible { outline: var(--focus-ring-width) solid var(--focus-ring-color); }
[data-theme="light"] .wm-theme-toggle__icon--light,
[data-theme="dark"]  .wm-theme-toggle__icon--dark { display: none; }

/* ── 28. Search bar ─────────────────────────────────────────────────────── */

.wm-search-bar__form { width: 100%; }
.wm-search-bar__field { position: relative; display: flex; }
.wm-search-bar__input {
  width: 100%; padding: var(--input-padding-y) 3rem var(--input-padding-y) var(--input-padding-x);
  border: 1px solid var(--color-border); border-radius: var(--input-radius);
  background: var(--color-surface); color: var(--color-text);
  font-size: 1rem; font-family: var(--font-family-base);
  transition: border-color .15s, box-shadow .15s;
}
.wm-search-bar__input:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 var(--focus-ring-width) rgba(20,99,194,.15); }
.wm-search-bar__submit { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--color-text-muted); padding: .375rem; display: flex; align-items: center; }
.wm-search-bar__submit:hover { color: var(--color-primary); }
.wm-search-bar__suggestions { position: absolute; top: 100%; left: 0; right: 0; z-index: 200; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); box-shadow: var(--shadow-md); margin-top: .25rem; max-height: 360px; overflow-y: auto; list-style: none; padding: .375rem; }
.wm-search-bar__suggestions li a { display: flex; flex-direction: column; gap: .125rem; padding: .625rem .875rem; border-radius: var(--radius-sm); text-decoration: none; color: var(--color-text); transition: background .15s; }
.wm-search-bar__suggestions li a:hover { background: var(--color-surface-alt); color: var(--color-link); }
.wm-search-bar__suggestions .wm-suggestion-label { font-weight: 600; font-size: .9375rem; }
.wm-search-bar__suggestions .wm-suggestion-type { font-size: 12px; color: var(--color-text-muted); }

/* ── 29. Archive controls ───────────────────────────────────────────────── */

.wm-archive-header { text-align: center; padding-block: 2.5rem; }
.wm-archive-header__title { margin-bottom: .875rem; }
.wm-archive-header__desc { color: var(--color-text-muted); max-width: 60ch; margin-inline: auto; margin-bottom: 1.5rem; }
.wm-archive-controls { margin-bottom: 2rem; }
.wm-archive-filters { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.wm-archive-filters__select { padding: var(--input-padding-y) var(--input-padding-x); border: 1px solid var(--color-border); border-radius: var(--input-radius); background: var(--color-surface); color: var(--color-text); font-size: .9375rem; cursor: pointer; }
.wm-archive-filters__reset { font-size: var(--font-size-small); color: var(--color-text-muted); text-decoration: underline; cursor: pointer; background: none; border: none; }

/* ── 30. Pagination ─────────────────────────────────────────────────────── */

.wm-pagination { display: flex; justify-content: center; gap: .5rem; flex-wrap: wrap; margin-top: 3rem; }
.wm-pagination a,
.wm-pagination span { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px; padding: 0 .75rem; border: 1px solid var(--color-border); border-radius: var(--radius-sm); font-size: .9375rem; text-decoration: none; color: var(--color-text); background: var(--color-surface); transition: background .15s, color .15s, border-color .15s; }
.wm-pagination a:hover { background: var(--color-surface-alt); border-color: var(--color-primary); color: var(--color-primary); }
.wm-pagination .current { background: var(--color-primary); color: #fff; border-color: var(--color-primary); font-weight: 700; }

/* ── 31. Univers hero ───────────────────────────────────────────────────── */

.wm-univers-hero { text-align: center; padding-block: 2.5rem 2rem; }
.wm-univers-hero__badge { font-size: var(--font-size-small); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .5rem; }
.wm-univers-hero__title { margin-bottom: .875rem; }
.wm-univers-hero__desc { color: var(--color-text-muted); max-width: 55ch; margin-inline: auto; margin-bottom: .875rem; }
.wm-univers-hero__count { font-size: var(--font-size-small); color: var(--color-text-muted); margin-bottom: 1.5rem; }

/* ── 32. Glossaire ──────────────────────────────────────────────────────── */

.wm-glossaire { padding-block: 2rem var(--section-spacing-mobile); }
.wm-glossaire-header { text-align: center; margin-bottom: 2rem; }
.wm-glossaire-header__title { margin-bottom: .875rem; }
.wm-glossaire-header__desc { color: var(--color-text-muted); max-width: 60ch; margin-inline: auto; }
.wm-glossaire-controls { margin-bottom: 2rem; display: flex; flex-direction: column; gap: 1rem; }
.wm-glossaire-search { display: flex; flex-direction: column; gap: .75rem; }
.wm-glossaire-filters { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.wm-glossaire-filters__select { padding: var(--input-padding-y) var(--input-padding-x); border: 1px solid var(--color-border); border-radius: var(--input-radius); background: var(--color-surface); color: var(--color-text); font-size: .9375rem; }
.wm-glossaire-filters__reset { font-size: var(--font-size-small); color: var(--color-text-muted); text-decoration: underline; background: none; border: none; cursor: pointer; }

/* Barre A-Z */
.wm-alpha-bar { margin-bottom: 2rem; }
.wm-alpha-bar__inner { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: .25rem; padding-bottom: .5rem; scrollbar-width: none; }
.wm-alpha-bar__inner::-webkit-scrollbar { display: none; }
.wm-alpha-bar__letter { display: flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; border-radius: var(--radius-sm); font-size: .9375rem; font-weight: 600; text-decoration: none; flex-shrink: 0; transition: background .15s, color .15s; }
.wm-alpha-bar__letter--active { color: var(--color-link); background: var(--color-info-bg); }
.wm-alpha-bar__letter--active:hover { background: var(--color-primary); color: #fff; }
.wm-alpha-bar__letter--empty { color: var(--color-text-muted); opacity: .4; cursor: default; }

/* Sections glossaire */
.wm-glossaire-section { margin-bottom: 2.5rem; }
.wm-glossaire-section__letter { font-size: 1.5rem; font-weight: 800; color: var(--color-primary); margin: 0 0 .875rem; padding-bottom: .5rem; border-bottom: 2px solid var(--color-border); scroll-margin-top: calc(var(--header-height) + 1.5rem); }
.wm-glossaire-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .5rem; }
.wm-glossaire-entry { border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); transition: box-shadow .15s, border-color .15s; }
.wm-glossaire-entry:hover { box-shadow: var(--shadow-sm); border-color: var(--color-primary); }
.wm-glossaire-entry__link { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 1rem; padding: .875rem 1rem; text-decoration: none; color: inherit; align-items: start; }
.wm-glossaire-entry__label { font-weight: 700; font-size: .9375rem; color: var(--color-text); grid-row: 1; grid-column: 1 / -1; margin-bottom: .25rem; }
.wm-glossaire-entry__acronym { color: var(--color-text-muted); font-weight: 400; margin-left: .25rem; }
.wm-glossaire-entry__micro { font-size: var(--font-size-small); color: var(--color-text-muted); line-height: 1.5; }
.wm-glossaire-entry__badges { padding: 0 1rem .75rem; display: flex; flex-wrap: wrap; gap: .25rem; }

/* ── 33. Navigation adjacente ───────────────────────────────────────────── */

.wm-adjacent-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3rem; border-top: 1px solid var(--color-border); padding-top: 2rem; }
.wm-adjacent-nav__item { display: flex; flex-direction: column; gap: .25rem; padding: 1rem; border: 1px solid var(--color-border); border-radius: var(--radius-md); text-decoration: none; color: inherit; transition: border-color .15s, background .15s; background: var(--color-surface); }
.wm-adjacent-nav__item:hover { border-color: var(--color-primary); background: var(--color-info-bg); }
.wm-adjacent-nav__item--disabled { opacity: .3; pointer-events: none; }
.wm-adjacent-nav__item--next { text-align: right; }
.wm-adjacent-nav__dir { font-size: var(--font-size-small); color: var(--color-text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.wm-adjacent-nav__label { font-weight: 700; color: var(--color-text); font-size: .9375rem; }

/* ── 34. Comparatif ─────────────────────────────────────────────────────── */

.wm-comparatif-header { margin-bottom: 2rem; }
.wm-comparatif-header__vs { display: flex; align-items: center; gap: 1rem; font-size: 1.25rem; font-weight: 700; margin-top: .75rem; flex-wrap: wrap; }
.wm-comparatif-header__sep { color: var(--color-text-muted); font-size: .875em; }
.wm-table-responsive { overflow-x: auto; }
.wm-table { border-collapse: collapse; width: 100%; }
.wm-table th, .wm-table td { padding: var(--table-cell-padding); border: 1px solid var(--color-border); text-align: left; font-size: .9375rem; }
.wm-table th { background: var(--color-surface-alt); font-weight: 700; color: var(--color-text); }
.wm-table tbody tr:nth-child(even) { background: var(--color-surface-alt); }
.wm-comparatif-table__criterion { font-weight: 700; background: var(--color-surface-alt) !important; }

/* ── 35. Empty state ────────────────────────────────────────────────────── */

.wm-empty-state { text-align: center; padding: 3rem 1rem; color: var(--color-text-muted); }
.wm-empty-state .wm-btn { margin-top: 1rem; }

/* ── 36. Icons ──────────────────────────────────────────────────────────── */

.wm-icon { display: inline-block; width: 20px; height: 20px; }
.wm-icon--sm { width: 16px; height: 16px; }
.wm-icon--lg { width: 24px; height: 24px; }

/* ── 37. Use cases ──────────────────────────────────────────────────────── */

.wm-use-case-list { display: flex; flex-direction: column; gap: .75rem; }
.wm-use-case-item { background: var(--color-surface-alt); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 1rem 1.25rem; }
.wm-use-case-item__title { font-weight: 700; font-size: .9375rem; margin: 0 0 .375rem; }

/* ── 38. Homepage ───────────────────────────────────────────────────────── */

/* Layout commun sections */
.wm-homepage { --section-gap: var(--section-spacing-desktop, 80px); }

.wm-hp-section { padding: var(--section-gap) 0; }
.wm-hp-section + .wm-hp-section { border-top: 1px solid var(--color-border); }

/* Entêtes de sections */
.wm-hp-section__header { margin-bottom: 2rem; }
.wm-hp-section__header--row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.wm-hp-section__title { font-size: var(--font-size-h2); font-weight: 800; line-height: var(--line-height-headings); color: var(--color-text); margin: 0 0 .5rem; }
.wm-hp-section__lead { color: var(--color-text-muted); font-size: 1rem; margin: .25rem 0 0; max-width: 640px; }
.wm-hp-section__link-all { display: inline-flex; align-items: center; gap: .35rem; font-size: .875rem; font-weight: 600; color: var(--color-primary); text-decoration: none; white-space: nowrap; }
.wm-hp-section__link-all:hover { text-decoration: underline; }

/* Container étroit (éditorial) */
.wm-container--narrow { max-width: 720px; margin-left: auto; margin-right: auto; padding-left: 1rem; padding-right: 1rem; }

/* ── Hero ── */
.wm-hp-hero { background: var(--color-surface); padding: 72px 0 60px; }
.wm-hp-hero__content { max-width: 680px; }
.wm-hp-hero__title { font-size: clamp(2rem, 4vw + .5rem, 3rem); font-weight: 900; line-height: 1.1; letter-spacing: -.02em; color: var(--color-text); margin: 0 0 1rem; }
.wm-hp-hero__text { font-size: 1.125rem; color: var(--color-text-muted); line-height: 1.6; margin: 0 0 2rem; max-width: 540px; }

/* Barre de recherche hero */
.wm-search-field--hero { max-width: 520px; }
.wm-search-field--hero .wm-search-field__input { font-size: 1rem; padding: .75rem 3rem .75rem 1rem; height: 52px; }
.wm-search-field--hero .wm-search-field__btn { height: 52px; width: 52px; }

.wm-hp-hero__cta { margin-top: 1.5rem; }

/* Stats rapides */
.wm-hp-hero__stats { list-style: none; margin: 2.5rem 0 0; padding: 0; display: flex; gap: 2.5rem; flex-wrap: wrap; }
.wm-hp-hero__stat { display: flex; flex-direction: column; gap: .125rem; }
.wm-hp-hero__stat-value { font-size: 1.5rem; font-weight: 800; color: var(--color-primary); }
.wm-hp-hero__stat-label { font-size: .8125rem; color: var(--color-text-muted); font-weight: 500; }

/* ── Univers ── */
.wm-hp-univers { background: var(--color-surface-alt); }
.wm-univers-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; }
.wm-univers-card { height: 100%; }
.wm-univers-card__link { display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; padding: 1.25rem; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--card-radius); text-decoration: none; color: inherit; height: 100%; transition: border-color .15s, box-shadow .15s, transform .15s; }
.wm-univers-card__link:hover { border-color: var(--color-primary); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.wm-univers-card__icon { font-size: 1.5rem; line-height: 1; }
.wm-univers-card__name { font-weight: 700; font-size: .9375rem; color: var(--color-text); }
.wm-univers-card__count { font-size: .75rem; color: var(--color-text-muted); font-weight: 500; margin-top: auto; }

/* ── Bande alphabétique homepage ── */
.wm-hp-alpha { background: var(--color-surface); }
.wm-hp-alpha-grid { display: grid; grid-template-columns: repeat(9, 1fr); gap: .5rem; }
.wm-hp-alpha-grid__letter { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; font-size: 1.0625rem; font-weight: 700; border-radius: var(--radius-sm); transition: background .15s, color .15s; }
.wm-hp-alpha-grid__letter--active { background: var(--color-info-bg); color: var(--color-primary); text-decoration: none; }
.wm-hp-alpha-grid__letter--active:hover { background: var(--color-primary); color: #fff; }
.wm-hp-alpha-grid__letter--empty { color: var(--color-border); cursor: default; }

/* ── Cartes grille 3 colonnes ── */
.wm-cards-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--grid-gap, 24px); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.wm-cards-grid--3 { grid-template-columns: repeat(3, 1fr); }

/* ── Guides ── */
.wm-card-guide { height: 100%; }
.wm-card-guide__link { display: flex; flex-direction: column; height: 100%; border: 1px solid var(--color-border); border-radius: var(--card-radius); overflow: hidden; text-decoration: none; color: inherit; background: var(--color-surface); transition: border-color .15s, box-shadow .15s; }
.wm-card-guide__link:hover { border-color: var(--color-primary); box-shadow: var(--shadow-md); }
.wm-card-guide__thumb { aspect-ratio: 16/9; overflow: hidden; }
.wm-card-guide__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wm-card-guide__body { padding: 1.25rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.wm-card-guide__title { font-size: .9375rem; font-weight: 700; color: var(--color-text); margin: 0; line-height: 1.35; }
.wm-card-guide__excerpt { font-size: .8125rem; color: var(--color-text-muted); margin: 0; line-height: 1.5; }

/* ── Éditorial ── */
.wm-hp-editorial { background: var(--color-surface-alt); }
.wm-hp-editorial__body { margin-top: 1.5rem; }

/* ── Mobile ── */
@media (max-width: 900px) {
  .wm-hp-hero { padding: 48px 0 40px; }
  .wm-hp-hero__title { font-size: clamp(1.75rem, 5vw, 2.25rem); }
  .wm-hp-hero__stats { gap: 1.5rem; }
  .wm-cards-grid--3 { grid-template-columns: repeat(2, 1fr); }
  .wm-hp-alpha-grid { grid-template-columns: repeat(9, 1fr); gap: .375rem; }
  .wm-hp-alpha-grid__letter { font-size: .9375rem; }
}

@media (max-width: 600px) {
  .wm-hp-section { padding: 40px 0; }
  .wm-cards-grid--3 { grid-template-columns: 1fr; }
  .wm-univers-grid { grid-template-columns: repeat(2, 1fr); }
  .wm-hp-alpha-grid { grid-template-columns: repeat(9, 1fr); gap: .25rem; }
  .wm-hp-alpha-grid__letter { font-size: .75rem; }
  .wm-hp-section__header--row { flex-direction: column; align-items: flex-start; }
}

/* ── 40. Print ──────────────────────────────────────────────────────────── */

@media print {
  .wm-header, .wm-footer, .wm-single-definition__sidebar, .wm-breadcrumb,
  .wm-adjacent-nav, .wm-cta-block, .wm-alpha-bar { display: none !important; }
  .wm-single-definition__layout { grid-template-columns: 1fr; }
  body { font-size: 12pt; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 10pt; color: #666; }
}
