/*
 * AINexus editorial redesign
 *
 * A calm, content-first system designed for trustworthy reading and
 * unobtrusive, clearly-labelled advertising.
 */

:root {
    --ainexus-paper: #eef2f7;
    --ainexus-surface: #fbfdff;
    --ainexus-ink: #0b1d36;
    --ainexus-muted: #465a73;
    --ainexus-line: #cbd6e3;
    --ainexus-soft: #e4edf3;
    --ainexus-accent: #08756d;
    --ainexus-accent-dark: #075c56;
    --ainexus-serif: Georgia, Cambria, "Times New Roman", serif;
    --ainexus-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --bg-color: #eef2f7;
    --text-color: #0b1d36;
    --card-bg: #fbfdff;
    --secondary-text: #465a73;
    --border-color: #cbd6e3;
    --primary-color: #08756d;
    --primary-hover: #075c56;
}

[data-theme="dark"] {
    --ainexus-paper: #101827 !important;
    --ainexus-surface: #172033 !important;
    --ainexus-ink: #eff6ff !important;
    --ainexus-muted: #a8b6cb !important;
    --ainexus-line: #2d3c53 !important;
    --ainexus-soft: #132f2d !important;
    --ainexus-accent: #5eead4 !important;
    --ainexus-accent-dark: #99f6e4 !important;
    --bg-color: #101827 !important;
    --text-color: #eff6ff !important;
    --card-bg: #172033 !important;
    --secondary-text: #a8b6cb !important;
    --border-color: #2d3c53 !important;
    --primary-color: #5eead4 !important;
    --primary-hover: #99f6e4 !important;
}

body.ainexus-editorial {
    --ainexus-fixed-header-height: 84px;
    background: var(--ainexus-paper);
    color: var(--ainexus-ink);
    font-family: var(--ainexus-sans);
    font-size: 16px;
    line-height: 1.65;
    padding-top: var(--ainexus-fixed-header-height);
}

body.admin-bar.ainexus-editorial { padding-top: calc(var(--ainexus-fixed-header-height) + 32px); }

body.ainexus-editorial .container {
    width: min(100% - 40px, 1240px);
    margin-inline: auto;
}

body.ainexus-editorial a {
    color: inherit;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.15em;
}

body.ainexus-editorial a:hover { color: var(--ainexus-accent); }

body.ainexus-editorial :focus-visible {
    outline: 3px solid color-mix(in srgb, var(--ainexus-accent) 62%, transparent);
    outline-offset: 3px;
}

.ainexus-skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1000;
    padding: 0.65rem 1rem;
    color: #fff;
    background: var(--ainexus-accent-dark);
    border-radius: 0.3rem;
    transform: translateY(-160%);
}

.ainexus-skip-link:focus { transform: translateY(0); color: #fff; }

.ainexus-utility-bar {
    color: var(--ainexus-muted);
    background: var(--ainexus-surface);
    border-bottom: 1px solid var(--ainexus-line);
    font-size: 0.78rem;
}

.ainexus-utility-bar .container,
.ainexus-utility-bar nav {
    display: flex;
    align-items: center;
}

.ainexus-utility-bar .container {
    justify-content: space-between;
    min-height: 36px;
    gap: 1rem;
}

.ainexus-utility-bar p { margin: 0; }
.ainexus-utility-bar nav { gap: 1rem; }
.ainexus-utility-bar a { color: var(--ainexus-muted); }

body.ainexus-editorial .site-header {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 100;
    background: color-mix(in srgb, var(--ainexus-surface) 94%, transparent);
    border-bottom: 1px solid var(--ainexus-line);
    box-shadow: none;
    backdrop-filter: blur(12px);
}

body.admin-bar.ainexus-editorial .site-header { top: 32px; }

.ainexus-header-inner {
    display: grid;
    grid-template-columns: minmax(190px, 0.8fr) minmax(360px, 1.5fr) auto auto;
    align-items: center;
    gap: 2rem;
    min-height: 84px;
}

.site-branding,
.site-title-wrap,
.header-actions,
.search-container,
.ainexus-header-end { display: flex; align-items: center; }

.site-branding { grid-column: 1; min-width: 0; gap: 0.7rem; }
.site-branding .custom-logo-link { display: flex; flex: 0 0 auto; }
.site-branding .custom-logo { width: auto; max-width: 48px; max-height: 48px; }
.site-title-wrap { display: block; min-width: 0; }

body.ainexus-editorial .site-title {
    margin: 0;
    color: var(--ainexus-ink);
    font-family: var(--ainexus-serif);
    font-size: clamp(1.35rem, 2vw, 1.75rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1;
}

.site-title a { text-decoration: none; }
.site-description { margin: 0.32rem 0 0; color: var(--ainexus-muted); font-size: 0.73rem; line-height: 1.25; }

body.ainexus-editorial .site-navigation { grid-column: 2; justify-self: center; width: 100%; }
body.ainexus-editorial .nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.15rem 0.85rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-links > li { position: relative; }
.nav-links > li > a {
    display: inline-block;
    position: relative;
    padding: 0.72rem 0.45rem;
    color: var(--ainexus-ink);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-decoration: none;
    white-space: nowrap;
}

.nav-links .current-menu-item > a,
.nav-links .current-cat > a,
.nav-links a:hover { color: var(--ainexus-accent); }
.nav-links > li > a::after { position: absolute; right: 0.45rem; bottom: 0.25rem; left: 0.45rem; height: 2px; background: var(--ainexus-accent); content: ""; opacity: 0; transform: scaleX(0.3); transition: opacity 0.2s ease, transform 0.2s ease; }
.nav-links > li.current-menu-item > a::after,
.nav-links > li.current-menu-ancestor > a::after,
.nav-links > li:hover > a::after,
.nav-links > li:focus-within > a::after { opacity: 1; transform: scaleX(1); }
.nav-links > li.menu-item-has-children > a { padding-right: 1.3rem; }
.nav-links > li.menu-item-has-children > a::before { position: absolute; top: 50%; right: 0.45rem; width: 0.38rem; height: 0.38rem; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; content: ""; transform: translateY(-70%) rotate(45deg); }
.nav-links .sub-menu { position: absolute; top: calc(100% + 0.65rem); left: -0.45rem; z-index: 150; display: grid; grid-template-columns: repeat(2, minmax(130px, 1fr)); width: min(430px, 72vw); gap: 0.15rem; margin: 0; padding: 0.75rem; list-style: none; visibility: hidden; background: var(--ainexus-surface); border: 1px solid var(--ainexus-line); border-radius: 0.45rem; box-shadow: 0 18px 38px rgb(15 23 42 / 16%); opacity: 0; pointer-events: none; transform: translateY(-5px); transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease; }
.nav-links > li.menu-item-has-children:hover > .sub-menu,
.nav-links > li.menu-item-has-children:focus-within > .sub-menu,
.nav-links > li.menu-item-has-children.is-submenu-open > .sub-menu { visibility: visible; opacity: 1; pointer-events: auto; transform: translateY(0); }
.nav-links .sub-menu li { min-width: 0; }
.nav-links .sub-menu a { display: block; padding: 0.65rem 0.75rem; color: var(--ainexus-ink); border-left: 2px solid transparent; font-size: 0.76rem; font-weight: 700; line-height: 1.25; text-decoration: none; }
.nav-links .sub-menu a:hover { color: var(--ainexus-accent); background: var(--ainexus-soft); border-left-color: var(--ainexus-accent); }
.nav-submenu-toggle { display: none; }
.ainexus-mobile-nav-header,
.ainexus-nav-backdrop { display: none; }

.header-actions { grid-column: 3; justify-content: flex-end; gap: 0.5rem; }
.ainexus-header-end { grid-column: 4; justify-content: flex-end; gap: 0.5rem; }
.header-theme-toggle { color: var(--ainexus-accent-dark); background: var(--ainexus-soft); border-color: color-mix(in srgb, var(--ainexus-accent) 35%, var(--ainexus-line)); }
.icon-btn {
    display: inline-grid;
    width: 40px;
    height: 40px;
    place-items: center;
    padding: 0;
    color: var(--ainexus-ink);
    background: transparent;
    border: 1px solid var(--ainexus-line);
    border-radius: 50%;
    cursor: pointer;
}

.icon-btn:hover { color: var(--ainexus-accent); border-color: var(--ainexus-accent); }
.mobile-menu-toggle { display: none; }
.search-container { position: relative; }
.search-dropdown {
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0;
    z-index: 20;
    display: none;
    width: min(330px, calc(100vw - 40px));
    padding: 0.75rem;
    background: var(--ainexus-surface);
    border: 1px solid var(--ainexus-line);
    border-radius: 0.45rem;
    box-shadow: 0 18px 40px rgb(15 23 42 / 14%);
}

.search-dropdown.active { display: block; }
.search-form { display: flex; gap: 0.5rem; }
.search-field {
    min-width: 0;
    width: 100%;
    padding: 0.65rem 0.75rem;
    color: var(--ainexus-ink);
    background: var(--ainexus-paper);
    border: 1px solid var(--ainexus-line);
    border-radius: 0.3rem;
}

.search-submit {
    padding: 0.65rem 0.85rem;
    color: #fff;
    background: var(--ainexus-accent-dark);
    border: 0;
    border-radius: 0.3rem;
    cursor: pointer;
}

.floating-toggle {
    position: fixed;
    right: 1rem;
    bottom: 5.5rem;
    z-index: 30;
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    color: var(--ainexus-ink);
    background: var(--ainexus-surface);
    border: 1px solid var(--ainexus-line);
    border-radius: 50%;
    box-shadow: 0 10px 24px rgb(15 23 42 / 12%);
    cursor: pointer;
}

body.ainexus-editorial .site-main { min-height: 0; padding: 3rem 0 4.5rem; }
body.home.ainexus-editorial .site-main,
body.blog.ainexus-editorial .site-main { padding-top: 2.25rem; }

.ainexus-eyebrow,
.ainexus-story-category,
.ainexus-article-category,
.ainexus-ad-label {
    color: var(--ainexus-accent);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

body.ainexus-editorial .section-heading {
    margin: 0;
    color: var(--ainexus-ink);
    font-family: var(--ainexus-serif);
    font-size: clamp(1.75rem, 3vw, 2.55rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.08;
}

body.ainexus-editorial .section-heading::after { display: none; }
.ainexus-section-intro { margin-bottom: 1.5rem; }
.ainexus-section-intro .ainexus-eyebrow { margin: 0 0 0.45rem; }
.ainexus-builder-section,
.ainexus-home-section,
.ainexus-home-widget-section,
.ainexus-home-newsletter { margin: 0 0 4.5rem; }

.ainexus-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.84fr);
    gap: 2rem;
    align-items: stretch;
}

.ainexus-feature-story {
    overflow: hidden;
    background: var(--ainexus-surface);
    border: 1px solid var(--ainexus-line);
    border-radius: 0.8rem;
}

.ainexus-feature-story-image { display: block; aspect-ratio: 16 / 8.7; overflow: hidden; background: var(--ainexus-soft); }
.ainexus-feature-story-image img,
.ainexus-hero-compact-image img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s ease; }
.ainexus-feature-story-image .fallback-thumbnail,
.ainexus-hero-compact-image .fallback-thumbnail {
    width: 100% !important;
    height: 100% !important;
    background: var(--ainexus-soft) !important;
}
.ainexus-feature-story-image .fallback-thumbnail h3,
.ainexus-hero-compact-image .fallback-thumbnail h3 { font-family: var(--ainexus-serif) !important; }
.ainexus-feature-story:hover img,
.ainexus-hero-compact:hover img { transform: scale(1.025); }

.ainexus-feature-story-content { padding: clamp(1.3rem, 3vw, 2.25rem); }
.ainexus-feature-story-content .cat-badge { margin: 0 0 0.85rem; }
.ainexus-feature-story-content h3 {
    margin: 0;
    color: var(--ainexus-ink);
    font-family: var(--ainexus-serif);
    font-size: clamp(1.7rem, 3.2vw, 2.65rem);
    letter-spacing: -0.045em;
    line-height: 1.1;
}

.ainexus-feature-story-content h3 a,
.ainexus-hero-compact h3 a { text-decoration: none; }
.ainexus-feature-story-content p { max-width: 62ch; margin: 1rem 0 0; color: var(--ainexus-muted); font-size: 0.98rem; }
.ainexus-story-meta,
.ainexus-article-meta,
.ainexus-live-card-meta { display: flex; flex-wrap: wrap; gap: 0.45rem 0.9rem; color: var(--ainexus-muted); font-size: 0.78rem; }
.ainexus-story-meta { margin-top: 1.1rem; }
.ainexus-story-meta > * + *::before,
.ainexus-article-meta > * + *::before { margin-right: 0.9rem; color: var(--ainexus-line); content: "•"; }

.ainexus-hero-list { display: grid; grid-template-rows: auto repeat(4, minmax(0, 1fr)); align-content: stretch; gap: 0; height: 100%; border-top: 1px solid var(--ainexus-line); }
.ainexus-hero-rail-label { align-self: center; margin: 0; padding: 0.75rem 0; color: var(--ainexus-accent); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.ainexus-hero-compact {
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr);
    gap: 0.9rem;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--ainexus-line);
}

.ainexus-hero-compact:last-child { border-bottom: 0; }
.ainexus-hero-compact-image { display: block; aspect-ratio: 1.25 / 1; overflow: hidden; border-radius: 0.35rem; background: var(--ainexus-soft); }
.ainexus-hero-compact h3 { margin: 0.35rem 0 0.45rem; font-family: var(--ainexus-serif); font-size: 1.08rem; letter-spacing: -0.02em; line-height: 1.25; }
.ainexus-hero-compact time { color: var(--ainexus-muted); font-size: 0.76rem; }

body.ainexus-editorial .ainexus-live-latest-header { margin-bottom: 1.25rem; }
body.ainexus-editorial .ainexus-live-latest-header > a { color: var(--ainexus-accent); text-decoration: none; }
body.ainexus-editorial .ainexus-live-latest-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.35rem; }
body.ainexus-editorial .ainexus-live-card {
    border-color: var(--ainexus-line);
    border-radius: 0.7rem;
    box-shadow: none;
}

body.ainexus-editorial .ainexus-live-card:hover { border-color: var(--ainexus-accent); transform: translateY(-2px); }
body.ainexus-editorial .ainexus-live-card-content { padding: 1.15rem; }
body.ainexus-editorial .ainexus-live-card-content h3 { font-family: var(--ainexus-serif); font-size: 1.2rem; }
body.ainexus-editorial .ainexus-live-card-content p { font-size: 0.9rem; }

body.ainexus-editorial .ainexus-home-section .section-heading,
body.ainexus-editorial .ainexus-home-widget-section .section-heading { margin-bottom: 1.25rem; }
body.ainexus-editorial .ainexus-section-grid,
body.ainexus-editorial .ainexus-related-grid { gap: 1.35rem; }
body.ainexus-editorial .ainexus-section-card,
body.ainexus-editorial .ainexus-related-card {
    background: var(--ainexus-surface);
    border: 1px solid var(--ainexus-line);
    border-radius: 0.65rem;
    box-shadow: none;
}

body.ainexus-editorial .ainexus-section-card h3,
body.ainexus-editorial .ainexus-related-card h3 { font-family: var(--ainexus-serif); }
body.ainexus-editorial .ainexus-category-grid a {
    color: var(--ainexus-ink);
    background: var(--ainexus-surface);
    border: 1px solid var(--ainexus-line);
    border-radius: 0.45rem;
}

body.ainexus-editorial .ainexus-home-newsletter {
    padding: clamp(1.5rem, 4vw, 3rem);
    color: var(--ainexus-ink);
    background: var(--ainexus-soft);
    border: 1px solid color-mix(in srgb, var(--ainexus-accent) 22%, var(--ainexus-line));
    border-radius: 0.75rem;
}

body.ainexus-editorial .ainexus-home-newsletter h2 { color: var(--ainexus-ink); font-family: var(--ainexus-serif); }
body.ainexus-editorial .ainexus-home-newsletter input { color: var(--ainexus-ink); background: var(--ainexus-surface); border-color: var(--ainexus-line); }
body.ainexus-editorial .ainexus-home-newsletter button { background: var(--ainexus-accent-dark); }

body.ainexus-editorial .ainexus-ad {
    display: grid;
    max-width: 970px;
    min-height: 0;
    gap: 0.55rem;
    margin: 2.75rem auto;
    padding: 0.75rem 0;
    text-align: center;
    border-top: 1px solid var(--ainexus-line);
    border-bottom: 1px solid var(--ainexus-line);
    background: transparent;
}

body.ainexus-editorial .ainexus-ad-label { color: var(--ainexus-muted); font-size: 0.62rem; }
body.ainexus-editorial .ainexus-ad-sidebar { margin: 1.5rem 0; }

body.ainexus-editorial .single-layout {
    max-width: 1120px;
    gap: clamp(2rem, 5vw, 4.5rem);
}

body.ainexus-editorial .main-content-area { min-width: 0; }
body.ainexus-editorial .single-post-content { max-width: 760px; margin: 0 auto; }
body.ainexus-editorial .ainexus-breadcrumbs { margin: 0 0 1.4rem; color: var(--ainexus-muted); font-size: 0.78rem; }
body.ainexus-editorial .ainexus-breadcrumbs a { color: var(--ainexus-muted); }
body.ainexus-editorial .entry-header { margin: 0 0 2rem; }
.ainexus-article-category { display: inline-block; margin-bottom: 0.8rem; text-decoration: none; }
body.ainexus-editorial .entry-title {
    margin: 0;
    color: var(--ainexus-ink);
    font-family: var(--ainexus-serif);
    font-size: clamp(2.25rem, 6vw, 4.25rem);
    font-weight: 700;
    letter-spacing: -0.055em;
    line-height: 1.02;
}

.ainexus-article-deck { max-width: 60ch; margin: 1.1rem 0 0; color: var(--ainexus-muted); font-family: var(--ainexus-serif); font-size: clamp(1.1rem, 2vw, 1.32rem); line-height: 1.48; }
.ainexus-article-meta { margin-top: 1.2rem; }
body.ainexus-editorial .post-thumbnail { margin: 0 0 2.5rem; overflow: hidden; border-radius: 0.65rem; }
body.ainexus-editorial .post-thumbnail img { display: block; width: 100%; height: auto; }

body.ainexus-editorial .entry-content {
    max-width: 700px;
    color: var(--ainexus-ink);
    font-family: var(--ainexus-serif);
    font-size: clamp(1.08rem, 1.5vw, 1.22rem);
    line-height: 1.82;
}

body.ainexus-editorial .entry-content p { max-width: none; margin: 0 0 1.55rem; }
body.ainexus-editorial .entry-content h2,
body.ainexus-editorial .entry-content h3,
body.ainexus-editorial .entry-content h4 { color: var(--ainexus-ink); font-family: var(--ainexus-serif); letter-spacing: -0.03em; }
body.ainexus-editorial .entry-content h2 { margin-top: 2.8rem; font-size: 1.85em; }
body.ainexus-editorial .entry-content h3 { margin-top: 2.25rem; font-size: 1.4em; }
body.ainexus-editorial .entry-content a:not(.wp-block-button__link) { color: var(--ainexus-accent); }
body.ainexus-editorial .entry-content blockquote {
    margin: 2.2rem 0;
    padding: 0.3rem 0 0.3rem 1.4rem;
    color: var(--ainexus-ink);
    background: transparent;
    border-left: 3px solid var(--ainexus-accent);
}

.article-share-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 2.5rem 0;
    padding: 1.15rem 0;
    color: var(--ainexus-muted);
    border-top: 1px solid var(--ainexus-line);
    border-bottom: 1px solid var(--ainexus-line);
    font-size: 0.84rem;
    font-weight: 700;
}

.share-buttons { display: flex; gap: 0.5rem; }
.share-btn {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    color: var(--ainexus-ink);
    border: 1px solid var(--ainexus-line);
    border-radius: 50%;
    text-decoration: none;
}

.share-btn:hover { color: #fff; background: #000; border-color: #000; }
body.ainexus-editorial .author-bio-card { margin: 2.5rem 0; padding: 1.5rem; background: var(--ainexus-soft); border: 1px solid var(--ainexus-line); border-radius: 0.65rem; }
body.ainexus-editorial .author-bio-content h2 { margin: 0; font-family: var(--ainexus-serif); font-size: 1.3rem; }
body.ainexus-editorial .author-bio-content p:not(.ainexus-eyebrow) { margin: 0.5rem 0 0; color: var(--ainexus-muted); }
body.ainexus-editorial .ainexus-post-navigation { margin: 2.5rem 0; border-top-color: var(--ainexus-line); border-bottom-color: var(--ainexus-line); }
body.ainexus-editorial .ainexus-post-navigation a { color: var(--ainexus-ink); font-family: var(--ainexus-serif); text-decoration: none; }
.ainexus-auto-next-article { display: flex; align-items: center; justify-content: center; gap: 0.75rem; max-width: 760px; min-height: 76px; margin: 3rem auto 0; color: var(--ainexus-muted); border-top: 1px solid var(--ainexus-line); border-bottom: 1px solid var(--ainexus-line); font-size: 0.78rem; }
.ainexus-auto-next-article p { margin: 0; }
.ainexus-auto-next-article a { display: inline-flex; align-items: center; gap: 0.3rem; color: var(--ainexus-accent); font-weight: 800; text-decoration: none; }
.ainexus-auto-next-article[data-loading="true"] p::before { display: inline-block; width: 0.7rem; height: 0.7rem; margin-right: 0.45rem; border: 2px solid var(--ainexus-line); border-top-color: var(--ainexus-accent); border-radius: 50%; content: ""; animation: ainexus-load-spin 0.7s linear infinite; vertical-align: -0.08em; }
.ainexus-infinite-article { margin-top: 5rem !important; padding-top: 4rem; border-top: 3px solid var(--ainexus-ink); }
.ainexus-infinite-article .entry-header > .ainexus-eyebrow { margin: 0 0 0.65rem; }
.ainexus-infinite-article .entry-title a { color: inherit; text-decoration: none; }
.ainexus-infinite-comments { margin-top: 3rem; padding: 1.5rem; background: var(--ainexus-soft); border: 1px solid var(--ainexus-line); }
.ainexus-infinite-comments h3 { margin: 0 0 1rem; color: var(--ainexus-ink); font-family: var(--ainexus-serif); font-size: 1.35rem; letter-spacing: -0.03em; }
.ainexus-infinite-comments ol { display: grid; gap: 1rem; margin: 0 0 1.25rem; padding: 0; list-style: none; }
.ainexus-infinite-comments li { padding-bottom: 1rem; color: var(--ainexus-muted); border-bottom: 1px solid var(--ainexus-line); font-size: 0.86rem; line-height: 1.55; }
.ainexus-infinite-comments li:last-child { padding-bottom: 0; border-bottom: 0; }
.ainexus-infinite-comments li > div { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 0.4rem; color: var(--ainexus-ink); }
.ainexus-infinite-comments time { color: var(--ainexus-muted); font-size: 0.68rem; }
.ainexus-infinite-comments > a { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--ainexus-accent); font-size: 0.78rem; font-weight: 800; text-decoration: none; }
@keyframes ainexus-load-spin { to { transform: rotate(360deg); } }

body.ainexus-editorial .ainexus-single-sidebar { padding-top: 0; }
body.ainexus-editorial .ainexus-single-sidebar-inner { display: grid; gap: 1.25rem; padding-left: 1.75rem; border-left: 1px solid var(--ainexus-line); }

/* Keep the article rail in view after its content has been read. The sidebar
 * grid item must stretch to the full article row; otherwise a sticky child is
 * limited to the sidebar's own short content height. */
@media (min-width: 981px) {
    body.ainexus-editorial .single-layout.has-sidebar { align-items: stretch; }
    body.ainexus-editorial .main-content-area { align-self: start; }
    body.ainexus-editorial .ainexus-single-sidebar { align-self: stretch; min-height: 100%; }
    body.ainexus-editorial .ainexus-single-sidebar-inner {
        position: sticky;
        top: var(--ainexus-sidebar-stick-top, 1.5rem);
        align-self: start;
    }
}

body.ainexus-editorial .ainexus-sidebar-context { padding: 1.25rem; color: var(--ainexus-ink); background: var(--ainexus-soft); border: 1px solid var(--ainexus-line); }
body.ainexus-editorial .ainexus-sidebar-context p { margin: 0 0 0.4rem; color: var(--ainexus-accent); font-size: 0.65rem; font-weight: 800; letter-spacing: 0.11em; text-transform: uppercase; }
body.ainexus-editorial .ainexus-sidebar-context h2 { margin: 0; color: var(--ainexus-ink); font-family: var(--ainexus-serif); font-size: 1.55rem; letter-spacing: -0.035em; line-height: 1.05; }
body.ainexus-editorial .ainexus-sidebar-context a { display: inline-flex; align-items: center; gap: 0.35rem; margin-top: 1rem; color: var(--ainexus-accent); font-size: 0.75rem; font-weight: 800; text-decoration: none; }
body.ainexus-editorial .ainexus-sidebar-tags { padding: 1.15rem; background: var(--ainexus-surface); border: 1px solid var(--ainexus-line); }
body.ainexus-editorial .ainexus-sidebar-tags .ainexus-sidebar-heading { margin: 0 0 0.85rem; color: var(--ainexus-ink); border-bottom-color: var(--ainexus-ink); }
body.ainexus-editorial .ainexus-sidebar-tags-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
body.ainexus-editorial .ainexus-sidebar-tags-list a { padding: 0.35rem 0.65rem; color: var(--ainexus-ink); background: var(--ainexus-soft); border: 1px solid var(--ainexus-line); border-radius: 999px; font-size: 0.75rem; font-weight: 700; line-height: 1.25; text-decoration: none; }
body.ainexus-editorial .ainexus-sidebar-tags-list a:hover { color: #fff; background: #000; border-color: #000; }
body.ainexus-editorial .ainexus-sidebar-posts { padding: 1.15rem; background: var(--ainexus-surface); border-color: var(--ainexus-line); border-radius: 0; }
body.ainexus-editorial .ainexus-sidebar-heading { margin: 0 0 0.9rem; padding-bottom: 0.7rem; color: var(--ainexus-ink); border-bottom: 2px solid var(--ainexus-accent); font-family: var(--ainexus-serif); font-size: 1.2rem; letter-spacing: -0.025em; }
body.ainexus-editorial .ainexus-sidebar-post { border-bottom-color: var(--ainexus-line); }
body.ainexus-editorial .ainexus-sidebar-post h3 { margin: 0; font-family: var(--ainexus-serif); }
body.ainexus-editorial .ainexus-sidebar-post-image { background: var(--ainexus-soft); }
body.ainexus-editorial .ainexus-generic-sidebar { display: grid; gap: 1.25rem; align-content: start; }
body.ainexus-editorial .ainexus-generic-sidebar .widget { margin: 0; padding: 1.15rem; background: var(--ainexus-surface); border: 1px solid var(--ainexus-line); border-radius: 0; box-shadow: none; }
body.ainexus-editorial .ainexus-sidebar-search { padding: 1.1rem; background: var(--ainexus-soft); border: 1px solid var(--ainexus-line); }
body.ainexus-editorial .ainexus-sidebar-label { margin: 0 0 0.65rem; color: var(--ainexus-accent); font-size: 0.66rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
body.ainexus-editorial .ainexus-sidebar-search .search-form { display: flex; }
body.ainexus-editorial .ainexus-sidebar-search .search-submit { flex: 0 0 auto; }
body.ainexus-editorial .ainexus-generic-sidebar .ainexus-sidebar-posts,
body.ainexus-editorial .ainexus-sidebar-topics { padding: 1.15rem; background: var(--ainexus-surface); border: 1px solid var(--ainexus-line); }
body.ainexus-editorial .ainexus-sidebar-topics ul { display: grid; margin: 0; padding: 0; list-style: none; }
body.ainexus-editorial .ainexus-sidebar-topics li { border-bottom: 1px solid var(--ainexus-line); }
body.ainexus-editorial .ainexus-sidebar-topics li:last-child { border-bottom: 0; }
body.ainexus-editorial .ainexus-sidebar-topics a { display: flex; justify-content: space-between; gap: 1rem; padding: 0.65rem 0; color: var(--ainexus-ink); font-family: var(--ainexus-serif); font-size: 0.92rem; font-weight: 700; text-decoration: none; }
body.ainexus-editorial .ainexus-sidebar-topics a:hover { color: var(--ainexus-accent); }
body.ainexus-editorial .ainexus-sidebar-topics small { color: var(--ainexus-muted); font-family: var(--ainexus-sans); font-size: 0.7rem; font-weight: 500; }

body.ainexus-editorial .content-sidebar-wrap { gap: 3rem; }
body.ainexus-editorial .archive-header,
body.ainexus-editorial .page-header { margin-bottom: 2rem; }
body.ainexus-editorial .page-title { color: var(--ainexus-ink); font-family: var(--ainexus-serif); font-size: clamp(2rem, 5vw, 3.5rem); letter-spacing: -0.05em; }
body.ainexus-editorial .archive-card { background: var(--ainexus-surface); border-color: var(--ainexus-line); box-shadow: none; }
body.ainexus-editorial .archive-card-title { font-family: var(--ainexus-serif); }

body.ainexus-editorial .ainexus-page-shell { padding: 0; }
body.ainexus-editorial .ainexus-page-container { max-width: 850px; }
body.ainexus-editorial .ainexus-page-hero { padding: 0 0 2rem; background: transparent; }
body.ainexus-editorial .ainexus-page-title { color: var(--ainexus-ink); font-family: var(--ainexus-serif); letter-spacing: -0.05em; }
body.ainexus-editorial .ainexus-page-card { background: var(--ainexus-surface); border-color: var(--ainexus-line); box-shadow: none; }

body.ainexus-editorial .site-footer.ainexus-news-footer {
    color: var(--ainexus-ink);
    background: var(--ainexus-surface) !important;
    border-top: 4px solid var(--ainexus-accent);
}

body.ainexus-editorial .site-footer.ainexus-news-footer::before { display: none; }
.ainexus-footer-shell { display: grid; grid-template-columns: minmax(250px, 1.35fr) minmax(220px, 1fr) minmax(150px, 0.8fr) minmax(220px, 1fr); gap: clamp(1.75rem, 4vw, 4.5rem); align-items: start; padding: 3.6rem 0 3.2rem; }
.ainexus-footer-shell > * { min-width: 0; }
.ainexus-footer-publication { padding-right: 1rem; }
.ainexus-footer-wordmark { color: var(--ainexus-ink); font-family: var(--ainexus-sans); font-size: clamp(1.55rem, 2.4vw, 2.1rem); font-weight: 900; letter-spacing: 0.105em; line-height: 1; text-decoration: none; text-transform: uppercase; }
.ainexus-footer-description { max-width: 34ch; margin: 1.7rem 0 0; color: var(--ainexus-muted); font-size: 1rem; line-height: 1.55; }
.ainexus-footer-label { margin: 0 0 0.85rem; color: var(--ainexus-accent); font-size: 0.67rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.ainexus-footer-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.58rem 1.25rem; margin: 0; padding: 0; list-style: none; }
.ainexus-footer-links a { color: var(--ainexus-ink); font-size: 0.82rem; text-decoration: none; }
.ainexus-footer-links a:hover, .ainexus-footer-latest a:hover { color: var(--ainexus-accent); }
.ainexus-footer-latest ul { display: grid; gap: 0.9rem; margin: 0; padding: 0; list-style: none; }
.ainexus-footer-latest li { display: grid; gap: 0.3rem; }
.ainexus-footer-latest a { color: var(--ainexus-ink); font-family: var(--ainexus-serif); font-size: 0.92rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.18; text-decoration: none; }
.ainexus-footer-latest time { color: var(--ainexus-muted); font-size: 0.68rem; }
body.ainexus-editorial .ainexus-news-footer .ainexus-footer-lower { background: #041323; border-top: 1px solid rgb(191 219 254 / 35%); }
body.ainexus-editorial .ainexus-news-footer .ainexus-footer-lower .container { display: flex; justify-content: space-between; gap: 1rem; padding-block: 1.1rem; color: #dbeafe; font-size: 0.78rem; font-weight: 500; }
body.ainexus-editorial .ainexus-news-footer .ainexus-footer-lower p,
body.ainexus-editorial .ainexus-news-footer .ainexus-footer-note { margin: 0; color: #dbeafe; }

body.ainexus-editorial .ainexus-font-switcher { background: var(--ainexus-surface); border-color: var(--ainexus-line); box-shadow: 0 10px 24px rgb(15 23 42 / 12%); }
body.ainexus-editorial .ainexus-font-switcher button { color: var(--ainexus-ink); border-color: var(--ainexus-line); }
body.ainexus-editorial .ainexus-back-to-top { color: #042f2e; background: #5eead4; border-color: #99f6e4; box-shadow: 0 8px 22px rgb(4 47 46 / 28%); }
body.ainexus-editorial .ainexus-back-to-top:hover,
body.ainexus-editorial .ainexus-back-to-top:focus-visible { color: #042f2e; background: #99f6e4; border-color: #ccfbf1; }

.ainexus-news-home { max-width: 1240px; }
.ainexus-news-section-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--ainexus-ink);
}

.ainexus-news-section-header .ainexus-eyebrow { margin: 0 0 0.35rem; }
.ainexus-news-section-header h2 { margin: 0; color: var(--ainexus-ink); font-family: var(--ainexus-serif); font-size: clamp(1.5rem, 3vw, 2.2rem); letter-spacing: -0.04em; line-height: 1; }
.ainexus-news-section-header > p { max-width: 31ch; margin: 0; color: var(--ainexus-muted); font-size: 0.85rem; text-align: right; }
.ainexus-view-all { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--ainexus-accent); font-size: 0.82rem; font-weight: 800; text-decoration: none; white-space: nowrap; }

.ainexus-news-trending,
.ainexus-news-latest,
.ainexus-news-topics,
.ainexus-news-categories { margin-bottom: 4.5rem; }

.ainexus-trending-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--ainexus-line); border-left: 1px solid var(--ainexus-line); }
.ainexus-trending-story { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.8rem; min-height: 142px; padding: 1.1rem; border-right: 1px solid var(--ainexus-line); border-bottom: 1px solid var(--ainexus-line); }
.ainexus-trending-rank { color: color-mix(in srgb, var(--ainexus-accent) 70%, var(--ainexus-muted)); font-family: var(--ainexus-serif); font-size: 1.85rem; font-weight: 700; line-height: 1; }
.ainexus-trending-story h3 { margin: 0.3rem 0 0.55rem; color: var(--ainexus-ink); font-family: var(--ainexus-serif); font-size: 1rem; letter-spacing: -0.025em; line-height: 1.25; }
.ainexus-trending-story h3 a { text-decoration: none; }
.ainexus-trending-story time,
.ainexus-news-brief time,
.ainexus-normal-card time,
.ainexus-feed-lead time { color: var(--ainexus-muted); font-size: 0.75rem; }

.ainexus-latest-top-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.8fr); gap: 2rem; }
.ainexus-feed-lead { display: grid; grid-template-columns: minmax(220px, 0.95fr) minmax(0, 1fr); min-height: 100%; background: var(--ainexus-surface); border: 1px solid var(--ainexus-line); }
.ainexus-feed-lead-image { display: block; min-height: 310px; overflow: hidden; background: var(--ainexus-soft); }
.ainexus-feed-lead-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ainexus-feed-lead-image .fallback-thumbnail { width: 100% !important; height: 100% !important; background: var(--ainexus-soft) !important; }
.ainexus-feed-lead-content { display: flex; flex-direction: column; align-items: flex-start; padding: clamp(1.25rem, 3vw, 2rem); }
.ainexus-feed-lead-content h3 { margin: 0.45rem 0 0; color: var(--ainexus-ink); font-family: var(--ainexus-serif); font-size: clamp(1.55rem, 3vw, 2.2rem); letter-spacing: -0.04em; line-height: 1.08; }
.ainexus-feed-lead-content h3 a { text-decoration: none; }
.ainexus-feed-lead-content p { margin: 0.9rem 0 1rem; color: var(--ainexus-muted); font-size: 0.9rem; }
.ainexus-feed-lead-content time { margin-top: auto; }

.ainexus-news-briefs { display: grid; align-content: start; }
.ainexus-news-brief { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 1rem; padding: 0 0 1.25rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--ainexus-line); }
.ainexus-news-brief:last-child { margin: 0; }
.ainexus-news-brief-image { display: block; aspect-ratio: 1 / 0.82; overflow: hidden; background: var(--ainexus-soft); }
.ainexus-news-brief-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ainexus-news-brief-image .fallback-thumbnail { width: 100% !important; height: 100% !important; background: var(--ainexus-soft) !important; }
.ainexus-news-brief h3 { margin: 0.35rem 0 0.65rem; color: var(--ainexus-ink); font-family: var(--ainexus-serif); font-size: 1.2rem; letter-spacing: -0.03em; line-height: 1.2; }
.ainexus-news-brief h3 a { text-decoration: none; }

.ainexus-normal-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.5rem; margin-top: 1.75rem; }
.ainexus-normal-card { padding-bottom: 1rem; border-bottom: 1px solid var(--ainexus-line); }
.ainexus-normal-card-image { display: block; aspect-ratio: 16 / 10; overflow: hidden; margin-bottom: 0.8rem; background: var(--ainexus-soft); }
.ainexus-normal-card-image img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.ainexus-normal-card:hover .ainexus-normal-card-image img { transform: scale(1.025); }
.ainexus-normal-card-image .fallback-thumbnail { width: 100% !important; height: 100% !important; background: var(--ainexus-soft) !important; }
.ainexus-normal-card h3 { margin: 0.35rem 0 0.6rem; color: var(--ainexus-ink); font-family: var(--ainexus-serif); font-size: 1.12rem; letter-spacing: -0.025em; line-height: 1.25; }
.ainexus-normal-card h3 a { text-decoration: none; }

.ainexus-news-topics-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--ainexus-line); border-left: 1px solid var(--ainexus-line); }
.ainexus-news-topics-list a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.25rem 0.75rem; align-items: center; min-height: 90px; padding: 1rem; color: var(--ainexus-ink); border-right: 1px solid var(--ainexus-line); border-bottom: 1px solid var(--ainexus-line); text-decoration: none; }
.ainexus-news-topics-list a:hover { color: var(--ainexus-accent); background: var(--ainexus-soft); }
.ainexus-news-topics-list span { font-family: var(--ainexus-serif); font-size: 1.08rem; font-weight: 700; letter-spacing: -0.025em; }
.ainexus-news-topics-list small { grid-column: 1; color: var(--ainexus-muted); font-size: 0.72rem; }
.ainexus-news-topics-list i { grid-column: 2; grid-row: 1 / span 2; color: var(--ainexus-accent); }

.ainexus-news-categories { padding-top: 0.25rem; }
.ainexus-category-news-section { padding: 2.2rem 0; border-top: 1px solid var(--ainexus-line); }
.ainexus-category-news-section:last-child { padding-bottom: 0; }
.ainexus-category-news-header { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.ainexus-category-news-header .ainexus-eyebrow { margin: 0 0 0.3rem; }
.ainexus-category-news-header h3 { margin: 0; color: var(--ainexus-ink); font-family: var(--ainexus-serif); font-size: clamp(1.4rem, 2.5vw, 1.95rem); letter-spacing: -0.04em; line-height: 1; }
.ainexus-category-news-header h3 a { text-decoration: none; }
.ainexus-category-news-grid { display: grid; grid-template-columns: minmax(0, 1.22fr) minmax(300px, 0.78fr); gap: 2rem; }
.ainexus-category-lead { display: grid; grid-template-columns: minmax(220px, 0.95fr) minmax(0, 1fr); min-height: 245px; background: var(--ainexus-surface); border: 1px solid var(--ainexus-line); }
.ainexus-category-lead-image { display: block; min-height: 245px; overflow: hidden; background: var(--ainexus-soft); }
.ainexus-category-lead-image img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s ease; }
.ainexus-category-lead:hover .ainexus-category-lead-image img { transform: scale(1.025); }
.ainexus-category-lead-image .fallback-thumbnail { width: 100% !important; height: 100% !important; background: var(--ainexus-soft) !important; }
.ainexus-category-lead-content { display: flex; flex-direction: column; align-items: flex-start; padding: 1.25rem; }
.ainexus-category-lead-content h4 { margin: 0.4rem 0 0; color: var(--ainexus-ink); font-family: var(--ainexus-serif); font-size: clamp(1.25rem, 2.2vw, 1.75rem); letter-spacing: -0.035em; line-height: 1.1; }
.ainexus-category-lead-content h4 a, .ainexus-category-brief h4 a { text-decoration: none; }
.ainexus-category-lead-content p { margin: 0.65rem 0 0.9rem; color: var(--ainexus-muted); font-size: 0.84rem; line-height: 1.5; }
.ainexus-category-lead-content time, .ainexus-category-brief time { margin-top: auto; color: var(--ainexus-muted); font-size: 0.7rem; }
.ainexus-category-news-list { display: grid; align-content: start; }
.ainexus-category-brief { display: grid; grid-template-columns: 126px minmax(0, 1fr); gap: 1rem; padding: 0 0 1rem; margin-bottom: 1rem; border-bottom: 1px solid var(--ainexus-line); }
.ainexus-category-brief:last-child { margin-bottom: 0; }
.ainexus-category-brief-image { display: block; aspect-ratio: 1 / 0.78; overflow: hidden; background: var(--ainexus-soft); }
.ainexus-category-brief-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ainexus-category-brief-image .fallback-thumbnail { width: 100% !important; height: 100% !important; background: var(--ainexus-soft) !important; }
.ainexus-category-brief h4 { margin: 0; color: var(--ainexus-ink); font-family: var(--ainexus-serif); font-size: 1.08rem; letter-spacing: -0.025em; line-height: 1.2; }
.ainexus-category-brief > div { display: flex; flex-direction: column; }

@media (max-width: 980px) {
    .ainexus-header-inner { grid-template-columns: 1fr auto auto; gap: 1rem; min-height: 76px; }
    .site-navigation { grid-column: 1 / -1; grid-row: 2; }
    .nav-links { justify-content: flex-start; padding-bottom: 0.8rem; }
    .ainexus-hero-grid { grid-template-columns: 1fr; }
    .ainexus-hero-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ainexus-hero-compact:last-child { padding-bottom: 1.15rem; border-bottom: 1px solid var(--ainexus-line); }
    .ainexus-trending-grid,
    .ainexus-normal-grid,
    .ainexus-news-topics-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ainexus-latest-top-grid { grid-template-columns: 1fr; }
    .ainexus-category-news-grid { grid-template-columns: 1fr; }
    .ainexus-footer-shell { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    body.ainexus-editorial .single-layout.has-sidebar { grid-template-columns: 1fr; }
    body.ainexus-editorial .ainexus-single-sidebar-inner { border-top: 1px solid var(--ainexus-line); border-left: 0; }
}

@media (max-width: 700px) {
    body.ainexus-editorial .container { width: min(100% - 28px, 1240px); }
    .ainexus-utility-bar .container { min-height: 32px; }
    .ainexus-utility-bar p { display: none; }
    .ainexus-utility-bar .container { justify-content: flex-end; }
    .ainexus-header-inner { grid-template-columns: minmax(0, 1fr) auto auto; }
    .mobile-menu-toggle { display: inline-grid; grid-column: 2; }
    .header-actions { grid-column: 3; }
    body.ainexus-editorial .site-navigation { grid-column: 1 / -1; display: none; grid-row: 2; padding-top: 0.3rem; }
    body.ainexus-editorial .site-navigation.active { display: block; }
    body.ainexus-editorial .nav-links { display: grid; gap: 0; padding: 0.4rem 0 0.75rem; }
    .nav-links li { border-top: 1px solid var(--ainexus-line); }
    .nav-links a { display: block; padding: 0.75rem 0; }
    .site-description { display: none; }
    .ainexus-hero-list,
    body.ainexus-editorial .ainexus-live-latest-grid,
    .ainexus-trending-grid,
    .ainexus-normal-grid,
    .ainexus-news-topics-list { grid-template-columns: 1fr; }
    .ainexus-hero-compact { grid-template-columns: 105px minmax(0, 1fr); }
    body.ainexus-editorial .site-main { padding: 2rem 0 3.5rem; }
    .ainexus-builder-section,
    .ainexus-home-section,
    .ainexus-home-widget-section,
    .ainexus-home-newsletter { margin-bottom: 3.25rem; }
    .ainexus-news-trending,
    .ainexus-news-latest,
    .ainexus-news-topics,
    .ainexus-news-categories { margin-bottom: 3.25rem; }
    .ainexus-news-section-header { align-items: start; flex-direction: column; gap: 0.6rem; }
    .ainexus-news-section-header > p { text-align: left; }
    .ainexus-feed-lead { grid-template-columns: 1fr; }
    .ainexus-feed-lead-image { min-height: 220px; aspect-ratio: 16 / 9; }
    .ainexus-category-news-section { padding: 1.8rem 0; }
    .ainexus-category-news-header { align-items: start; }
    .ainexus-category-lead { grid-template-columns: 1fr; }
    .ainexus-category-lead-image { min-height: 210px; aspect-ratio: 16 / 9; }
    .ainexus-auto-next-article { align-items: flex-start; flex-direction: column; justify-content: center; padding: 1rem 0; }
    .ainexus-footer-shell { grid-template-columns: 1fr; gap: 2rem; padding: 2.25rem 0; }
    .ainexus-footer-links { grid-template-columns: 1fr; }
    body.ainexus-editorial .ainexus-footer-lower .container { display: grid; }
    .article-share-section { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* Keep a complete, visible navigation bar on tablets and smaller laptops. */
@media (min-width: 1601px) {
    body.ainexus-editorial .mobile-menu-toggle { display: none !important; }
    body.ainexus-editorial .site-navigation { display: block !important; position: static !important; opacity: 1 !important; visibility: visible !important; transform: none !important; }
}

@media (min-width: 641px) and (max-width: 980px) {
    .ainexus-hero-list { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto repeat(2, minmax(0, 1fr)); gap: 0 1.25rem; height: auto; }
    .ainexus-hero-rail-label { grid-column: 1 / -1; }
    .ainexus-hero-compact { padding: 1rem 0; }
}

@media (max-width: 980px) {
    body.ainexus-editorial .ainexus-single-sidebar-inner { padding: 1.5rem 0 0; border-top: 1px solid var(--ainexus-line); border-left: 0; }
}

@media (max-width: 1600px) {
    body.ainexus-editorial { --ainexus-fixed-header-height: 68px; }
    html, body.ainexus-editorial { overflow-x: clip; }
    html.ainexus-scroll-locked,
    body.ainexus-editorial.ainexus-menu-open { overflow: hidden !important; height: 100%; }
    body.ainexus-editorial.ainexus-menu-open { position: fixed; right: 0; left: 0; width: 100%; }
    /* A backdrop filter creates a containing block for fixed descendants.
     * Without this reset the off-canvas navigation can be clipped by the
     * header when a submenu expands. */
    body.ainexus-editorial .site-header {
        padding: 0;
        overflow: visible;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
    .ainexus-header-inner { grid-template-columns: 96px minmax(0, 1fr) 96px; min-height: 68px; gap: 0.35rem; }
    .site-branding { grid-column: 2; grid-row: 1; justify-self: center; justify-content: center; max-width: 100%; }
    .site-branding .custom-logo-link { display: none; }
    .site-branding .custom-logo { display: none; }
    .site-title-wrap { min-width: 0; }
    body.ainexus-editorial .site-title { overflow: hidden; font-size: clamp(1.3rem, 5.7vw, 1.75rem); text-align: center; text-overflow: ellipsis; white-space: nowrap; }
    .ainexus-header-end { grid-column: 3; grid-row: 1; justify-self: end; gap: 0.2rem; }
    body.ainexus-editorial .mobile-menu-toggle { display: inline-grid !important; width: 44px; height: 44px; color: var(--ainexus-ink); border: 0; border-radius: 0.3rem; font-size: 1.55rem; }
    .header-actions { grid-column: 1; grid-row: 1; justify-self: start; gap: 0.2rem; }
    .header-actions .icon-btn,
    .ainexus-header-end .icon-btn { width: 44px; height: 44px; color: var(--ainexus-ink); border: 0; border-radius: 0.3rem; font-size: 1.4rem; }
    .header-actions .icon-btn:hover,
    .ainexus-header-end .icon-btn:hover { color: var(--ainexus-accent); background: var(--ainexus-soft); }
    body.ainexus-editorial .search-dropdown { position: fixed; top: 76px; right: 0.75rem; left: 0.75rem; width: auto; }
    body.ainexus-editorial .site-navigation {
        position: fixed !important;
        top: 0;
        right: 0;
        bottom: 0;
        left: auto;
        z-index: 100001;
        display: block !important;
        width: 50vw !important;
        max-width: none;
        height: 100dvh;
        margin: 0;
        padding: 0 0 calc(1.25rem + env(safe-area-inset-bottom));
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        scrollbar-color: #666 transparent;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
        background: var(--ainexus-surface);
        border: 0;
        border-left: 1px solid var(--ainexus-line);
        border-radius: 0;
        box-shadow: -18px 0 44px rgb(15 23 42 / 20%);
        opacity: 0;
        pointer-events: none;
        transform: translateX(105%);
        transition: opacity 0.32s ease, transform 0.42s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.32s ease;
        visibility: hidden;
    }
    body.ainexus-editorial .site-navigation.active { opacity: 1; pointer-events: auto; transform: translateX(0); visibility: visible; }
    .ainexus-nav-backdrop {
        position: fixed;
        inset: 0;
        z-index: 100000;
        display: block;
        width: 100%;
        height: 100%;
        padding: 0;
        background: rgb(4 19 35 / 45%);
        border: 0;
        cursor: pointer;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.32s ease, visibility 0.32s ease;
        visibility: hidden;
    }
    .ainexus-nav-backdrop.active { opacity: 1; pointer-events: auto; visibility: visible; }
    .ainexus-mobile-nav-header {
        position: sticky;
        top: 0;
        z-index: 1;
        display: flex;
        box-sizing: border-box;
        flex-shrink: 0;
        align-items: center;
        justify-content: space-between;
        min-height: 78px;
        padding: 1rem 1.25rem;
        background: var(--ainexus-surface);
        border-bottom: 1px solid var(--ainexus-line);
    }
    .ainexus-mobile-nav-brand { display: inline-flex; align-items: center; gap: 0.7rem; min-width: 0; color: var(--ainexus-ink); font-family: var(--ainexus-serif); font-size: 1.3rem; font-weight: 700; letter-spacing: -0.035em; text-decoration: none; }
    .ainexus-mobile-nav-logo { display: block; flex: 0 0 auto; width: 36px; height: 36px; object-fit: cover; }
    .ainexus-mobile-nav-mark { display: grid; flex: 0 0 auto; width: 36px; height: 36px; place-items: center; color: #fff; background: var(--ainexus-accent-dark); font-family: var(--ainexus-sans); font-size: 0.88rem; font-weight: 900; letter-spacing: -0.07em; }
    .ainexus-mobile-nav-tools { display: flex; align-items: center; gap: 0.45rem; }
    .ainexus-mobile-nav-close,
    .ainexus-mobile-theme-toggle { display: inline-grid; flex: 0 0 auto; width: 40px; height: 40px; place-items: center; padding: 0; color: var(--ainexus-ink); background: transparent; border: 1px solid var(--ainexus-line); border-radius: 0.35rem; font-size: 1.2rem; cursor: pointer; }
    .ainexus-mobile-nav-close:hover,
    .ainexus-mobile-theme-toggle:hover { color: var(--ainexus-accent); border-color: var(--ainexus-accent); }
    body.ainexus-editorial .nav-links { display: grid; grid-template-columns: 1fr; width: 100%; gap: 0; margin: 0; padding: 1rem 1.75rem; }
    .nav-links > li { display: block; min-width: 0; border-bottom: 1px solid var(--ainexus-line); }
    .nav-links > li > a { display: block; min-height: 54px; padding: 1rem 0.5rem; color: var(--ainexus-ink); font-size: 0.92rem; font-weight: 700; line-height: 1.22; white-space: normal; }
    .nav-links > li > a::after { display: none; }
    .nav-links > li.menu-item-has-children > a { padding-right: 2.5rem; }
    .nav-links > li.menu-item-has-children > a::before { display: none; }
    .nav-submenu-toggle { position: absolute; top: 0.5rem; right: 0.25rem; display: inline-grid; width: 34px; height: 34px; place-items: center; color: var(--ainexus-ink); background: transparent; border: 1px solid var(--ainexus-line); border-radius: 50%; cursor: pointer; }
    .nav-links > li.menu-item-has-children.is-submenu-open { grid-column: 1; padding: 0 0.5rem 0.7rem; background: var(--ainexus-soft); border-radius: 0.45rem; }
    .nav-links > li.menu-item-has-children.is-submenu-open > a { border-bottom: 1px solid var(--ainexus-line); }
    .nav-links .sub-menu { position: static; grid-template-columns: 1fr; width: auto; gap: 0; margin: 0.45rem 0 0; padding: 0; overflow: visible; visibility: visible; background: transparent; border: 0; border-radius: 0; box-shadow: none; opacity: 1; pointer-events: auto; transform: none; }
    .nav-links > li.menu-item-has-children > .sub-menu { display: none; }
    .nav-links > li.menu-item-has-children.is-submenu-open > .sub-menu { display: grid; }
    .nav-links .sub-menu a { padding: 0.7rem 0.35rem; color: var(--ainexus-muted); font-size: 0.82rem; }
}

@media (max-width: 782px) {
    body.admin-bar.ainexus-editorial { padding-top: calc(var(--ainexus-fixed-header-height) + 46px); }
    body.admin-bar.ainexus-editorial .site-header { top: 46px; }
}

@media (max-width: 782px) {
    body.admin-bar.ainexus-editorial .search-dropdown { top: 122px; }
}

@media (max-width: 390px) {
    body.ainexus-editorial .nav-links,
    .nav-links .sub-menu { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
    body.ainexus-editorial .site-navigation { left: 0; width: 100vw !important; }
    body.ainexus-editorial .nav-links { padding-inline: 1.25rem; }
}

/* Explicit compact-header order: search, centred wordmark, then menu. */
html.ainexus-compact-header body.ainexus-editorial .site-header .ainexus-header-inner { display: grid !important; grid-template-columns: 96px minmax(0, 1fr) 96px !important; align-items: center; min-height: 68px; }
html.ainexus-compact-header body.ainexus-editorial .site-header .site-branding { grid-column: 2 !important; grid-row: 1 !important; justify-self: center !important; justify-content: center; max-width: 100%; }
html.ainexus-compact-header body.ainexus-editorial .site-header .site-branding .custom-logo-link { display: none !important; }
html.ainexus-compact-header body.ainexus-editorial .site-header .ainexus-header-end { grid-column: 3 !important; grid-row: 1 !important; justify-self: end !important; }
html.ainexus-compact-header body.ainexus-editorial .site-header .header-actions { grid-column: 1 !important; grid-row: 1 !important; justify-self: start !important; }
body.ainexus-editorial.ainexus-menu-open .site-navigation { overflow-y: auto !important; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
body.ainexus-editorial .site-navigation::-webkit-scrollbar { width: 8px; }
body.ainexus-editorial .site-navigation::-webkit-scrollbar-track { background: transparent; }
body.ainexus-editorial .site-navigation::-webkit-scrollbar-thumb { background: #666; border-radius: 999px; }
[data-theme="light"] body.ainexus-editorial .site-navigation::-webkit-scrollbar-thumb { background: #aaa; }

/* Monochrome navigation drawer: high contrast in both colour modes. */
[data-theme="dark"] body.ainexus-editorial .site-navigation { background: #000 !important; border-color: #333 !important; box-shadow: -18px 0 44px rgb(0 0 0 / 55%); }
[data-theme="dark"] body.ainexus-editorial .ainexus-mobile-nav-header { background: #000; border-color: #333; }
[data-theme="dark"] body.ainexus-editorial .ainexus-mobile-nav-brand,
[data-theme="dark"] body.ainexus-editorial .nav-links > li > a,
[data-theme="dark"] body.ainexus-editorial .nav-submenu-toggle,
[data-theme="dark"] body.ainexus-editorial .ainexus-mobile-nav-close,
[data-theme="dark"] body.ainexus-editorial .ainexus-mobile-theme-toggle { color: #fff; }
[data-theme="dark"] body.ainexus-editorial .nav-links > li,
[data-theme="dark"] body.ainexus-editorial .nav-links > li.menu-item-has-children.is-submenu-open > a,
[data-theme="dark"] body.ainexus-editorial .ainexus-mobile-nav-close,
[data-theme="dark"] body.ainexus-editorial .ainexus-mobile-theme-toggle,
[data-theme="dark"] body.ainexus-editorial .nav-submenu-toggle { border-color: #333; }
[data-theme="dark"] body.ainexus-editorial .nav-links > li.menu-item-has-children.is-submenu-open { background: #111; }
[data-theme="dark"] body.ainexus-editorial .nav-links .sub-menu a { color: #d4d4d4; }
[data-theme="dark"] body.ainexus-editorial .ainexus-mobile-nav-mark { color: #000; background: #fff; }
[data-theme="dark"] body.ainexus-editorial .nav-links .current-menu-item > a,
[data-theme="dark"] body.ainexus-editorial .nav-links .current-cat > a,
[data-theme="dark"] body.ainexus-editorial .nav-links a:hover,
[data-theme="dark"] body.ainexus-editorial .ainexus-mobile-nav-close:hover,
[data-theme="dark"] body.ainexus-editorial .ainexus-mobile-theme-toggle:hover { color: #fff; background: #1a1a1a; border-color: #fff; }

[data-theme="light"] body.ainexus-editorial .site-navigation { background: #fff !important; border-color: #d4d4d4 !important; box-shadow: -18px 0 44px rgb(0 0 0 / 18%); }
[data-theme="light"] body.ainexus-editorial .ainexus-mobile-nav-header { background: #fff; border-color: #d4d4d4; }
[data-theme="light"] body.ainexus-editorial .ainexus-mobile-nav-brand,
[data-theme="light"] body.ainexus-editorial .nav-links > li > a,
[data-theme="light"] body.ainexus-editorial .nav-submenu-toggle,
[data-theme="light"] body.ainexus-editorial .ainexus-mobile-nav-close,
[data-theme="light"] body.ainexus-editorial .ainexus-mobile-theme-toggle { color: #111; }
[data-theme="light"] body.ainexus-editorial .nav-links > li,
[data-theme="light"] body.ainexus-editorial .nav-links > li.menu-item-has-children.is-submenu-open > a,
[data-theme="light"] body.ainexus-editorial .ainexus-mobile-nav-close,
[data-theme="light"] body.ainexus-editorial .ainexus-mobile-theme-toggle,
[data-theme="light"] body.ainexus-editorial .nav-submenu-toggle { border-color: #d4d4d4; }
[data-theme="light"] body.ainexus-editorial .nav-links > li.menu-item-has-children.is-submenu-open { background: #f5f5f5; }
[data-theme="light"] body.ainexus-editorial .nav-links .sub-menu a { color: #404040; }
[data-theme="light"] body.ainexus-editorial .ainexus-mobile-nav-mark { color: #fff; background: #000; }
[data-theme="light"] body.ainexus-editorial .nav-links .current-menu-item > a,
[data-theme="light"] body.ainexus-editorial .nav-links .current-cat > a,
[data-theme="light"] body.ainexus-editorial .nav-links a:hover,
[data-theme="light"] body.ainexus-editorial .ainexus-mobile-nav-close:hover,
[data-theme="light"] body.ainexus-editorial .ainexus-mobile-theme-toggle:hover { color: #000; background: #f5f5f5; border-color: #000; }

/* Whole-site monochrome palette. */
[data-theme="dark"] {
    --ainexus-paper: #000 !important;
    --ainexus-surface: #000 !important;
    --ainexus-ink: #fff !important;
    --ainexus-muted: #d4d4d4 !important;
    --ainexus-line: #333 !important;
    --ainexus-soft: #111 !important;
    --ainexus-accent: #fff !important;
    --ainexus-accent-dark: #fff !important;
    --bg-color: #000 !important;
    --text-color: #fff !important;
    --card-bg: #000 !important;
    --card-border: #333 !important;
    --primary-color: #fff !important;
    --primary-hover: #d4d4d4 !important;
    --secondary-text: #d4d4d4 !important;
    --border-color: #333 !important;
}

[data-theme="light"] {
    --ainexus-paper: #fff !important;
    --ainexus-surface: #fff !important;
    --ainexus-ink: #111 !important;
    --ainexus-muted: #404040 !important;
    --ainexus-line: #d4d4d4 !important;
    --ainexus-soft: #f5f5f5 !important;
    --ainexus-accent: #000 !important;
    --ainexus-accent-dark: #000 !important;
    --bg-color: #fff !important;
    --text-color: #111 !important;
    --card-bg: #fff !important;
    --card-border: #d4d4d4 !important;
    --primary-color: #000 !important;
    --primary-hover: #404040 !important;
    --secondary-text: #404040 !important;
    --border-color: #d4d4d4 !important;
}

[data-theme="dark"] body.ainexus-editorial,
[data-theme="dark"] body.ainexus-editorial .site-header,
[data-theme="dark"] body.ainexus-editorial .site-main { color: #fff; background: #000; }
[data-theme="light"] body.ainexus-editorial,
[data-theme="light"] body.ainexus-editorial .site-header,
[data-theme="light"] body.ainexus-editorial .site-main { color: #111; background: #fff; }

[data-theme="dark"] body.ainexus-editorial .site-footer.ainexus-news-footer,
[data-theme="dark"] body.ainexus-editorial .ainexus-news-footer .ainexus-footer-lower { color: #fff; background: #000 !important; border-color: #333; }
[data-theme="light"] body.ainexus-editorial .site-footer.ainexus-news-footer,
[data-theme="light"] body.ainexus-editorial .ainexus-news-footer .ainexus-footer-lower { color: #111; background: #fff !important; border-color: #d4d4d4; }
[data-theme="dark"] body.ainexus-editorial .ainexus-footer-wordmark,
[data-theme="dark"] body.ainexus-editorial .ainexus-footer-description,
[data-theme="dark"] body.ainexus-editorial .ainexus-footer-label,
[data-theme="dark"] body.ainexus-editorial .ainexus-footer-links a,
[data-theme="dark"] body.ainexus-editorial .ainexus-footer-latest a,
[data-theme="dark"] body.ainexus-editorial .ainexus-footer-latest time,
[data-theme="dark"] body.ainexus-editorial .ainexus-news-footer .ainexus-footer-lower p { color: #fff; }
[data-theme="light"] body.ainexus-editorial .ainexus-footer-wordmark,
[data-theme="light"] body.ainexus-editorial .ainexus-footer-description,
[data-theme="light"] body.ainexus-editorial .ainexus-footer-label,
[data-theme="light"] body.ainexus-editorial .ainexus-footer-links a,
[data-theme="light"] body.ainexus-editorial .ainexus-footer-latest a,
[data-theme="light"] body.ainexus-editorial .ainexus-footer-latest time,
[data-theme="light"] body.ainexus-editorial .ainexus-news-footer .ainexus-footer-lower p { color: #111; }

[data-theme="dark"] body.ainexus-editorial .ainexus-sidebar-context { color: #fff; background: #000; border-color: #333; }
[data-theme="dark"] body.ainexus-editorial .ainexus-sidebar-context p,
[data-theme="dark"] body.ainexus-editorial .ainexus-sidebar-context a { color: #fff; }
[data-theme="light"] body.ainexus-editorial .ainexus-sidebar-context { color: #111; background: #fff; border-color: #d4d4d4; }
[data-theme="light"] body.ainexus-editorial .ainexus-sidebar-context h2,
[data-theme="light"] body.ainexus-editorial .ainexus-sidebar-context p,
[data-theme="light"] body.ainexus-editorial .ainexus-sidebar-context a { color: #111; }

/* Interactive controls always invert to a readable black/white pair. */
[data-theme="dark"] body.ainexus-editorial .share-btn:hover,
[data-theme="dark"] body.ainexus-editorial .ainexus-sidebar-tags-list a:hover,
[data-theme="dark"] body.ainexus-editorial .ainexus-footer-socials a:hover { color: #000; background: #fff; border-color: #fff; }
[data-theme="dark"] body.ainexus-editorial .ainexus-comments input[type="submit"] { color: #000; background: #fff; }
[data-theme="light"] body.ainexus-editorial .share-btn:hover,
[data-theme="light"] body.ainexus-editorial .ainexus-sidebar-tags-list a:hover,
[data-theme="light"] body.ainexus-editorial .ainexus-footer-socials a:hover { color: #fff; background: #000; border-color: #000; }
[data-theme="light"] body.ainexus-editorial .ainexus-comments input[type="submit"] { color: #fff; background: #000; }

[data-theme="dark"] body.ainexus-editorial .ainexus-back-to-top { color: #000; background: #fff; border-color: #fff; box-shadow: 0 8px 22px rgb(255 255 255 / 18%); }
[data-theme="light"] body.ainexus-editorial .ainexus-back-to-top { color: #fff; background: #000; border-color: #000; box-shadow: 0 8px 22px rgb(0 0 0 / 18%); }
[data-theme="dark"] body.ainexus-editorial .ainexus-skip-link,
[data-theme="dark"] body.ainexus-editorial .search-submit,
[data-theme="dark"] body.ainexus-editorial .ainexus-home-newsletter button { color: #000; background: #fff; }
[data-theme="light"] body.ainexus-editorial .ainexus-skip-link,
[data-theme="light"] body.ainexus-editorial .search-submit,
[data-theme="light"] body.ainexus-editorial .ainexus-home-newsletter button { color: #fff; background: #000; }

/* Missing-cover placeholders always remain readable. */
body.ainexus-editorial .fallback-thumbnail { color: #fff !important; background: #000 !important; }
body.ainexus-editorial .fallback-thumbnail h1,
body.ainexus-editorial .fallback-thumbnail h2,
body.ainexus-editorial .fallback-thumbnail h3,
body.ainexus-editorial .fallback-thumbnail h4,
body.ainexus-editorial .fallback-thumbnail a { color: #fff !important; text-shadow: none; }
[data-theme="dark"] body.ainexus-editorial .fallback-thumbnail { color: #000 !important; background: #fff !important; }
[data-theme="dark"] body.ainexus-editorial .fallback-thumbnail h1,
[data-theme="dark"] body.ainexus-editorial .fallback-thumbnail h2,
[data-theme="dark"] body.ainexus-editorial .fallback-thumbnail h3,
[data-theme="dark"] body.ainexus-editorial .fallback-thumbnail h4,
[data-theme="dark"] body.ainexus-editorial .fallback-thumbnail a { color: #000 !important; }
[data-theme="dark"] body.ainexus-editorial .fallback-thumbnail .cat-badge { color: #fff !important; background: #000 !important; }
[data-theme="dark"] body.ainexus-editorial .cat-badge { color: #000 !important; background: #fff !important; }
