/* Article extras: topics, contents box, resource block, share buttons, related articles, reading progress. */

/* Reading progress (created by article-extras.js) */
.ax-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 50; pointer-events: none; }
.ax-progress span { display: block; height: 100%; width: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }

/* Topic chips (article header + filter on the Articles page) */
.ax-topics { margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.ax-chip { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--ink); font-size: 0.85rem; font-weight: 600; text-decoration: none; border: 1px solid transparent; }
.ax-chip:hover { border-color: var(--accent); }
.ax-chip:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.ax-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.ax-filter .ax-chip { background: var(--card); border-color: var(--line); padding: 6px 14px; }
.ax-filter .ax-chip.is-on { background: var(--accent); border-color: var(--accent); color: #0f1626; }

/* "On this page" */
.ax-toc { max-width: 720px; margin: 0 auto 32px; padding: 16px 20px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.ax-toc summary { cursor: pointer; font-weight: 800; font-size: 0.95rem; }
.ax-toc summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.ax-toc ol { margin: 12px 0 0; padding-left: 20px; display: grid; gap: 6px; }
.ax-toc li { color: var(--muted); }
.ax-toc .ax-toc-3 { margin-left: 16px; list-style: circle; font-size: 0.95rem; }
.ax-toc a { color: var(--ink); text-decoration: none; }
.ax-toc a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.art-text h2[id], .art-text h3[id] { scroll-margin-top: 80px; }

/* Resource block */
.ax-res { max-width: 720px; margin: 40px auto 0; display: flex; gap: 18px; align-items: flex-start; padding: 22px 24px; border-radius: 18px; background: var(--accent-soft); border: 1px solid var(--line); }
.ax-res-ico { flex: 0 0 52px; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px; background: var(--card); color: var(--ink); box-shadow: 0 0 0 2px var(--accent) inset; }
.ax-res-ico svg { width: 26px; height: 26px; }
.ax-res-body { min-width: 0; }
.ax-res-title { margin: 2px 0 6px; font-size: 1.2rem; font-weight: 800; letter-spacing: -0.01em; line-height: 1.25; }
.ax-res p { margin: 0 0 14px; color: var(--muted); }
.ax-res-btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 999px; background: var(--accent); color: #0f1626; font-weight: 600; text-decoration: none; }
.ax-res-btn:hover { background: var(--ink); color: var(--bg); }
.ax-res-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
@media (max-width: 520px) { .ax-res { flex-direction: column; } }

/* Share */
.ax-share { max-width: 720px; margin: 32px auto 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ax-share-label { color: var(--muted); font-size: 0.9rem; font-weight: 600; margin-right: 4px; }
.ax-share-btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink); font: inherit; font-size: 0.9rem; font-weight: 600; text-decoration: none; cursor: pointer; }
.ax-share-btn:hover { border-color: var(--accent); }
.ax-share-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.ax-share-btn svg { width: 18px; height: 18px; }
.ax-copied { font-size: 0.9rem; font-weight: 600; color: var(--muted); }

/* Related */
.ax-related { margin: 64px 0 0; }
.ax-related > h2 { margin: 0; font-size: 1.5rem; font-weight: 800; letter-spacing: -0.015em; }
.ax-related .art-grid { margin-top: 20px; }
@media (min-width: 700px) { .ax-related .art-grid { grid-template-columns: repeat(3, 1fr); } }

@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
