/* Composants des articles de blog (src/templates/article.js) */
/* La colonne de l'article ne doit jamais s'élargir au-delà de l'écran (tableaux, code…) */
.post-grid > * { min-width: 0; }
.prose { overflow-wrap: break-word; }
.prose code { word-break: break-word; }
.prose > p:first-of-type { font-size: 20px; color: var(--ink); }
.a-toc { margin: 0 0 32px; padding: 20px 24px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.a-toc p { margin: 0 0 10px; font-weight: 800; color: var(--ink); font-size: 15px; text-transform: uppercase; letter-spacing: .06em; }
.a-toc ol { margin: 0; padding-left: 1.2em; columns: 2; column-gap: 32px; font-size: 15.5px; }
.a-toc li { margin-bottom: 6px; break-inside: avoid; }
.a-toc a { text-decoration: none; color: var(--text); }
.a-toc a:hover { color: var(--accent); }
.prose h2[id] { scroll-margin-top: calc(var(--nav-h) + 20px); }

.a-brief { margin: 0 0 32px; padding: 22px 26px; border-radius: 18px; background: linear-gradient(160deg, var(--accent-soft), #fff); border: 1px solid #E2DAFF; }
.a-brief-title { margin: 0 0 8px; font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: .08em; font-size: 13px; }
.a-brief ul { margin: 0; }
.a-brief li { margin-bottom: 6px; }

.a-table { margin: 28px 0; }
.a-table figcaption, .a-flow figcaption, .a-bars figcaption { font-weight: 700; color: var(--ink); font-size: 15px; margin-bottom: 10px; }
.a-table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
.a-table table { width: 100%; border-collapse: collapse; font-size: 15.5px; min-width: 520px; }
.a-table th, .a-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.a-table thead th { background: var(--ink); color: #fff; font-size: 14px; font-weight: 700; }
.a-table tbody th { color: var(--ink); font-weight: 700; background: var(--tint); }
.a-table tbody tr:last-child th, .a-table tbody tr:last-child td { border-bottom: 0; }

.a-note { margin: 26px 0; padding: 18px 22px; border-radius: 14px; border-left: 4px solid; font-size: 16.5px; }
.a-note p { margin: 0 0 8px; }
.a-note p:last-child { margin: 0; }
.a-note ul { margin: 6px 0 0; }
.a-note-title { font-weight: 800; color: var(--ink); }
.a-tip { background: #EEF9F2; border-color: #12A150; }
.a-warn { background: #FFF6E5; border-color: #D98A00; }
.a-info { background: #EEF4FF; border-color: #3B6FE0; }
.a-key { background: var(--accent-soft); border-color: var(--accent); }

.a-steps { list-style: none; padding: 0 !important; margin: 28px 0; position: relative; }
.a-steps li { display: grid; grid-template-columns: 44px 1fr; gap: 16px; margin-bottom: 18px; position: relative; }
.a-steps li:not(:last-child)::before { content: ''; position: absolute; left: 21px; top: 44px; bottom: -18px; width: 2px; background: #E2DAFF; }
.a-step-n { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; display: grid; place-items: center; }
.a-steps b { color: var(--ink); display: block; margin-top: 8px; }
.a-steps p { margin: 4px 0 0; font-size: 16.5px; }

.a-flow { margin: 28px 0; }
.a-flow ol { list-style: none; padding: 0 !important; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; counter-reset: f; }
.a-flow li { counter-increment: f; position: relative; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 15px; font-weight: 600; color: var(--ink); margin: 0; box-shadow: 0 4px 12px rgba(15, 23, 42, .05); }
.a-flow li::before { content: counter(f); display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 8px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 12px; }
.a-flow li:not(:last-child)::after { content: '→'; position: absolute; right: -10px; top: 50%; transform: translate(50%, -50%); color: var(--accent); font-weight: 800; }
.a-flow li:not(:last-child) { margin-right: 14px; }

.a-bars { margin: 28px 0; padding: 20px 22px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.a-bar { display: grid; grid-template-columns: minmax(120px, 34%) 1fr auto; gap: 12px; align-items: center; margin-bottom: 10px; font-size: 15px; }
.a-bar-label { color: var(--text); }
.a-bar-track { height: 12px; border-radius: 99px; background: #EEF1F6; overflow: hidden; }
.a-bar-fill { display: block; height: 100%; border-radius: inherit; background: #A996FF; }
.a-bar-fill.hl { background: var(--accent); }
.a-bar b { color: var(--ink); font-size: 14px; white-space: nowrap; }
.a-bars-note { margin: 10px 0 0; font-size: 13px; color: var(--muted); }

.a-check { margin: 26px 0; padding: 20px 24px; border: 1px dashed #CBD5E1; border-radius: 16px; }
.a-check-title { font-weight: 800; color: var(--ink); margin: 0 0 10px; }
.a-check ul { list-style: none; padding: 0 !important; margin: 0; }
.a-check li { position: relative; padding-left: 32px; margin-bottom: 10px; }
.a-check li::before { content: '✓'; position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 800; display: grid; place-items: center; }

.a-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 28px 0; }
.a-col { border-radius: 16px; padding: 18px 20px; border: 1px solid var(--line); }
.a-col-a { background: #F6FBF8; }
.a-col-b { background: #F8F7FF; }
.a-col-title { font-weight: 800; color: var(--ink); margin: 0 0 8px; }
.a-col ul { margin: 0; font-size: 16px; }

.a-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 28px 0; }
.a-figures > div { padding: 18px; border-radius: 14px; background: var(--ink); color: #C7D2E8; }
.a-figures b { display: block; color: #fff; font-size: 28px; line-height: 1.1; margin-bottom: 6px; }
.a-figures span { font-size: 14px; }
.a-src { grid-column: 1 / -1; margin: 0; font-size: 13px; color: var(--muted); }

.a-qa details { border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin-bottom: 10px; background: #fff; }
.a-qa summary { font-weight: 700; color: var(--ink); cursor: pointer; }
.a-qa details p { margin: 10px 0 0; font-size: 16.5px; }

@media (max-width: 640px) {
  .prose > p:first-of-type { font-size: 18px; }
  .a-toc, .a-brief, .a-bars, .a-check { padding: 16px 18px; }
  .a-toc ol { columns: 1; font-size: 15px; }
  .a-note { padding: 14px 16px; font-size: 16px; }
  .a-compare { grid-template-columns: 1fr; gap: 12px; }
  .a-col { padding: 16px 18px; }
  .a-steps li { grid-template-columns: 34px 1fr; gap: 12px; }
  .a-step-n { width: 34px; height: 34px; font-size: 15px; }
  .a-steps li:not(:last-child)::before { left: 16px; top: 34px; }
  .a-steps b { margin-top: 5px; }
  .a-steps p { font-size: 16px; }
  .a-bar { grid-template-columns: 1fr auto; gap: 4px 10px; }
  .a-bar-label { grid-column: 1 / -1; }
  .a-flow ol { flex-direction: column; align-items: stretch; }
  .a-flow li:not(:last-child) { margin-right: 0; margin-bottom: 14px; }
  .a-flow li:not(:last-child)::after { content: '↓'; right: 50%; top: auto; bottom: -14px; transform: translate(50%, 50%); }
  .a-figures { grid-template-columns: 1fr 1fr; }
  .a-figures b { font-size: 22px; }

  /* Tableaux : une carte par ligne, libellé de colonne au-dessus de chaque valeur */
  .a-table-scroll { overflow: visible; border: 0; border-radius: 0; }
  .a-table table { min-width: 0; font-size: 15px; }
  .a-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .a-table table, .a-table tbody, .a-table tr, .a-table th, .a-table td { display: block; width: 100%; }
  .a-table tr { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 10px; background: #fff; }
  .a-table tbody th { padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .a-table td { padding: 8px 14px; border-bottom: 1px dashed var(--line); }
  .a-table tbody tr td:last-child { border-bottom: 0; }
  .a-table td::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
  .a-table td[data-label=""]::before { display: none; }
}
