/* ============================================================
   Center for Anomalous Research (CAR) — brand overrides
   Navy #0B1F3A · Gold #C9A227 · White #FFFFFF
   Playfair Display headings · Inter body
   Loaded after Casper's screen.css; CSS-level changes only.
   ============================================================ */

:root {
    --car-navy: #0B1F3A;
    --car-navy-deep: #08172c;
    --car-gold: #C9A227;
    --car-gold-dark: #8A6D1B; /* readable gold for text links on white */
    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    --font-serif: "Playfair Display", Georgia, Times, serif;
}

/* ---------- Typography ---------- */
body {
    font-family: var(--font-sans);
}

.gh-content {
    font-family: var(--font-sans);
}

h1, h2, h3, h4, h5, h6,
.gh-article-title,
.post-card-title,
.gh-author-name,
.gh-tag-name,
.gh-page-title {
    font-family: var(--font-serif);
    color: var(--car-navy);
}

/* ---------- Header: navy ---------- */
.gh-head {
    background: var(--car-navy);
    color: #fff;
}

.gh-head a,
.gh-nav a,
.gh-head-brand a {
    color: #fff;
}

.gh-head a:hover,
.gh-nav a:hover {
    color: var(--car-gold);
}

.gh-head .gh-icon-btn svg,
.gh-search svg {
    stroke: #fff;
}

.gh-burger::before,
.gh-burger::after {
    background-color: #fff;
}

/* ---------- Buttons: gold with navy text ---------- */
.gh-btn,
.button,
.gh-head-btn,
.gh-subscribe-btn {
    background: var(--car-gold);
    color: var(--car-navy);
}

.gh-btn:hover,
.button:hover,
.gh-head-btn:hover,
.gh-subscribe-btn:hover {
    background: #b08d1f;
    color: var(--car-navy);
}

/* ---------- Links & accents ---------- */
.gh-content a {
    color: var(--car-gold-dark);
}

.gh-content a:hover {
    color: var(--car-gold);
}

.post-card-tag,
.gh-tag,
.gh-article-tag {
    color: var(--car-gold-dark);
}

.gh-article-meta a:hover,
.post-card-meta a:hover {
    color: var(--car-gold-dark);
}

/* ---------- Footer: navy ---------- */
.gh-foot {
    background: var(--car-navy);
    color: #fff;
}

.gh-foot a,
.gh-foot .gh-nav a {
    color: #fff;
}

.gh-foot a:hover {
    color: var(--car-gold);
}

.gh-foot .gh-copyright,
.gh-foot .gh-powered-by {
    color: rgba(255, 255, 255, 0.75);
}

/* ---------- Dark mode: keep headings readable ---------- */
.dark-mode h1, .dark-mode h2, .dark-mode h3,
.dark-mode h4, .dark-mode h5, .dark-mode h6,
.dark-mode .gh-article-title,
.dark-mode .post-card-title,
.dark-mode .gh-author-name,
.dark-mode .gh-tag-name,
.dark-mode .gh-page-title {
    color: #fff;
}

@media (prefers-color-scheme: dark) {
    .auto-color h1, .auto-color h2, .auto-color h3,
    .auto-color h4, .auto-color h5, .auto-color h6,
    .auto-color .gh-article-title,
    .auto-color .post-card-title,
    .auto-color .gh-author-name,
    .auto-color .gh-tag-name,
    .auto-color .gh-page-title {
        color: #fff;
    }
}

/* ---------- Header gold rule (matches archive) ---------- */
.gh-head {
    border-bottom: 2px solid var(--car-gold);
}

/* ---------- Hero block: archive navy-deep (no cover image) ---------- */
.site-header,
.has-cover .site-header-content {
    background: #081426;
    background-color: #081426;
}

/* ---------- Hero + head: archive navy-deep, specificity-proof ---------- */
.site-header,
.has-cover .site-header-content,
.home-template.has-cover .gh-head,
.has-cover .gh-head {
    background: #081426 !important;
    background-color: #081426 !important;
}

/* ---------- Hero height: half of Casper default ---------- */
.has-cover .site-header-content {
    min-height: 280px;
}

/* ---------- Hero padding: Casper 19vmin is the real height driver ---------- */
.has-cover .site-header-content,
.site-header-content {
    padding-top: 90px;
    padding-bottom: 40px;
}


/* ---------- Archive-style header: brand left, nav below, no hero band ---------- */
.gh-head .car-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
}
.gh-head .car-brand img {
    width: 56px;
    height: 56px;
    max-height: none;
    object-fit: contain;
}
.car-brand-text {
    display: flex;
    flex-direction: column;
}
.car-org {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #fff;
    line-height: 1.15;
}
.car-sub {
    font-size: 0.78rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--car-gold);
    margin-top: 0.2rem;
}
/* Eliminate the hero color band below the header */
.site-header-content {
    display: none;
}
@media (min-width: 768px) {
    .gh-head-inner {
        flex-wrap: wrap;
    }
    .gh-head-brand {
        order: 1;
    }
    .gh-head-actions {
        order: 2;
        margin-left: auto;
    }
    .gh-head-menu {
        order: 3;
        flex-basis: 100%;
        margin-top: 0.7rem;
    }
}
@media (max-width: 767px) {
    .gh-head .car-brand img {
        width: 44px;
        height: 44px;
    }
    .car-org {
        font-size: 1.05rem;
    }
    .car-sub {
        font-size: 0.65rem;
        letter-spacing: 0.18em;
    }
}


/* ---------- Fix: un-hide head logo on home, in-flow header, grid nav-below ---------- */
.is-head-left-logo.home-template .gh-head .gh-head-logo {
    display: flex !important;
}
.gh-head {
    height: auto !important;
}
.home-template.has-cover .gh-head {
    position: relative !important;
}
.gh-head-inner {
    height: auto;
    padding-top: 16px;
    padding-bottom: 14px;
}
@media (min-width: 768px) {
    .gh-head-inner {
        grid-template-columns: auto 1fr auto;
        grid-template-rows: auto auto;
    }
    .gh-head-brand {
        grid-row: 1;
        grid-column: 1;
    }
    .gh-head-actions {
        grid-row: 1;
        grid-column: 3;
    }
    .gh-head-menu {
        grid-row: 2;
        grid-column: 1 / -1;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-top: 0.7rem;
    }
}


/* ---------- Subscribe CTA: navy band, gold button ---------- */
.footer-cta {
    background: #081426;
    color: #fff;
    padding: min(64px, 8vmin) 0;
}
.footer-cta-title {
    color: #fff;
    font-family: var(--font-serif);
}
.car-cta-sub {
    color: rgba(255, 255, 255, 0.8);
    margin: 0.4rem 0 1.2rem;
}
.footer-cta-button {
    background: #fff;
    color: #667085;
    border: 1px solid rgba(255, 255, 255, 0.25);
}
.footer-cta-button span {
    background: var(--car-gold);
    color: var(--car-navy-deep);
}
.footer-cta-button:hover span {
    background: #b08d1f;
}


/* ---------- Layout fixes 2026-12-03: kill white gap, unify footer, full-frame card images ---------- */
.footer-cta {
    margin-top: 4.8rem;
    margin-bottom: 0;
}
.gh-foot {
    margin-top: 0;
    background: #081426;
}
.post-card-image {
    object-fit: contain;
    background: #000;
}


/* ---------- Footer fix: class is .site-footer (not .gh-foot); kill 12vmin top margin, match CTA navy ---------- */
.site-footer {
    margin-top: 0;
    background: #081426;
    padding-bottom: 48px;
}


/* ---------- Briefing strip under header ---------- */
.car-brief-strip {
    background: #fff;
    border-bottom: 2px solid var(--car-gold);
    padding: 1.6rem 0;
}
.car-brief-strip-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}
.car-brief-strip-text {
    margin: 0;
    font-size: 1.6rem;
    color: var(--car-navy);
}
.car-brief-strip-btn {
    background: var(--car-gold);
    color: var(--car-navy-deep);
    font-weight: 700;
    padding: 0.8rem 1.8rem;
    border-radius: 6px;
    text-decoration: none;
    white-space: nowrap;
}
.car-brief-strip-btn:hover {
    background: #b08d1f;
    color: var(--car-navy-deep);
}


/* ---------- Header search bar ---------- */
.car-head-search {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    padding: 0 0.4rem 0 1.2rem;
    height: 38px;
}
.car-head-search input {
    background: transparent;
    border: 0;
    outline: none;
    color: #fff;
    font-size: 1.4rem;
    width: 255px;
}
.car-head-search input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}
.car-head-search button {
    background: transparent;
    border: 0;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0.4rem;
}
.car-head-search button svg {
    width: 18px;
    height: 18px;
}
@media (max-width: 767px) {
    .car-head-search input {
        width: 130px;
    }
}

/* Mobile-only full-width search bar under the header */
.car-mobile-search {
    display: none;
}
@media (max-width: 767px) {
    .car-mobile-search {
        display: block;
        background: #081426;
        padding: 0 1.6rem 1.2rem;
    }
    .car-mobile-search .car-head-search {
        width: 100%;
    }
    .car-mobile-search .car-head-search input {
        flex: 1;
        width: auto;
    }
}

/* Post typography: titles + dates bold, body text regular */
.post-card-title,
.article-title {
    font-weight: 800;
}
.post-card-meta,
.post-card-meta-date,
.article-byline-meta {
    font-weight: 700;
}
.post-card-excerpt,
.article-excerpt,
.gh-content {
    font-weight: 400;
}

/* Stronger title/date vs body differentiation */
.post-card-meta-date,
.byline-meta-date {
    color: var(--car-gold);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.post-card-title {
    font-size: 2.9rem;
}
.post-card-excerpt {
    color: var(--color-secondary-text);
}

/* Article sections: lead-ins stand out as mini-headings, body text subtle */
.gh-content p,
.gh-content li {
    color: #55565e;
}
.gh-content strong {
    color: var(--car-navy-deep);
}
.gh-content p > strong:first-child {
    display: block;
    margin-top: 1.4em;
    margin-bottom: 0.35em;
    padding-left: 0.6em;
    border-left: 3px solid var(--car-gold);
    font-size: 1.12em;
    line-height: 1.35;
    color: var(--car-navy-deep);
}
.gh-content h2 {
    color: var(--car-navy-deep);
    border-bottom: 2px solid var(--car-gold);
    padding-bottom: 0.25em;
}

/* ---------- Mobile fixes (2026-12-03) ---------- */
/* Hero band: Source's mobile .has-cover rule out-specifies our plain
   display:none, leaving ~180px of empty navy on phones. Force it off. */
.site-header-content,
.has-cover .site-header-content {
    display: none !important;
}
@media (max-width: 767px) {
    /* Mobile menu: the actions area (accent/gold bg) holds our search form;
       mobile already has the under-header search bar, so drop the duplicate
       and the gold block. */
    .gh-head-actions .car-head-search {
        display: none !important;
    }
    .gh-head-actions {
        background: transparent !important;
    }
    /* Brand: a touch larger so it doesn't read scrunched */
    .gh-head .car-brand img {
        width: 48px;
        height: 48px;
    }
    .car-org {
        font-size: 1.12rem;
    }
    /* Mobile search bar sits tight under the header */
    .car-mobile-search {
        padding-top: 0.15rem;
        padding-bottom: 0.9rem;
    }
}

/* ---------- Mobile fixes v2 (2026-12-03) ---------- */
.car-search-toggle { display: none; }
@media (max-width: 767px) {
    /* Brand row: Source caps .gh-head-brand at 40px; let it breathe and
       size the mark/name like the archive header */
    .gh-head-brand { height: auto; }
    .gh-head .car-brand img { width: 54px; height: 54px; }
    .car-org { font-size: 1.22rem; }
    /* Magnifier-only search: icon in the header toggles the bar */
    .car-search-toggle {
        display: flex;
        align-items: center;
        margin-left: auto;
        background: transparent;
        border: 0;
        color: #fff;
        cursor: pointer;
        padding: 0.5rem;
    }
    .car-search-toggle svg { width: 20px; height: 20px; stroke: #fff; }
    .car-mobile-search { display: none; }
    .car-mobile-search.open { display: block; }
}

/* ---------- Mobile fixes v3 (2026-12-03) ---------- */
@media (max-width: 767px) {
    /* Source mobile header grid is auto/1fr/auto with 48px gaps; menu and
       actions are fixed overlays, so the empty rows + gaps leave ~100px of
       dead navy. Collapse to the brand row only. */
    #gh-head .gh-head-inner {
        grid-template-rows: auto;
        gap: 0;
    }
    /* Subscribe strip: center the message to match the centered button */
    .car-brief-strip-inner {
        gap: 1rem;
    }
    .car-brief-strip-text {
        text-align: center;
    }
}

/* ---------- Random archive photo (2026-12-03) ---------- */
.car-random-photo {
    text-align: center;
    padding: 3.2rem 0 4rem;
}
.car-random-title {
    font-family: "Playfair Display", Georgia, serif;
    color: var(--car-navy-deep, #081426);
    font-size: 2.4rem;
    margin: 0 0 1.6rem;
}
.car-random-figure { margin: 0 auto; max-width: 720px; }
.car-random-figure img {
    max-width: 100%;
    max-height: 480px;
    object-fit: contain;
    background: #000;
    border-radius: 6px;
}
.car-random-figure figcaption { margin-top: 1rem; }
#car-random-caption {
    display: block;
    font-weight: 700;
    color: var(--car-navy-deep, #081426);
}
.car-random-meta {
    display: block;
    margin-top: .3rem;
    font-size: .85em;
    color: #6b6f78;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.car-random-btn {
    margin-top: 1.4rem;
    background: var(--car-gold, #c9a227);
    color: var(--car-navy-deep, #081426);
    font-weight: 700;
    border: 0;
    border-radius: 6px;
    padding: .8rem 1.8rem;
    cursor: pointer;
}
.car-random-btn:hover { background: #b08d1f; }
