/* ============================================================
   Rehab Wealth Project — Ghost theme stylesheet
   Brand: #FFFFFF bg, #0F172A ink, #0F766E teal, #D9A86C gold
   Typography: Inter
   ============================================================ */

/* --- Reset & base --- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }
img, picture, svg, video { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }

/* --- Custom properties --- */
:root {
    --color-bg: #FFFFFF;
    --color-ink: #0F172A;
    --color-ink-soft: #475569;
    --color-ink-softer: #64748B;
    --color-accent: #0F766E;
    --color-accent-hover: #115E59;
    --color-gold: #D9A86C;
    --color-border: #E2E8F0;
    --color-border-soft: #F1F5F9;
    --color-surface: #F8FAFC;

    --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --gh-font-heading: var(--font-sans);
    --gh-font-body: var(--font-sans);

    --container-w: 1200px;
    --container-narrow-w: 760px;
    --container-wide-w: 960px;

    --radius: 10px;
    --radius-sm: 6px;
    --radius-pill: 999px;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06);

    --transition: 0.15s ease;
}

/* --- Body & typography --- */
body {
    font-family: var(--font-sans);
    font-size: 17px;
    line-height: 1.65;
    color: var(--color-ink);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    color: var(--color-ink);
    margin: 0 0 0.6em 0;
    letter-spacing: -0.01em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p { margin: 0 0 1.2em 0; }

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover { color: var(--color-accent-hover); }

/* --- Layout containers --- */
.container {
    width: 100%;
    max-width: var(--container-w);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container-narrow {
    max-width: var(--container-narrow-w);
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
    text-decoration: none;
    line-height: 1.2;
    font-family: inherit;
}

.btn-primary {
    background: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
}

.btn-primary:hover {
    background: var(--color-accent-hover);
    border-color: var(--color-accent-hover);
    color: white;
}

.btn-secondary {
    background: transparent;
    color: var(--color-ink);
    border-color: var(--color-border);
}

.btn-secondary:hover {
    border-color: var(--color-ink);
    color: var(--color-ink);
}

.btn-large {
    padding: 0.95rem 2rem;
    font-size: 1.0625rem;
}

/* --- Header --- */
.site-header {
    border-bottom: 1px solid var(--color-border-soft);
    background: var(--color-bg);
    padding: 1.25rem 0;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.site-logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.site-logo img {
    max-height: 36px;
    width: auto;
}

.site-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--color-ink);
}

.site-nav { display: block; }

.nav-menu {
    display: flex;
    gap: 1.75rem;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-item a {
    color: var(--color-ink);
    font-weight: 500;
    text-decoration: none;
    font-size: 0.95rem;
}

.nav-item a:hover { color: var(--color-accent); }

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    flex-direction: column;
    gap: 4px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-ink);
    transition: transform var(--transition), opacity var(--transition);
}

/* --- Hero --- */
.hero {
    padding: 3rem 0 2.5rem;
    text-align: center;
}

.hero-inner {
    max-width: 760px;
}

.hero-title {
    font-size: clamp(1.75rem, 3.4vw, 2.25rem);
    font-weight: 600;
    letter-spacing: -0.025em;
    margin-bottom: 1.25rem;
    color: var(--color-ink);
}

.hero-subhead {
    font-size: 1.1875rem;
    color: var(--color-ink-soft);
    margin-bottom: 0;
    line-height: 1.55;
}

.hero-roadmap {
    margin: 1rem 0 0;
}

.hero-roadmap-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-accent);
}

.hero-roadmap-link:hover {
    color: var(--color-accent-hover);
}

.hero-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

/* --- Why band --- */
.why-band {
    padding: 2.75rem 0 3rem;
    border-top: 1px solid var(--color-border-soft);
    text-align: center;
}

.why-inner {
    max-width: 760px;
}

.why-heading {
    font-size: clamp(1.5rem, 3.2vw, 2rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--color-ink);
    margin-bottom: 1rem;
}

.why-body {
    font-size: 1.1875rem;
    color: var(--color-ink-soft);
    line-height: 1.55;
    margin-bottom: 1.5rem;
}

.why-link {
    font-weight: 600;
    color: var(--color-accent);
}

.why-link:hover { color: var(--color-accent-hover); }

/* --- Section header --- */
.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: var(--color-ink);
}

.section-header {
    margin-bottom: 2rem;
}

.section-header .section-title {
    margin-bottom: 0.5rem;
}

.section-subhead {
    color: var(--color-ink-soft);
    font-size: 1.0625rem;
    margin: 0 0 0;
    max-width: 640px;
    line-height: 1.55;
}

/* --- Calculators showcase --- */
.calculators-showcase {
    padding: 2.5rem 0 3rem;
    border-top: 1px solid var(--color-border-soft);
}

.calc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.calc-card {
    position: relative;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.75rem;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.calc-card:hover {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.calc-card-soon {
    opacity: 0.85;
}

.calc-card-soon:hover {
    border-color: var(--color-border);
    box-shadow: none;
    transform: none;
}

.calc-card-status {
    display: inline-block;
    align-self: flex-start;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-pill);
    margin-bottom: 1rem;
}

.calc-card-status-live {
    background: var(--color-accent);
    color: #fff;
}

.calc-card-status-soon {
    background: var(--color-border);
    color: var(--color-ink-soft);
}

.calc-card-title {
    font-size: 1.25rem;
    margin: 0 0 0.5rem;
    color: var(--color-ink);
}

.calc-card-desc {
    color: var(--color-ink-soft);
    font-size: 0.975rem;
    line-height: 1.55;
    margin: 0 0 1.25rem;
}

.calc-card-cta {
    color: var(--color-accent);
    font-weight: 600;
    font-size: 0.95rem;
}

.calc-card-cta-muted {
    color: var(--color-ink-softer);
    font-weight: 500;
    font-size: 0.95rem;
}

/* Tools showcase: cards are links; featured salary card leads the row */
.calc-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--color-ink);
}

.calc-card .calc-card-desc {
    flex: 1;
}

.calc-card-featured {
    grid-column: 1 / -1;
    background: #fff;
    border-color: var(--color-accent);
}

/* Tinted band so the whole tools group reads as one zone, cards sit inside it */
.tools-showcase {
    background: var(--color-surface);
}

.tools-showcase .calc-card {
    background: #fff;
}

/* --- Phase timeline --- */
.phase-timeline {
    padding: 3rem 0 3.5rem;
    border-top: 1px solid var(--color-border-soft);
}

.phase-grid {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    counter-reset: phase-counter;
}

.phase-card {
    display: flex;
}

.phase-link {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 1.75rem 1.75rem 1.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: #fff;
    color: var(--color-ink);
    text-decoration: none;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.phase-link:hover {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    color: var(--color-ink);
}

.phase-step {
    display: inline-block;
    align-self: flex-start;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-accent);
    margin-bottom: 0.75rem;
}

.phase-title {
    font-size: 1.35rem;
    line-height: 1.25;
    margin: 0 0 0.6rem;
    color: var(--color-ink);
}

.phase-link:hover .phase-title {
    color: var(--color-accent);
}

.phase-desc {
    color: var(--color-ink-soft);
    font-size: 0.975rem;
    line-height: 1.55;
    margin: 0 0 1.25rem;
    flex: 1;
}

.phase-cta {
    color: var(--color-accent);
    font-weight: 600;
    font-size: 0.95rem;
}

/* --- Featured posts --- */
.featured-posts {
    padding: 2.5rem 0 6rem;
    border-top: 1px solid var(--color-border-soft);
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem 1.75rem;
}

.post-grid-2 {
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
}

/* --- Post card --- */
.post-card {
    background: transparent;
}

.post-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform var(--transition);
}

.post-card-link:hover {
    color: inherit;
}

.post-card-image {
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--color-surface);
    aspect-ratio: 16 / 9;
    margin-bottom: 1rem;
}

.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.post-card-link:hover .post-card-image img {
    transform: scale(1.03);
}

.post-card-body {
    padding: 0;
}

.post-card-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.post-card-title {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.5rem;
    color: var(--color-ink);
}

.post-card-link:hover .post-card-title {
    color: var(--color-accent);
}

.post-card-excerpt {
    font-size: 0.95rem;
    color: var(--color-ink-soft);
    line-height: 1.55;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-meta {
    font-size: 0.8125rem;
    color: var(--color-ink-softer);
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.post-card-dot { opacity: 0.5; }

/* --- Post (single) --- */
.post-header {
    padding: 4rem 0 2rem;
    text-align: left;
}

.post-tag {
    display: inline-block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    text-decoration: none;
}

.post-tag:hover { color: var(--color-accent-hover); }

.post-title {
    font-size: clamp(2rem, 4.5vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    line-height: 1.15;
}

.post-subhead {
    font-size: 1.25rem;
    color: var(--color-ink-soft);
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.post-meta {
    font-size: 0.95rem;
    color: var(--color-ink-softer);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.post-meta-dot { opacity: 0.5; }

.post-feature-image {
    margin: 1.5rem 0 3rem;
}

.post-feature-image img {
    width: 100%;
    max-height: 600px;
    object-fit: cover;
    border-radius: var(--radius);
}

/* post-content padding is handled by .gh-content grid above */

/* --- Ghost editor content styling --- */
/* Grid sets up the three width tiers Koenig uses: content (narrow), wide, full */
.gh-content {
    display: grid;
    grid-template-columns:
        [full-start] minmax(1.5rem, 1fr)
        [wide-start] minmax(0, 180px)
        [content-start] min(100% - 3rem, 760px) [content-end]
        minmax(0, 180px) [wide-end]
        minmax(1.5rem, 1fr) [full-end];
    padding: 1rem 0 4rem;
}

/* Wide page template */
.gh-content-wide {
    grid-template-columns:
        [full-start] minmax(1.5rem, 1fr)
        [wide-start] minmax(0, 60px)
        [content-start] min(100% - 3rem, var(--container-wide-w)) [content-end]
        minmax(0, 60px) [wide-end]
        minmax(1.5rem, 1fr) [full-end];
}

/* Tighter spacing for hub pages — scoped to phase page body classes */
body.page-get-to-zero .gh-content,
body.page-build-the-runway .gh-content,
body.page-buy-back-your-time .gh-content {
    padding-top: 0.25rem;
}

body.page-get-to-zero .gh-content h2,
body.page-build-the-runway .gh-content h2,
body.page-buy-back-your-time .gh-content h2 {
    font-size: 1.5rem;
    margin: 1rem 0 0.4rem;
}

body.page-get-to-zero .gh-content h3,
body.page-build-the-runway .gh-content h3,
body.page-buy-back-your-time .gh-content h3 {
    font-size: 1.1rem;
    margin: 0.75rem 0 0.4rem;
}

body.page-get-to-zero .gh-content h4,
body.page-build-the-runway .gh-content h4,
body.page-buy-back-your-time .gh-content h4 {
    font-size: 1rem;
    margin: 0.75rem 0 0.25rem;
}

body.page-get-to-zero .gh-content p,
body.page-build-the-runway .gh-content p,
body.page-buy-back-your-time .gh-content p {
    margin-bottom: 0.6rem;
}

body.page-get-to-zero .gh-content hr,
body.page-build-the-runway .gh-content hr,
body.page-buy-back-your-time .gh-content hr {
    margin: 1.25rem 0;
}

.gh-content > * {
    grid-column: content;
}

.gh-content > .kg-width-wide,
.gh-content > figure.kg-width-wide {
    grid-column: wide;
}

.gh-content > .kg-width-full,
.gh-content > figure.kg-width-full {
    grid-column: full;
}

.gh-content > .kg-width-full img,
.gh-content > figure.kg-width-full img {
    width: 100%;
    border-radius: 0;
}

.gh-content > .kg-width-wide img,
.gh-content > figure.kg-width-wide img {
    width: 100%;
    border-radius: var(--radius);
}

.gh-content p,
.gh-content ul,
.gh-content ol,
.gh-content blockquote {
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--color-ink);
    margin-bottom: 1.5rem;
}

/* Tighten the gap under bold-only paragraphs used as inline headers
   (the legacy "bold paragraph" header style, e.g. "The short version").
   Pairs the label with the list or text it introduces instead of leaving
   a full paragraph gap. Real H2/H3 headings are the current standard;
   this just cleans up posts that still use the old bold-paragraph style. */
.gh-content p:has(> strong:only-child),
.gh-content p:has(> b:only-child) {
    margin-bottom: 0.4rem;
}

.gh-content h2 {
    font-size: 1.75rem;
    margin: 2.5rem 0 1rem;
}

.gh-content h3 {
    font-size: 1.35rem;
    margin: 2rem 0 0.75rem;
}

.gh-content a {
    color: var(--color-accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

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

.gh-content img {
    margin: 2rem 0;
    border-radius: var(--radius-sm);
}

/* --- Figures and image captions --- */
.gh-content figure {
    /* paragraph above already adds space, so keep the top gap small */
    margin-top: 0.5rem;
    /* room below the caption before the next paragraph */
    margin-bottom: 1.75rem;
    border-radius: var(--radius-sm);
}

/* Make image captions read as captions, not body text */
.gh-content figcaption {
    display: block;
    font-size: 0.85rem;
    line-height: 1.45;
    font-style: italic;
    color: var(--color-ink-soft, #6b7280);
    text-align: center;
    /* give the caption room so it isn't crammed against the image */
    margin-top: 1rem;
}

/* Tighten the paragraph that directly introduces a figure */
.gh-content p:has(+ figure) {
    margin-bottom: 0.5rem;
}

.gh-content blockquote {
    border-left: 3px solid var(--color-accent);
    padding-left: 1.25rem;
    margin-left: 0;
    color: var(--color-ink-soft);
    font-style: italic;
}

.gh-content code {
    background: var(--color-surface);
    padding: 0.15em 0.35em;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'SF Mono', Menlo, Consolas, monospace;
}

.gh-content pre {
    background: var(--color-ink);
    color: #F8FAFC;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 2rem 0;
}

.gh-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.gh-content hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 3rem 0;
}

/* --- Author bio --- */
.post-author-bio {
    padding: 2rem 0 1rem;
    border-top: 1px solid var(--color-border-soft);
    margin-top: 3rem;
}

.author-card {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}

.author-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.author-avatar-large {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1.25rem;
}

.author-label {
    font-size: 0.8125rem;
    color: var(--color-ink-softer);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.25rem;
    font-weight: 600;
}

.author-name {
    font-size: 1.15rem;
    margin: 0 0 0.35rem;
}

.author-bio {
    font-size: 0.95rem;
    color: var(--color-ink-soft);
    margin: 0;
    line-height: 1.55;
}

/* --- Post nav --- */
.post-nav {
    padding: 1rem 0 4rem;
}

.post-nav-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.post-nav-item {
    display: block;
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    text-decoration: none;
    transition: border-color var(--transition);
    color: var(--color-ink);
}

.post-nav-item:hover {
    border-color: var(--color-ink);
    color: var(--color-ink);
}

.post-nav-next { text-align: right; }

.post-nav-label {
    display: block;
    font-size: 0.8125rem;
    color: var(--color-ink-softer);
    margin-bottom: 0.35rem;
    font-weight: 500;
}

.post-nav-title {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-ink);
}

/* --- Pages --- */
.page-header {
    padding: 4rem 0 2rem;
    text-align: left;
}

.page-title {
    font-size: clamp(2rem, 4.5vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    line-height: 1.15;
}

.page-subhead {
    font-size: 1.25rem;
    color: var(--color-ink-soft);
    line-height: 1.5;
}

.page-feature-image {
    margin: 1.5rem 0 3rem;
}

.page-feature-image img {
    width: 100%;
    max-height: 600px;
    object-fit: cover;
    border-radius: var(--radius);
}

/* page-content uses .gh-content grid layout */

/* Wide page header — centered, matches homepage hero style */
.page-header-wide {
    text-align: center;
    padding: 2.5rem 0 1rem;
}

.page-header-wide .page-title {
    font-size: clamp(2rem, 4.5vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}

.page-header-wide .page-subhead {
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
    font-size: 1.1875rem;
    color: var(--color-ink-soft);
}

/* --- Archive (tag/author) --- */
.archive-header {
    padding: 4rem 0 2.5rem;
    text-align: center;
    border-bottom: 1px solid var(--color-border-soft);
}

.archive-label {
    font-size: 0.8125rem;
    color: var(--color-ink-softer);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    margin: 0 0 0.5rem;
}

.archive-title {
    font-size: clamp(2rem, 4vw, 2.75rem);
    margin-bottom: 0.75rem;
}

.archive-description {
    font-size: 1.1rem;
    color: var(--color-ink-soft);
    max-width: 620px;
    margin: 0 auto;
    line-height: 1.55;
}

.archive-posts { padding: 4rem 0 6rem; }

/* --- Pagination --- */
.pagination {
    margin: 3rem auto 0;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.pagination a,
.pagination .page-number {
    color: var(--color-ink-soft);
    text-decoration: none;
}

/* --- Newsletter section --- */
.newsletter-section {
    padding: 4.5rem 0;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border-soft);
}

.newsletter-inner {
    text-align: center;
}

.newsletter-title {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
}

.newsletter-subhead {
    font-size: 1rem;
    color: var(--color-ink-soft);
    margin-bottom: 1.75rem;
    line-height: 1.5;
}

.newsletter-form {
    display: flex;
    gap: 0.5rem;
    max-width: 460px;
    margin: 0 auto;
}

.newsletter-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 1rem;
    background: var(--color-bg);
    color: var(--color-ink);
    transition: border-color var(--transition);
}

.newsletter-input:focus {
    outline: none;
    border-color: var(--color-accent);
}

.newsletter-success,
.newsletter-error {
    font-size: 0.9rem;
    margin: 1rem 0 0;
}

.newsletter-success[hidden],
.newsletter-error[hidden] {
    display: none;
}

.newsletter-success { color: var(--color-accent); }
.newsletter-error { color: #B91C1C; }

/* --- Footer --- */
.site-footer {
    border-top: 1px solid var(--color-border-soft);
    padding: 3.5rem 0 2rem;
    background: var(--color-bg);
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 2.5rem;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 2.5rem;
}

.footer-brand { max-width: 380px; }

.footer-logo img { max-height: 32px; }

.footer-tagline {
    margin-top: 1rem;
    color: var(--color-ink-soft);
    font-size: 0.95rem;
    line-height: 1.55;
}

.footer-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-menu a {
    color: var(--color-ink-soft);
    text-decoration: none;
    font-size: 0.9rem;
}

.footer-menu a:hover { color: var(--color-ink); }

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid var(--color-border-soft);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    align-items: center;
}

.footer-copyright {
    color: var(--color-ink-softer);
    font-size: 0.85rem;
    margin: 0;
}

.footer-disclaimer {
    color: var(--color-ink-softer);
    font-size: 0.8125rem;
    margin: 0;
    max-width: 640px;
    line-height: 1.5;
}

/* --- Error page --- */
.error {
    padding: 6rem 0;
    text-align: center;
}

.error-code {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0 0 0.5rem;
}

.error-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.error-message {
    color: var(--color-ink-soft);
    margin-bottom: 2rem;
}

/* --- Code injection overrides (moved from Ghost code injection) --- */

/* Content font size */
.gh-content p,
.gh-content li,
.gh-content blockquote {
    font-size: 1rem;
    line-height: 1.75;
}

/* Image cards: preserve aspect ratio */
.kg-image-card img {
    object-fit: contain !important;
    height: auto !important;
    max-height: none !important;
}

/* Hide feature images on phase hub pages */
body.page-get-to-zero .gh-feature-image,
body.page-build-the-runway .gh-feature-image,
body.page-buy-back-your-time .gh-feature-image,
body.page-get-to-zero .gh-canvas-image,
body.page-build-the-runway .gh-canvas-image,
body.page-buy-back-your-time .gh-canvas-image {
    display: none;
}

/* Scroll margin for anchor links */
.gh-content h2,
.gh-content h3,
.gh-content h4 {
    scroll-margin-top: 100px;
}

span[id] {
    scroll-margin-top: 100px;
}

/* Post feature image: centered and capped */
body.post-template .post-feature-image {
    text-align: center;
}

body.post-template .post-feature-image img {
    max-height: 350px;
    width: auto;
    height: auto;
    margin: 0 auto;
    display: block;
}

/* Strategy comparison table */
.rw-strategy-table {
    width: auto;
    min-width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    font-size: 0.95em;
}

.rw-strategy-table th,
.rw-strategy-table td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid #e5e5e5;
    vertical-align: top;
}

.rw-strategy-table th {
    background: #f7f7f5;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75em;
    letter-spacing: 0.5px;
    color: #555;
}

.rw-strategy-table .rw-name { font-weight: 600; }

.rw-strategy-table .rw-cost,
.rw-strategy-table .rw-years {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    white-space: nowrap;
}

.rw-strategy-table .rw-row-best td { background: rgba(10, 125, 62, 0.06); }
.rw-strategy-table .rw-row-worst td { background: rgba(179, 65, 65, 0.05); }

.rw-strategy-footnote {
    font-size: 0.85em;
    color: #666;
    margin: 0.5em 0 1.5em;
    font-style: italic;
}

/* Footnote acts as a caption: tuck it up under its table. The table's
   .rw-table-wrap has a 1.5em bottom margin that otherwise governs the gap
   (margins collapse), so pull the footnote up to leave ~0.5em. */
.rw-table-wrap + .rw-strategy-footnote { margin-top: -1em; }

/* Mobile-friendly tables. main.js wraps each .rw-strategy-table in a
   horizontally scrollable container. The table stays a real table and only
   scrolls when it is wider than the screen; tables that fit render statically.
   The first column is frozen so labels stay visible while scrolling, and a
   right-edge fade + "swipe" hint appear only when there is more to see. */
.rw-table-wrap { position: relative; margin: 1.5em 0; }
.rw-table-wrap .rw-strategy-table { margin: 0; }
.rw-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }

.rw-table-wrap::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: 38px;
    pointer-events: none;
    background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.96));
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 3;
}
.rw-table-wrap.can-scroll-right::after { opacity: 1; }

.rw-swipe-hint {
    display: none;
    text-align: right;
    font-size: 0.72em;
    font-weight: 700;
    color: #0a7d3e;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin: 6px 2px 0;
    transition: opacity 0.2s;
}
.rw-table-wrap.is-overflowing .rw-swipe-hint { display: block; }
.rw-table-wrap.scrolled .rw-swipe-hint { opacity: 0; }

/* Frozen first column. Tints are composited over an opaque base so scrolling
   values never bleed through; the edge shadow shows only when the table
   actually overflows. */
.rw-strategy-table th:first-child,
.rw-strategy-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background-color: #fff;
}
.rw-strategy-table thead th:first-child { background-color: #f7f7f5; }
.rw-strategy-table .rw-row-best td:first-child {
    background-image: linear-gradient(rgba(10, 125, 62, 0.06), rgba(10, 125, 62, 0.06));
}
.rw-strategy-table .rw-row-worst td:first-child {
    background-image: linear-gradient(rgba(179, 65, 65, 0.05), rgba(179, 65, 65, 0.05));
}
.rw-table-wrap.is-overflowing .rw-strategy-table th:first-child,
.rw-table-wrap.is-overflowing .rw-strategy-table td:first-child {
    box-shadow: 2px 0 6px -2px rgba(0, 0, 0, 0.16);
}

/* Prose cells (e.g. a Notes column) get a min-width so a content-heavy table
   overflows into a scroll instead of crushing into unreadable columns. A cell
   counts as numeric/label — and is left alone — whether its rw-name / rw-cost /
   rw-years class sits on the <td> or on a child <span>. Narrow all-numeric
   tables have no prose cells, so they stay static. */
.rw-strategy-table td:not(.rw-name):not(.rw-cost):not(.rw-years):not(:has(.rw-name)):not(:has(.rw-cost)):not(:has(.rw-years)) {
    min-width: 200px;
}
.rw-strategy-table td:first-child { min-width: 108px; }

@media (max-width: 640px) {
    .rw-strategy-table { font-size: 0.85em; }
    .rw-strategy-table th,
    .rw-strategy-table td { padding: 10px 12px; }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    body { font-size: 16px; }

    .nav-toggle { display: flex; }

    .site-nav {
        display: none;
        position: fixed;
        top: 72px;
        right: 0;
        left: 0;
        background: var(--color-bg);
        border-bottom: 1px solid var(--color-border);
        padding: 1rem 1.5rem 1.5rem;
        z-index: 40;
    }

    .site-nav.is-open { display: block; }

    .nav-menu {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.25rem;
    }

    .hero { padding: 3.5rem 0 3rem; }

    .why-band { padding: 2.25rem 0 2.5rem; }

    .featured-posts { padding: 3rem 0 4rem; }

    .calculators-showcase { padding: 2rem 0 2.5rem; }

    .calc-grid { grid-template-columns: 1fr; gap: 1rem; }

    .calc-card { padding: 1.5rem; }

    .phase-timeline { padding: 2.25rem 0 2.5rem; }

    .page-header-wide { padding: 1.75rem 0 0.75rem; }

    .phase-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .phase-link { padding: 1.5rem 1.5rem 1.25rem; }

    .phase-title { font-size: 1.2rem; }

    .post-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .post-nav-grid { grid-template-columns: 1fr; }

    .post-nav-next { text-align: left; }

    .newsletter-form {
        flex-direction: column;
    }

    .newsletter-form .btn {
        width: 100%;
    }

    .footer-inner {
        flex-direction: column;
        gap: 1.75rem;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}
