/* Magazine layout for guide and blog articles: big headline, standfirst, a contents rail, one reading column,
   numbered steps, a dark call-out and related stories. Uses the site's own accent (--accent). */
.mag {
    --mag-ink: #1c1917; --mag-muted: #57534e; --mag-line: #e7e5e4; --mag-code: #f5f5f4; --mag-danger: #b91c1c;
    --mag-wash: #fff1e6; --mag-accent-ink: #c2410c;
    --mag-display: 'Bricolage Grotesque', 'Space Grotesk', 'Helvetica Neue', Arial, sans-serif;
    --mag-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
    --mag-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
    max-width: 1180px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 32px) 24px; color: var(--mag-ink);
}
.mag *, .mag *::before, .mag *::after { box-sizing: border-box; }
.mag-progress { position: fixed; left: 0; right: 0; top: 0; height: 3px; z-index: 50; pointer-events: none; }
.mag-progress i { display: block; height: 100%; width: 0; background: var(--accent); }

.mag-crumbs { padding: 22px 0 0; font-family: var(--mag-display); font-size: 14px; font-weight: 500; color: var(--mag-muted); }
.mag-crumbs a { color: var(--mag-muted); text-decoration: none; }
.mag-crumbs a:hover { color: var(--accent); }
.mag-crumbs span[aria-hidden] { margin: 0 6px; }

.mag-hero { padding: 36px 0 40px; max-width: 980px; }
.mag-kicker { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; font-family: var(--mag-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--mag-accent-ink); margin: 0 0 20px; }
.mag-chip { border: 1.5px solid var(--accent); border-radius: 999px; padding: 2px 12px; }
.mag-hero h1 { font-family: var(--mag-display); font-weight: 800; font-size: clamp(2.2rem, 5.6vw, 4.2rem); line-height: 1.04; letter-spacing: -0.035em; margin: 0 0 24px; color: var(--mag-ink); text-wrap: balance; }
.mag-standfirst { font-family: var(--mag-serif); font-size: clamp(1.15rem, 2.1vw, 1.5rem); line-height: 1.45; color: var(--mag-muted); margin: 0 0 26px; max-width: 34em; text-wrap: pretty; }
.mag-meta { display: flex; flex-wrap: wrap; gap: 6px 22px; font-family: var(--mag-display); font-size: 14.5px; font-weight: 500; color: var(--mag-muted); padding-top: 16px; border-top: 2px solid var(--mag-ink); }
.mag-meta b { color: var(--mag-ink); font-weight: 700; }

.mag-layout { display: grid; grid-template-columns: 210px minmax(0, 700px); gap: 72px; padding-top: 28px; justify-content: center; }
.mag-rail { position: sticky; top: 24px; align-self: start; font-family: var(--mag-display); }
.mag-rail h2 { font-family: var(--mag-mono); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--mag-muted); font-weight: 500; margin: 0 0 14px; }
.mag-rail ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--mag-line); }
.mag-rail ol a { display: block; padding: 7px 0 7px 16px; margin-left: -2px; border-left: 2px solid transparent; font-size: 15px; font-weight: 500; line-height: 1.3; color: var(--mag-muted); text-decoration: none; }
.mag-rail ol a:hover { color: var(--mag-ink); }
.mag-rail ol a.on { color: var(--mag-ink); border-left-color: var(--accent); font-weight: 700; }
.mag-help { margin-top: 28px; padding: 16px; border-radius: 12px; background: var(--mag-wash); font-size: 14.5px; line-height: 1.4; color: var(--mag-ink); }
.mag-help b { display: block; font-size: 15.5px; margin-bottom: 4px; }
.mag-help a { display: inline-block; margin-top: 10px; color: var(--mag-accent-ink); font-weight: 700; text-decoration: none; }

.mag-article { min-width: 0; font-family: var(--mag-serif); font-size: 19px; line-height: 1.7; color: var(--mag-ink); }
.mag-sec { scroll-margin-top: 24px; padding-bottom: 12px; }
.mag-article h2.mag-h2, .mag-prose h2 { font-family: var(--mag-display); font-weight: 800; font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.12; letter-spacing: -0.025em; margin: 52px 0 16px; color: var(--mag-ink); text-wrap: balance; scroll-margin-top: 24px; }
.mag-sec:first-of-type h2.mag-h2 { margin-top: 8px; }
.mag-prose h3 { font-family: var(--mag-display); font-weight: 700; font-size: 1.3rem; line-height: 1.2; letter-spacing: -0.015em; margin: 34px 0 10px; }
.mag-prose p, .mag-article .mag-sec > div > p { margin: 0 0 1.15em; text-wrap: pretty; }
.mag-prose a, .mag-sec a:not(.mag-card):not(.mag-task) { color: var(--mag-accent-ink); text-underline-offset: 3px; }
.mag-prose code, .mag-sec code { font-family: var(--mag-mono); font-size: .8em; background: var(--mag-code); padding: .12em .42em; border-radius: 5px; border: 1px solid var(--mag-line); }
.mag-prose strong, .mag-sec strong { font-weight: 600; }
.mag-prose ul, .mag-prose ol { padding-left: 1.4em; margin: 0 0 1.2em; }
.mag-prose li { margin-bottom: .45em; }
.mag-prose table, .mag-prose .bp-table { display: block; overflow-x: auto; max-width: 100%; border-collapse: collapse; margin: 1.6rem 0; font-family: var(--mag-display); font-size: .92rem; line-height: 1.45; }
.mag-prose th { text-align: left; padding: .65rem .85rem; font-weight: 700; background: #f5f5f4; border-bottom: 2px solid var(--mag-ink); white-space: nowrap; }
.mag-prose td { padding: .65rem .85rem; border-bottom: 1px solid var(--mag-line); vertical-align: top; }

.mag-lead::first-letter, .mag-lead > p:first-child::first-letter { font-family: var(--mag-display); font-weight: 800; font-size: 4.2em; float: left; line-height: .82; padding: 6px 12px 0 0; color: var(--accent); }

.mag-pull { margin: 44px 0; padding: 4px 0 4px 28px; border-left: 5px solid var(--accent); font-family: var(--mag-display); font-weight: 700; font-size: clamp(1.5rem, 2.8vw, 2rem); line-height: 1.2; letter-spacing: -0.02em; text-wrap: balance; }

/* causes: diamonds. How to fix it: big numerals, because the order matters there. */
.mag-causes ol, .mag-causes ul { list-style: none; margin: 0 0 1.4em; padding: 0; display: grid; gap: 14px; }
.mag-causes li { position: relative; padding-left: 30px; margin: 0; }
.mag-causes li::before { content: ""; position: absolute; left: 0; top: .62em; width: 12px; height: 12px; background: var(--accent); border-radius: 3px; transform: rotate(45deg) scale(.8); }
.mag-fix ol { list-style: none; margin: 8px 0 0; padding: 0; counter-reset: s; }
.mag-fix ol > li { counter-increment: s; position: relative; padding: 22px 0 22px 72px; border-top: 1px solid var(--mag-line); margin: 0; }
.mag-fix ol > li:last-child { border-bottom: 1px solid var(--mag-line); }
.mag-fix ol > li::before { content: counter(s); position: absolute; left: 0; top: 18px; font-family: var(--mag-display); font-weight: 800; font-size: 3rem; line-height: 1; color: var(--accent); letter-spacing: -0.04em; }
.mag-fix ul { padding-left: 1.4em; }

.mag-seen { background: var(--mag-code); border: 1px solid var(--mag-line); border-radius: 12px; padding: 6px 0; margin: 8px 0 14px; font-family: var(--mag-mono); font-size: 14px; line-height: 1.5; overflow-x: auto; }
.mag-seen div { padding: 8px 18px; border-left: 4px solid var(--mag-danger); margin: 8px 0; white-space: pre-wrap; word-break: break-word; }
.mag-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 1.2em; }
.mag-pill { font-family: var(--mag-mono); font-size: 12.5px; padding: 3px 10px; border-radius: 6px; background: var(--mag-wash); color: var(--mag-accent-ink); text-decoration: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mag-faq details { border-top: 1px solid var(--mag-line); }
.mag-faq details:last-of-type { border-bottom: 1px solid var(--mag-line); }
.mag-faq summary { list-style: none; cursor: pointer; padding: 20px 44px 20px 0; position: relative; font-family: var(--mag-display); font-weight: 700; font-size: 1.15rem; line-height: 1.3; }
.mag-faq summary::-webkit-details-marker { display: none; }
.mag-faq summary::after { content: "+"; position: absolute; right: 4px; top: 14px; font-size: 1.9rem; font-weight: 500; color: var(--accent); line-height: 1; }
.mag-faq details[open] summary::after { content: "\2212"; }
.mag-faq details p { margin: 0 0 20px; color: var(--mag-muted); }
.mag a:focus-visible, .mag summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.mag-more { padding-top: 56px; }
.mag-more h2 { font-family: var(--mag-display); font-weight: 800; font-size: 1.5rem; letter-spacing: -0.02em; margin: 0 0 20px; }
.mag-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.mag-card { display: block; text-decoration: none; color: var(--mag-ink); background: #fff; border: 1px solid var(--mag-line); border-top: 4px solid var(--accent); border-radius: 4px 4px 14px 14px; padding: 18px 20px 22px; }
.mag-card small { display: block; font-family: var(--mag-mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--mag-accent-ink); margin-bottom: 10px; }
.mag-card b { display: block; font-family: var(--mag-display); font-weight: 700; font-size: 1.12rem; line-height: 1.25; letter-spacing: -0.015em; }
.mag-card:hover b { color: var(--mag-accent-ink); }
.mag-task { display: block; text-decoration: none; color: var(--mag-ink); border-top: 1px solid var(--mag-line); padding: 14px 0; font-family: var(--mag-display); }
.mag-task:last-child { border-bottom: 1px solid var(--mag-line); }
.mag-task b { font-weight: 700; }
.mag-task small { display: block; color: var(--mag-muted); font-size: 13.5px; margin-top: 2px; }

.mag-codebox { position: relative; margin: 12px 0 24px; border-radius: 12px; background: #1c1917; color: #fafaf9; }
.mag-codebox .lab { font-family: var(--mag-mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: #a8a29e; padding: 12px 16px 0; }
.mag-codebox pre { margin: 0; padding: 8px 90px 16px 16px; overflow-x: auto; font-family: var(--mag-mono); font-size: 14px; line-height: 1.6; white-space: pre; color: #fafaf9; }
.mag-copy { position: absolute; top: 8px; right: 8px; border: 1px solid #44403c; background: #292524; color: #fafaf9; font-family: var(--mag-display); font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 8px; cursor: pointer; }
.mag-copy:hover { background: #44403c; }
.mag-copy:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.mag-note { font-size: .92em; color: var(--mag-muted); }

@media (max-width: 940px) {
    .mag-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .mag-rail { display: none; }
    .mag-hero { padding-top: 28px; }
    .mag-article { font-size: 18px; }
    .mag-fix ol > li { padding-left: 56px; }
    .mag-fix ol > li::before { font-size: 2.4rem; top: 20px; }
    .mag-pull { padding-left: 18px; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
