/* ============================================================
   LoanRateCheck — article.css
   Blog article page styles — supplements style.css
   ============================================================ */

/* ── ARTICLE HERO ────────────────────────────────────────────── */
.article-hero {
    background: linear-gradient(135deg, var(--navy) 0%, #1e3d5c 60%, #26527a 100%);
    padding: 36px 24px 40px;
    position: relative;
}
.article-hero::after {
    content: ''; position: absolute; bottom: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), var(--gold-light), var(--gold));
}
.article-hero-inner { max-width: 820px; margin: 0 auto; }

/* Breadcrumb */
.breadcrumb {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    font-size: .8rem; margin-bottom: 14px;
}
.breadcrumb a { color: rgba(255,255,255,.55); text-decoration: none; transition: color .2s; }
.breadcrumb a:hover { color: var(--gold-light); }
.breadcrumb span:last-child { color: rgba(255,255,255,.75); }
.bc-sep { color: rgba(255,255,255,.3); }

/* Article meta top */
.article-meta-top {
    display: flex; align-items: center; gap: 14px; margin-bottom: 14px;
}
.article-category {
    display: inline-block; padding: 3px 10px;
    background: var(--gold); color: var(--navy);
    border-radius: 20px; font-size: .72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .06em;
}
.article-read-time { color: rgba(255,255,255,.5); font-size: .82rem; }

/* Title */
.article-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.4rem; font-weight: 700; color: #fff;
    line-height: 1.22; margin-bottom: 14px;
}
.article-subtitle {
    font-size: 1.05rem; color: rgba(255,255,255,.7);
    font-weight: 300; line-height: 1.6; margin-bottom: 22px;
    max-width: 700px;
}

/* Byline */
.article-byline { display: flex; align-items: center; gap: 12px; }
.byline-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--gold); color: var(--navy);
    display: flex; align-items: center; justify-content: center;
    font-size: .82rem; font-weight: 800; flex-shrink: 0;
}
.byline-info { display: flex; flex-direction: column; gap: 1px; }
.byline-author { font-size: .88rem; font-weight: 600; color: #fff; }
.byline-date   { font-size: .78rem; color: rgba(255,255,255,.45); }

/* ── ARTICLE LAYOUT ──────────────────────────────────────────── */
.article-layout {
    max-width: 1200px; margin: 0 auto;
    padding: 40px 24px 60px;
    display: grid;
    grid-template-columns: 240px 1fr 260px;
    gap: 36px;
    align-items: start;
}

/* Without sidebar — use article-layout-no-sidebar class */
.article-layout-no-sidebar {
    grid-template-columns: 240px 1fr;
}

/* ── TABLE OF CONTENTS ───────────────────────────────────────── */
.article-toc {
    position: sticky;
    top: 80px;
}
.toc-inner {
    background: var(--bg-card); border-radius: var(--radius);
    border: 1px solid var(--border); box-shadow: var(--shadow-sm);
    padding: 20px 18px;
}
.toc-title {
    font-family: 'Playfair Display', serif;
    font-size: .95rem; font-weight: 700; color: var(--navy);
    margin-bottom: 12px; padding-bottom: 8px;
    border-bottom: 2px solid var(--gold);
}
.toc-list {
    list-style: none; padding: 0;
    display: flex; flex-direction: column; gap: 2px;
    counter-reset: toc-counter;
    margin-bottom: 18px;
}
.toc-list li { counter-increment: toc-counter; }
.toc-list a {
    display: flex; align-items: flex-start; gap: 8px;
    font-size: .8rem; color: var(--slate); text-decoration: none;
    padding: 5px 6px; border-radius: 4px;
    transition: background .15s, color .15s;
    line-height: 1.35;
}
.toc-list a::before {
    content: counter(toc-counter) '.';
    font-size: .72rem; color: var(--text-muted);
    flex-shrink: 0; margin-top: 1px; min-width: 18px;
}
.toc-list a:hover   { background: #eef5ff; color: var(--navy-mid); }
.toc-list a.toc-active {
    background: #eef5ff; color: var(--navy-mid);
    font-weight: 600;
}
.toc-cta {
    display: block; text-align: center;
    padding: 9px 14px;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: #fff; border-radius: var(--radius-sm);
    font-size: .82rem; font-weight: 700; text-decoration: none;
    transition: filter .15s, transform .15s;
    box-shadow: 0 2px 8px rgba(200,146,58,.3);
}
.toc-cta:hover { filter: brightness(1.07); transform: translateY(-1px); }

/* ── ARTICLE BODY ────────────────────────────────────────────── */
.article-body {
    min-width: 0; /* prevent grid blowout */
}

/* Lead paragraph */
.article-lead {
    font-size: 1.1rem; color: var(--slate); line-height: 1.75;
    margin-bottom: 28px; font-weight: 400;
    border-left: 4px solid var(--gold); padding-left: 18px;
}

/* Key takeaways box */
.article-key-points {
    background: #f0f5fb; border-radius: var(--radius);
    border: 1px solid var(--border); padding: 20px 24px;
    margin-bottom: 36px;
}
.article-key-points h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1rem; font-weight: 700; color: var(--navy);
    margin-bottom: 12px; padding-bottom: 8px;
    border-bottom: 2px solid var(--gold);
}
.article-key-points ul {
    list-style: none; padding: 0;
    display: flex; flex-direction: column; gap: 9px;
}
.article-key-points li {
    font-size: .9rem; color: var(--slate); line-height: 1.55;
    padding-left: 22px; position: relative;
}
.article-key-points li::before {
    content: '✓'; position: absolute; left: 0;
    color: var(--green); font-weight: 700; font-size: .85rem;
}

/* Headings */
.article-body h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.65rem; font-weight: 700; color: var(--navy);
    margin: 40px 0 12px; padding-bottom: 10px;
    border-bottom: 2px solid var(--gold);
    scroll-margin-top: 90px;
}
.article-body h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem; font-weight: 700; color: var(--navy);
    margin: 26px 0 8px;
    scroll-margin-top: 90px;
}
.article-body h4 {
    font-size: .92rem; font-weight: 700; color: var(--navy);
    text-transform: uppercase; letter-spacing: .05em;
    margin-bottom: 10px;
}

/* Body paragraphs */
.article-body p {
    font-size: .97rem; color: var(--slate);
    line-height: 1.75; margin-bottom: 14px;
}
.article-body strong { color: var(--navy); }
.article-body em { color: var(--slate); font-style: italic; }
.article-body a { color: var(--navy-mid); text-decoration: underline; }
.article-body a:hover { color: var(--gold); }

/* Callout boxes */
.article-callout {
    border-radius: var(--radius-sm); padding: 16px 20px;
    margin: 20px 0; font-size: .9rem; line-height: 1.6; color: var(--slate);
}
.callout-blue {
    background: #eef5ff; border-left: 4px solid var(--navy-mid);
}
.callout-gold {
    background: #fef8ee; border-left: 4px solid var(--gold);
}
.callout-green {
    background: #e8f7ee; border-left: 4px solid var(--green);
}
.article-callout strong { color: var(--navy); display: block; margin-bottom: 4px; }

/* Comparison table */
.article-comparison-table {
    margin: 24px 0; overflow-x: auto;
    border-radius: var(--radius-sm); border: 1px solid var(--border);
}
.article-comparison-table h4 {
    background: var(--navy); color: rgba(255,255,255,.85);
    padding: 12px 16px; font-size: .82rem; letter-spacing: .04em;
    margin: 0; text-transform: uppercase;
}
.article-comparison-table table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.article-comparison-table th {
    background: #2d4f72; color: rgba(255,255,255,.8);
    padding: 10px 12px; text-align: left; font-size: .78rem;
    font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
    border-bottom: 2px solid var(--gold); white-space: nowrap;
}
.article-comparison-table td {
    padding: 9px 12px; border-bottom: 1px solid #eef0f4;
    color: var(--text); vertical-align: top;
}
.article-comparison-table tr:last-child td { border-bottom: none; }
.article-comparison-table tr:nth-child(even) td { background: #f8f9fc; }
.article-comparison-table tr:hover td { background: #eef5ff; }

/* Data table with highlights */
.article-data-table { margin: 20px 0; overflow-x: auto; }
.article-data-table table {
    width: 100%; border-collapse: collapse; font-size: .88rem;
    border-radius: var(--radius-sm); overflow: hidden;
    border: 1px solid var(--border);
}
.article-data-table th {
    background: var(--navy); color: rgba(255,255,255,.85);
    padding: 10px 14px; text-align: left; font-size: .76rem;
    font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
    white-space: nowrap; border-bottom: 2px solid var(--gold);
}
.article-data-table td {
    padding: 10px 14px; border-bottom: 1px solid #eef0f4;
    color: var(--text); white-space: nowrap;
}
.article-data-table tr.highlight-row td { background: #f0f5fb; }
.article-data-table tr:last-child td { border-bottom: none; }
.article-data-table tr:hover td { background: #eef5ff; }
.article-data-table tr:first-child td { color: var(--text-muted); }
.table-note {
    font-size: .76rem; color: var(--text-muted);
    margin-top: 8px; line-height: 1.5;
}

/* ── FAQ in article ──────────────────────────────────────────── */
.article-faq {
    margin-top: 40px; padding-top: 32px;
    border-top: 2px solid var(--border);
}
.article-faq > h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.55rem; font-weight: 700; color: var(--navy);
    margin-bottom: 24px; padding-bottom: 10px;
    border-bottom: 2px solid var(--gold);
}
.article-faq .faq-item {
    margin-bottom: 22px; padding-bottom: 22px;
    border-bottom: 1px solid var(--border);
}
.article-faq .faq-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.article-faq .faq-q-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.02rem; font-weight: 700; color: var(--navy);
    margin-bottom: 8px; padding-left: 14px;
    border-left: 3px solid var(--gold);
}
.article-faq .faq-a p {
    font-size: .92rem; color: var(--slate);
    line-height: 1.68; margin: 0; padding-left: 17px;
}

/* ── CTA block ───────────────────────────────────────────────── */
.article-cta-block {
    background: var(--navy); border-radius: var(--radius);
    padding: 30px 28px; margin-top: 40px; text-align: center;
    box-shadow: var(--shadow-lg);
}
.article-cta-block h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem; font-weight: 700; color: #fff; margin-bottom: 10px;
}
.article-cta-block p {
    color: rgba(255,255,255,.65); font-size: .92rem;
    line-height: 1.6; margin-bottom: 20px; max-width: 520px; margin-left: auto; margin-right: auto;
}
.article-cta-btn {
    display: inline-block; padding: 13px 30px;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: #fff; border-radius: var(--radius-sm);
    font-size: .97rem; font-weight: 700; text-decoration: none;
    transition: filter .15s, transform .15s;
    box-shadow: 0 4px 14px rgba(200,146,58,.4);
}
.article-cta-btn:hover { filter: brightness(1.07); transform: translateY(-2px); color: #fff; }

/* ── Article footer meta ─────────────────────────────────────── */
.article-footer-meta { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--border); }
.article-tags {
    display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px;
}
.article-disclaimer {
    font-size: .76rem; color: var(--text-muted);
    line-height: 1.6; font-style: italic;
}

/* ── RESPONSIVE ──────────────────────────────────────────────── */
/* ── ARTICLE SIDEBAR (right column) ─────────────────────────── */
.article-sidebar {
    position: sticky;
    top: 80px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* Related posts list in sidebar */
.article-sidebar-posts {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.article-sidebar-posts li a {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    text-decoration: none;
    color: var(--navy);
    font-size: .82rem;
    font-weight: 600;
    line-height: 1.4;
    transition: color .2s;
}
.article-sidebar-posts li a:hover { color: var(--navy-mid); }
.article-sidebar-posts li a img {
    width: 56px; height: 42px;
    object-fit: cover; border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    flex-shrink: 0;
    transition: opacity .2s;
}
.article-sidebar-posts li a:hover img { opacity: .85; }
.article-sidebar-posts li a span { flex: 1; padding-top: 2px; }

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .article-layout {
        grid-template-columns: 220px 1fr 240px;
        gap: 24px;
    }
}

@media (max-width: 960px) {
    /* Stack: TOC goes away, sidebar moves below article */
    .article-layout {
        grid-template-columns: 1fr;
        padding: 24px 16px 40px;
    }
    .article-toc {
        position: static;
        order: -1;
    }
    .article-sidebar {
        position: static;
        order: 3;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
    /* Newsletter spans full width on tablet */
    .article-sidebar .hp-widget-newsletter {
        grid-column: 1 / -1;
    }
    .toc-list { flex-direction: row; flex-wrap: wrap; gap: 4px; }
    .toc-list a { font-size: .75rem; padding: 4px 8px; }
    .toc-list a::before { display: none; }
}

@media (max-width: 600px) {
    .article-title    { font-size: 1.55rem; }
    .article-subtitle { font-size: .93rem; }
    .article-hero     { padding: 24px 16px 28px; }
    .article-body h2  { font-size: 1.35rem; }
    .article-body h3  { font-size: 1.05rem; }
    .article-lead     { font-size: 1rem; }
    .article-cta-block { padding: 22px 16px; }
    .article-cta-block h3 { font-size: 1.2rem; }
    /* Single column sidebar on mobile */
    .article-sidebar {
        grid-template-columns: 1fr;
    }
}

@media print {
    .site-header, .article-toc, .article-cta-block, .article-sidebar,
    .nav-toggle, .site-footer { display: none !important; }
    .article-layout { grid-template-columns: 1fr; }
    .article-hero { background: none; padding: 0 0 16px; }
    .article-title, .article-subtitle, .byline-author, .byline-date { color: #000; }
    .article-body h2, .article-body h3 { color: #000; border-color: #ccc; }
    .article-body p, .article-faq .faq-a p { color: #333; }
}

/* ── ARTICLE IMAGES (featured + infographic) ─────────────────── */
.article-featured-img,
.article-infographic {
    margin: 0 0 28px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}
.article-featured-img img,
.article-infographic img {
    width: 100%;
    height: auto;
    display: block;
}
.article-featured-img figcaption,
.article-infographic figcaption {
    padding: 10px 14px;
    font-size: .8rem;
    color: var(--text-muted);
    background: #f7f8fa;
    border-top: 1px solid var(--border);
    line-height: 1.5;
}
.article-infographic {
    margin: 28px 0;
}
.article-infographic figcaption a {
    color: var(--navy-mid);
    text-decoration: underline;
}
.article-infographic figcaption a:hover { color: var(--gold); }

/* Scroll anchor offset for sticky header */
.scroll-anchor { scroll-margin-top: 80px; }
