/* ═══════════════════════════════════════════════════════════════════════
   2026 AEO & GEO VISUAL HARDENING — weMOVEtogether Knowledge Hub
   ═══════════════════════════════════════════════════════════════════════
   Standard: Habito/NerdWallet Hybrid — high-authority answer engine design
   Created: 25 March 2026 | ADR 001 compliant
   ═══════════════════════════════════════════════════════════════════════ */

/* ── 0. Global Layout Stabiliser ──────────────────────────────────────── */

html, body {
    overflow-x: hidden !important;
    max-width: 100vw;
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* Kill nav overflow on blog pages */
.site-header,
.site-header .header-container,
.blog-header-nav {
    max-width: 100vw;
    overflow-x: hidden;
}

.site-header .header-container {
    flex-wrap: wrap;
}

.site-header .nav-list {
    flex-wrap: wrap;
}

/* Constrain article + sidebar within viewport */
article,
.article-content,
.blog-content {
    max-width: 100%;
    overflow-x: hidden;
}

/* ── 1. Typography Foundation ─────────────────────────────────────────── */

.blog-content,
.article-content,
.guide-content,
#main-content {
    font-size: 18px;
    line-height: 1.7;
    color: #1a1a1a;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* High-specificity overrides to beat inline <style> blocks */
body .blog-content h1,
body .article-content h1,
body .guide-content h1,
body .article-header h1 {
    font-size: 2.5rem !important;
    font-weight: 800 !important;
    color: #004d4d !important;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

body .blog-content h2,
body .article-content h2,
body .guide-content h2 {
    font-size: 1.65rem !important;
    font-weight: 700 !important;
    color: #004d4d !important;
    line-height: 1.3;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

body .blog-content h3,
body .article-content h3,
body .guide-content h3 {
    font-size: 1.3rem !important;
    font-weight: 600 !important;
    color: #004d4d !important;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

/* ── 2. The Atomic Answer Block (AEO Summary) ────────────────────────── */

.aeo-summary {
    background-color: #f0fafa;
    border-left: 5px solid #008080;
    border: 1px solid #c8e6e6;
    border-left: 5px solid #008080;
    padding: 28px 32px;
    margin: 16px 0 32px 0;
    border-radius: 0 10px 10px 0;
    box-shadow: 0 2px 8px rgba(0, 77, 77, 0.08);
}

.aeo-summary p {
    font-size: 1.25rem;
    line-height: 1.6;
    color: #1a1a1a;
    font-weight: 600;
    margin: 0;
}

.aeo-summary strong {
    color: #004d4d;
}

/* ── 3. E-E-A-T Metadata Strip ────────────────────────────────────────── */

.post-meta {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 10px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.post-meta .author-badge {
    color: #004d4d;
    font-weight: 600;
}

.post-meta .last-updated {
    color: #666;
}

.post-meta .read-time {
    color: #888;
}

.post-meta .separator {
    color: #ccc;
}

/* ── 4. March 2026 Reality Check (Sticky Sidebar) ────────────────────── */

.article-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
    max-width: 1100px;
    margin: 0 auto;
}

.article-main {
    min-width: 0;
}

/* When sidebar is inside .article-content (float mode) */
.article-content .article-sidebar,
.blog-content .article-sidebar {
    float: right;
    width: 280px;
    margin: 0 0 24px 40px;
}

/* When sidebar is a sibling (grid mode) */
.article-layout > .article-sidebar {
    float: none;
    width: auto;
    margin: 0;
}

.reality-check-sidebar {
    position: sticky;
    top: 100px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    font-family: 'Inter', sans-serif;
}

.reality-check-sidebar h3 {
    color: #004d4d;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    margin-top: 0;
    border-bottom: 2px solid #f0f4f4;
    padding-bottom: 8px;
}

.reality-check-data-point {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.reality-check-label {
    color: #666;
}

.reality-check-value {
    font-weight: 700;
    color: #008080;
}

.reality-check-source {
    font-size: 0.75rem;
    color: #aaa;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.reality-check-cta {
    display: block;
    margin-top: 16px;
    padding: 10px 16px;
    background: #008080;
    color: #fff;
    text-align: center;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.reality-check-cta:hover {
    background: #006666;
    color: #fff;
}

/* ── 5. Blog Grid & Card Normalisation ────────────────────────────────── */

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 32px;
    padding: 40px 0;
}

.blog-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.blog-card:focus-visible {
    outline: 3px solid #008080;
    outline-offset: 2px;
}

.blog-card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-bottom: 1px solid #eee;
    border-radius: 0;
}

.blog-card-body {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.blog-card-excerpt {
    font-size: 0.95rem;
    color: #444;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #004d4d;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.blog-card-meta {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 8px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.blog-card-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #888;
}

/* ── 6. Image Normalisation ───────────────────────────────────────────── */

.blog-content img,
.article-content img,
.guide-content img {
    border-radius: 8px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    width: 100%;
    max-width: 100%;
    height: auto;
}

/* ── 7. Responsive: Mobile/Tablet ─────────────────────────────────────── */

@media (max-width: 900px) {
    .article-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .reality-check-sidebar {
        position: relative;
        top: 0;
    }

    .article-sidebar,
    .article-content .article-sidebar,
    .blog-content .article-sidebar {
        float: none;
        width: 100%;
        margin: 0 0 24px 0;
        order: -1;
    }

    .blog-content h1,
    .article-content h1 {
        font-size: 1.75rem;
    }

    .blog-content h2,
    .article-content h2 {
        font-size: 1.35rem;
    }
}

@media (max-width: 600px) {
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .blog-content,
    .article-content {
        font-size: 16px;
    }

    .aeo-summary {
        padding: 16px;
        margin: 12px 0 24px 0;
    }

    .post-meta {
        flex-direction: column;
        gap: 4px;
    }
}

/* ── 8. Kill Duplicate Metadata ──────────────────────────────────────── */
/* Hide JS-injected 'Last updated' line */
.post-last-updated {
    display: none !important;
}
/* Hide original template .article-meta (replaced by .post-meta strip) */
.article-meta {
    display: none !important;
}

/* ── 9. Ghost Button Fix (Nav CTA overflow on blog pages) ───────────── */

/*
 * ROOT CAUSE: Blog template inline CSS does `header nav { display: none }`
 * which hides the nav links but NOT the `.nav-cta` button (it's a sibling
 * of <nav>, not inside it). The button renders but its container is
 * collapsed, making it appear as a floating teal circle.
 *
 * Fix: The blog pages have their own `.blog-header-nav` sticky nav.
 * The original site-header becomes redundant on blog pages.
 * Hide the CTA button in any header where the main nav is hidden.
 */
/* ZOMBIE KILL: The nav CTA button (.btn.btn-primary.nav-cta) is a sibling
 * of <nav>, not inside it. When blog CSS hides header nav, this button
 * survives as a floating 56x56px teal circle. Kill it with maximum
 * specificity + !important on every display-related property. */
html body header.site-header .btn.btn-primary.nav-cta,
html body .site-header .nav-cta,
html body .header-container .nav-cta,
.nav-cta {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    left: -9999px !important;
}

/* ── 10. AEO Checklist (Teal Checkmarks) ──────────────────────────────── */

ul.aeo-checklist {
    list-style: none;
    padding-left: 0;
    margin: 1rem 0;
}

ul.aeo-checklist li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

ul.aeo-checklist li::before {
    content: '\2714';
    position: absolute;
    left: 0;
    top: 0.1em;
    color: #008080;
    font-weight: 700;
    font-size: 1.1em;
}

/* ── 11. Table of Contents ────────────────────────────────────────────── */

.aeo-toc {
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 20px 14px;
    margin: 12px 0 24px 0;
    max-width: min(600px, 100%);
    box-sizing: border-box;
    overflow: hidden;
    word-wrap: break-word;
}

.aeo-toc-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #004d4d;
    margin: 0 0 8px 0;
    font-variant: small-caps;
}

.aeo-toc-list {
    margin: 0;
    padding-left: 1rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 24px;
}

.aeo-toc-list li {
    margin-bottom: 2px;
    font-size: 0.85rem;
    line-height: 1.35;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

@media (max-width: 600px) {
    .aeo-toc-list {
        grid-template-columns: 1fr;
    }
}

.aeo-toc-list a {
    color: #008080;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.aeo-toc-list a:hover {
    border-bottom-color: #008080;
}

/* ── 12. Data Tables (converted from Markdown) ───────────────────────── */

.aeo-data-table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
    background: #fff;
    border-radius: 8px;
    overflow-x: auto;
    display: block;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.aeo-data-table thead th {
    background: #004d4d;
    color: #fff;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.aeo-data-table tbody td {
    padding: 10px 16px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}

.aeo-data-table tbody tr:nth-child(even) {
    background: #f8fcfc;
}

.aeo-data-table tbody tr:hover {
    background: #f0f7f7;
}

.aeo-data-table tbody td:first-child {
    color: #004d4d;
}

@media (max-width: 600px) {
    .aeo-data-table {
        font-size: 0.85rem;
    }
    .aeo-data-table thead th,
    .aeo-data-table tbody td {
        padding: 8px 10px;
    }
}
