/* Long-form article kit (blog-post.php only). Reads the band tokens from theme.css. */
.article-credit { max-width: 1040px; margin: calc(-1 * clamp(24px, 4vw, 52px)) auto clamp(28px, 4vw, 48px); font-size: .8rem; color: var(--text-3); text-align: right; }
.article-credit a { color: inherit; }

.article h3 { font-size: clamp(1.15rem, 1.05rem + .4vw, 1.4rem); letter-spacing: -.02em; margin: var(--space-6, 32px) 0 var(--space-3, 12px); color: var(--text-1); }
.article ul, .article ol { margin: 0 0 var(--space-5, 24px); padding-left: 1.4em; font-size: 1.08rem; line-height: 1.75; color: var(--text-2); list-style: disc; }
.article ol { list-style: decimal; }
.article li { margin-bottom: .55em; }
.article li::marker { color: var(--text-accent); font-weight: 700; }
.article strong { color: var(--text-1); }
.article code, .article kbd { font-family: var(--font-mono); font-size: .9em; background: var(--surface-2); border-radius: 6px; padding: .12em .4em; }
.article { overflow-wrap: break-word; }
.article :not(pre) > code { overflow-wrap: anywhere; }
.article pre { background: #0b0b0b; color: #f2f2f2; border-radius: 14px; padding: 18px 20px; overflow-x: auto; font-size: .88rem; line-height: 1.6; margin: 0 0 var(--space-5, 24px); }
.article pre code { background: none; padding: 0; color: inherit; }

/* Numbered how-to steps */
.article ol.steps { list-style: none; padding: 0; counter-reset: step; }
.article ol.steps > li { counter-increment: step; position: relative; padding: 0 0 0 52px; margin-bottom: 1.1em; }
.article ol.steps > li::before { content: counter(step); position: absolute; left: 0; top: .1em; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--text-1); color: var(--bg); font: 700 .9rem/1 var(--font-mono); }

/* Screenshots and figures */
.article figure { margin: var(--space-6, 32px) 0; }
.article figure img { width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-1); }
.article figcaption { font-size: .86rem; line-height: 1.55; color: var(--text-3); margin-top: 10px; }
.article figcaption a { color: inherit; }

/* Tables */
.article .table-wrap { overflow-x: auto; margin: 0 0 var(--space-5, 24px); border: 1px solid var(--border); border-radius: 14px; }
.article table { width: 100%; border-collapse: collapse; font-size: .96rem; line-height: 1.5; min-width: 520px; }
.article th, .article td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; color: var(--text-2); }
.article th { background: var(--surface-2); color: var(--text-1); font-weight: 700; }
.article tr:last-child td { border-bottom: 0; }

/* Callouts */
.article .callout { border-radius: 14px; padding: 16px 20px; margin: 0 0 var(--space-5, 24px); background: var(--surface-1); border: 1px solid var(--border); border-left: 4px solid var(--mz-blue); }
.article .callout p:last-child { margin-bottom: 0; }
.article .callout--warn { border-left-color: var(--mz-coral); }
.article .callout--tip { border-left-color: var(--mz-green); }
.article .callout-title { font-weight: 700; color: var(--text-1); margin-bottom: 6px; }

/* Answer-first block, takeaways, contents */
.answer-box, .takeaways, .toc { border-radius: 18px; padding: 20px 24px; margin: 0 0 var(--space-5, 24px); border: 1px solid var(--border); }
.answer-box { background: var(--surface-2); }
.answer-box p:last-child { margin-bottom: 0; color: var(--text-1); }
.answer-box-label, .takeaways-label, .toc-label { font-family: var(--font-mono); font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3) !important; margin: 0 0 8px !important; }
.takeaways ul, .toc ol { margin-bottom: 0 !important; }
.toc a { text-decoration: none !important; color: var(--text-2); }
.toc a:hover, .toc a:focus-visible { color: var(--text-1); text-decoration: underline !important; }

/* FAQ */
.faq-list { border-top: 1px solid var(--border); margin-bottom: var(--space-5, 24px); }
.faq-item { border-bottom: 1px solid var(--border); padding: 16px 0; }
.faq-item summary { cursor: pointer; font-weight: 700; color: var(--text-1); font-size: 1.06rem; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-family: var(--font-mono); color: var(--text-3); }
.faq-item[open] summary::after { content: "–"; }
.faq-item p { margin: 10px 0 0 !important; font-size: 1.02rem !important; }
.article ol.sources { font-size: .92rem; }

/* ================= article page v2: editorial layout + reading aids ================= */
.ar-progress { position: fixed; z-index: 1001; inset: 0 0 auto; height: 3px; pointer-events: none; }
.ar-progress span { display: block; height: 100%; transform: scaleX(0); transform-origin: 0 50%; background: linear-gradient(90deg, #7C3AED, #F7BE22); }

/* hero */
.page-banner.ar-hero { padding-block: clamp(40px, 5vw, 72px) clamp(44px, 5.5vw, 80px); }
.ar-hero__inner { max-width: 1040px; }
.page-banner.ar-hero .container > * { text-align: left; margin-left: 0; margin-right: 0; }
.ar-back { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 22px; font-size: .88rem; font-weight: 500; color: rgba(255, 255, 255, .8); text-decoration: none; }
.ar-back:hover { color: #fff; }
.ar-back i { transition: transform .25s; }
.ar-back:hover i { transform: translateX(-3px); }
.ar-cat { display: inline-block; margin: 0 0 14px !important; padding: 5px 12px; border-radius: 999px; background: rgba(255, 255, 255, .14); font-size: .78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #fff; }
.ar-hero h1 { max-width: 22ch; margin-bottom: 16px; font-size: clamp(2rem, 1.3rem + 2.6vw, 3.4rem); line-height: 1.08; }
.page-banner.ar-hero .ar-dek { max-width: 62ch; margin-bottom: 26px; font-size: clamp(1.05rem, .98rem + .35vw, 1.25rem); line-height: 1.55; color: rgba(255, 255, 255, .88); }
.ar-meta { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; font-size: .9rem; color: rgba(255, 255, 255, .86); }
.ar-meta li { display: inline-flex; align-items: center; gap: 8px; }
.ar-meta i { opacity: .75; }
.ar-meta__ava { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: #1A1100; font-size: .78rem; }
.ar-meta__ava i { opacity: 1; }

/* cover */
.ar-cover { position: relative; max-width: none; margin: 0 0 clamp(28px, 4vw, 52px); border-radius: 24px; }
.ar-cover figcaption { position: absolute; right: 12px; bottom: 12px; padding: 4px 10px; border-radius: 999px; background: rgba(0, 0, 0, .55); backdrop-filter: blur(8px); font-size: .74rem; color: rgba(255, 255, 255, .9); }
.ar-cover figcaption a { color: inherit; }

/* two-column layout */
.ar-layout { display: grid; grid-template-columns: minmax(0, 720px) 280px; gap: clamp(40px, 5vw, 80px); justify-content: center; align-items: start; }
.ar-layout .article { max-width: none; margin: 0; }
.ar-rail { position: sticky; top: calc(var(--header-height, 72px) + 24px); display: grid; gap: 18px; max-height: calc(100vh - var(--header-height, 72px) - 48px); overflow-y: auto; scrollbar-width: thin; padding-bottom: 4px; }
.ar-rail__label { margin: 0 0 10px; font-size: .72rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--text-2); }
.ar-toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--border); }
.ar-toc a { position: relative; display: block; margin-left: -2px; padding: 7px 0 7px 14px; border-left: 2px solid transparent; font-size: .88rem; line-height: 1.4; color: var(--text-2); text-decoration: none; transition: color .2s, border-color .2s; }
.ar-toc a:hover { color: var(--text-1); }
.ar-toc a.is-active { color: #6D28D9; border-left-color: #6D28D9; font-weight: 500; }
.ar-share__row { display: flex; gap: 8px; }
.ar-share__btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; border: 1px solid var(--border); background: var(--bg, #fff); color: var(--text-1); font-size: .9rem; cursor: pointer; text-decoration: none; transition: background .2s, color .2s, border-color .2s, transform .2s; }
.ar-share__btn:hover { background: #6D28D9; border-color: #6D28D9; color: #fff; transform: translateY(-2px); }
.ar-help { padding: 18px; border-radius: 18px; background: linear-gradient(135deg, #6D28D9, #4C1D95); color: #fff; }
.ar-help__title { margin: 0 0 4px; font-weight: 600; font-size: 1rem; color: #fff; }
.ar-help p:not(.ar-help__title) { margin: 0 0 14px; font-size: .86rem; line-height: 1.5; color: rgba(255, 255, 255, .85); }
.ar-help .btn { background: var(--gold); color: #1A1100; border-color: var(--gold); }
.ar-toc a:focus-visible, .ar-share__btn:focus-visible, .ar-mtoc__btn:focus-visible, .ar-anchor:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* phone / tablet contents bar */
.ar-mtoc { display: none; position: sticky; top: calc(var(--header-height, 64px) + 8px); z-index: 6; margin: 0 -6px 24px; }
.ar-mtoc__btn { width: 100%; display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 16px; border-radius: 16px; border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg, #fff) 88%, transparent); backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5);
  box-shadow: 0 18px 36px -28px rgba(46, 16, 101, .6); font: inherit; font-size: .9rem; color: var(--text-1); cursor: pointer; text-align: left; }
.ar-mtoc__btn > i:first-child { color: #6D28D9; }
.ar-mtoc__now { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 500; }
.ar-mtoc__chev { font-size: .75rem; color: var(--text-2); transition: transform .25s; }
.ar-mtoc.is-open .ar-mtoc__chev { transform: rotate(180deg); }
.ar-mtoc__list { list-style: none; margin: 8px 0 0; padding: 6px; max-height: 60vh; overflow-y: auto; border-radius: 16px; border: 1px solid var(--border); background: var(--bg, #fff); box-shadow: 0 24px 48px -24px rgba(46, 16, 101, .5); }
.ar-mtoc__list a { display: flex; gap: 12px; padding: 10px 12px; border-radius: 10px; font-size: .9rem; line-height: 1.4; color: var(--text-1); text-decoration: none; }
.ar-mtoc__list a span { flex: none; font-variant-numeric: tabular-nums; font-size: .78rem; color: var(--text-2); padding-top: 2px; }
.ar-mtoc__list a.is-active { background: color-mix(in srgb, #8B5CF6 12%, transparent); color: #5B21B6; }

/* reading typography */
.ar-layout .article p, .ar-layout .article li { font-size: 1.125rem; line-height: 1.8; }
.ar-layout .article h2 { position: relative; font-size: clamp(1.5rem, 1.25rem + .9vw, 2rem); line-height: 1.2; scroll-margin-top: calc(var(--header-height, 72px) + 32px); }
.ar-layout .article h3 { scroll-margin-top: calc(var(--header-height, 72px) + 32px); }
.ar-anchor { margin-left: 10px; width: 30px; height: 30px; vertical-align: middle; border-radius: 9px; border: 1px solid var(--border); background: none; color: var(--text-2); font-size: .72rem; cursor: pointer; opacity: 0; transition: opacity .2s, color .2s, border-color .2s; }
.article h2:hover .ar-anchor, .ar-anchor:focus-visible { opacity: 1; }
.ar-anchor:hover { color: #6D28D9; border-color: #6D28D9; }
@media (hover: none) { .ar-anchor { opacity: .6; } }

.ar-layout .answer-box { position: relative; padding: 22px 24px; border: 0; border-radius: 20px; background: color-mix(in srgb, #8B5CF6 10%, var(--bg, #fff)); box-shadow: 0 0 0 1px color-mix(in srgb, #8B5CF6 28%, transparent) inset; }
.ar-layout .answer-box p:last-child { font-size: 1.1rem; line-height: 1.7; }
.ar-layout .answer-box-label, .ar-layout .takeaways-label { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font); font-weight: 600; color: #5B21B6 !important; }
.ar-layout .takeaways { padding: 22px 24px; border-radius: 20px; background: var(--bg, #fff); }
.ar-layout .takeaways ul { list-style: none; padding: 0; }
.ar-layout .takeaways li { position: relative; padding-left: 30px; font-size: 1.02rem; }
.ar-layout .takeaways li::before { content: ""; position: absolute; left: 0; top: .45em; width: 18px; height: 18px; border-radius: 50%; background: #16A34A url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat; }
.ar-layout .takeaways li::marker { content: ""; }

.ar-layout .faq-item summary { font-weight: 600; }
.ar-sources { margin: 28px 0 0; border: 1px solid var(--border); border-radius: 16px; padding: 0 18px; }
.ar-sources summary { display: flex; align-items: center; gap: 10px; padding: 14px 0; cursor: pointer; list-style: none; font-weight: 500; color: var(--text-1); }
.ar-sources summary::-webkit-details-marker { display: none; }
.ar-sources summary small { margin-left: auto; color: var(--text-2); }
.ar-sources[open] summary { border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.ar-layout .article ol.sources li { font-size: .9rem; line-height: 1.5; }

.ar-end { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin: 36px 0 0; padding: 24px; border-radius: 20px; background: var(--text-1); color: var(--bg, #fff); }
.ar-end p { margin: 0 !important; font-size: .98rem !important; line-height: 1.5 !important; color: color-mix(in srgb, var(--bg, #fff) 78%, transparent) !important; max-width: 46ch; }
.ar-end .ar-end__title { margin-bottom: 4px !important; font-size: 1.12rem !important; font-weight: 600; color: var(--bg, #fff) !important; }
.ar-end .btn { flex: none; }
.ar-end a { text-decoration: none; }
.ar-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.ar-layout .article a.ar-tag { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); font-size: .86rem; font-weight: 500; color: var(--text-1); text-decoration: none; }
.ar-tag i { color: var(--svc, #6D28D9); font-size: .8rem; }
.ar-tag:hover { border-color: #6D28D9; }

.ar-toast { position: fixed; left: 50%; bottom: 28px; z-index: 1002; translate: -50% 20px; opacity: 0; pointer-events: none; padding: 10px 18px; border-radius: 999px; background: #0A0A0A; color: #fff; font-size: .88rem; font-weight: 500; transition: opacity .25s, translate .25s; }
.ar-toast.is-on { opacity: 1; translate: -50% 0; }

@media (max-width: 1100px) {
  .ar-layout { grid-template-columns: minmax(0, 720px); }
  .ar-rail { position: static; max-height: none; overflow: visible; grid-template-columns: 1fr 1fr; }
  .ar-toc { display: none; }
  .ar-mtoc { display: block; max-width: 732px; margin-inline: auto; }
  .ar-mtoc ~ .ar-layout { }
}
@media (max-width: 620px) {
  .ar-rail { grid-template-columns: 1fr; }
  .ar-layout .article p, .ar-layout .article li { font-size: 1.05rem; line-height: 1.75; }
  .ar-cover { border-radius: 18px; aspect-ratio: 16 / 10; }
  .ar-end { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) { .ar-toast, .ar-share__btn { transition: none; } }
.page-banner.ar-hero .ar-back { display: flex; width: fit-content; }
.page-banner.ar-hero .ar-cat { display: table; font-size: .76rem; line-height: 1.2; }
.ar-rail { max-height: none; overflow: visible; }
.ar-toc ol { max-height: calc(100vh - var(--header-height, 72px) - 330px); min-height: 120px; overflow-y: auto; scrollbar-width: thin; }
@media (max-width: 1100px) { .ar-toc ol { max-height: none; } }
.ar-layout .article .answer-box-label, .ar-layout .article .takeaways-label { font-size: .76rem !important; letter-spacing: .1em; line-height: 1.4; margin-bottom: 10px !important; }
.ar-hero__inner { max-width: calc(720px + 280px + clamp(40px, 5vw, 80px) + 2 * var(--gutter, 32px)); }
@media (max-width: 1100px) { .ar-hero__inner { max-width: 760px; } }
