/* =============================================================
   RoofExplained — Theme v2 (Trust & Authority)
   Loaded after bootstrap.min.css to override defaults.
   Fonts: Libre Baskerville (headings) + Inter (body)
   Palette: Navy #1e293b / Blue #1d4ed8 / Light #eff6ff
   ============================================================= */

/* ── GLOBAL ── */
html {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: #1e293b;
    background: #fff;
    line-height: 1.65;
    padding-top: 64px;
    max-width: 100%;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Libre Baskerville', Georgia, serif;
    letter-spacing: -0.01em;
}

a {
    color: #1d4ed8;
}
a:hover {
    color: #1a44c4;
}

/* ── NAV ── */
.navbar {
    background: #fff !important;
    border-bottom: 1px solid #e2e8f0;
    min-height: 64px;
    padding: 0 1rem;
    flex-wrap: nowrap !important;
    align-items: center;
    width: 100%;
    max-width: 100vw;
}

@media (max-width: 991.98px) {
    .navbar {
        flex-wrap: wrap !important;
        padding: 0 0.75rem;
    }

    /* Keep brand and hamburger on same line */
    .navbar > .container,
    .navbar > .container-fluid {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        column-gap: 0.75rem;
        flex-wrap: initial !important;
        align-items: center;
        width: 100%;
        max-width: 100%;
        padding-left: 0;
        padding-right: 0;
    }

    .navbar .navbar-brand {
        min-width: 0;
        max-width: calc(100vw - 7rem);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 1.05rem;
    }

    .navbar-toggler {
        justify-self: end;
        margin-left: 0;
        max-width: 3.75rem;
    }

    .navbar-collapse {
        grid-column: 1 / -1;
        flex-basis: 100%;
        min-width: 0;
        width: 100%;
    }

    .navbar-nav {
        width: 100%;
    }

    /* Solid white background when menu expands */
    .navbar-collapse.show,
    .navbar-collapse.collapsing {
        background: #fff;
        border-top: 1px solid #e2e8f0;
        padding: 0.75rem 0 1rem;
        margin: 0.5rem 0 0;
        box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    }

    .navbar .navbar-nav .nav-link.nav-cta {
        display: inline-block;
        margin-left: 0;
        margin-top: 0.5rem;
    }
}

.navbar-brand {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 700;
    color: #1e293b !important;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
}

.navbar-brand span {
    color: #1d4ed8;
}

.navbar-nav .nav-link {
    color: #64748b !important;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.2s;
    padding: 0.4rem 0.7rem;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: #1e293b !important;
}

.navbar-nav .nav-link.nav-cta {
    background: #1d4ed8;
    color: #fff !important;
    border-radius: 6px;
    padding: 0.4rem 1rem;
    font-weight: 600;
    margin-left: 0.25rem;
}

.navbar-nav .nav-link.nav-cta:hover {
    background: #1a44c4;
    color: #fff !important;
}

.navbar-toggler {
    border-color: #e2e8f0;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2830, 41, 59, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ── PAGE LAYOUT ── */
.page-wrap {
    max-width: 1100px;
}

.section-block {
    margin-bottom: 5rem;
}

/* ── KICKER LABELS ── */
.section-kicker {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #1d4ed8;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-kicker::before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 2px;
    background: #1d4ed8;
    flex-shrink: 0;
}

/* ── HERO ── */
.hero-section {
    background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 50%, #f8fafc 100%);
    border-bottom: 1px solid #e2e8f0;
    padding: 5rem 0 4.5rem;
}

/* Full-bleed hero — sits outside .container in its own wrapper */
.homepage-hero {
    background: #eff6ff;
    border-bottom: 1px solid #e2e8f0;
    padding: 4rem 1rem;
}

.hero-title {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 2.6rem;
    line-height: 1.18;
    letter-spacing: -0.02em;
    color: #0f172a;
    margin-bottom: 1.25rem;
}

.hero-copy {
    color: #475569;
    font-size: 1.05rem;
    max-width: 520px;
    line-height: 1.75;
}

/* ── BUTTONS ── */
.btn-primary {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #fff;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 7px;
    font-size: 0.92rem;
    box-shadow: 0 2px 8px rgba(29, 78, 216, 0.28);
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.btn-primary:hover {
    background: #1a44c4;
    border-color: #1a44c4;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(29, 78, 216, 0.35);
}

.btn-outline-primary {
    color: #1d4ed8;
    border-color: #1d4ed8;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 7px;
    font-size: 0.92rem;
    border-width: 1.5px;
    transition: background 0.2s;
}

.btn-outline-primary:hover {
    background: #eff6ff;
    color: #1d4ed8;
}

/* ── RESOURCE / QUESTION CARD ── */
.resource-card {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    height: 100%;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.055);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.resource-card:hover {
    border-color: #93c5fd;
    box-shadow: 0 6px 28px rgba(29, 78, 216, 0.09);
}

.resource-card .card-body {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.resource-card h2,
.resource-card .h4 {
    font-family: 'Libre Baskerville', Georgia, serif;
}

.resource-card ul li {
    color: #475569;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
}

.resource-card ul li:last-child {
    border-bottom: none;
}

.resource-card p {
    color: #64748b;
}

/* ── SECTION HEADINGS ── */
.section-block h2 {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 1.75rem;
    color: #0f172a;
    letter-spacing: -0.01em;
}

/* ── GUIDE CARDS (start here / latest) ── */
.card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    transition: border-color 0.2s, background 0.2s;
}

.card:hover {
    border-color: #93c5fd;
    background: #f8fafc;
}

/* Prevent hover from touching CTA cards */
.card.soft-cta:hover {
    border-color: transparent !important;
    background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 100%) !important;
}

.card h3 a,
.card .h5 a {
    font-family: 'Libre Baskerville', Georgia, serif;
    color: #0f172a;
    text-decoration: none;
}

.card h3 a:hover,
.card .h5 a:hover {
    color: #1d4ed8;
}

/* ── PILLAR / TOPIC CARDS ── */
.card h2 a {
    font-family: 'Libre Baskerville', Georgia, serif;
    color: #0f172a;
    text-decoration: none;
}

.card h2 a:hover {
    color: #1d4ed8;
}

/* guide count badge */
.guide-count {
    font-size: 0.75rem;
    color: #1d4ed8;
    font-weight: 600;
    background: #eff6ff;
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 100px;
}

/* ── SOFT CTA BLOCK ── */
.soft-cta {
    background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 100%);
    border: none !important;
    border-radius: 16px;
    padding: 2.5rem;
    color: #fff;
}

.soft-cta h2,
.soft-cta h3 {
    color: #fff !important;
}

/* Override any inline color styles on paragraphs inside the CTA */
.soft-cta p,
.soft-cta p[style] {
    color: #bfdbfe !important;
}

.soft-cta .btn {
    background: #fff;
    color: #1d4ed8;
    border: none;
    font-weight: 700;
    border-radius: 7px;
}

.soft-cta .btn:hover {
    background: #eff6ff;
    color: #1d4ed8;
}

/* ── ARTICLE PAGES ── */
.article-shell {
    max-width: 860px;
}

.article-body-wrap {
    font-size: 1.04rem;
    line-height: 1.78;
    color: #334155;
}

.article-body-wrap h2 {
    margin-top: 2.5rem;
    font-size: 1.45rem;
}

.article-body-wrap h3 {
    margin-top: 1.75rem;
    font-size: 1.15rem;
}

.answer-snippet {
    color: #475569;
    font-size: 0.95rem;
}

/* ── CALCULATOR HUB ── */
.calculator-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    gap: 1.25rem;
    align-items: start;
}

.calculator-card,
.calculator-result-card {
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.055);
}

.calculator-result-card {
    position: sticky;
    top: 84px;
}

.calculator-result-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.calculator-result-grid div {
    border: 1px solid #dbeafe;
    border-radius: 8px;
    background: #eff6ff;
    padding: 0.85rem;
}

.calculator-result-grid span {
    display: block;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.calculator-result-grid strong {
    color: #0f172a;
    font-size: 1.1rem;
}

/* ── FOOTER ── */
footer.site-footer {
    background: #0f172a !important;
    border-top: none !important;
    padding: 3rem 0 !important;
    margin-top: 0 !important;
    color: #94a3b8 !important;
}

footer.site-footer h5 {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #f1f5f9;
    margin-bottom: 0.85rem;
}

footer.site-footer p {
    font-size: 0.83rem;
    color: #94a3b8;
}

footer.site-footer ul li a {
    color: #94a3b8;
    font-size: 0.84rem;
    transition: color 0.2s;
    text-decoration: none;
}

footer.site-footer ul li a:hover {
    color: #e2e8f0;
}

footer.site-footer .footer-brand {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 700;
    color: #f1f5f9;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    display: block;
    text-decoration: none;
}

footer.site-footer .footer-brand span {
    color: #60a5fa;
}

footer.site-footer .footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.07);
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    font-size: 0.78rem;
    color: #475569;
    text-align: center;
}

/* ── START HERE GRID (3 + 2) ── */
@media (min-width: 992px) {
    .start-here-grid {
        display: grid !important;
        grid-template-columns: repeat(6, 1fr);
        gap: 1rem;
    }

    /* Reset Bootstrap col sizing */
    .start-here-grid > [class*="col-"] {
        padding: 0 !important;
        width: auto !important;
        max-width: none !important;
        flex: none !important;
    }

    /* First 3 cards: 2 columns each across a 6-col grid */
    .start-here-grid > [class*="col-"]:nth-child(1),
    .start-here-grid > [class*="col-"]:nth-child(2),
    .start-here-grid > [class*="col-"]:nth-child(3) {
        grid-column: span 2;
    }

    /* Last 2 cards: 3 columns each, centered (3+3=6) */
    .start-here-grid > [class*="col-"]:nth-child(4),
    .start-here-grid > [class*="col-"]:nth-child(5) {
        grid-column: span 3;
    }
}

/* ── RESPONSIVE ── */
@media (max-width: 767.98px) {
    .hero-title {
        font-size: 1.95rem;
    }

    .section-block {
        margin-bottom: 3.5rem;
    }

    .hero-section {
        padding: 3rem 0 2.5rem;
    }

    .soft-cta {
        padding: 2rem;
    }

    .calculator-shell {
        grid-template-columns: 1fr;
    }

    .calculator-result-card {
        position: static;
    }

    .calculator-result-grid {
        grid-template-columns: 1fr;
    }
}
