.position-sticky {
    top: 3rem;
}

.breadcrumb-trail {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 7px;
    font-size: 0.8rem;
    color: var(--text-muted);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    min-width: 0;
    padding-bottom: 2px;
}

.breadcrumb-trail > * {
    flex-shrink: 0;
}

.breadcrumb-link {
    color: var(--text-link, #273c75);
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb-link:hover {
    color: var(--text-link-hover, #1e3060);
    text-decoration: underline;
}

.breadcrumb-current {
    color: inherit;
    font-weight: 600;
}

.breadcrumb-sep {
    color: var(--text-muted-alt);
    margin: 0 2px;
}

/* Root crumb: short label on small viewports (align with header .brand-short) */
.breadcrumb-brand-full {
    display: inline;
}

.breadcrumb-brand-short {
    display: none;
}

@media (max-width: 991px) {
    .breadcrumb-brand-full {
        display: none;
    }

    .breadcrumb-brand-short {
        display: inline;
    }
}

/* h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: "Playfair Display", Georgia, "Times New Roman", serif;
} */

.site-main {
    position: relative;
}

/* .pages_content_block{
    margin-top: 50px;
    margin-bottom: 50px;
} */


.title-block {
    background: rgba(0, 0, 0, .7);
    z-index: 500;
    color: #ffffff;
    padding: 15px 30px;
    border-radius: 8px;
}


.primary_section,
.cosmo_section{
    min-height: 100vh;
    box-sizing: border-box;
    overflow: hidden;
    padding: 90px 0;
}

.faq-section {
    padding-top: 0;
    margin-bottom: 0;
}

/* Human-readable /sitemap/ (aligned with FAQ spacing) */
.sitemap-html-grid {
    display: grid;
    gap: 2rem 2rem;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    align-items: start;
}

.sitemap-html-block--wide {
    grid-column: 1 / -1;
}

.sitemap-html-block-title {
    font-size: 1.2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.85rem;
    color: var(--text-link);
}

.sitemap-html-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    font-size: 1rem;
    line-height: 1.45;
}

.sitemap-html-list--tags {
    flex-flow: row wrap;
    flex-direction: row;
    gap: 0.45rem 1.1rem;
}

/* Main pages + Topic hubs: same inline-wrap rhythm as Tags, only on small viewports */
@media (max-width: 767.98px) {
    #sitemap-main-pages .sitemap-html-list,
    #sitemap-topics .sitemap-html-list {
        flex-flow: row wrap;
        flex-direction: row;
        gap: 0.45rem 1.1rem;
    }
}

.sitemap-html-link {
    transition: color 0.2s ease;
}

.sitemap-html-link:hover {
    color: var(--text-link) !important;
}

html[data-theme="dark"] .sitemap-html-link {
    display: inline-block;
    padding: 0.2rem 0.45rem;
    margin: 0 -0.45rem;
    border-radius: 4px;
    transition: background-color 0.12s ease, color 0.12s ease;
}

html[data-theme="dark"] .sitemap-html-link:hover {
    background: var(--bg-subtle, #f1f2f6);
    color: var(--text-link) !important;
}

.sitemap-html-header .text-body {
    font-weight: 500;
    color: inherit;
}

/* @media (max-width: 768px) {
    .faq-section {
        padding-bottom: 6rem;
    }
} */


.centered {
    display: flex;
    /* center horizontally */
    flex-direction: column;
    justify-content: center;
    /* center vertically */
    align-items: center;
}

.faq_answer {
    white-space: pre-wrap;
    /* important: preserve line breaks */
    line-height: 1.5;
}


/* ====================== SECONDARY SECTION (updated) ====================== */
/* Secondary section — slightly darkened background (overlay) */
.cosmo_section {
    position: relative;
    /* min-height: 100vh; */
    color: #fff;
    background: url("../img/earth_hero.webp") center / cover fixed;
    overflow: hidden;
}

.cosmo_section a {
    z-index: 200;
}

/* Darken background layer (above bg, below astronauts/text) */
.cosmo_section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 1;
    pointer-events: none;
}

.cosmo_section::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 15vh;
    pointer-events: none;
    background: linear-gradient(to bottom,
            rgba(0, 0, 0, 0) 0%,
            rgba(0, 0, 0, 0.6) 35%,
            rgba(0, 0, 0, 0.9) 70%,
            #000 100%);
    z-index: 100;
}

/* Inner text block */
.sec-inner {
    position: relative;
    z-index: 6;
    /* above astronaut layers */
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.sec-title,
.sec-sub {
    transition: transform 0.12s linear;
    will-change: transform;
}

.sec-sub {
    font-size: 1.1rem;
    line-height: 2rem;
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.6);
    max-width: 550px;
}

/* Shared style for astronaut figures */
.sec-astro {
    position: absolute;
    transform: translateX(-50%) translateY(0) scale(1);
    width: 220px;
    max-width: 24vw;
    z-index: 3;
    /* overridden per element */
    pointer-events: none;
    transition: none;
    /* animation driven from JS */
    will-change: transform, filter;
    mix-blend-mode: normal;
    filter: saturate(1) contrast(1);
    backface-visibility: hidden;
}

.flip-h {
    scale: -1 1;
    /* mirror on X axis */
}

.hero-snap {
    display: flex;
    gap: 30px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    z-index: 50;
    -webkit-overflow-scrolling: touch;
    align-items: center;
    padding: 0 8vw;
}

.hero-snap::-webkit-scrollbar {
    display: none;
}

.hero-card {
    flex: 0 0 calc((100vw - 10vw - 64px) / 3);
    height: 560px;
    scroll-snap-align: center;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, .3);
    backdrop-filter: blur(6px);
    transition: transform .3s ease;
    z-index: 200;
    display: flex;
    flex-direction: column;
}

.hero-card-body a {
    color: #fff;
    text-decoration: none;
    font-size: .9rem;
}

.hero-card > img {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    object-fit: cover;
    object-position: 50% 40%;
    transition: .3s ease;
}

.hero-card > .hero-card__thumb-placeholder {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    background: rgba(0, 0, 0, .12);
}

.hero-card:hover > img {
    transform: scale(1.03);
}

.hero-card-body {
    flex: 0 0 auto;
    padding: 16px;
    color: #fff;
}

/* Tablet — 2 cards */
@media (max-width: 1024px) {
    .hero-card {
        flex: 0 0 calc((100vw - 16vw - 32px) / 2);
        height: 520px;
    }
}

/* Mobile — 1 card */
@media (max-width: 640px) {
    .hero-card {
        flex: 0 0 88vw;
        height: 480px;
    }
}

.sec-title {
    color: #c8d6e5;
    text-decoration: underline;
}


/* ===== Custom FAQ accordion ===== */
.faq-accordion-custom {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.faq-item-header {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    font-weight: 500;
    text-align: left;
    color: var(--text-default, #1f2328);
    background: var(--bg-default, #fff);
    border: none;
    border-radius: var(--radius-md, 8px);
    cursor: pointer;
    transition: background 0.2s ease;
}

.faq-item-header:hover {
    background: var(--bg-subtle, #f1f2f3);
}

.faq-item-question {
    flex: 1;
}

.faq-item-toggle {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: rgb(25, 42, 86);
    border-radius: 50%;
}

.faq-toggle-icon {
    position: relative;
    width: 1rem;
    height: 1rem;
    transition: transform 0.3s ease;
}

.faq-item.is-open .faq-toggle-icon {
    transform: rotate(45deg);
}

.faq-toggle-line {
    position: absolute;
    background: #ffffff;
    transition: background 0.2s ease;
}

.faq-toggle-h {
    left: 0;
    right: 0;
    top: 50%;
    height: 2px;
    margin-top: -1px;
}

.faq-toggle-v {
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    margin-left: -1px;
}

/* .faq-item-header:hover .faq-toggle-line {
    background: var(--text-default, #1f2328);
} */

.faq-item-answer {
    overflow: hidden;
    max-height: 0;
    margin-top: 0;
    background: var(--bg-muted, #f6f8fa);
    border-radius: var(--radius-md, 8px);
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), margin-top 0.4s ease;
}

.faq-item.is-open .faq-item-answer {
    margin-top: 0.25rem;
    max-height: 800px;
}

@media (max-width: 768px) {
    .faq-item.is-open .faq-item-answer {
        max-height: 70vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

.faq-item-answer .faq_answer {
    padding: 1rem 1.25rem 1.25rem;
    margin: 0;
}

html[data-theme="dark"] .faq-item-header {
    background: var(--bg-default);
    color: var(--text-default);
}

html[data-theme="dark"] .faq-item-header:hover {
    background: var(--bg-subtle);
}

html[data-theme="dark"] .faq-toggle-line {
    background: #ffffff;
}

html[data-theme="dark"] .faq-item-header:hover .faq-toggle-line {
    background: var(--text-default);
}

html[data-theme="dark"] .faq-item-answer {
    background: var(--bg-muted);
}

/* ========== Static pages: About / Contacts (minimal, informative) ========== */
/* Top spacing like BraiNews/Popular: parent .container.content_block (styles.css) */
.page-static {
    --page-static-max: 55rem;
    padding: 0 0 clamp(2.5rem, 6vw, 4rem);
    color: var(--text-default, #1f2328);
    background: transparent;
    box-sizing: border-box;
}

.page-static__inner {
    max-width: var(--page-static-max);
    margin: 0 auto;
}

.page-static__header {
    margin-bottom: clamp(1.75rem, 4vw, 2.5rem);
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-default, #e6e6e6);
}

.page-static__title {
    font-family: var(--font-heading, 'Space Grotesk', sans-serif);
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin: 0 0 0.75rem;
    color: var(--text-default);
}

.page-static__lede {
    font-size: 1.05rem;
    line-height: 1.65;
    margin: 0;
    color: var(--text-muted, #6c757d);
    max-width: 38rem;
}

.page-static__lede strong {
    color: var(--text-default);
    font-weight: 600;
}

.page-static__section {
    margin-bottom: clamp(1.75rem, 4vw, 2.25rem);
}

.page-static__section--muted .page-static__p {
    color: var(--text-muted);
}

.page-static__h2 {
    font-family: var(--font-heading, 'Space Grotesk', sans-serif);
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 1rem;
    color: var(--text-muted-alt, #8b949e);
}

.page-static__list {
    margin: 0;
    padding-left: 1.25rem;
    line-height: 1.65;
    color: var(--text-default);
}

.page-static__list li {
    margin-bottom: 0.5rem;
}

.page-static__list li:last-child {
    margin-bottom: 0;
}

.page-static__facts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem 1.25rem;
    margin: 0;
}

.page-static__fact {
    margin: 0;
    padding: 1rem 1rem 1.1rem;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md, 8px);
    background: var(--bg-muted, #f6f8fa);
}

.page-static__fact-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted-alt);
    margin: 0 0 0.35rem;
}

.page-static__fact-value {
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.45;
    margin: 0;
    color: var(--text-default);
}

.page-static__contact-list {
    margin: 0;
}

.page-static__contact-row {
    display: grid;
    grid-template-columns: minmax(7rem, 10rem) 1fr;
    gap: 0.75rem 1.25rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border-subtle, #f1f2f3);
    align-items: start;
}

.page-static__contact-row:last-child {
    border-bottom: none;
}

.page-static__contact-key {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    margin: 0;
}

.page-static__contact-val {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--text-default);
}

.page-static__contact-note {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted-alt);
    margin-top: 0.25rem;
}

.page-static__p {
    margin: 0;
    line-height: 1.65;
    font-size: 0.95rem;
}

.page-static__footer {
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-default);
}

.page-static__cta {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.55;
}

.page-static__cta-hint {
    color: var(--text-muted);
}

.page-static__meta {
    margin: 0;
    font-size: 0.9rem;
}

.page-static__link {
    color: var(--text-link, #2980b9);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.page-static__link:hover {
    color: var(--text-link-hover, #58a6ff);
    border-bottom-color: currentColor;
}

.page-static__link--subtle {
    font-weight: 400;
    color: var(--text-muted);
}

.page-static__link--subtle:hover {
    color: var(--text-link);
}

@media (max-width: 640px) {
    .page-static__facts {
        grid-template-columns: 1fr;
    }

    .page-static__contact-row {
        grid-template-columns: 1fr;
        gap: 0.35rem;
        min-height: 0;
        padding: 1rem 0;
    }

    .page-static__contact-key {
        margin-bottom: 0.15rem;
    }
}

@media (max-width: 768px) {
    .page-static__contact-row .page-static__contact-val {
        min-height: 2.75rem;
    }
}

/* Error pages (404 / 403 / 429) — tokens + typography; no Bootstrap reboot */
body.error-page {
    font-family: var(--font-body, 'Inter', sans-serif);
    background: var(--bg-default, #ffffff);
    color: var(--text-default, #1f2328);
    min-height: 100vh;
}

[data-theme='dark'] body.error-page {
    background: var(--bg-default);
    color: var(--text-default);
}

.error-page-section {
    padding: clamp(2rem, 6vw, 4rem) 0 clamp(3rem, 8vw, 5rem);
    min-height: min(70vh, calc(100vh - 2 * var(--main-pad-y, 76px) - 120px));
    display: flex;
    align-items: center;
}

body.error-page .main {
    flex: 1;
}

.error-page-card {
    max-width: 40rem;
    margin: 0 auto;
    padding: clamp(1.75rem, 4vw, 2.75rem);
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-default, #e6e6e6);
    border-radius: var(--radius-lg, 12px);
    box-shadow: var(--card-shadow, 0 3px 12px rgba(0, 0, 0, 0.08));
    text-align: center;
}

[data-theme='dark'] .error-page-card {
    background: var(--card-bg);
    border-color: var(--border-strong, #30363d);
}

.error-page-brand {
    font-family: var(--font-heading, 'Space Grotesk', sans-serif);
    font-size: 0.9rem;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

.error-page-brand-link {
    color: var(--text-primary, #273c75);
    text-decoration: none;
    font-weight: 600;
}

.error-page-brand-link:hover {
    color: var(--text-link-hover, #58a6ff);
}

.error-page-code {
    font-family: var(--font-heading, 'Space Grotesk', sans-serif);
    font-size: clamp(3.5rem, 12vw, 5.5rem);
    font-weight: 700;
    line-height: 1;
    margin: 0 0 0.75rem;
    color: var(--text-muted-alt, #8b949e);
    letter-spacing: -0.06em;
}

.error-page-code--denied {
    color: var(--orange-color, #e67e22);
}

.error-page-title {
    font-family: var(--font-heading, 'Space Grotesk', sans-serif);
    font-size: clamp(1.35rem, 4vw, 1.75rem);
    font-weight: 600;
    color: var(--text-default, #1f2328);
    margin: 0 0 0.75rem;
}

.error-page-lead {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 1rem;
    line-height: 1.65;
    color: var(--text-muted, #6c757d);
    margin: 0 auto 1.75rem;
    max-width: 32rem;
}

.error-page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    justify-content: center;
}

@media (max-width: 480px) {
    .error-page-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .error-page-actions .cstm-btn,
    .error-page-actions .cstm-btn-sm {
        width: 100%;
    }
}

/* —— Home v2 legacy (kept for rollback only; new layout is v3 below) —— */
.home-section__empty {
    text-align: center;
    font-size: 0.95rem;
}

.home-empty-banner {
    text-align: center;
    border: 1px solid var(--border-default, rgba(0, 0, 0, 0.12));
    border-radius: var(--radius-sm, 8px);
    padding: 0.75rem 1rem;
    background: var(--bg-muted, rgba(0, 0, 0, 0.03));
}

/* Legacy v2 home component CSS (post cards, for-you scroll, topic chips,
 * editor picks, latest list, bottom CTA) was removed in the v3 redesign.
 * Markup partials in pages/templates/includes/home/ are kept in git for
 * rollback only and have no live consumer. */

/* ============================================================
 * Home v3 — layout (Popular authors / Trending).
 * Hero curtain markup/CSS/JS временно отключены.
 * ============================================================ */

.home-page--v3 {
    --home-section-pad-y: 0;
}

/* Home page — drop outer <main class="main"> vertical padding so sections align
 * with header/footer (--main-pad-y from public-breakpoints.css).
 * (Isolation override was only needed for fixed hero curtain.) */
body.home-page-body .main {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}


body.home-page-body .home-page--v3 .home-section + .home-section {
    border-top: none !important;
}

/* Carousel chrome: strip/shell/track stay flat — only real surfaces cast shadow.
 * Do NOT apply to `.home-section-stripe--accent` — that stripe carries the same
 * upward divider shadow as `.footer`. */
body.home-page-body .home-page--v3 .home-section-stripe--light,
body.home-page-body .home-page--v3 .home-section__container,
body.home-page-body .home-page--v3 .home-authors-carousel,
body.home-page-body .home-page--v3 .home-trending-carousel,
body.home-page-body .home-page--v3 .home-authors-carousel__shell,
body.home-page-body .home-page--v3 .home-trending-carousel__shell,
body.home-page-body .home-page--v3 .home-carousel-track {
    box-shadow: none !important;
}

body.home-page-body .home-page--v3 .home-carousel-viewport {
    box-shadow: none !important;
    /* Let card box-shadows paint above/below without being clipped — otherwise
       `overflow:hidden` bites the shadow and reads as a fake inner border. */
    padding-block: max(14px, 1rem);
}

body.home-page-body .home-page--v3 .home-carousel-btn {
    box-shadow: none !important;
}

/* Trending stripe — divider matches site footer (hairline + shadow cast upward). */
body.home-page-body .home-page--v3 .home-section-stripe--accent {
    border-top: 1px solid var(--border-subtle);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 1;
}

html[data-theme="dark"] body.home-page-body .home-page--v3 .home-section-stripe--accent {
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.35);
}


/*
 * ---- HOME HERO CURTAIN (disabled) ----
 * Scroll lock (.home-curtain-locked) + .home-hero-curtain* + hero arrow —
 * временно закомментировано; см. историю git / templates/home.html.
 *
html.home-curtain-locked,
html:has(body.home-curtain-locked) {
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: none;
}

body.home-curtain-locked {
    position: fixed;
    inset: 0;
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: none;
}

.home-hero-curtain {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    isolation: isolate;
    color: #ffffff;
    background: #000;
    transform: translate3d(0, 0, 0);
    transition: transform 700ms cubic-bezier(0.65, 0, 0.35, 1);
    will-change: transform;
}

.home-hero-curtain.is-revealed {
    transform: translate3d(0, -100%, 0);
    pointer-events: none;
}

.home-hero-curtain__bg {
    position: absolute;
    inset: -6% -2%;
    background-image: var(--home-hero-bg, url("../img/earth_hero.webp"));
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
    will-change: transform;
    transform: translate3d(0, 0, 0);
}

.home-hero-curtain__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.45) 0%,
        rgba(0, 0, 0, 0.35) 60%,
        rgba(0, 0, 0, 0.55) 100%
    );
    pointer-events: none;
}

html[data-theme="dark"] .home-hero-curtain__overlay {
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.55) 0%,
        rgba(0, 0, 0, 0.45) 60%,
        rgba(0, 0, 0, 0.7) 100%
    );
}

.home-hero-curtain__content {
    position: relative;
    z-index: 2;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-hero-curtain__inner {
    text-align: center;
    padding: clamp(2rem, 6vw, 4rem) 0;
    max-width: 60rem;
    margin: 0 auto;
}

.home-hero-curtain__h1 {
    font-family: var(--font-heading, 'Space Grotesk', sans-serif);
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin: 0 0 1rem;
    color: #ffffff;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
}

.home-hero-curtain__lede {
    font-size: clamp(1rem, 1.6vw, 1.2rem);
    line-height: 1.6;
    margin: 0 auto;
    max-width: 42rem;
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}

.home-hero-arrow {
    position: relative;
    z-index: 3;
    width: 100%;
    border: none;
    background: rgba(0, 0, 0, 0.45);
    color: #ffffff;
    cursor: pointer;
    padding: 0.9rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: background 0.2s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.home-hero-arrow:hover,
.home-hero-arrow:focus-visible {
    background: rgba(0, 0, 0, 0.65);
    outline: none;
}

.home-hero-arrow__label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.home-hero-arrow .fa {
    animation: home-hero-arrow-bob 2.4s ease-in-out infinite;
    font-size: 1rem;
}

@keyframes home-hero-arrow-bob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(4px); }
}

@media (prefers-reduced-motion: reduce) {
    .home-hero-arrow .fa { animation: none; }
    .home-hero-curtain { transition: none; }
}
*/

/* ---- Section stripes: full viewport, no padding (no header/footer hugging) ---- */
.home-section-stripe {
    min-height: 100vh;
    padding-top: 0;
    padding-bottom: 0;
    display: flex;
    align-items: center;
}

.home-section__container {
    width: 100%;
    padding-top: clamp(2rem, 5vh, 4rem);
    padding-bottom: clamp(2rem, 5vh, 4rem);
}

.home-section-stripe--light {
    background: var(--home-stripe-light);
    color: var(--home-stripe-light-fg);
}

.home-section-stripe--accent {
    background: var(--home-stripe-accent);
    color: var(--home-stripe-accent-fg);
}

/* ---- Section header ---- */
.home-section-header {
    text-align: center;
    margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
}

.home-section-header__title {
    font-family: var(--font-heading, 'Space Grotesk', sans-serif);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 600;
    margin: 0 0 0.4rem;
    letter-spacing: -0.01em;
}

.home-section-header__subtitle {
    margin: 0 auto;
    max-width: 36rem;
    font-size: 0.95rem;
    line-height: 1.55;
    opacity: 0.78;
}

.home-section-header--on-accent .home-section-header__subtitle {
    opacity: 0.92;
}

.home-section-cta {
    display: flex;
    justify-content: center;
    margin-top: clamp(1.5rem, 3vw, 2.25rem);
}

.home-section-cta__btn--on-accent {
    background: #ffffff;
    color: #4b3fcc;
    border-color: #ffffff;
}

.home-section-cta__btn--on-accent:hover,
.home-section-cta__btn--on-accent:focus-visible {
    background: #f3f1ff;
    color: #2a1f9c;
}

html[data-theme="dark"] .home-section-cta__btn--on-accent {
    background: #a29bfe;
    color: #0d1117;
    border-color: #a29bfe;
}

/* ============================================================
 * Generic horizontal carousel (sections 2 and 3)
 * ============================================================ */

.home-authors-carousel,
.home-trending-carousel {
    position: relative;
}

.home-authors-carousel__shell,
.home-trending-carousel__shell {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.home-carousel-viewport {
    flex: 1 1 auto;
    overflow: hidden;
    touch-action: pan-y;
    -webkit-user-select: none;
    user-select: none;
}

.home-carousel-track {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    transition: transform 480ms cubic-bezier(0.22, 0.61, 0.36, 1);
    will-change: transform;
}

.home-carousel-slide {
    flex: 0 0 100%;
    max-width: 100%;
    padding: 0 0.5rem;
    box-sizing: border-box;
}

.home-carousel-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    border: 1px solid var(--border-default, #e6e6e6);
    background: var(--bg-default, #ffffff);
    color: var(--text-default);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.home-carousel-btn:hover:not(:disabled),
.home-carousel-btn:focus-visible:not(:disabled) {
    background: var(--bg-muted, #f6f8fa);
    border-color: var(--border-strong, #d0d7de);
    outline: none;
}

.home-carousel-btn[disabled],
.home-carousel-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.home-carousel-btn[hidden] {
    display: none !important;
}

/* When the carousel has no overflow on this viewport, drop the gap reserved
 * for the (now hidden) arrow buttons so the cards don't shift right. */
[data-home-carousel][data-static="1"] {
    gap: 0;
    justify-content: center;
}

[data-home-carousel][data-static="1"] .home-carousel-viewport {
    flex: 0 1 auto;
    width: 100%;
}

/* Both stripes share the same neutral arrow styling (default rules apply). */

html[data-theme="dark"] .home-carousel-btn {
    background: var(--bg-muted, #161b22);
    border-color: var(--border-default, #30363d);
    color: var(--text-default);
}

/* ============================================================
 * Section 2 — Author card
 * ============================================================ */

.home-author-card-slide {
    padding: 0 0.75rem;
}

.home-author-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    padding: 1.25rem 0.75rem 1.5rem;
    text-decoration: none;
    color: inherit;
    border-radius: var(--radius-md, 8px);
    transition: transform 0.2s ease, background 0.2s ease;
    text-align: center;
}

.home-author-card:hover,
.home-author-card:focus-visible {
    transform: translateY(-3px);
    outline: none;
}

.home-author-card__avatar {
    --avatar-size: clamp(250px, 18vw, 200px);
    width: var(--avatar-size);
    height: var(--avatar-size);
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    overflow: hidden;
    -webkit-mask-image: radial-gradient(circle, #000 99%, transparent 100%);
            mask-image: radial-gradient(circle, #000 99%, transparent 100%);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.10);
    background: var(--bg-muted, #f6f8fa);
    margin: 0 auto;
    flex: 0 0 auto;
}

.home-author-card__avatar .home-author-card__img,
.home-author-card__avatar img {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover;
    object-position: 50% 50%;
    display: block;
    border-radius: 50%;
}

.home-author-card__name-row {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    margin-top: 0.25rem;
    max-width: 100%;
}

.home-author-card__name-row .trust-level-badge {
    min-width: 2.25em;
    text-align: center;
    flex-shrink: 0;
}

.home-author-card__name {
    font-family: var(--font-heading, 'Space Grotesk', sans-serif);
    font-size: 1.1rem;
    font-weight: 600;
    color: inherit;
    word-break: break-word;
}

.home-author-card__stats {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.85rem;
    opacity: 0.85;
    line-height: 1.35;
}

.home-author-card__stat {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    justify-content: center;
}

.home-author-card__stat .fa {
    font-size: 0.8rem;
    opacity: 0.75;
}

/* ============================================================
 * Section 3 — Trending card
 * ============================================================ */

.home-trending-card-slide {
    padding: 0 0.5rem;
}

/* Mirrors Topics index `.trending-card--topic` (smart_blog/static/.../styles.css). */
.home-trending-card {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-default);
    background: var(--bg-default);
    /* box-shadow: var(--card-shadow); */
    color: var(--text-default);
    text-decoration: none;
    height: 100%;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.home-trending-card:hover,
.home-trending-card:focus-visible {
    transform: translateY(-2px);
    /* box-shadow: var(--card-shadow-lg); */
    text-decoration: none;
    outline: none;
    color: var(--text-default);
}

html[data-theme="dark"] .home-trending-card {
    border-color: var(--border-strong);
    box-shadow: var(--card-shadow);
}

html[data-theme="dark"] .home-trending-card:hover,
html[data-theme="dark"] .home-trending-card:focus-visible {
    box-shadow: 0 0.4rem 1.25rem rgba(0, 0, 0, 0.45);
}


.home-trending-card__media {
    position: relative;
    display: block;
    aspect-ratio: 16 / 14;
    background: var(--bg-muted, #f6f8fa);
    overflow: hidden;
}

.home-trending-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

/* .home-trending-card:hover .home-trending-card__img {
    transform: scale(1.04);
} */

.home-trending-card__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 100, 60, 0.6);
    font-size: 2.4rem;
    background: var(--bg-muted);
}

.home-trending-card__rank {
    position: absolute;
    top: 0.6rem;
    left: 0.6rem;
    font-family: var(--font-heading, 'Space Grotesk', sans-serif);
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.5);
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    backdrop-filter: blur(2px);
}

.home-trending-card__body {
    padding: 0.85rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1 1 auto;
}

.home-trending-card__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.home-trending-card__cat {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted, #6c757d);
}

.home-trending-card__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: #d8410f;
    background: rgba(255, 100, 60, 0.12);
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}

.home-trending-card__title {
    margin: 0;
    font-size: 1rem;
    line-height: 1.35;
    font-weight: 600;
    color: inherit;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.home-trending-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    font-size: 0.8rem;
    color: var(--text-muted, #6c757d);
    margin-top: auto;
}

.home-trending-card__meta .fa {
    margin-right: 0.2rem;
}

/* ============================================================
 * Empty state inside dark/light stripe
 * ============================================================ */
.home-section-stripe--accent .home-section__empty {
    color: var(--text-muted);
}

/* Slide outline reset for keyboard focus */
.home-author-card:focus-visible,
.home-trending-card:focus-visible {
    box-shadow: 0 0 0 3px var(--input-focus-ring, rgba(40, 100, 220, 0.32));
    border-radius: var(--radius-md, 10px);
}
