/* Editorial polish and optional article reading tools. */
body.theme-standard :where(a, button, input, textarea, select):focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent) 42%, transparent);
    outline-offset: 3px;
}

body.theme-standard .mz-global-search__input:focus-visible {
    outline: none;
    outline-offset: 0;
}

body.theme-standard .skip-link {
    z-index: 120;
    color: var(--text);
    font-weight: 800;
}

body.theme-standard .section-head {
    gap: 14px;
}

body.theme-standard .section-head::after {
    content: "";
    order: 1;
    flex: 1 1 80px;
    height: 1px;
    background: linear-gradient(90deg, var(--border), transparent);
}

body.theme-standard .section-head > :last-child:not(:first-child) {
    order: 2;
}

body.theme-standard [data-async-pagination-region="latest-articles"] {
    scroll-margin-top: 24px;
}

body.theme-standard.template-sticky-header [data-async-pagination-region="latest-articles"] {
    scroll-margin-top: 120px;
}

body.theme-standard .article-card {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    transition: transform .2s ease, border-color .2s ease, background-color .2s ease;
}

body.theme-standard .article-card::before {
    content: "";
    position: absolute;
    z-index: 2;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .2s ease;
}

body.theme-standard .article-card .text-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: max-content;
    margin-top: auto;
    text-underline-offset: 4px;
}

body.theme-standard .article-card .text-link::after {
    content: "→";
    transition: transform .2s ease;
}

body.theme-standard .article-card-thumb img,
body.theme-standard .category-card__media img {
    transition: transform .28s ease;
}

@media (hover: hover) {
    body.theme-standard .article-card:hover,
    body.theme-standard .article-card:focus-within,
    body.theme-standard .category-card:hover,
    body.theme-standard .category-card:focus-within {
        transform: translateY(-3px);
        border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
    }

    body.theme-standard .article-card:hover::before,
    body.theme-standard .article-card:focus-within::before {
        transform: scaleX(1);
    }

    body.theme-standard .article-card:hover .text-link::after,
    body.theme-standard .article-card:focus-within .text-link::after {
        transform: translateX(4px);
    }

    body.theme-standard .article-card:hover .article-card-thumb img,
    body.theme-standard .article-card:focus-within .article-card-thumb img,
    body.theme-standard .category-card:hover .category-card__media img,
    body.theme-standard .category-card:focus-within .category-card__media img {
        transform: scale(1.025);
    }
}

body.theme-standard .single-card--article {
    padding: clamp(24px, 4vw, 48px);
}

body.theme-standard .single-card--article > h1 {
    width: 100%;
    max-width: none;
    font-size: clamp(2.25rem, 5vw, 4.4rem);
    line-height: .98;
    letter-spacing: -.045em;
}

body.theme-standard .single-card--article > .lead {
    width: 100%;
    max-width: none;
    font-size: clamp(1.08rem, 2vw, 1.28rem);
    line-height: 1.7;
}

body.theme-standard .st-reading-time {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

body.theme-standard .st-reading-time::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--accent);
}

body.theme-standard .st-reading-progress {
    position: fixed;
    z-index: 110;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    pointer-events: none;
}

body.theme-standard .st-reading-progress__bar {
    display: block;
    width: var(--standard-reading-progress, 0%);
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transition: width .08s linear;
}

body.theme-standard .st-reading-layout {
    display: block;
    margin-top: 28px;
}

body.theme-standard .st-reading-layout--toc {
    display: grid;
    grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
    gap: clamp(24px, 4vw, 48px);
    align-items: start;
}

body.theme-standard .st-reading-layout__body {
    width: 100%;
    max-width: none;
    min-width: 0;
    margin-inline: 0;
}

body.theme-standard .st-reading-layout--single {
    display: block;
}

body.theme-standard .st-reading-layout--single .st-reading-layout__body {
    width: 100%;
    max-width: none;
    margin-inline: 0;
}

body.theme-standard .st-reading-toc {
    position: sticky;
    top: 24px;
    max-height: calc(100vh - 48px);
    overflow: auto;
    overscroll-behavior: contain;
    padding: 18px;
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--mz-border-radius);
    background: var(--surface-2);
}

body.theme-standard.template-sticky-header .st-reading-toc {
    top: 104px;
    max-height: calc(100vh - 128px);
}

body.theme-standard .st-reading-toc__title {
    display: block;
    margin-bottom: 12px;
    font-size: .82rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}

body.theme-standard .st-reading-toc__list {
    display: grid;
    gap: 5px;
    margin: 0;
    padding: 0;
    list-style: none;
}

body.theme-standard .st-reading-toc__link {
    display: block;
    padding: 7px 9px;
    border-radius: calc(var(--mz-border-radius) * .7);
    color: var(--muted);
    font-size: .88rem;
    font-weight: 650;
    line-height: 1.35;
    transition: color .18s ease, background-color .18s ease;
}

body.theme-standard .st-reading-toc__link--depth-3 {
    padding-left: 20px;
    font-size: .82rem;
}

body.theme-standard .st-reading-toc__link:hover,
body.theme-standard .st-reading-toc__link[aria-current="location"] {
    background: color-mix(in srgb, var(--accent) 12%, var(--surface));
    color: var(--text);
}

body.theme-standard .article-content {
    line-height: 1.82;
}

body.theme-standard .article-content :where(h2, h3) {
    scroll-margin-top: 120px;
    line-height: 1.15;
    letter-spacing: -.025em;
}

body.theme-standard .article-content h2 {
    margin-top: 2.2em;
    font-size: clamp(1.65rem, 3vw, 2.25rem);
}

body.theme-standard .article-content h3 {
    margin-top: 1.8em;
    font-size: clamp(1.3rem, 2vw, 1.65rem);
}

body.theme-standard .article-content :where(p, ul, ol, blockquote) {
    margin-block: 1.15em;
}

@media (max-width: 900px) {
    body.theme-standard .st-reading-layout--toc {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    body.theme-standard .st-reading-toc,
    body.theme-standard.template-sticky-header .st-reading-toc {
        position: static;
        max-height: none;
        overscroll-behavior: auto;
    }
}

@media (max-width: 720px) {
    body.theme-standard .single-card--article {
        padding: 22px 20px;
    }

    body.theme-standard .single-card--article > h1 {
        font-size: clamp(2rem, 11vw, 3.25rem);
    }

    body.theme-standard .st-reading-layout {
        margin-top: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.theme-standard .st-reading-progress__bar {
        transition: none;
    }
}
