/* =====================================================
   ARTICLE COMPONENTS
   =====================================================
   Every selector here is scoped under .article-body, and
   every class is prefixed art-.

   WHY BOTH:
   The old article vocabulary reused names the rest of the
   site already owns — .eyebrow, .tag, .badge, .dot, .col,
   .snippet, .table-scroll. An imported article using any of
   them picked up header and card styling and looked broken.
   That is the "CSS overlaps with website style" problem.

   A prefixed, scoped name cannot collide with anything, now
   or when the site design changes later.

   The old class names still work — they are styled in
   style.css under .prose and are untouched, so every
   already-published article renders exactly as before.
   Use art- names for everything new.
   ===================================================== */

.article-body {
    /* A styling boundary. Anything inside inherits from here,
       not from whatever the surrounding page happens to set. */
    --art-gap: 26px;
    --art-radius: 14px;
    container-type: inline-size;
}

/* ---------------------------------------------------
   LEAD PARAGRAPH
   --------------------------------------------------- */

.article-body .art-lead {
    font-size: 18.5px;
    line-height: 1.68;
    color: var(--text);
    font-weight: 450;
    margin: 0 0 var(--art-gap);
    padding-left: 18px;
    border-left: 3px solid var(--accent);
}

/* ---------------------------------------------------
   CALLOUTS
   .art-note is the neutral default; the rest signal urgency.
   --------------------------------------------------- */

.article-body .art-note,
.article-body .art-tip,
.article-body .art-warn,
.article-body .art-danger {
    position: relative;
    margin: var(--art-gap) 0;
    padding: 18px 20px 18px 54px;
    border: 1px solid var(--border);
    border-left-width: 3px;
    border-radius: var(--art-radius);
    background: var(--bg-elevated);
    font-size: 15px;
    line-height: 1.65;
}

.article-body .art-note > :first-child,
.article-body .art-tip > :first-child,
.article-body .art-warn > :first-child,
.article-body .art-danger > :first-child { margin-top: 0; }

.article-body .art-note > :last-child,
.article-body .art-tip > :last-child,
.article-body .art-warn > :last-child,
.article-body .art-danger > :last-child { margin-bottom: 0; }

/* The marker glyph is drawn in CSS so the author never has to
   paste an SVG, and so it can never be styled by the page. */
.article-body .art-note::before,
.article-body .art-tip::before,
.article-body .art-warn::before,
.article-body .art-danger::before {
    position: absolute;
    left: 18px;
    top: 18px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 800;
    font-family: var(--font-heading);
}

.article-body .art-note   { border-left-color: var(--border-strong); }
.article-body .art-note::before   { content: "i"; background: var(--bg-card); color: var(--text-muted); border: 1px solid var(--border); }

.article-body .art-tip    { border-left-color: var(--accent); background: var(--accent-softer); }
.article-body .art-tip::before    { content: "✓"; background: var(--accent-soft); color: var(--accent-ink); }

.article-body .art-warn   { border-left-color: var(--warning-ink); }
.article-body .art-warn::before   { content: "!"; background: rgba(251, 191, 36, 0.14); color: var(--warning-ink); }

.article-body .art-danger { border-left-color: var(--danger); background: var(--danger-soft); }
.article-body .art-danger::before { content: "×"; background: var(--danger-soft); color: var(--danger-ink); font-size: 16px; }

.article-body .art-title {
    display: block;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--text);
    margin-bottom: 5px;
}

/* ---------------------------------------------------
   COPYABLE BLOCKS — prompts and code
   The copy button is injected by assets/js/article.js at
   runtime, so the author writes no button markup and the
   sanitiser never has to allow <button> inside content.
   --------------------------------------------------- */

.article-body .art-prompt,
.article-body .art-code {
    position: relative;
    margin: var(--art-gap) 0;
    border: 1px solid var(--border);
    border-radius: var(--art-radius);
    background: var(--bg-sunken);
    overflow: hidden;
}

.article-body .art-prompt { border-color: var(--accent-border); }

.article-body .art-prompt-head,
.article-body .art-code-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    font-family: var(--font-heading);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.article-body .art-prompt-head { color: var(--accent-ink); }

.article-body .art-prompt pre,
.article-body .art-code pre {
    margin: 0;
    padding: 16px 18px;
    background: transparent;
    border: none;
    border-radius: 0;
    overflow-x: auto;
    font-size: 13.5px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.article-body .art-code pre { white-space: pre; word-break: normal; }

/* The injected button */
.article-body .art-copy-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    font-family: var(--font-body);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: none;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 7px;
    cursor: pointer;
    transition: color 0.18s var(--ease), border-color 0.18s var(--ease), background 0.18s var(--ease);
}

.article-body .art-copy-btn:hover {
    color: var(--text);
    border-color: var(--border-strong);
    background: var(--bg-card-hover);
}

.article-body .art-copy-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.article-body .art-copy-btn.is-copied {
    color: var(--accent-ink);
    border-color: var(--accent-border);
    background: var(--accent-soft);
}

.article-body .art-copy-btn svg { width: 13px; height: 13px; }

/* ---------------------------------------------------
   KEY FACTS / SPEC BOX
   --------------------------------------------------- */

.article-body .art-facts {
    margin: var(--art-gap) 0;
    padding: 4px 20px;
    border: 1px solid var(--border);
    border-radius: var(--art-radius);
    background: var(--bg-elevated);
}

.article-body .art-facts dl,
.article-body .art-facts > div {
    display: grid;
    grid-template-columns: minmax(130px, 32%) 1fr;
    gap: 0;
    margin: 0;
}

.article-body .art-facts dt {
    padding: 12px 14px 12px 0;
    border-bottom: 1px solid var(--border-soft);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.article-body .art-facts dd {
    margin: 0;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-soft);
    font-size: 14.5px;
    color: var(--text-prose);
}

.article-body .art-facts dt:last-of-type,
.article-body .art-facts dd:last-of-type { border-bottom: none; }

/* ---------------------------------------------------
   NUMBERED STEPS
   --------------------------------------------------- */

.article-body .art-steps {
    counter-reset: art-step;
    list-style: none;
    margin: var(--art-gap) 0;
    padding: 0;
}

.article-body .art-steps > li {
    counter-increment: art-step;
    position: relative;
    margin: 0 0 18px;
    padding: 0 0 0 48px;
    list-style: none;
}

.article-body .art-steps > li::before {
    content: counter(art-step, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: var(--accent-soft);
    border: 1px solid var(--accent-border);
    color: var(--accent-ink);
    font-family: var(--font-heading);
    font-size: 12.5px;
    font-weight: 800;
}

.article-body .art-steps > li > :first-child { margin-top: 0; }
.article-body .art-steps > li > :last-child { margin-bottom: 0; }

/* ---------------------------------------------------
   CHECKLIST
   --------------------------------------------------- */

.article-body .art-checklist {
    list-style: none;
    margin: var(--art-gap) 0;
    padding: 0;
    display: grid;
    gap: 11px;
}

.article-body .art-checklist > li {
    position: relative;
    padding-left: 30px;
    list-style: none;
    font-size: 15px;
    line-height: 1.6;
}

.article-body .art-checklist > li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 1px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent-ink);
    font-size: 11px;
    font-weight: 800;
}

.article-body .art-checklist.is-cross > li::before {
    content: "×";
    background: var(--danger-soft);
    color: var(--danger-ink);
    font-size: 14px;
}

/* ---------------------------------------------------
   CARD GRIDS
   --------------------------------------------------- */

.article-body .art-grid-2,
.article-body .art-grid-3 {
    display: grid;
    gap: 16px;
    margin: var(--art-gap) 0;
}

.article-body .art-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.article-body .art-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.article-body .art-card {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--art-radius);
    background: var(--bg-card);
}

.article-body .art-card > :first-child { margin-top: 0; }
.article-body .art-card > :last-child { margin-bottom: 0; }

.article-body .art-card h3,
.article-body .art-card h4 {
    font-size: 15.5px;
    margin: 0 0 8px;
}

.article-body .art-card p { font-size: 14.5px; margin: 0; }

/* ---------------------------------------------------
   PROS AND CONS
   --------------------------------------------------- */

.article-body .art-verdict {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: var(--art-gap) 0;
}

.article-body .art-pros,
.article-body .art-cons {
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-top-width: 3px;
    border-radius: var(--art-radius);
    background: var(--bg-card);
}

.article-body .art-pros { border-top-color: var(--accent); }
.article-body .art-cons { border-top-color: var(--danger); }

.article-body .art-pros h4,
.article-body .art-cons h4 {
    margin: 0 0 12px;
    font-size: 12px;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.article-body .art-pros h4 { color: var(--accent-ink); }
.article-body .art-cons h4 { color: var(--danger-ink); }

.article-body .art-pros ul,
.article-body .art-cons ul { margin: 0; padding-left: 18px; font-size: 14.5px; }

/* ---------------------------------------------------
   STAT BAND
   --------------------------------------------------- */

.article-body .art-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1px;
    margin: var(--art-gap) 0;
    border: 1px solid var(--border);
    border-radius: var(--art-radius);
    background: var(--border);
    overflow: hidden;
}

.article-body .art-stat {
    padding: 20px 18px;
    background: var(--bg-card);
    text-align: center;
}

.article-body .art-stat b,
.article-body .art-stat strong {
    display: block;
    font-family: var(--font-heading);
    font-size: 27px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--accent-ink);
}

.article-body .art-stat span {
    display: block;
    margin-top: 5px;
    font-size: 12.5px;
    line-height: 1.4;
    color: var(--text-muted);
}

/* ---------------------------------------------------
   TABLES
   Wrap any table in .art-table so it scrolls on a phone
   instead of forcing the whole page sideways.
   --------------------------------------------------- */

.article-body .art-table {
    margin: var(--art-gap) 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border);
    border-radius: var(--art-radius);
}

.article-body .art-table table {
    margin: 0;
    border: none;
    min-width: 520px;
    width: 100%;
    border-collapse: collapse;
}

.article-body .art-table th,
.article-body .art-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-soft);
    font-size: 14.5px;
    text-align: left;
    vertical-align: top;
}

.article-body .art-table thead th {
    background: var(--bg-elevated);
    font-family: var(--font-heading);
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
}

.article-body .art-table tbody th {
    font-weight: 600;
    color: var(--text);
    word-break: normal;
    min-width: 7em;
}

.article-body .art-table tbody tr:last-child th,
.article-body .art-table tbody tr:last-child td { border-bottom: none; }

.article-body .art-table .is-good { color: var(--accent-ink); font-weight: 600; }
.article-body .art-table .is-bad  { color: var(--danger-ink); font-weight: 600; }

/* ---------------------------------------------------
   FAQ / ACCORDION  (plain <details>, no JS needed)
   --------------------------------------------------- */

.article-body .art-faq {
    margin: var(--art-gap) 0;
    border: 1px solid var(--border);
    border-radius: var(--art-radius);
    overflow: hidden;
}

.article-body .art-faq details { border-bottom: 1px solid var(--border-soft); }
.article-body .art-faq details:last-child { border-bottom: none; }

.article-body .art-faq summary {
    padding: 15px 44px 15px 18px;
    position: relative;
    cursor: pointer;
    list-style: none;
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    background: var(--bg-card);
    transition: background 0.18s var(--ease);
}

.article-body .art-faq summary::-webkit-details-marker { display: none; }
.article-body .art-faq summary:hover { background: var(--bg-card-hover); }
.article-body .art-faq summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.article-body .art-faq summary::after {
    content: "";
    position: absolute;
    right: 18px;
    top: 50%;
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: translateY(-70%) rotate(45deg);
    transition: transform 0.22s var(--ease);
}

.article-body .art-faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }

.article-body .art-faq details > div,
.article-body .art-faq details > p {
    padding: 0 18px 16px;
    margin: 0;
    font-size: 14.5px;
    line-height: 1.68;
    color: var(--text-prose);
    background: var(--bg-card);
}

/* ---------------------------------------------------
   TIMELINE
   --------------------------------------------------- */

.article-body .art-timeline {
    position: relative;
    margin: var(--art-gap) 0;
    padding-left: 26px;
    list-style: none;
}

.article-body .art-timeline::before {
    content: "";
    position: absolute;
    left: 5px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: var(--border);
}

.article-body .art-timeline > li {
    position: relative;
    margin-bottom: 20px;
    list-style: none;
}

.article-body .art-timeline > li::before {
    content: "";
    position: absolute;
    left: -26px;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 3px var(--bg);
}

.article-body .art-when {
    display: block;
    font-family: var(--font-heading);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--accent-ink);
    margin-bottom: 3px;
}

/* ---------------------------------------------------
   BAR CHART  (widths come from .art-w-NN, never inline CSS)
   --------------------------------------------------- */

.article-body .art-chart {
    margin: var(--art-gap) 0;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--art-radius);
    background: var(--bg-card);
}

.article-body .art-chart-title {
    display: block;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
}

.article-body .art-bar {
    display: grid;
    grid-template-columns: minmax(80px, 26%) 1fr auto;
    align-items: center;
    gap: 12px;
    margin-bottom: 11px;
    font-size: 13.5px;
}

.article-body .art-bar:last-child { margin-bottom: 0; }
.article-body .art-bar > span:first-child { color: var(--text-muted); }

.article-body .art-track {
    height: 9px;
    border-radius: 999px;
    background: var(--bg-sunken);
    overflow: hidden;
}

.article-body .art-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--gradient);
}

.article-body .art-fill.is-muted  { background: var(--border-strong); }
.article-body .art-fill.is-danger { background: var(--danger); }

.article-body .art-bar > b { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--text); }

.article-body .art-w-5   { width: 5%; }
.article-body .art-w-10  { width: 10%; }
.article-body .art-w-15  { width: 15%; }
.article-body .art-w-20  { width: 20%; }
.article-body .art-w-25  { width: 25%; }
.article-body .art-w-30  { width: 30%; }
.article-body .art-w-35  { width: 35%; }
.article-body .art-w-40  { width: 40%; }
.article-body .art-w-45  { width: 45%; }
.article-body .art-w-50  { width: 50%; }
.article-body .art-w-55  { width: 55%; }
.article-body .art-w-60  { width: 60%; }
.article-body .art-w-65  { width: 65%; }
.article-body .art-w-70  { width: 70%; }
.article-body .art-w-75  { width: 75%; }
.article-body .art-w-80  { width: 80%; }
.article-body .art-w-85  { width: 85%; }
.article-body .art-w-90  { width: 90%; }
.article-body .art-w-95  { width: 95%; }
.article-body .art-w-100 { width: 100%; }

/* ---------------------------------------------------
   PULL QUOTE
   --------------------------------------------------- */

.article-body .art-quote {
    margin: calc(var(--art-gap) + 6px) 0;
    padding: 0 0 0 22px;
    border-left: 3px solid var(--accent);
    font-family: var(--font-heading);
    font-size: 19px;
    line-height: 1.5;
    font-weight: 500;
    color: var(--text);
}

.article-body .art-quote cite {
    display: block;
    margin-top: 10px;
    font-family: var(--font-body);
    font-size: 13.5px;
    font-style: normal;
    font-weight: 500;
    color: var(--text-muted);
}

/* ---------------------------------------------------
   CTA BAND
   --------------------------------------------------- */

.article-body .art-cta {
    margin: calc(var(--art-gap) + 10px) 0;
    padding: 26px 28px;
    border: 1px solid var(--accent-border);
    border-radius: var(--art-radius);
    background: var(--accent-softer);
    text-align: center;
}

.article-body .art-cta > :first-child { margin-top: 0; }
.article-body .art-cta > :last-child { margin-bottom: 0; }

.article-body .art-cta h3 { font-size: 20px; margin: 0 0 8px; }
.article-body .art-cta p { font-size: 15px; color: var(--text-muted); margin: 0 0 16px; }

.article-body .art-cta a {
    display: inline-block;
    padding: 11px 22px;
    border-radius: 9px;
    background: var(--gradient);
    color: var(--text-on-accent);
    font-weight: 700;
    font-size: 14.5px;
    text-decoration: none;
    border: none;
}

.article-body .art-cta a:hover { filter: brightness(1.05); text-decoration: none; }

/* ---------------------------------------------------
   TABLE OF CONTENTS (built by article.js)
   --------------------------------------------------- */

.article-body .art-toc {
    margin: 0 0 32px;
    padding: 18px 22px;
    border: 1px solid var(--border);
    border-radius: var(--art-radius);
    background: var(--bg-elevated);
}

.article-body .art-toc-title {
    display: block;
    font-family: var(--font-heading);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 11px;
}

.article-body .art-toc ol { margin: 0; padding-left: 18px; }
.article-body .art-toc li { margin: 0 0 6px; font-size: 14.5px; }
.article-body .art-toc li:last-child { margin-bottom: 0; }
.article-body .art-toc a { color: var(--text-prose); text-decoration: none; border: none; }
.article-body .art-toc a:hover { color: var(--accent-ink); text-decoration: underline; }

/* Anchor link beside each heading */
.article-body .art-anchor {
    opacity: 0;
    margin-left: 8px;
    font-size: 0.7em;
    color: var(--text-faint);
    text-decoration: none;
    border: none;
    transition: opacity 0.18s var(--ease);
}

.article-body h2:hover .art-anchor,
.article-body h3:hover .art-anchor,
.article-body .art-anchor:focus-visible { opacity: 1; }

/* ---------------------------------------------------
   SMALL UTILITIES
   --------------------------------------------------- */

.article-body .art-eyebrow {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-ink);
    margin-bottom: 6px;
}

.article-body .art-tag {
    display: inline-block;
    padding: 3px 10px;
    margin: 0 4px 4px 0;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-elevated);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.article-body .art-tag.is-accent {
    border-color: var(--accent-border);
    background: var(--accent-soft);
    color: var(--accent-ink);
}

.article-body .art-muted  { color: var(--text-muted); font-size: 14px; }
.article-body .art-center { text-align: center; }

.article-body .art-divider {
    height: 1px;
    margin: 36px 0;
    border: none;
    background: var(--border);
}

.article-body .art-source {
    display: block;
    margin-top: -14px;
    margin-bottom: var(--art-gap);
    font-size: 12.5px;
    color: var(--text-faint);
}

/* ---------------------------------------------------
   EMBEDS — responsive 16:9 for video
   --------------------------------------------------- */

.article-body .art-embed {
    position: relative;
    margin: var(--art-gap) 0;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--art-radius);
    background: var(--bg-sunken);
}

.article-body .art-embed iframe,
.article-body .art-embed video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ---------------------------------------------------
   RESPONSIVE
   --------------------------------------------------- */

@media (max-width: 700px) {
    .article-body .art-grid-2,
    .article-body .art-grid-3,
    .article-body .art-verdict { grid-template-columns: 1fr; }

    .article-body .art-facts dl,
    .article-body .art-facts > div { grid-template-columns: 1fr; }

    .article-body .art-facts dt { padding-bottom: 2px; border-bottom: none; }
    .article-body .art-facts dd { padding-top: 0; }

    .article-body .art-lead { font-size: 17px; }
    .article-body .art-quote { font-size: 17px; }
    .article-body .art-bar { grid-template-columns: 1fr; gap: 5px; }
    .article-body .art-bar > b { justify-self: end; margin-top: -22px; }
    .article-body .art-cta { padding: 22px 18px; }
}

@media (prefers-reduced-motion: reduce) {
    .article-body .art-faq summary::after,
    .article-body .art-copy-btn,
    .article-body .art-anchor { transition: none; }
}

@media print {
    .article-body .art-copy-btn,
    .article-body .art-toc,
    .article-body .art-anchor { display: none !important; }
    .article-body .art-prompt,
    .article-body .art-code { border: 1px solid #999; }
}
