/* ============================================================
   FedSmith — Theme-wide styles
   Tokens, light & dark mode, header, footer, sidebar, shared
   post-card chrome, drawers, ads. Homepage-only styles live in
   front-page.css. Other templates will add their own siblings.
   ============================================================ */

/* --- Light mode tokens (default) --- */
:root {
    /* Brand (locked) */
    --brand-navy: #0606ab;
    --brand-red: #a9271c;
    --brand-deep-navy: #04047a;

    /* Surfaces */
    --bg-page: #fafaf8; /* warm white */
    --bg-card: #ffffff;
    --bg-sand: #f0ebdf; /* announcement, sidebar fills */
    --bg-sand-dark: #d9d1c0;
    --bg-federal-blue: #e7f1fa;
    --bg-light-navy: #e8e8f8;
    --bg-alt-row: #f5f2fe;
    --bg-footer: #f0ebdf;
    --bg-footer-strip: #d9d1c0;

    /* Text */
    --text-body: #2d2d2d;
    --text-muted: #6b6b6b;
    --text-heading: #1b1b23;
    --text-on-navy: #ffffff;

    /* Lines & borders */
    --line: #dedede;
    --line-soft: #e8e5dc;

    /* Accents */
    --link: #0606ab;
    --link-hover: #04047a;

    /* Misc */
    --nav-height: 64px;
    --strip-height: 42px;
    --admin-bar-height: 0px;
    --container: 1280px;
    --sidebar: 320px;
    --gutter: 24px;

    /* Radii */
    --r-sm: 0.125rem;
    --r: 0.25rem;
    --r-md: 0.375rem;
    --r-lg: 0.5rem;
    --r-xl: 0.75rem;

    /* Shadows */
    --shadow-card: 0 1px 2px rgba(20, 20, 40, 0.04), 0 1px 1px rgba(20, 20, 40, 0.03);
    --shadow-pop: 0 12px 32px rgba(15, 15, 60, 0.12), 0 2px 6px rgba(15, 15, 60, 0.08);
    --shadow-nav: 0 1px 0 rgba(0, 0, 0, 0.06), 0 2px 8px rgba(15, 15, 60, 0.05);

    /* Logos — paths resolved relative to this stylesheet (assets/css/) */
    --logo-light: url("../images/fedsmith-logo-light.png");
    --logo-dark: url("../images/fedsmith-logo-dark.png");

    /* Shared gray scale */
    --lt-color-gray-100: #ebebeb;

    /* Status / alert colors */
    --bg-alert-red: #fdecea;
    --text-alert-red: #8a1f15;

    /* Social platform brand colors */
    --social-web: #1672d9;
    --social-x: #000000;
    --social-facebook: #1877f2;
    --social-linkedin: #0a66c2;
}

/* --- Dark mode tokens (manual override via [data-theme="dark"]) --- */
:root[data-theme="dark"] {
    --bg-page: #0f0f0f;
    --bg-card: #1e1e1e;
    --bg-sand: #1a1a1a;
    --bg-sand-dark: #232323;
    --bg-federal-blue: #1a2030;
    --bg-light-navy: #161628;
    --bg-alt-row: #181820;
    --bg-footer: #141414;
    --bg-footer-strip: #0c0c0c;

    --text-body: #a0a0a0;
    --text-muted: #8a8a8a;
    --text-heading: #e8e8e8;
    --text-on-navy: #ffffff;

    --line: #2e2e2e;
    --line-soft: #262626;

    --link: #7ab3e0;
    --link-hover: #a6cfec;

    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.5), 0 1px 1px rgba(0, 0, 0, 0.4);
    --shadow-pop: 0 16px 40px rgba(0, 0, 0, 0.7), 0 4px 8px rgba(0, 0, 0, 0.6);
    --shadow-nav: 0 1px 0 rgba(255, 255, 255, 0.04), 0 2px 8px rgba(0, 0, 0, 0.5);
    --lt-color-gray-100: #232323;

    /* Dark-mode hover background (used across nav, icon buttons, search, drawer) */
    --bg-dark-hover: #2a2a35;
}

/* Apply OS default if user hasn't manually set a theme */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --bg-page: #0f0f0f;
        --bg-card: #1e1e1e;
        --bg-sand: #1a1a1a;
        --bg-sand-dark: #232323;
        --bg-federal-blue: #1a2030;
        --bg-light-navy: #161628;
        --bg-alt-row: #181820;
        --bg-footer: #141414;
        --bg-footer-strip: #0c0c0c;

        --text-body: #a0a0a0;
        --text-muted: #8a8a8a;
        --text-heading: #e8e8e8;

        --line: #2e2e2e;
        --line-soft: #262626;

        --link: #7ab3e0;
        --bg-dark-hover: #2a2a35;
        --link-hover: #a6cfec;

        --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.5), 0 1px 1px rgba(0, 0, 0, 0.4);
        --shadow-pop: 0 16px 40px rgba(0, 0, 0, 0.7), 0 4px 8px rgba(0, 0, 0, 0.6);
        --shadow-nav: 0 1px 0 rgba(255, 255, 255, 0.04), 0 2px 8px rgba(0, 0, 0, 0.5);
        --lt-color-gray-100: #232323;
    }
}

/* WordPress admin bar — override --admin-bar-height when #wpadminbar is active */
body.admin-bar {
    --admin-bar-height: 32px;
}
@media screen and (max-width: 782px) {
    body.admin-bar {
        --admin-bar-height: 46px;
    }
}

/* ----- Reset & base ----- */
*,
*::before,
*::after {
    box-sizing: border-box;
}
html {
    scroll-padding-top: calc(var(--nav-height) + var(--strip-height) + 12px);
}
html.wp-toolbar {
    scroll-padding-top: calc(32px + var(--nav-height) + var(--strip-height) + 12px);
}
/* Note: overflow-x:hidden lives on body only, never html — applying it to html
   binds position:fixed/sticky descendants to document scrollWidth on mobile
   browsers, which manifests as the nav clipping off-screen. */
body {
    margin: 0;
    font-family: "DM Sans", system-ui, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-body);
    background: var(--bg-page);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
img {
    max-width: 100%;
    display: block;
}
a {
    color: var(--link);
    text-decoration: none;
}
a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}
button {
    font-family: inherit;
    cursor: pointer;
}

h1,
h2,
h3,
h4,
h5 {
    font-family: "Outfit", system-ui, sans-serif;
    color: var(--text-heading);
    margin: 0;
    line-height: 1.2;
}
h1 {
    font-size: 2.5rem;
    font-weight: 700;
}
h2 {
    font-size: 2rem;
    font-weight: 700;
}
h3 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.3;
}
h4 {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
}

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

/* ============================================================
   Announcement strip (above nav, full width, fixed position)
   ============================================================ */
.announcement {
    background: var(--bg-sand);
    color: var(--text-body);
    border-bottom: 1px solid var(--bg-sand-dark);
    font-size: 0.875rem;
    min-height: 42px;
    padding: 4px 0;
    display: flex;
    align-items: center;
    position: fixed;
    top: var(--admin-bar-height);
    left: 0;
    right: 0;
    z-index: 60;
}
:root[data-theme="dark"] .announcement {
    border-bottom-color: var(--line);
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .announcement {
        border-bottom-color: var(--line);
    }
}
.announcement .container {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}
.announcement__badge {
    background: var(--brand-red);
    color: #fff;
    font-family: "Outfit", sans-serif;
    font-weight: 700;
    font-size: 0.6875rem;
    letter-spacing: 0.06em;
    padding: 3px 8px;
    border-radius: var(--r);
    text-transform: uppercase;
    flex: 0 0 auto;
}
.announcement__text {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-body);
    line-height: 1.3;
}
.announcement__text a {
    color: var(--brand-deep-navy);
    font-weight: 500;
    text-decoration: underline;
}
:root[data-theme="dark"] .announcement__text a {
    color: var(--link);
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .announcement__text a {
        color: var(--link);
    }
}

/* ============================================================
   Main navigation (fixed)
   ============================================================ */
.nav {
    position: fixed;
    top: calc(var(--admin-bar-height) + var(--strip-height));
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--line);
    z-index: 50;
    box-shadow: var(--shadow-nav);
}
.nav__inner {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 24px;
    min-width: 0;
}
.nav__logo {
    display: block;
    height: 40px;
    width: 168px;
    background-image: var(--logo-light);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: left center;
    flex: 0 0 auto;
}
:root[data-theme="dark"] .nav__logo {
    background-image: var(--logo-dark);
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .nav__logo {
        background-image: var(--logo-dark);
    }
}

.nav__menu {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
}
.nav__menu > li {
    position: relative;
}
.nav__link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0 12px;
    height: var(--nav-height);
    font-family: "DM Sans", sans-serif;
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-heading);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition:
        color 0.15s,
        border-color 0.15s;
    cursor: pointer;
    background: none;
    border-top: 0;
    border-left: 0;
    border-right: 0;
}
.nav__link:hover {
    color: var(--brand-navy);
    border-bottom-color: var(--brand-red);
    text-decoration: none;
}
:root[data-theme="dark"] .nav__link:hover {
    color: var(--link);
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .nav__link:hover {
        color: var(--link);
    }
}
.nav__link[aria-expanded="true"] {
    color: var(--brand-navy);
    border-bottom-color: var(--brand-red);
}

/* Topics dropdown */
.nav__dropdown {
    position: absolute;
    top: calc(var(--nav-height) - 4px);
    left: 0;
    min-width: 220px;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-pop);
    padding: 8px;
    list-style: none;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition:
        opacity 0.15s,
        transform 0.15s,
        visibility 0.15s;
    z-index: 51;
}
.nav__dropdown[data-open="true"] {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.nav__dropdown a {
    display: block;
    padding: 10px 12px;
    border-radius: var(--r);
    color: var(--text-heading);
    font-weight: 500;
    font-size: 0.9375rem;
    text-decoration: none;
}
.nav__dropdown a:hover {
    background: var(--bg-light-navy);
    color: var(--brand-navy);
    text-decoration: none;
}
:root[data-theme="dark"] .nav__dropdown a:hover {
    background: var(--bg-dark-hover);
    color: var(--link);
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .nav__dropdown a:hover {
        background: var(--bg-dark-hover);
        color: var(--link);
    }
}

.nav__caret {
    width: 12px;
    height: 12px;
    transition: transform 0.15s;
}
.nav__link[aria-expanded="true"] .nav__caret {
    transform: rotate(180deg);
}

.nav__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}
.btn-subscribe {
    background: var(--brand-navy);
    color: #fff;
    font-family: "DM Sans", sans-serif;
    font-weight: 700;
    font-size: 0.875rem;
    letter-spacing: 0.02em;
    padding: 9px 18px;
    border: 0;
    border-radius: var(--r);
    text-transform: uppercase;
}
.btn-subscribe:hover {
    background: var(--brand-red);
    color: #fff;
}

.icon-btn {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--r);
    color: var(--text-heading);
    transition:
        background 0.15s,
        border-color 0.15s,
        color 0.15s;
}
.icon-btn:hover {
    background: var(--bg-light-navy);
    color: var(--brand-navy);
}
:root[data-theme="dark"] .icon-btn:hover {
    background: var(--bg-dark-hover);
    color: var(--link);
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .icon-btn:hover {
        background: var(--bg-dark-hover);
        color: var(--link);
    }
}
.icon-btn svg {
    width: 20px;
    height: 20px;
}

/* Hamburger button (hidden on desktop) */
.hamburger {
    display: none;
}

/* When no announcement strip is rendered, nav and overlay sit flush at the top */
body:not(:has(.announcement)) .nav {
    top: var(--admin-bar-height);
}

/* ============================================================
   Search overlay (appears below the nav, fixed)
   ============================================================ */
.search-overlay {
    position: fixed;
    top: calc(var(--admin-bar-height) + var(--strip-height) + var(--nav-height));
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 8px 24px rgba(15, 15, 60, 0.08);
    padding: 14px 0;
    z-index: 49;
    transform: translateY(-110%);
    transition: transform 0.25s ease;
    visibility: hidden;
}
.search-overlay[data-open="true"] {
    transform: translateY(0);
    visibility: visible;
}
.search-overlay__row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}
.search-overlay__icon {
    width: 22px;
    height: 22px;
    color: var(--text-muted);
    flex: 0 0 auto;
}
.search-overlay__input {
    flex: 1;
    font-family: "DM Sans", sans-serif;
    font-size: 1rem;
    color: var(--text-heading);
    background: var(--bg-page);
    border: 1.5px solid var(--brand-navy);
    border-radius: var(--r-md);
    padding: 12px 16px;
    outline: none;
}
.search-overlay__input:focus-visible {
    outline: 2px solid var(--brand-navy);
    outline-offset: 3px;
}
.search-overlay__input::placeholder {
    color: var(--text-muted);
    font-style: italic;
}
:root[data-theme="dark"] .search-overlay__input {
    background: #2a2a2a;
    border-color: #444;
    color: #e8e8e8;
}
:root[data-theme="dark"] .search-overlay__input::placeholder {
    color: #666;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .search-overlay__input {
        background: #2a2a2a;
        border-color: #444;
        color: #e8e8e8;
    }
    :root:not([data-theme]) .search-overlay__input::placeholder {
        color: #666;
    }
}
.search-overlay__close {
    background: var(--bg-card);
    color: var(--text-heading);
    border: 1px solid var(--line);
    border-radius: var(--r);
    font-family: "DM Sans", sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 9px 18px;
}
.search-overlay__close:hover {
    background: var(--bg-light-navy);
    color: var(--brand-navy);
    border-color: var(--brand-navy);
}
:root[data-theme="dark"] .search-overlay__close:hover {
    background: var(--bg-dark-hover);
    color: var(--link);
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .search-overlay__close:hover {
        background: var(--bg-dark-hover);
        color: var(--link);
    }
}

/* ============================================================
   Page main offset for the fixed header
   ============================================================ */
main.page {
    padding-top: calc(var(--strip-height) + var(--nav-height));
}
body:not(:has(.announcement)) main.page {
    padding-top: var(--nav-height);
}

body:not(:has(.announcement)) .search-overlay {
    top: calc(var(--admin-bar-height) + var(--nav-height));
}

/* Shared content/sidebar grid — used by every template */
.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--sidebar);
    gap: 32px;
    padding: 28px 0 48px;
}
.main-col {
    min-width: 0;
}

/* ============================================================
   Post card meta (shared across templates)
   ============================================================ */
.post-card__cat {
    display: inline-block;
    font-family: "DM Sans", sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brand-navy);
    margin-bottom: 6px;
}
:root[data-theme="dark"] .post-card__cat {
    color: var(--link);
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .post-card__cat {
        color: var(--link);
    }
}
.post-card__excerpt {
    color: var(--text-body);
    font-size: 1rem;
    margin: 0;
}
.post-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    font-size: 0.875rem;
    color: var(--text-muted);
    letter-spacing: 0.01em;
}
.post-card__meta strong {
    color: var(--text-heading);
    font-weight: 500;
}
.post-card__meta .dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--text-muted);
    display: inline-block;
}
.post-card__meta .comments {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text-muted);
}
.post-card__meta .comments svg {
    opacity: 0.7;
}

/* ============================================================
   Blogroll + blog-card (shared across templates)
   Used by the homepage Latest Articles list, archive/category/tag,
   author archive, and search results.
   ============================================================ */
.blogroll {
    display: grid;
    grid-template-columns: 1fr;
    gap: 22px;
}
.blog-card {
    display: grid;
    grid-template-columns: 1fr;
    padding-left: 20px;
    border-left: 4px solid var(--cat-color, var(--brand-navy));
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
}
.blogroll .blog-card:last-of-type {
    border-bottom: 0;
}
.blog-card__body {
    display: flex;
    flex-direction: column;
}
.blog-card h3 {
    font-size: 1.625rem;
    margin: 4px 0 8px;
    line-height: 1.28;
    text-wrap: balance;
}
.blog-card h3 a {
    color: var(--text-heading);
}
.blog-card h3 a:hover {
    color: var(--brand-navy);
    text-decoration: none;
}
.blog-card .post-card__cat {
    color: var(--cat-color, var(--brand-navy));
}
:root[data-theme="dark"] .blog-card h3 a:hover {
    color: var(--link);
}
:root[data-theme="dark"] .blog-card {
    border-left-color: var(--cat-color-dark, var(--link));
}
:root[data-theme="dark"] .blog-card .post-card__cat {
    color: var(--cat-color-dark, var(--link));
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .blog-card {
        border-left-color: var(--cat-color-dark, var(--link));
    }
    :root:not([data-theme]) .blog-card .post-card__cat {
        color: var(--cat-color-dark, var(--link));
    }
    :root:not([data-theme]) .blog-card h3 a:hover {
        color: var(--link);
    }
}

@media (max-width: 720px) {
    .blog-card h3 {
        font-size: 1.25rem;
    }
}

/* Blog card — pinned variant */
.blog-card--pinned {
    border-left-color: var(--brand-navy);
}
:root[data-theme="dark"] .blog-card--pinned {
    border-left-color: var(--link);
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .blog-card--pinned {
        border-left-color: var(--link);
    }
}
.blog-card__pinned-badge {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 5px;
    font-family: "DM Sans", sans-serif;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--brand-navy);
    background: var(--bg-sand);
    border-radius: var(--r);
    padding: 2px 7px 2px 5px;
    margin-bottom: 7px;
    line-height: 1;
}
:root[data-theme="dark"] .blog-card__pinned-badge {
    color: var(--text-on-navy);
    background: var(--brand-navy);
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .blog-card__pinned-badge {
        color: var(--text-on-navy);
        background: var(--brand-navy);
    }
}

/* ============================================================
   Section heading (with bottom border accent — shared)
   ============================================================ */
.section-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin: 32px 0 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--brand-navy);
    position: relative;
}
.section-heading::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 64px;
    height: 3px;
    background: var(--brand-red);
}
.section-heading h2 {
    font-size: 1.625rem;
}
.section-heading .view-all {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--brand-navy);
}
:root[data-theme="dark"] .section-heading .view-all {
    color: var(--link);
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .section-heading .view-all {
        color: var(--link);
    }
}

/* ============================================================
   Ad placeholder chrome (shared across templates)
   ============================================================ */
.ad-slot {
    background: var(--bg-sand);
    border: 1px dashed var(--bg-sand-dark);
    color: var(--text-muted);
    text-align: center;
    font-family: "DM Sans", sans-serif;
    font-size: 0.6875rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    padding: 36px 12px;
    border-radius: var(--r);
    margin: 28px 0;
}
:root[data-theme="dark"] .ad-slot {
    background: #1a1a1a;
    border-color: #2e2e2e;
}

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 22px;
}
.widget {
    background: var(--bg-card);
    border-radius: var(--r-md);
}
.widget--bordered {
    border: 1px solid var(--line);
    overflow: hidden;
}
.widget__head {
    background: var(--brand-navy);
    color: #fff;
    font-family: "Outfit", sans-serif;
    font-weight: 700;
    font-size: 0.9375rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 12px 16px;
}
.widget__body {
    padding: 14px 16px;
}

/* TSP sidebar widget chrome */
[data-fedsmith-widget="tsp"] {
    padding: 0; /* heading and footer extend edge-to-edge; .widget--bordered overflow:hidden clips */
}
[data-fedsmith-widget="tsp"] h3 {
    background: var(--brand-navy);
    color: var(--text-on-navy);
    font-family: "Outfit", sans-serif;
    font-weight: 700;
    font-size: 0.9375rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 12px 16px;
    border-bottom: none;
    margin: 0;
}
[data-fedsmith-widget="tsp"] .tsp-data-container {
    padding: 10px 14px 0;
    margin-bottom: 0; /* prevent remote tsp-table.css bottom margin from gapping the footer strip */
}
[data-fedsmith-widget="tsp"] .tsp-disclaimer {
    margin: 0;
    font-style: normal;
}

/* TSP table */
.tsp-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    margin-top: -12px;
}
.tsp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}
.tsp-table th,
.tsp-table td {
    text-align: right;
    padding: 7px 4px;
    border-bottom: 1px solid var(--line-soft);
}
.tsp-table th:first-child,
.tsp-table td:first-child {
    text-align: left;
    font-weight: 500;
    color: var(--text-heading);
}
.tsp-table thead th {
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.6875rem;
    letter-spacing: 0.06em;
    border-bottom: 2px solid var(--line);
}
.tsp-up {
    color: #136d2e;
    font-weight: 500;
}
.tsp-down {
    color: #b12d21;
    font-weight: 500;
}
:root[data-theme="dark"] .tsp-up {
    color: #6bd08a;
}
:root[data-theme="dark"] .tsp-down {
    color: #f08a7e;
}
.tsp-foot {
    font-size: 0.75rem;
    font-weight: 500;
    font-family: "Outfit", sans-serif;
    color: var(--text-muted);
    padding: 10px 16px;
    background: var(--bg-sand);
    border-top: 1px solid var(--line);
    text-align: center;
}
:root[data-theme="dark"] .tsp-foot {
    background: #181820;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .tsp-up {
        color: #6bd08a;
    }
    :root:not([data-theme]) .tsp-down {
        color: #f08a7e;
    }
    :root:not([data-theme]) .tsp-foot {
        background: #181820;
    }
}

/* ============================================================
   TSP bridge widget — dark mode overrides
   Overrides the hardcoded light-mode colors in tsp-table.css,
   the remote stylesheet shipped by the tsp-data-engine plugin.
   Classes: .tsp-data-table, .tsp-pos, .tsp-neg, .tsp-disclaimer
   Higher specificity via :root[data-theme] / prefers-color-scheme
   ensures these win regardless of stylesheet load order.
   ============================================================ */
:root[data-theme="dark"] .tsp-data-table {
    background: var(--bg-card);
    border-color: var(--line);
}
:root[data-theme="dark"] .tsp-data-table thead {
    background-color: var(--bg-sand);
}
:root[data-theme="dark"] .tsp-data-table th,
:root[data-theme="dark"] .tsp-data-table td {
    border-bottom-color: var(--line-soft);
}
:root[data-theme="dark"] .tsp-data-table th {
    color: var(--text-muted);
}
:root[data-theme="dark"] .tsp-data-table th:first-child,
:root[data-theme="dark"] .tsp-data-table td:first-child {
    color: var(--text-heading);
}
:root[data-theme="dark"] .tsp-pos {
    color: #6bd08a !important;
}
:root[data-theme="dark"] .tsp-neg {
    color: #f08a7e !important;
}
:root[data-theme="dark"] .tsp-disclaimer {
    color: var(--text-muted);
}
@media screen and (max-width: 600px) {
    :root[data-theme="dark"] .tsp-data-table tr {
        border-color: var(--line);
    }
    :root[data-theme="dark"] .tsp-data-table td {
        border-bottom-color: var(--line-soft);
    }
    :root[data-theme="dark"] .tsp-data-table td::before {
        color: var(--text-muted);
    }
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .tsp-data-table {
        background: var(--bg-card);
        border-color: var(--line);
    }
    :root:not([data-theme]) .tsp-data-table thead {
        background-color: var(--bg-sand);
    }
    :root:not([data-theme]) .tsp-data-table th,
    :root:not([data-theme]) .tsp-data-table td {
        border-bottom-color: var(--line-soft);
    }
    :root:not([data-theme]) .tsp-data-table th {
        color: var(--text-muted);
    }
    :root:not([data-theme]) .tsp-data-table th:first-child,
    :root:not([data-theme]) .tsp-data-table td:first-child {
        color: var(--text-heading);
    }
    :root:not([data-theme]) .tsp-pos {
        color: #6bd08a !important;
    }
    :root:not([data-theme]) .tsp-neg {
        color: #f08a7e !important;
    }
    :root:not([data-theme]) .tsp-disclaimer {
        color: var(--text-muted);
    }
}
@media screen and (prefers-color-scheme: dark) and (max-width: 600px) {
    :root:not([data-theme]) .tsp-data-table tr {
        border-color: var(--line);
    }
    :root:not([data-theme]) .tsp-data-table td {
        border-bottom-color: var(--line-soft);
    }
    :root:not([data-theme]) .tsp-data-table td::before {
        color: var(--text-muted);
    }
}

/* Newsletter widget */
.fs-newsletter {
    background: var(--brand-navy);
    color: #fff;
    border-radius: var(--r-md);
    padding: 22px 20px;
    text-align: center;
}
:root[data-theme="dark"] .fs-newsletter {
    background: #0d0d8a;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .fs-newsletter {
        background: #0d0d8a;
    }
}
.fs-newsletter__icon {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    margin-bottom: 8px;
}
.fs-newsletter h3 {
    color: #fff;
    font-size: 1.25rem;
    margin-bottom: 4px;
}
.fs-newsletter p {
    font-size: 0.875rem;
    opacity: 0.9;
    margin: 0 0 14px;
}
.fs-newsletter input[type="email"] {
    width: 100%;
    font-family: "DM Sans", sans-serif;
    font-size: 0.875rem;
    padding: 11px 12px;
    border: 0;
    border-radius: var(--r);
    margin-bottom: 8px;
    outline: none;
    color: var(--text-heading);
    background: #fff;
}
.fs-newsletter input[type="email"]:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.85);
    outline-offset: 2px;
}
/* Soften to slightly-off-white in dark mode — pure white was jarring against the dark page. */
:root[data-theme="dark"] .fs-newsletter input[type="email"] {
    background: rgba(255, 255, 255, 0.88);
    color: #1a1a2e;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .fs-newsletter input[type="email"] {
        background: rgba(255, 255, 255, 0.88);
        color: #1a1a2e;
    }
}
.fs-newsletter button {
    width: 100%;
    background: var(--brand-red);
    color: #fff;
    border: 0;
    border-radius: var(--r);
    font-family: "DM Sans", sans-serif;
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 11px;
    cursor: pointer;
    transition: background 0.15s;
}
.fs-newsletter button:hover {
    background: #8e120b;
}
/* Email signup form overrides — navy sidebar context */
.fs-newsletter .fs-es-form {
    text-align: left;
}
.fs-newsletter .fs-es-field {
    margin-bottom: 0;
}
.fs-newsletter .fs-es-field label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.75);
}
.fs-newsletter .fs-es-groups {
    margin-bottom: 0.5rem;
}
.fs-newsletter .fs-es-groups legend {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 6px;
}
.fs-newsletter .fs-es-groups label {
    font-size: 0.8125rem;
    color: #fff;
}
.fs-newsletter .fs-es-groups input[type="checkbox"] {
    accent-color: var(--brand-red);
}
.fs-newsletter .fs-es-groups input[type="checkbox"]:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.85);
    outline-offset: 2px;
}
.fs-newsletter .fs-es-btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.85);
    outline-offset: 2px;
}
/* Inline validation errors — bold + light rose; weight distinguishes from surrounding UI text */
.fs-newsletter .fs-es-error {
    color: #ffcccc;
    font-weight: 700;
    margin-bottom: 7px;
}
/* Response messages — translucent overlays on navy */
.fs-newsletter .fs-es-response--subscribed {
    background: rgba(30, 100, 50, 0.3);
    border: 1px solid rgba(140, 230, 160, 0.35);
    color: #b8f5cb;
}
.fs-newsletter .fs-es-response--already_subscribed {
    background: rgba(190, 130, 20, 0.25);
    border: 1px solid rgba(255, 210, 100, 0.35);
    color: #ffe8b0;
}
.fs-newsletter .fs-es-response--error {
    background: rgba(169, 39, 28, 0.3);
    border: 1px solid rgba(255, 160, 160, 0.35);
    color: #ffcccc;
}
/* Topics widget (tag cloud) */
.topics {
    padding: 14px 18px 16px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--bg-card);
}
.topics h3 {
    font-family: "Outfit", sans-serif;
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-heading);
    padding-bottom: 8px;
    border-bottom: 2px solid var(--brand-red);
    margin: 0 0 12px;
}
.topics__list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.topics__tag {
    display: inline-flex;
    align-items: center;
    font-family: "DM Sans", sans-serif;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-heading);
    background: var(--bg-light-navy);
    border: 1px solid transparent;
    border-radius: var(--r);
    padding: 5px 10px;
    text-decoration: none;
    transition:
        background 0.15s,
        color 0.15s,
        border-color 0.15s;
}
.topics__tag:hover {
    background: var(--brand-navy);
    color: #fff;
    border-color: var(--brand-navy);
    text-decoration: none;
}
:root[data-theme="dark"] .topics__tag {
    background: var(--bg-dark-hover);
    color: var(--text-heading);
}
:root[data-theme="dark"] .topics__tag:hover {
    background: var(--link);
    color: #0f0f0f;
    border-color: var(--link);
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .topics__tag {
        background: var(--bg-dark-hover);
        color: var(--text-heading);
    }
    :root:not([data-theme]) .topics__tag:hover {
        background: var(--link);
        color: #0f0f0f;
        border-color: var(--link);
    }
}

/* Most popular widget */
.popular {
    padding: 14px 18px 16px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--bg-card);
}
.popular h3 {
    font-family: "Outfit", sans-serif;
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-heading);
    padding-bottom: 8px;
    border-bottom: 2px solid var(--brand-red);
    margin-bottom: 10px;
}
.popular ol {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: pop;
}
.popular li {
    counter-increment: pop;
    display: grid;
    grid-template-columns: 22px 1fr;
    gap: 4px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line-soft);
    font-size: 0.875rem;
    line-height: 1.4;
}
.popular li:last-child {
    border-bottom: 0;
}
.popular li::before {
    content: counter(pop) ".";
    font-family: "Outfit", sans-serif;
    font-weight: 700;
    color: var(--brand-navy);
}
:root[data-theme="dark"] .popular li::before {
    color: var(--link);
}
.popular li a {
    color: var(--text-heading);
}
.popular li a:hover {
    color: var(--brand-navy);
}
:root[data-theme="dark"] .popular li a:hover {
    color: var(--link);
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .popular li::before {
        color: var(--link);
    }
    :root:not([data-theme]) .popular li a:hover {
        color: var(--link);
    }
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
    background: var(--bg-footer);
    border-top: 1px solid var(--bg-sand-dark);
    margin-top: 48px;
}
:root[data-theme="dark"] .footer {
    border-top-color: var(--line);
}
.footer__grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 32px;
    padding: 40px 0;
}
.footer__brand-logo {
    display: block;
    width: 140px;
    height: 38px;
    background-image: var(--logo-light);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: left center;
    margin-bottom: 14px;
}
:root[data-theme="dark"] .footer__brand-logo {
    background-image: var(--logo-dark);
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .footer__brand-logo {
        background-image: var(--logo-dark);
    }
}
.footer__tagline {
    font-family: "DM Sans", sans-serif;
    font-size: 0.875rem;
    font-style: italic;
    color: var(--text-muted);
    margin: 0 0 12px;
}
.footer__about {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 16px;
    max-width: 320px;
}
.footer__social {
    display: flex;
    gap: 12px;
}
.footer__social a {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--bg-sand-dark);
    border-radius: 50%;
    color: var(--text-heading);
    transition:
        background 0.15s,
        color 0.15s,
        border-color 0.15s;
}
:root[data-theme="dark"] .footer__social a {
    border-color: var(--line);
    color: var(--text-heading);
}
.footer__social a:hover,
.footer__social a:hover svg {
    background: var(--brand-navy);
    border-color: var(--brand-navy);
    color: #fff;
    fill: #fff;
    text-decoration: none;
}
:root[data-theme="dark"] .footer__social a:hover,
:root[data-theme="dark"] .footer__social a:hover svg {
    background: var(--link);
    border-color: var(--link);
    color: #0f0f0f;
    fill: #0f0f0f;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .footer__social a:hover,
    :root:not([data-theme]) .footer__social a:hover svg {
        background: var(--link);
        border-color: var(--link);
        color: #0f0f0f;
        fill: #0f0f0f;
    }
}
.footer__social svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.footer__col h4 {
    font-family: "Outfit", sans-serif;
    font-weight: 700;
    font-size: 0.8125rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-heading);
    margin: 6px 0 12px;
}
.footer__col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer__col li {
    margin: 8px 0;
}
.footer__col a {
    color: var(--text-body);
    font-size: 0.90625rem;
}
.footer__col a:hover {
    color: var(--brand-navy);
    text-decoration: underline;
}
:root[data-theme="dark"] .footer__col a:hover {
    color: var(--link);
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .footer__col a:hover {
        color: var(--link);
    }
}

.footer__strip {
    background: var(--lt-color-gray-100);
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 14px 0;
}

.footer__strip .container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.footer__strip .disclaimer {
    font-style: italic;
}

/* ============================================================
   Mobile drawer
   ============================================================ */
.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s;
    z-index: 70;
}
.drawer-backdrop[data-open="true"] {
    opacity: 1;
    visibility: visible;
}
.drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(360px, 86vw);
    height: 100vh;
    background: var(--bg-card);
    border-left: 1px solid var(--line);
    z-index: 71;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.drawer[data-open="true"] {
    transform: translateX(0);
}
.drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    background: var(--bg-card);
}
.drawer__logo {
    height: 32px;
    width: 132px;
    background-image: var(--logo-light);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: left center;
}
:root[data-theme="dark"] .drawer__logo {
    background-image: var(--logo-dark);
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .drawer__logo {
        background-image: var(--logo-dark);
    }
}
.drawer__actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.drawer__nav {
    padding: 8px 0 16px;
}
.drawer__nav a,
.drawer__nav button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 22px;
    font-family: "DM Sans", sans-serif;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-heading);
    text-decoration: none;
    background: none;
    border: 0;
    text-align: left;
    border-bottom: 1px solid var(--line-soft);
}
.drawer__nav a:hover,
.drawer__nav button:hover {
    background: var(--bg-light-navy);
    color: var(--brand-navy);
    text-decoration: none;
}
:root[data-theme="dark"] .drawer__nav a:hover,
:root[data-theme="dark"] .drawer__nav button:hover {
    background: var(--bg-dark-hover);
    color: var(--link);
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .drawer__nav a:hover,
    :root:not([data-theme]) .drawer__nav button:hover {
        background: var(--bg-dark-hover);
        color: var(--link);
    }
}
.drawer__sub {
    background: var(--bg-alt-row);
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
}
.drawer__sub[data-open="true"] {
    max-height: 400px;
}
.drawer__sub a {
    padding: 12px 22px 12px 38px;
    font-size: 0.9375rem;
    font-weight: 400;
}
.drawer__sub-toggle .nav__caret {
    transition: transform 0.2s;
}
.drawer__sub-toggle[aria-expanded="true"] .nav__caret {
    transform: rotate(180deg);
}
.drawer__cta {
    margin: 16px 22px;
    background: var(--brand-navy);
    color: #fff;
    border: 0;
    border-radius: var(--r);
    padding: 14px;
    font-family: "DM Sans", sans-serif;
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
}

/* ============================================================
   Responsive — theme-wide rules
   (Homepage-specific responsive overrides live in front-page.css)
   ============================================================ */
@media (max-width: 1080px) {
    :root {
        --sidebar: 280px;
    }
}

@media (max-width: 960px) {
    .nav__menu {
        display: none;
    }
    .btn-subscribe {
        display: none;
    }
    .hamburger {
        display: inline-flex;
    }
    .nav__inner {
        gap: 12px;
    }
    .nav__actions {
        gap: 0;
    }

    .layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    :root {
        --nav-height: 60px;
    }
    .container {
        padding: 0 16px;
    }
    .nav__logo {
        width: 140px;
        height: 34px;
    }
    h1 {
        font-size: 1.75rem;
    }
    h2 {
        font-size: 1.5rem;
    }
    .footer__grid {
        grid-template-columns: 1fr 1fr;
        gap: 28px;
    }
    .footer__strip .container {
        flex-direction: column;
        align-items: flex-start;
    }
    .section-heading h2 {
        font-size: 1.375rem;
    }
    .announcement__text {
        font-size: 0.8125rem;
    }
    .announcement__badge {
        font-size: 0.625rem;
    }
}

@media (max-width: 480px) {
    .footer__grid {
        grid-template-columns: 1fr;
    }
}

/* Accessibility: visually hide content while keeping it available to screen readers */
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Accessibility: suppress all motion for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
