/*
 * Finance Master — main stylesheet.
 * Clean, fast, numbers-forward. No web fonts (system stack) to protect LCP.
 */

:root {
    --primary: #0b5d3b;
    --primary-dark: #083f28;
    --accent: #0a7d55;
    --ink: #12203a;
    --muted: #5b667a;
    --line: #e3e8ef;
    --surface: #f6f8fb;
    --base: #ffffff;
    --warning: #b7791f;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(18, 32, 58, .06), 0 4px 16px rgba(18, 32, 58, .05);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --numeric: "SF Mono", ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
    --maxw: 1100px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--ink);
    background: var(--base);
}

img { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }

.container {
    width: 100%;
    max-width: var(--maxw);
    margin-inline: auto;
    padding-inline: 20px;
}

/* Accessibility helpers */
.screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}
.skip-link {
    position: absolute; left: -9999px; top: 0;
    background: var(--ink); color: #fff; padding: 10px 16px; z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ---------- Header ---------- */
.site-header {
    border-bottom: 1px solid var(--line);
    background: var(--base);
    position: sticky; top: 0; z-index: 40;
}
.site-header__inner {
    display: flex; align-items: center; gap: 20px;
    padding-block: 14px;
}
.site-title { margin: 0; font-size: 1.4rem; font-weight: 800; }
.site-title a { color: var(--primary); }
.site-description { margin: 0; font-size: .85rem; color: var(--muted); }
.main-navigation { margin-left: auto; display: flex; align-items: center; gap: 20px; }
.main-navigation ul {
    list-style: none; display: flex; gap: 18px; margin: 0; padding: 0; flex-wrap: wrap;
}
.main-navigation a { color: var(--ink); font-weight: 600; font-size: .95rem; }
.menu-toggle { display: none; }

/* ---------- Layout ---------- */
.site-content { padding-block: 30px 50px; }
.content-area {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 40px;
    align-items: start;
}
.content-area--full { display: block; }
.widget-area { position: sticky; top: 90px; }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { font-size: .82rem; color: var(--muted); margin-bottom: 16px; }
.breadcrumbs a { color: var(--muted); }

/* ---------- Hero / front page ---------- */
.hero {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(180deg, var(--surface), var(--base));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 28px;
}
.hero__title { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 8px; color: var(--primary-dark); }
.hero__subtitle { color: var(--muted); max-width: 620px; margin: 0 auto 20px; }
.hero .search-form { justify-content: center; }

.pillars__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}
.pillar-card {
    display: flex; flex-direction: column; gap: 12px;
    padding: 20px; border: 1px solid var(--line);
    border-radius: var(--radius); background: var(--base);
    color: var(--ink); box-shadow: var(--shadow);
    transition: transform .12s ease, border-color .12s ease;
}
.pillar-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.pillar-card__head { display: flex; flex-direction: column; gap: 4px; color: var(--ink); }
.pillar-card__head:hover { text-decoration: none; }
.pillar-card__name { font-weight: 700; font-size: 1.08rem; color: var(--primary-dark); }
.pillar-card__count { font-size: .78rem; color: var(--muted); font-family: var(--numeric); }
.pillar-card__subs { list-style: none; margin: 0; padding: 10px 0 0; border-top: 1px solid var(--line); }
.pillar-card__subs li { margin-bottom: 4px; }
.pillar-card__subs a { font-size: .9rem; color: var(--muted); }
.pillar-card__subs a:hover { color: var(--accent); }

.section-title {
    font-size: 1.5rem; margin: 0 0 20px;
    padding-bottom: 8px; border-bottom: 2px solid var(--line);
}

/* ---------- Post lists ---------- */
.posts-list--grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px;
}
.post-card {
    border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; background: var(--base); box-shadow: var(--shadow);
}
.post-card__link { display: block; color: inherit; }
.post-card__link:hover { text-decoration: none; }
.post-card__thumb img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.post-card__body { display: block; padding: 16px; }
.post-card__title { display: block; font-weight: 700; font-size: 1.1rem; margin: 6px 0; }
.post-card__excerpt { display: block; color: var(--muted); font-size: .92rem; }

.post-row {
    display: grid; grid-template-columns: 200px 1fr; gap: 20px;
    padding-block: 24px; border-bottom: 1px solid var(--line);
}
.post-row__thumb img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; }
.post-row__title { margin: 6px 0; font-size: 1.3rem; }
.post-row__excerpt { color: var(--muted); }
.read-more { font-weight: 600; font-size: .9rem; }

.entry-meta { display: flex; gap: 12px; font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.entry-meta__cat a { color: var(--accent); font-weight: 700; }

/* ---------- Single article ---------- */
.single-article, .single-page { max-width: 760px; }
.entry-title { font-size: clamp(1.6rem, 3.5vw, 2.3rem); line-height: 1.2; margin: 8px 0 16px; }
.entry-thumbnail { margin: 0 0 24px; }
.entry-thumbnail img { width: 100%; border-radius: var(--radius); }

.entry-content { font-size: 1.08rem; }
.entry-content h2 { font-size: 1.5rem; margin-top: 2em; }
.entry-content h3 { font-size: 1.2rem; margin-top: 1.6em; }
.entry-content p { margin: 0 0 1.2em; }
.entry-content ul, .entry-content ol { margin: 0 0 1.2em 1.2em; }

/* Byline with E-E-A-T signals */
.entry-byline {
    display: flex; gap: 12px; align-items: center;
    padding: 14px 0; margin-bottom: 20px;
    border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.entry-byline img { border-radius: 50%; }
.entry-byline__author { font-weight: 600; }
.entry-byline__role { color: var(--muted); font-weight: 400; }
.entry-byline__dates { display: block; font-size: .82rem; color: var(--muted); }
.entry-byline__reviewed { color: var(--accent); font-weight: 600; }

/* Author box */
.author-box {
    display: flex; gap: 20px;
    padding: 24px; margin: 36px 0;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.author-box__avatar img { border-radius: 50%; }
.author-box__name { margin: 0 0 2px; font-size: 1.25rem; }
.author-box__role { margin: 0 0 10px; color: var(--accent); font-weight: 600; }
.author-box__creds { list-style: none; margin: 0 0 10px; padding: 0; font-size: .9rem; }
.author-box__creds li { margin-bottom: 3px; }
.author-box__bio { color: var(--ink); font-size: .95rem; }
.author-box__links a { margin-right: 14px; font-weight: 600; font-size: .9rem; }

/* Sources / disclosure / regulators */
.ft-sources {
    background: var(--surface); border-left: 4px solid var(--primary);
    border-radius: 8px; padding: 16px 20px; margin: 28px 0;
}
.ft-sources h3 { margin: 0 0 10px; font-size: 1.05rem; }
.ft-sources ul { margin: 0; padding-left: 18px; }
.ft-sources li { margin-bottom: 4px; font-size: .92rem; }

.ft-disclosure {
    background: #fdf7e8; border: 1px solid #f0e2bd;
    color: #6b5615; border-radius: 8px; padding: 12px 16px; margin: 0 0 24px;
    font-size: .88rem;
}
.ft-disclosure p { margin: 0; }

.ft-regulators { font-size: .82rem; color: var(--muted); margin: 20px 0; }
.ft-regulators ul { list-style: none; display: flex; flex-wrap: wrap; gap: 14px; padding: 0; margin: 6px 0 0; }
.ft-regulators a { color: var(--muted); text-decoration: underline; }

/* ---------- Data blocks: keep readable, shield from auto-ads ---------- */
.ft-products, .ft-calculator, .no-autoads {
    /* Wrapping data in its own block discourages Auto-ad injection mid-table
       and guarantees the site owner a region to exclude in AdSense settings. */
    margin: 28px 0;
}
.ft-products { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ft-products-table {
    width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 520px;
}
.ft-products-table th, .ft-products-table td {
    padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line);
}
.ft-products-table thead th {
    background: var(--surface); font-size: .78rem; text-transform: uppercase;
    letter-spacing: .03em; color: var(--muted);
}
.ft-products-table td:nth-child(2),
.ft-products-table td:nth-child(3),
.ft-products-table td:nth-child(4) { font-family: var(--numeric); font-weight: 600; }

.ft-btn, .read-more.ft-btn {
    display: inline-block; padding: 8px 14px; border-radius: 8px;
    background: var(--primary); color: #fff; font-weight: 600; font-size: .85rem;
}
.ft-btn:hover { background: var(--primary-dark); text-decoration: none; }

/* Calculator */
.ft-calculator {
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: 20px; background: var(--surface);
}
.ft-calculator h3 { margin: 0 0 14px; }
.ft-calc-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.ft-calc-fields label { display: flex; flex-direction: column; font-size: .85rem; font-weight: 600; gap: 4px; }
.ft-calc-fields input {
    padding: 10px; border: 1px solid var(--line); border-radius: 8px;
    font-family: var(--numeric); font-size: 1rem;
}
.ft-calc-results { margin-top: 16px; }
.ft-calc-row {
    display: flex; justify-content: space-between; padding: 8px 0;
    border-bottom: 1px dashed var(--line); font-family: var(--numeric);
}
.ft-calc-primary { font-size: 1.2rem; font-weight: 800; color: var(--primary-dark); border-bottom: 2px solid var(--primary); }
.ft-calc-note { font-size: .78rem; color: var(--muted); margin: 12px 0 0; }

/* ---------- Ad slots ---------- */
.ad-slot {
    margin: 28px 0; min-height: 90px;
    display: flex; align-items: center; justify-content: center;
    background: repeating-linear-gradient(45deg, #fafbfc, #fafbfc 10px, #f2f4f7 10px, #f2f4f7 20px);
    border: 1px dashed var(--line); border-radius: 8px;
}
.ad-slot__label { color: #aab2c0; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.ad-slot .adsbygoogle { width: 100%; }

/* ---------- Search form ---------- */
.search-form { display: flex; gap: 8px; }
.search-field {
    padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; min-width: 180px;
}
.search-submit {
    padding: 9px 16px; border: 0; border-radius: 8px;
    background: var(--primary); color: #fff; font-weight: 600; cursor: pointer;
}

/* ---------- Pagination ---------- */
.pagination { margin-top: 34px; }
.pagination .nav-links { display: flex; gap: 8px; flex-wrap: wrap; }
.pagination .page-numbers {
    padding: 8px 13px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink);
}
.pagination .page-numbers.current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- Footer ---------- */
.site-footer {
    margin-top: 60px; border-top: 1px solid var(--line);
    background: var(--surface); padding-block: 34px;
}
.site-footer__widgets {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 30px;
    margin-bottom: 24px;
}
.footer-navigation ul { list-style: none; display: flex; flex-wrap: wrap; gap: 18px; padding: 0; margin: 0 0 16px; }
.footer-navigation a { color: var(--ink); font-weight: 600; font-size: .9rem; }
.site-footer__meta { color: var(--muted); font-size: .82rem; margin: 0; }

.widget-title { font-size: 1rem; margin: 0 0 12px; }
.widget { margin-bottom: 28px; }

/* ---------- Comments ---------- */
.comments-area { margin-top: 40px; max-width: 760px; }
.comment-list { list-style: none; padding: 0; }
.comment-list ol { list-style: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .content-area { grid-template-columns: 1fr; }
    .widget-area { position: static; }
    .post-row { grid-template-columns: 1fr; }
    .main-navigation {
        display: none; position: absolute; top: 100%; left: 0; right: 0;
        flex-direction: column; align-items: stretch; gap: 0;
        background: var(--base); border-bottom: 1px solid var(--line); padding: 14px 20px;
    }
    .main-navigation.is-open { display: flex; }
    .main-navigation ul { flex-direction: column; gap: 0; }
    .main-navigation li { border-bottom: 1px solid var(--line); }
    .main-navigation a { display: block; padding: 12px 0; }
    .menu-toggle {
        display: inline-flex; margin-left: auto; align-items: center;
        background: none; border: 1px solid var(--line); border-radius: 8px;
        padding: 8px 10px; cursor: pointer;
    }
    .menu-toggle__bars, .menu-toggle__bars::before, .menu-toggle__bars::after {
        display: block; width: 20px; height: 2px; background: var(--ink); position: relative;
    }
    .menu-toggle__bars::before, .menu-toggle__bars::after { content: ""; position: absolute; left: 0; }
    .menu-toggle__bars::before { top: -6px; }
    .menu-toggle__bars::after { top: 6px; }
    .site-header__inner { position: relative; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
