/* Homepage: mobile-first editorial layout with dark sacred subtlety */

.home-page {
    max-width: none;
    margin-inline: 0;
}

.gap-md-6 {
    gap: clamp(2.5rem, 5vw, 4.5rem);
}

.home-kicker {
    letter-spacing: 0.08em;
    font-size: var(--sv-meta-size);
    line-height: 1.3;
    color: var(--color-text-muted);
}

.home-lead {
    max-width: 48ch;
    line-height: var(--sv-line-height);
    font-size: var(--sv-font-size-base);
}

/* Today's Scroll — vertical editorial card (full-width image band, copy below) */

.home-hero.home-hero--daily-feature {
    border-color: color-mix(in srgb, var(--color-border) 78%, var(--color-heading) 22%);
    background: linear-gradient(
        168deg,
        color-mix(in srgb, var(--color-surface) 97%, var(--color-heading) 3%),
        color-mix(in srgb, var(--color-surface-alt) 94%, var(--color-accent) 6%)
    );
}

/* Today's Scroll — compact editorial overlay hero (image + gradient + foreground copy) */

.home-feature-card {
    min-width: 0;
}

.home-feature-card--hero-overlay {
    border-radius: inherit;
}

.home-feature-card__frame {
    position: relative;
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 15.5rem;
    aspect-ratio: 1.52 / 1;
    max-height: min(23rem, 85cqi);
    overflow: hidden;
    background: color-mix(in srgb, var(--color-surface-alt) 88%, var(--color-heading) 12%);
}

.home-feature-card__media-hit {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: block;
    text-decoration: none;
    outline: none;
}

.home-feature-card__media-hit:focus-visible {
    z-index: 4;
}

.home-feature-card__media-hit:focus-visible .home-feature-card__image {
    outline: 2px solid var(--color-accent);
    outline-offset: -2px;
}

.home-feature-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 40%;
    display: block;
}

/*
 * Readability scrim — kept intentionally light. The localized glass panel does most of
 * the readability work; this gradient just biases shadow toward the text side without
 * darkening the full image. Mobile uses a soft bottom-up scrim because the panel sits
 * full-width at the bottom; wider viewports switch to a side-biased gradient (below).
 */
.home-feature-card__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(
            to top,
            color-mix(in srgb, rgb(8, 10, 14) 38%, transparent) 0%,
            color-mix(in srgb, rgb(8, 10, 14) 12%, transparent) 40%,
            transparent 64%
        );
}

.home-feature-card__body {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding: clamp(0.75rem, 2cqi, 1rem) clamp(0.85rem, 2.4cqi, 1.2rem) clamp(0.8rem, 2.2cqi, 1.05rem);
    pointer-events: none;
}

@media (min-width: 768px) {
    .home-feature-card__body {
        padding: clamp(0.9rem, 2cqi, 1.1rem) clamp(1rem, 2.35cqi, 1.35rem) clamp(0.95rem, 2.1cqi, 1.2rem);
    }
}

/*
 * Localized glass panel — backdrop-filter is scoped to this element only, so blur
 * is confined to the text region. The translucent white wash lifts contrast in both
 * light- and dark-theme images without becoming an opaque slab.
 */
.home-feature-card__body-inner {
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: 100%;
    padding: clamp(0.55rem, 1.45cqi, 0.78rem) clamp(0.72rem, 1.75cqi, 0.95rem);
    border-radius: clamp(0.3rem, 1cqi, var(--sv-radius-block));
    background: linear-gradient(
        165deg,
        color-mix(in srgb, rgb(255, 255, 255) 9%, transparent) 0%,
        color-mix(in srgb, rgb(255, 255, 255) 4%, transparent) 100%
    );
    backdrop-filter: blur(14px) saturate(118%);
    -webkit-backdrop-filter: blur(14px) saturate(118%);
    box-shadow:
        inset 0 1px 0 color-mix(in srgb, rgb(255, 255, 255) 18%, transparent),
        0 8px 24px -10px color-mix(in srgb, rgb(0, 0, 0) 38%, transparent);
    pointer-events: none;
}

/* Older Safari / browsers without backdrop-filter: fall back to a softer translucent tint. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .home-feature-card__body-inner {
        background: linear-gradient(
            165deg,
            color-mix(in srgb, rgb(8, 10, 14) 55%, transparent) 0%,
            color-mix(in srgb, rgb(8, 10, 14) 38%, transparent) 100%
        );
    }
}

.home-feature-card__body-inner a,
.home-feature-card__body-inner .sv-btn {
    pointer-events: auto;
}

/* Homepage editorial topic pill scale — Today's Scroll overlay (inherited by `.home-topic-label`). */
.home-feature-card--hero-overlay .home-feature-card__body-inner {
    --sv-editorial-tag-font-size: clamp(0.68rem, 0.62rem + 0.14cqi, 0.74rem);
    --sv-editorial-tag-padding-y: 0.14rem;
    --sv-editorial-tag-padding-x: 0.4rem;
    --sv-editorial-tag-letter-spacing: 0.055em;
    --sv-editorial-tag-line-height: 1.12;
}

/* Section kicker — top of overlay stack, above the headline. */
.home-feature-card--hero-overlay .home-feature-card__body-inner > .home-kicker {
    margin-top: 0;
    color: color-mix(in srgb, rgb(255, 255, 255) 82%, rgb(180, 186, 198) 18%);
    text-shadow: 0 1px 1px color-mix(in srgb, rgb(0, 0, 0) 28%, transparent);
    letter-spacing: 0.082em;
    font-size: clamp(
        calc(0.74rem * var(--sv-font-scale)),
        calc(0.66rem + 0.16cqi),
        calc(0.82rem * var(--sv-font-scale))
    );
    line-height: 1.32;
    margin-bottom: clamp(0.3rem, 0.92cqi, 0.52rem);
}

.home-feature-card--hero-overlay .home-topic-label {
    flex-shrink: 0;
    border-color: color-mix(in srgb, rgb(255, 255, 255) 26%, transparent);
    background-color: color-mix(in srgb, rgb(255, 255, 255) 7%, transparent);
    color: color-mix(in srgb, rgb(255, 255, 255) 94%, rgb(210, 214, 222) 6%);
}

.home-feature-card__meta {
    font-size: var(--sv-meta-size);
    letter-spacing: 0.04em;
    line-height: 1.3;
    color: color-mix(in srgb, rgb(255, 255, 255) 76%, rgb(170, 176, 188) 24%);
    text-shadow: 0 1px 1px color-mix(in srgb, rgb(0, 0, 0) 32%, transparent);
}

/* Topic pill + date: one metadata band below the excerpt, tight rhythm before the CTA. */
.home-feature-card--hero-overlay .home-feature-card__meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: clamp(0.28rem, 0.75cqi, 0.42rem);
    row-gap: 0.1rem;
    margin-top: clamp(0.2rem, 0.58cqi, 0.36rem) !important;
    margin-bottom: 0 !important;
    padding-top: 0.5rem;
}

.home-feature-card--hero-overlay .home-feature-card__meta-row time {
    letter-spacing: 0.035em;
}

.home-feature-card__meta-sep {
    margin-inline: 0;
    opacity: 0.72;
    user-select: none;
}

/* Hero headline: Today's Scroll overlay card */
.home-feature-card__title.home-hero-title {
    font-family: var(--sv-font-family-heading);
    font-size: clamp(
        calc(1.02rem * var(--sv-heading-scale)),
        calc(0.55rem + 1.72cqi * var(--sv-heading-scale)),
        calc(1.52rem * var(--sv-heading-scale))
    );
    line-height: 1.1;
    letter-spacing: 0.01em;
    margin: 0;
}

.home-feature-card--hero-overlay .home-feature-card__title a {
    color: rgb(255, 255, 255);
    text-shadow:
        0 1px 2px color-mix(in srgb, rgb(0, 0, 0) 45%, transparent),
        0 0 1px color-mix(in srgb, rgb(0, 0, 0) 55%, transparent);
}

.home-feature-card--hero-overlay .home-feature-card__title a:hover,
.home-feature-card--hero-overlay .home-feature-card__title a:focus-visible {
    color: rgb(255, 255, 255);
    text-decoration: underline;
    text-underline-offset: 0.14em;
}

.home-hero .home-feature-card__excerpt.home-lead {
    margin-top: clamp(0.2rem, 0.62cqi, 0.36rem);
    margin-bottom: clamp(0.26rem, 0.62cqi, 0.4rem);
    max-width: min(42ch, 100%);
    font-size: clamp(calc(0.86rem * var(--sv-font-scale)), calc(0.78rem + 0.24cqi), calc(0.95rem * var(--sv-font-scale)));
    line-height: 1.42;
    color: color-mix(in srgb, rgb(255, 255, 255) 88%, rgb(190, 196, 206) 12%);
    text-shadow: 0 1px 2px color-mix(in srgb, rgb(0, 0, 0) 38%, transparent);
}

.home-feature-card__actions {
    margin-top: clamp(0.38rem, 1.05cqi, 0.58rem);
}

.home-feature-card--hero-overlay .home-hero-cta-btn {
    padding-block: 0.58rem;
    padding-inline: max(1.1rem, var(--sv-btn-padding-x, 1rem));
}

.home-hero .btn {
    font-family: var(--sv-font-family);
    font-size: var(--sv-font-size-base);
    line-height: 1.4;
}

.home-daily-scroll {
    border: 1px solid color-mix(in srgb, var(--color-border) 75%, var(--color-heading) 25%);
    background: linear-gradient(
        145deg,
        color-mix(in srgb, var(--color-surface-alt) 94%, var(--color-heading) 6%),
        color-mix(in srgb, var(--color-surface) 92%, var(--color-accent) 8%)
    );
}

.home-daily-media {
    position: relative;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    border-radius: var(--sv-radius-block, 0.5rem);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
}

.home-daily-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.home-card-media--empty {
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-card-media {
    --sv-card-media-aspect-ratio: 16 / 10;
}

.home-card-media img {
    object-fit: var(--sv-card-media-fit, cover);
}

.home-topic-card {
    border: 1px solid var(--color-border);
    border-radius: var(--sv-radius-block, 0.5rem);
}

.home-quote-block {
    max-width: 52ch;
    padding: 1.5rem 1rem;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
    font-size: 1.08rem;
    line-height: 1.9;
    font-family: "Literata", "Georgia", "Times New Roman", serif;
    letter-spacing: 0.02em;
}

.home-display-title {
    font-size: var(--sv-h1-size);
    letter-spacing: 0.01em;
    line-height: var(--sv-heading-line-height);
}

/* Section + sidebar widget titles: one stack (color/type) from theme tokens. */
:is(.home-section-heading, .home-sidebar-heading) {
    color: var(--sv-heading);
    font-family: var(--sv-font-family-heading);
    line-height: var(--sv-heading-line-height);
}

.home-daily-heading {
    font-size: var(--sv-h3-size);
}

.home-daily-title {
    font-size: var(--sv-h2-size);
    line-height: var(--sv-heading-line-height);
}

.home-daily-title a {
    font-family: var(--sv-font-family-heading);
}

.home-daily-excerpt {
    max-width: 52ch;
    font-size: var(--sv-font-size-base);
    line-height: var(--sv-line-height);
}

.home-daily-meta {
    font-family: var(--sv-font-family);
    font-size: var(--sv-meta-size);
    line-height: 1.4;
    letter-spacing: 0.05em;
}

.home-daily-cta {
    font-family: var(--sv-font-family);
    font-size: var(--sv-font-size-s);
    line-height: 1.4;
}

.home-section-intro {
    max-width: 42rem;
}

.letter-spacing-heading {
    letter-spacing: 0.12em;
    font-weight: 600;
}

.topic-card-minimal:hover,
.topic-card-minimal:focus-visible {
    border-color: var(--color-border);
    background: color-mix(in srgb, var(--color-surface-alt) 88%, var(--color-heading) 12%);
}

.home-series-cover {
    --sv-card-media-aspect-ratio: 16 / 10;
    border-top-left-radius: var(--sv-card-media-radius, var(--sv-radius-block, var(--bs-card-inner-border-radius, 0.4375rem)));
    border-top-right-radius: var(--sv-card-media-radius, var(--sv-radius-block, var(--bs-card-inner-border-radius, 0.4375rem)));
}

.home-series-cover img {
    object-fit: var(--sv-card-media-fit, cover);
}

.home-blog-secondary-item:last-child article {
    border-bottom: none;
    padding-bottom: 0;
}

.home-blog-thumb {
    width: 4.5rem;
    height: 4.5rem;
    border-radius: var(--sv-radius-md);
    overflow: hidden;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
}

.home-blog-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tiny-meta {
    font-size: var(--sv-meta-size);
    letter-spacing: 0.02em;
}

@media (min-width: 768px) {
    .home-quote-block {
        font-size: 1.2rem;
        padding: 2rem 1rem;
    }
}

/*
 * Wider main rail: taller hero frame (shorter width:height ratio) so the artwork
 * dominates; glass panel stays compact (~half rail) so the right image stays crisp.
 */
@container home-main (min-width: 47.5rem) {
    .home-feature-card__frame {
        aspect-ratio: 1.82 / 1;
        min-height: 24.5rem;
        max-height: min(34rem, 72cqi);
    }

    /* Side-biased scrim — fades to fully transparent before 70% width, so the
       right half of the image remains free of any dark tint. */
    .home-feature-card__overlay {
        background:
            linear-gradient(
                to right,
                color-mix(in srgb, rgb(8, 10, 14) 28%, transparent) 0%,
                color-mix(in srgb, rgb(8, 10, 14) 14%, transparent) 34%,
                color-mix(in srgb, rgb(8, 10, 14) 3%, transparent) 58%,
                transparent 72%
            );
    }

    .home-feature-card__body {
        padding: clamp(0.95rem, 2.1cqi, 1.35rem);
    }

    .home-feature-card__body-inner {
        max-width: min(50%, 26rem);
        padding: clamp(0.78rem, 1.65cqi, 1.05rem) clamp(0.95rem, 1.9cqi, 1.25rem);
        border-radius: clamp(0.36rem, 1.05cqi, var(--sv-radius-block));
    }

    .home-feature-card__title.home-hero-title {
        font-size: clamp(
            calc(1.05rem * var(--sv-heading-scale)),
            calc(0.48rem + 1.72cqi * var(--sv-heading-scale)),
            calc(1.68rem * var(--sv-heading-scale))
        );
        line-height: 1.1;
    }
}

/* Larger desktop main column: slightly taller frame, compact overlay. */
@container home-main (min-width: 62rem) {
    .home-feature-card__frame {
        aspect-ratio: 1.88 / 1;
        min-height: 27rem;
        max-height: min(36rem, 64cqi);
    }

    .home-feature-card__body-inner {
        max-width: min(48%, 27rem);
    }

    .home-feature-card__title.home-hero-title {
        font-size: clamp(
            calc(1.08rem * var(--sv-heading-scale)),
            calc(0.5rem + 1.65cqi * var(--sv-heading-scale)),
            calc(1.72rem * var(--sv-heading-scale))
        );
    }
}

@media (min-width: 992px) {
    .home-editorial-sidebar {
        position: sticky;
        top: 1.25rem;
    }
}

/* Editorial homepage: sidebar (secondary rail) */

.home-editorial-main {
    min-width: 0;
    container-name: home-main;
    container-type: inline-size;
}

.home-editorial-sidebar-col {
    min-width: 0;
}

.home-editorial-sidebar {
    --sv-sidebar-radius: clamp(0.38rem, 0.95vw, var(--sv-radius-block));
    --sv-sidebar-pad: clamp(0.78rem, 1.85vw, 1.02rem);
    --sv-sidebar-edge: color-mix(in srgb, var(--color-border) 86%, transparent);
    --sv-sidebar-surface-a: color-mix(in srgb, var(--color-surface-alt) 36%, var(--color-bg) 64%);
    --sv-sidebar-surface-b: color-mix(in srgb, var(--color-surface-alt) 20%, var(--color-bg) 80%);
    /*
     * Reading prefs (data-reading-size / data-reading-font + inline --sv-font-*) apply on `html`.
     * Mirror the reading typography token names here so the rail tracks the same preferences live,
     * with a damped step so XL modes do not blow out the narrow column.
     */
    --sv-sidebar-reading-strength: 0.52;
    --sv-sidebar-meta-strength: 0.4;
    --sv-sidebar-font-mult: calc(1 + (var(--sv-font-scale) - 1) * var(--sv-sidebar-reading-strength));
    --sv-sidebar-meta-mult: calc(1 + (var(--sv-font-scale) - 1) * var(--sv-sidebar-meta-strength));
    /*
     * Supporting copy (muted, hooks, subheads): same tokens as .card-excerpt / p.text-muted-soft,
     * scaled down slightly so the narrow rail stays compact while tracking reading prefs.
     */
    --sv-sidebar-editorial-support-scale: 0.91;
    --sv-sidebar-font-support: calc(var(--sv-editorial-support-font-size) * var(--sv-sidebar-editorial-support-scale));
    --sv-reading-font: var(--sv-font-family);
    --sv-reading-body-size: calc(var(--sv-font-size-m) * var(--sv-sidebar-font-mult));
    --sv-reading-meta-size: calc(0.82rem * var(--sv-sidebar-meta-mult));
    --sv-sidebar-font-base: var(--sv-reading-body-size);
    --sv-sidebar-font-meta: var(--sv-reading-meta-size);
    font-family: var(--sv-reading-font);
}

.home-sidebar-stack {
    display: flex;
    flex-direction: column;
    gap: clamp(0.85rem, 2.1vw, 1.2rem);
}

.home-sidebar-widget {
    position: relative;
    padding: var(--sv-sidebar-pad);
    border-radius: var(--sv-sidebar-radius);
    background: linear-gradient(165deg, var(--sv-sidebar-surface-a) 0%, var(--sv-sidebar-surface-b) 100%);
    border: 1px solid var(--sv-sidebar-edge);
    box-shadow:
        inset 0 1px 0 color-mix(in srgb, rgb(var(--color-text-rgb)) 7%, transparent),
        0 10px 26px -20px color-mix(in srgb, rgb(0, 0, 0) 14%, transparent),
        var(--color-shadow-soft);
    transition:
        border-color var(--theme-transition-duration) ease,
        box-shadow var(--theme-transition-duration) ease;
    font-family: var(--sv-reading-font);
    font-size: var(--sv-sidebar-font-meta);
}

.home-sidebar-widget-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.28rem;
    margin: 0 0 clamp(0.62rem, 1.35vw, 0.82rem);
    padding-bottom: clamp(0.48rem, 1.05vw, 0.65rem);
    border-bottom: 1px solid color-mix(in srgb, var(--color-border) 64%, transparent);
}

.home-sidebar-heading {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
}

.home-sidebar-heading-icon {
    --sv-sidebar-heading-icon-size: 0.82rem;
    /* Bind palette vars from html[data-theme] to locals (never reassign --sv-sidebar-heading-icon-* here). */
    --_sv-sidebar-heading-icon-fill: var(
        --sv-sidebar-heading-icon-color,
        color-mix(in srgb, var(--sv-heading) 90%, var(--color-text-muted) 10%)
    );
    --_sv-sidebar-heading-icon-fill-hover: var(
        --sv-sidebar-heading-icon-hover-color,
        rgb(var(--color-heading-rgb))
    );
    width: var(--sv-sidebar-heading-icon-size);
    height: var(--sv-sidebar-heading-icon-size);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transform: translateY(-0.01em);
}

.home-sidebar-heading-icon-glyph.home-sidebar-heading-icon-theme {
    display: block;
    width: 100%;
    height: 100%;
    flex-shrink: 0;
    background-color: var(--_sv-sidebar-heading-icon-fill);
    -webkit-mask-image: var(--sv-sidebar-heading-icon-mask);
    mask-image: var(--sv-sidebar-heading-icon-mask);
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    transition: background-color var(--theme-transition-duration) ease;
}

.home-sidebar-heading:hover .home-sidebar-heading-icon-glyph.home-sidebar-heading-icon-theme,
.home-sidebar-heading:focus-within .home-sidebar-heading-icon-glyph.home-sidebar-heading-icon-theme {
    background-color: var(--_sv-sidebar-heading-icon-fill-hover);
}

.home-sidebar-heading-icon .home-sidebar-heading-icon-theme {
    display: none !important;
}

html[data-theme="light"] .home-sidebar-heading-icon .home-sidebar-heading-icon-theme--light,
html[data-theme="sepia"] .home-sidebar-heading-icon .home-sidebar-heading-icon-theme--sepia,
html[data-theme="dark"] .home-sidebar-heading-icon .home-sidebar-heading-icon-theme--dark {
    display: block !important;
}

.home-sidebar-heading-icon--fallback-rail {
    width: 2px;
    height: 0.9em;
    border-radius: var(--sv-radius-circle);
    background-color: var(--_sv-sidebar-heading-icon-fill);
    transform: none;
    transition: background-color var(--theme-transition-duration) ease;
}

.home-sidebar-heading:hover .home-sidebar-heading-icon--fallback-rail,
.home-sidebar-heading:focus-within .home-sidebar-heading-icon--fallback-rail {
    background-color: var(--_sv-sidebar-heading-icon-fill-hover);
}

.home-sidebar-heading > span:last-child {
    min-width: 0;
}

/* Narrow-rail widget titles (Topics, Active reading plan, Active scroll series): compact scale vs main column h4 sections. */
.home-sidebar-heading.home-sidebar-heading--rail {
    font-size: clamp(
        calc(0.9rem * var(--sv-heading-scale)),
        calc(0.8rem + 0.16vw),
        calc(1.02rem * var(--sv-heading-scale))
    );
}

.home-sidebar-muted {
    color: var(--color-text-muted);
}

.home-editorial-sidebar :is(.small, small):not(.home-sidebar-cta-link) {
    font-size: calc(var(--sv-sidebar-font-meta) * 0.96);
}

/* Muted body + soft links: rail-scaled editorial support tokens (see --sv-sidebar-font-support). */
.home-editorial-sidebar .home-sidebar-muted,
.home-editorial-sidebar .home-sidebar-soft-link {
    font-family: var(--sv-reading-font);
    font-size: var(--sv-sidebar-font-support);
    line-height: var(--sv-editorial-support-line-height);
}

.home-editorial-sidebar .home-sidebar-soft-link {
    font-size: calc(var(--sv-sidebar-font-support) * 0.97);
}

/* Series description line: same tier as card excerpts / muted rail copy. */
.home-editorial-sidebar .home-sidebar-series-hook {
    font-family: var(--sv-reading-font);
    font-size: var(--sv-sidebar-font-support);
    line-height: var(--sv-editorial-support-line-height);
    overflow-wrap: anywhere;
}

.home-sidebar-soft-link {
    color: var(--color-text-muted);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition:
        color var(--theme-transition-duration) ease,
        border-color var(--theme-transition-duration) ease;
}

.home-sidebar-soft-link:hover,
.home-sidebar-soft-link:focus-visible {
    color: var(--color-heading);
    border-bottom-color: color-mix(in srgb, var(--color-accent) 55%, var(--color-border) 45%);
}

.home-sidebar-soft-link:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 3px;
    border-radius: var(--sv-radius-xs);
}

.home-sidebar-topic-list {
    display: flex;
    flex-direction: column;
    gap: 0.08rem;
}

.home-sidebar-topic-link {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.35rem 0.75rem;
    padding: 0.38rem 0.42rem;
    margin-inline: -0.42rem;
    text-decoration: none;
    color: var(--color-text);
    border-radius: calc(var(--sv-sidebar-radius, var(--sv-radius-block)) - 0.18rem);
    border: 1px solid transparent;
    transition:
        background-color var(--theme-transition-duration) ease,
        border-color var(--theme-transition-duration) ease,
        color var(--theme-transition-duration) ease;
}

.home-sidebar-topic-link > * {
    min-width: 0;
}

.home-sidebar-topic-link:hover,
.home-sidebar-topic-link:focus-visible {
    color: var(--color-heading);
    background-color: color-mix(in srgb, var(--color-surface-alt) 72%, var(--color-bg) 28%);
    border-color: color-mix(in srgb, var(--color-border) 45%, transparent);
}

.home-sidebar-topic-link:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 1px;
}

.home-sidebar-topic-name {
    font-family: var(--sv-reading-font);
    font-size: var(--sv-sidebar-font-base);
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.home-sidebar-topic-meta {
    font-size: var(--sv-sidebar-font-meta);
    white-space: normal;
    text-align: end;
    overflow-wrap: anywhere;
}

.home-sidebar-series-list {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
}

.home-sidebar-series-link {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.48rem 0.42rem;
    margin-inline: -0.42rem;
    text-decoration: none;
    color: var(--color-text);
    border-radius: calc(var(--sv-sidebar-radius, var(--sv-radius-block)) - 0.15rem);
    border: 1px solid transparent;
    transition:
        background-color var(--theme-transition-duration) ease,
        border-color var(--theme-transition-duration) ease,
        color var(--theme-transition-duration) ease,
        box-shadow var(--theme-transition-duration) ease;
}

.home-sidebar-series-link:hover,
.home-sidebar-series-link:focus-visible {
    background-color: color-mix(in srgb, var(--color-surface-alt) 68%, var(--color-bg) 32%);
    border-color: color-mix(in srgb, var(--color-border) 48%, transparent);
    color: var(--color-heading);
    box-shadow: inset 0 1px 0 color-mix(in srgb, rgb(var(--color-text-rgb)) 5%, transparent);
}

.home-sidebar-series-link:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 1px;
}

.home-sidebar-series-title {
    font-family: var(--sv-reading-font);
    font-size: calc(var(--sv-sidebar-font-base) * 0.93);
    line-height: 1.35;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.home-sidebar-series-meta {
    font-size: var(--sv-sidebar-font-meta);
}

.home-sidebar-cta-link {
    display: inline-block;
    font-weight: 500;
    font-family: var(--sv-reading-font);
    font-size: var(--sv-sidebar-font-base);
    color: var(--color-heading);
    text-decoration: none;
    border-bottom: 1px solid color-mix(in srgb, var(--color-accent) 40%, transparent);
}

.home-sidebar-cta-link:hover,
.home-sidebar-cta-link:focus-visible {
    border-bottom-color: var(--color-accent);
}

.home-sidebar-cta-link:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 3px;
    border-radius: var(--sv-radius-xs);
}

.home-sidebar-footnote {
    padding-top: clamp(0.52rem, 1.1vw, 0.68rem);
    margin-top: clamp(0.5rem, 1.05vw, 0.65rem);
    border-top: 1px solid color-mix(in srgb, var(--color-border) 58%, transparent);
}

.home-sidebar-reading-plan-active {
    padding: clamp(0.52rem, 1.05vw, 0.68rem) clamp(0.55rem, 1.1vw, 0.72rem);
    border-radius: calc(var(--sv-sidebar-radius, var(--sv-radius-block)) - 0.14rem);
    background: color-mix(in srgb, var(--color-surface-alt) 42%, var(--color-bg) 58%);
    border: 1px solid color-mix(in srgb, var(--color-border) 52%, transparent);
    box-shadow: inset 0 1px 0 color-mix(in srgb, rgb(var(--color-text-rgb)) 5%, transparent);
}

.home-sidebar-reading-plan-title {
    font-family: var(--sv-reading-font);
    font-size: calc(var(--sv-sidebar-font-base) * 0.93);
    font-weight: 600;
    line-height: 1.38;
    color: var(--color-heading);
    letter-spacing: 0.01em;
}

/* Homepage editorial carousels (Latest Scrolls, Popular Series) — shared shell + scrollport */

#home-latest-scrolls-section,
#home-popular-series-section {
    --home-editorial-carousel-gap: 1rem;
    width: 100%;
    min-width: 0;
}

#home-latest-scrolls-section .home-editorial-carousel-header,
#home-popular-series-section .home-editorial-carousel-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
}

#home-latest-scrolls-section .home-editorial-carousel-nav,
#home-popular-series-section .home-editorial-carousel-nav {
    display: inline-flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

#home-latest-scrolls-section .home-editorial-carousel-nav[hidden],
#home-popular-series-section .home-editorial-carousel-nav[hidden] {
    display: none !important;
}

#home-latest-scrolls-section .home-carousel-arrow,
#home-popular-series-section .home-carousel-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    padding: 0;
    margin: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--sv-radius-circle);
    background: color-mix(in srgb, var(--color-surface-alt) 90%, var(--color-heading) 10%);
    color: var(--color-heading);
    cursor: pointer;
    pointer-events: auto;
    z-index: 1;
    transition:
        background-color var(--theme-transition-duration) ease,
        border-color var(--theme-transition-duration) ease,
        color var(--theme-transition-duration) ease;
}

#home-latest-scrolls-section .home-carousel-arrow:hover,
#home-latest-scrolls-section .home-carousel-arrow:focus-visible,
#home-popular-series-section .home-carousel-arrow:hover,
#home-popular-series-section .home-carousel-arrow:focus-visible {
    background: color-mix(in srgb, var(--color-surface-alt) 80%, var(--color-heading) 20%);
    border-color: color-mix(in srgb, var(--color-border) 60%, var(--color-heading) 40%);
}

#home-latest-scrolls-section .home-carousel-arrow:focus-visible,
#home-popular-series-section .home-carousel-arrow:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

#home-latest-scrolls-section .home-carousel-arrow:disabled,
#home-popular-series-section .home-carousel-arrow:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#home-latest-scrolls-section .home-editorial-carousel-shell,
#home-popular-series-section .home-editorial-carousel-shell {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

#home-latest-scrolls-section .home-editorial-carousel-viewport,
#home-popular-series-section .home-editorial-carousel-viewport {
    container-name: home-editorial;
    container-type: inline-size;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scroll-padding-inline: 0;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pinch-zoom;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#home-latest-scrolls-section .home-editorial-carousel-viewport::-webkit-scrollbar,
#home-popular-series-section .home-editorial-carousel-viewport::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

#home-latest-scrolls-section .home-editorial-carousel-viewport:focus-visible,
#home-popular-series-section .home-editorial-carousel-viewport:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 3px;
    border-radius: var(--sv-radius-block, 0.5rem);
}

#home-latest-scrolls-section .home-editorial-carousel-track,
#home-popular-series-section .home-editorial-carousel-track {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: var(--home-editorial-carousel-gap);
    width: max-content;
    min-height: min-content;
}

#home-latest-scrolls-section .home-editorial-carousel-track > .home-editorial-carousel-item,
#home-popular-series-section .home-editorial-carousel-track > .home-editorial-carousel-item {
    box-sizing: border-box;
    flex: 0 0 auto;
    width: 100cqw;
    max-width: 100cqw;
    min-width: 0;
    scroll-snap-align: start;
    scroll-snap-stop: normal;
    display: flex;
}

#home-latest-scrolls-section .home-editorial-carousel-track > .home-editorial-carousel-item > [class*="col-"] {
    min-width: 0;
    width: auto;
    max-width: none;
    flex: 1 1 auto;
    padding: 0;
    display: flex;
}

#home-latest-scrolls-section .home-editorial-carousel-track > .home-editorial-carousel-item > [class*="col-"] > .card {
    width: 100%;
}

#home-popular-series-section .home-popular-series-item.home-editorial-carousel-item > .home-series-card {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

#home-latest-scrolls-section .home-latest-scrolls-item .card-media,
#home-popular-series-section .home-popular-series-item .card-media {
    margin-bottom: 0.55rem;
}

#home-latest-scrolls-section .home-latest-scrolls-item .card-body,
#home-popular-series-section .home-popular-series-item .card-body {
    padding: 0.85rem 0.95rem 0.9rem;
    gap: 0;
}

/*
 * Homepage editorial pills — Latest Scrolls + From the blog `.card-kicker` / `.home-topic-label`
 * (same tokens as Today's Scroll overlay; `cqi` uses nearest size container: carousel viewport vs main rail).
 */
#home-latest-scrolls-section .home-latest-scrolls-item article.editorial-card,
#home-popular-series-section .home-popular-series-item article.editorial-card,
.home-blog-secondary .editorial-card {
    --sv-editorial-tag-font-size: clamp(0.68rem, 0.62rem + 0.14cqi, 0.74rem);
    --sv-editorial-tag-padding-y: 0.14rem;
    --sv-editorial-tag-padding-x: 0.4rem;
    --sv-editorial-tag-letter-spacing: 0.055em;
    --sv-editorial-tag-line-height: 1.12;
}

.home-blog-secondary .editorial-card .card-body {
    padding: 0.85rem 0.95rem 0.9rem;
}

.home-blog-secondary .editorial-card .card-footer {
    padding-top: 0.35rem;
    gap: 0.45rem;
}

@media (min-width: 768px) {
    .home-blog-secondary .editorial-card .card-body {
        padding: 0.95rem 1.05rem 1rem;
    }
}

#home-latest-scrolls-section .home-latest-scrolls-item h3,
#home-popular-series-section .home-popular-series-item h3 {
    margin-bottom: 0.45rem !important;
}

#home-latest-scrolls-section .home-latest-scrolls-item h3.h5,
#home-popular-series-section .home-popular-series-item h3.h5 {
    font-size: clamp(1rem, 0.93rem + 0.24vw, 1.1rem);
    line-height: 1.25;
    overflow-wrap: anywhere;
}

#home-latest-scrolls-section .home-latest-scrolls-item .card-title-link,
#home-popular-series-section .home-popular-series-item .card-title-link {
    line-height: inherit;
}

#home-latest-scrolls-section .home-latest-scrolls-item .card-excerpt,
#home-popular-series-section .home-popular-series-item .card-excerpt {
    margin-bottom: 0 !important;
    line-height: var(--sv-editorial-support-line-height);
}

#home-latest-scrolls-section .home-latest-scrolls-item .card-body > .card-excerpt + .sv-card-footer,
#home-latest-scrolls-section .home-latest-scrolls-item .card-body > .card-text.card-excerpt + .sv-card-footer {
    margin-top: 0 !important;
}

#home-latest-scrolls-section .home-latest-scrolls-item .card-excerpt p:last-child {
    margin-bottom: 0;
}

#home-latest-scrolls-section .home-latest-scrolls-item .card-footer {
    padding-top: 0.35rem;
    gap: 0.45rem;
}

#home-latest-scrolls-section .home-latest-scrolls-item .sv-card-read-more {
    font-size: 0.8rem;
    padding-inline: 0.55rem;
    padding-block: 0.22rem;
}

#home-latest-scrolls-section .home-latest-scrolls-item p,
#home-popular-series-section .home-popular-series-item p {
    margin-top: 0;
}

/*
 * Breakpoints are for the carousel scrollport (col-lg-9), not the full window.
 * Using 992px here left the rail stuck at 2 columns because the main column is narrower.
 */
@container home-editorial (min-width: 560px) {
    #home-latest-scrolls-section .home-editorial-carousel-track > .home-editorial-carousel-item,
    #home-popular-series-section .home-editorial-carousel-track > .home-editorial-carousel-item {
        width: calc((100cqw - var(--home-editorial-carousel-gap)) / 2);
        max-width: calc((100cqw - var(--home-editorial-carousel-gap)) / 2);
    }
}

@container home-editorial (min-width: 720px) {
    #home-latest-scrolls-section .home-editorial-carousel-track > .home-editorial-carousel-item,
    #home-popular-series-section .home-editorial-carousel-track > .home-editorial-carousel-item {
        width: calc((100cqw - (var(--home-editorial-carousel-gap) * 2)) / 3);
        max-width: calc((100cqw - (var(--home-editorial-carousel-gap) * 2)) / 3);
    }
}

@media (min-width: 768px) {
    #home-latest-scrolls-section,
    #home-popular-series-section {
        --home-editorial-carousel-gap: 1.5rem;
    }

    #home-latest-scrolls-section .home-latest-scrolls-item .card-body {
        padding: 0.5rem 1.05rem 1rem;
    }

    #home-popular-series-section .home-popular-series-item .card-body {
        padding: 0.5rem 1.05rem 1rem;
    }
}
