/*
 Theme Name:   PanduSihat (Astra Child)
 Theme URI:    https://pandusihat.com
 Description:  Child theme of Astra for PanduSihat — Malaysian health portal. All custom design system, layouts, and editorial templates live here. Never edit the parent Astra theme directly.
 Author:       PanduSihat
 Author URI:   https://pandusihat.com
 Template:     astra
 Version:      0.4.0
 Text Domain:  pandusihat
*/

/* =========================================================
   DESIGN TOKENS
   ========================================================= */
:root {
    /* ----- Brand colors ----- */
    --ps-color-primary: #0E5E5E;
    --ps-color-primary-hover: #094545;
    --ps-color-primary-soft: #D1E8E5;

    --ps-color-accent: #D97706;
    --ps-color-accent-hover: #B45309;
    --ps-color-accent-soft: #FEF3C7;

    /* ----- Surface ----- */
    --ps-color-bg: #FAF7F2;
    --ps-color-surface: #FFFFFF;
    --ps-color-surface-muted: #F2EEE6;

    /* ----- Text ----- */
    --ps-color-text: #1A2024;
    --ps-color-text-muted: #5A6470;
    --ps-color-text-subtle: #8B9298;
    --ps-color-text-inverse: #FFFFFF;

    /* ----- Border ----- */
    --ps-color-border: #E5E0D8;
    --ps-color-border-strong: #C9C2B6;

    /* ----- Semantic ----- */
    --ps-color-success: #2D6A4F;
    --ps-color-warning: #D97706;
    --ps-color-error: #C84B31;
    --ps-color-info: #0E5E5E;

    /* ----- Typography ----- */
    --ps-font-display: "Fraunces", Georgia, "Times New Roman", serif;
    --ps-font-body: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    --ps-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    --ps-text-xs: 0.75rem;
    --ps-text-sm: 0.875rem;
    --ps-text-base: 1rem;
    --ps-text-lg: 1.125rem;
    --ps-text-xl: 1.25rem;
    --ps-text-2xl: 1.5rem;
    --ps-text-3xl: 1.75rem;
    --ps-text-4xl: 2rem;
    --ps-text-5xl: 2.5rem;
    --ps-text-6xl: 3rem;

    --ps-leading-tight: 1.2;
    --ps-leading-snug: 1.35;
    --ps-leading-normal: 1.5;
    --ps-leading-relaxed: 1.75;

    --ps-tracking-tight: -0.01em;
    --ps-tracking-normal: 0;
    --ps-tracking-wide: 0.025em;

    --ps-weight-regular: 400;
    --ps-weight-medium: 500;
    --ps-weight-semibold: 600;
    --ps-weight-bold: 700;

    /* ----- Spacing (4-based) ----- */
    --ps-space-1: 0.25rem;
    --ps-space-2: 0.5rem;
    --ps-space-3: 0.75rem;
    --ps-space-4: 1rem;
    --ps-space-5: 1.25rem;
    --ps-space-6: 1.5rem;
    --ps-space-8: 2rem;
    --ps-space-10: 2.5rem;
    --ps-space-12: 3rem;
    --ps-space-16: 4rem;
    --ps-space-20: 5rem;
    --ps-space-24: 6rem;

    /* ----- Radius ----- */
    --ps-radius-sm: 4px;
    --ps-radius-md: 8px;
    --ps-radius-lg: 12px;
    --ps-radius-xl: 16px;
    --ps-radius-2xl: 24px;
    --ps-radius-full: 9999px;

    /* ----- Shadows ----- */
    --ps-shadow-sm: 0 1px 2px rgba(26, 32, 36, 0.05);
    --ps-shadow-md: 0 4px 12px rgba(26, 32, 36, 0.08);
    --ps-shadow-lg: 0 12px 32px rgba(26, 32, 36, 0.12);
    --ps-shadow-focus: 0 0 0 3px rgba(14, 94, 94, 0.35);

    /* ----- Layout ----- */
    --ps-content-max-w: 720px;
    --ps-container-max-w: 1200px;

    /* ----- Motion ----- */
    --ps-transition-fast: 120ms ease;
    --ps-transition-base: 200ms ease;
}

/* Scale display sizes up on tablet+ */
@media (min-width: 768px) {
    :root {
        --ps-text-3xl: 2rem;
        --ps-text-4xl: 2.5rem;
        --ps-text-5xl: 3rem;
        --ps-text-6xl: 3.75rem;
    }
}

/* =========================================================
   BASE
   ========================================================= */
body {
    font-family: var(--ps-font-body);
    font-size: var(--ps-text-base);
    line-height: var(--ps-leading-normal);
    color: var(--ps-color-text);
    background-color: var(--ps-color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6,
.entry-title,
.site-title {
    font-family: var(--ps-font-display);
    font-weight: var(--ps-weight-semibold);
    line-height: var(--ps-leading-tight);
    letter-spacing: var(--ps-tracking-tight);
    color: var(--ps-color-text);
}

h1, .entry-title { font-size: var(--ps-text-4xl); }
h2 { font-size: var(--ps-text-3xl); }
h3 { font-size: var(--ps-text-2xl); }
h4 { font-size: var(--ps-text-xl); }
h5 { font-size: var(--ps-text-lg); }
h6 {
    font-family: var(--ps-font-body);
    font-size: var(--ps-text-sm);
    font-weight: var(--ps-weight-semibold);
    text-transform: uppercase;
    letter-spacing: var(--ps-tracking-wide);
    color: var(--ps-color-text-muted);
}

p {
    margin: 0 0 var(--ps-space-4);
}

a {
    color: var(--ps-color-primary);
    text-decoration-color: rgba(14, 94, 94, 0.3);
    text-underline-offset: 2px;
    transition: color var(--ps-transition-fast), text-decoration-color var(--ps-transition-fast);
}

a:hover {
    color: var(--ps-color-primary-hover);
    text-decoration-color: var(--ps-color-primary-hover);
}

:focus-visible {
    outline: none;
    box-shadow: var(--ps-shadow-focus);
    border-radius: var(--ps-radius-sm);
}

/* Long-form article body — wider line-height + slightly larger body for sustained reading */
.entry-content {
    max-width: var(--ps-content-max-w);
    margin-inline: auto;
    font-size: var(--ps-text-lg);
    line-height: var(--ps-leading-relaxed);
}

.entry-content > p,
.entry-content > ul,
.entry-content > ol,
.entry-content > blockquote {
    margin-bottom: var(--ps-space-6);
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
    margin-top: var(--ps-space-10);
    margin-bottom: var(--ps-space-4);
}

/* =========================================================
   COMPONENTS
   ========================================================= */

/* ----- Buttons ----- */
.ps-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--ps-space-2);
    padding: var(--ps-space-3) var(--ps-space-5);
    font-family: var(--ps-font-body);
    font-size: var(--ps-text-base);
    font-weight: var(--ps-weight-semibold);
    line-height: 1;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: var(--ps-radius-md);
    cursor: pointer;
    transition: background-color var(--ps-transition-fast),
                border-color var(--ps-transition-fast),
                color var(--ps-transition-fast);
}

.ps-btn-primary {
    background-color: var(--ps-color-primary);
    color: var(--ps-color-text-inverse);
}
.ps-btn-primary:hover {
    background-color: var(--ps-color-primary-hover);
    color: var(--ps-color-text-inverse);
    text-decoration: none;
}

.ps-btn-accent {
    background-color: var(--ps-color-accent);
    color: var(--ps-color-text-inverse);
}
.ps-btn-accent:hover {
    background-color: var(--ps-color-accent-hover);
    color: var(--ps-color-text-inverse);
    text-decoration: none;
}

.ps-btn-ghost {
    background-color: transparent;
    color: var(--ps-color-primary);
    border-color: var(--ps-color-primary);
}
.ps-btn-ghost:hover {
    background-color: var(--ps-color-primary-soft);
    color: var(--ps-color-primary-hover);
    text-decoration: none;
}

.ps-btn-sm { padding: var(--ps-space-2) var(--ps-space-4); font-size: var(--ps-text-sm); }
.ps-btn-lg { padding: var(--ps-space-4) var(--ps-space-6); font-size: var(--ps-text-lg); }

/* ----- Card ----- */
.ps-card {
    display: flex;
    flex-direction: column;
    background-color: var(--ps-color-surface);
    border: 1px solid var(--ps-color-border);
    border-radius: var(--ps-radius-lg);
    padding: var(--ps-space-6);
    box-shadow: var(--ps-shadow-sm);
    transition: box-shadow var(--ps-transition-base), transform var(--ps-transition-base);
}
.ps-card:hover {
    box-shadow: var(--ps-shadow-md);
    transform: translateY(-2px);
}
.ps-card-meta {
    font-size: var(--ps-text-sm);
    color: var(--ps-color-text-muted);
    margin-bottom: var(--ps-space-2);
}
.ps-card-title {
    font-family: var(--ps-font-display);
    font-size: var(--ps-text-2xl);
    font-weight: var(--ps-weight-semibold);
    line-height: var(--ps-leading-tight);
    margin: 0 0 var(--ps-space-3);
}
.ps-card-excerpt {
    color: var(--ps-color-text-muted);
    margin-bottom: var(--ps-space-4);
}
.ps-card-footer {
    margin-top: auto;
    padding-top: var(--ps-space-4);
    border-top: 1px solid var(--ps-color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--ps-text-sm);
    color: var(--ps-color-text-subtle);
}

/* ----- Callout ----- */
.ps-callout {
    padding: var(--ps-space-4) var(--ps-space-5);
    border-left: 4px solid var(--ps-color-info);
    border-radius: 0 var(--ps-radius-md) var(--ps-radius-md) 0;
    background-color: var(--ps-color-primary-soft);
    margin-block: var(--ps-space-6);
}
.ps-callout > :last-child { margin-bottom: 0; }
.ps-callout-title {
    font-family: var(--ps-font-body);
    font-size: var(--ps-text-sm);
    font-weight: var(--ps-weight-bold);
    text-transform: uppercase;
    letter-spacing: var(--ps-tracking-wide);
    margin-bottom: var(--ps-space-2);
}
.ps-callout-success { background-color: #E0F2E9; border-left-color: var(--ps-color-success); }
.ps-callout-success .ps-callout-title { color: var(--ps-color-success); }
.ps-callout-warning { background-color: var(--ps-color-accent-soft); border-left-color: var(--ps-color-warning); }
.ps-callout-warning .ps-callout-title { color: var(--ps-color-accent-hover); }
.ps-callout-error { background-color: #FEE5DD; border-left-color: var(--ps-color-error); }
.ps-callout-error .ps-callout-title { color: var(--ps-color-error); }

/* ----- Badge ----- */
.ps-badge {
    display: inline-flex;
    align-items: center;
    padding: var(--ps-space-1) var(--ps-space-3);
    font-family: var(--ps-font-body);
    font-size: var(--ps-text-xs);
    font-weight: var(--ps-weight-semibold);
    text-transform: uppercase;
    letter-spacing: var(--ps-tracking-wide);
    border-radius: var(--ps-radius-full);
    background-color: var(--ps-color-primary-soft);
    color: var(--ps-color-primary);
}
.ps-badge-success { background-color: #E0F2E9; color: var(--ps-color-success); }
.ps-badge-accent { background-color: var(--ps-color-accent-soft); color: var(--ps-color-accent-hover); }
.ps-badge-error { background-color: #FEE5DD; color: var(--ps-color-error); }

/* ----- Doctor reviewer credit block (empty by default; only render when reviewer is assigned) ----- */
.ps-reviewer {
    display: flex;
    gap: var(--ps-space-4);
    align-items: center;
    padding: var(--ps-space-4);
    background-color: var(--ps-color-surface-muted);
    border-radius: var(--ps-radius-md);
    border: 1px solid var(--ps-color-border);
}
.ps-reviewer-avatar {
    width: 56px;
    height: 56px;
    border-radius: var(--ps-radius-full);
    background-color: var(--ps-color-primary-soft);
    flex-shrink: 0;
    display: grid;
    place-items: center;
    font-family: var(--ps-font-display);
    font-weight: var(--ps-weight-bold);
    color: var(--ps-color-primary);
}
.ps-reviewer-label {
    font-size: var(--ps-text-xs);
    text-transform: uppercase;
    letter-spacing: var(--ps-tracking-wide);
    color: var(--ps-color-text-muted);
    margin-bottom: var(--ps-space-1);
}
.ps-reviewer-name {
    font-family: var(--ps-font-display);
    font-size: var(--ps-text-base);
    font-weight: var(--ps-weight-semibold);
    margin-bottom: var(--ps-space-1);
}
.ps-reviewer-meta {
    font-size: var(--ps-text-sm);
    color: var(--ps-color-text-muted);
}

/* =========================================================
   LAYOUT — site chrome + page sections
   ========================================================= */
.container {
    max-width: var(--ps-container-max-w);
    margin-inline: auto;
    padding-inline: 1.25rem;
}

/* ----- Site header (sticky, blurred) ----- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(250, 247, 242, 0.92);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--ps-color-border);
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--ps-space-6);
    padding-block: var(--ps-space-4);
}
.site-logo {
    font-family: var(--ps-font-display);
    font-weight: 700;
    font-size: var(--ps-text-xl);
    color: var(--ps-color-text);
    text-decoration: none;
    letter-spacing: -0.02em;
}
.site-logo span { color: var(--ps-color-primary); }
.site-nav { display: none; gap: var(--ps-space-6); align-items: center; }
.site-nav a {
    font-size: var(--ps-text-sm);
    font-weight: var(--ps-weight-medium);
    color: var(--ps-color-text);
    text-decoration: none;
}
.site-nav a:hover { color: var(--ps-color-primary); }
.site-header-search {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border-radius: var(--ps-radius-full);
    background: var(--ps-color-surface-muted);
    border: 1px solid var(--ps-color-border);
    color: var(--ps-color-text);
    text-decoration: none;
}
.site-mobile-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    background: none;
    border: 1px solid var(--ps-color-border);
    border-radius: var(--ps-radius-md);
    cursor: pointer;
}
/* Mobile nav: hamburger toggles .nav-open on .site-header (JS in functions.php) */
.site-header.nav-open .site-nav {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--ps-space-4);
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: var(--ps-space-5) var(--ps-space-6);
    background: var(--ps-color-bg);
    border-bottom: 1px solid var(--ps-color-border);
    box-shadow: 0 12px 24px rgba(26, 32, 36, 0.08);
}
@media (min-width: 768px) {
    .site-nav { display: flex; }
    .site-mobile-toggle { display: none; }
    .site-header.nav-open .site-nav {
        position: static;
        flex-direction: row;
        padding: 0;
        border-bottom: 0;
        box-shadow: none;
        background: none;
    }
}

/* ----- Hero ----- */
.hero {
    padding-block: var(--ps-space-16) var(--ps-space-12);
    text-align: center;
}
.hero h1 {
    font-size: var(--ps-text-4xl);
    max-width: 18ch;
    margin: 0 auto var(--ps-space-4);
    letter-spacing: -0.02em;
}
.hero-sub {
    font-size: var(--ps-text-lg);
    color: var(--ps-color-text-muted);
    max-width: 50ch;
    margin: 0 auto var(--ps-space-8);
    line-height: var(--ps-leading-relaxed);
}
.hero-search {
    max-width: 480px;
    margin-inline: auto;
    display: flex;
    gap: var(--ps-space-2);
    background: var(--ps-color-surface);
    padding: var(--ps-space-2);
    border: 1px solid var(--ps-color-border);
    border-radius: var(--ps-radius-full);
    box-shadow: var(--ps-shadow-sm);
}
.hero-search input {
    flex: 1;
    border: none;
    background: transparent;
    padding-inline: var(--ps-space-4);
    font-family: var(--ps-font-body);
    font-size: var(--ps-text-base);
    color: var(--ps-color-text);
    outline: none;
}
.hero-search input::placeholder { color: var(--ps-color-text-subtle); }
.hero-search button {
    border: none;
    background: var(--ps-color-primary);
    color: var(--ps-color-text-inverse);
    padding: var(--ps-space-3) var(--ps-space-5);
    border-radius: var(--ps-radius-full);
    font-family: var(--ps-font-body);
    font-weight: var(--ps-weight-semibold);
    cursor: pointer;
}
.hero-search button:hover { background: var(--ps-color-primary-hover); }
@media (min-width: 768px) {
    .hero { padding-block: var(--ps-space-20) var(--ps-space-16); }
    .hero h1 { font-size: var(--ps-text-6xl); }
}

/* ----- Generic page section ----- */
.section { padding-block: var(--ps-space-12); }
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: var(--ps-space-8);
    gap: var(--ps-space-4);
}
.section-head h2 { font-size: var(--ps-text-3xl); margin: 0; }
.section-head a { font-size: var(--ps-text-sm); color: var(--ps-color-primary); font-weight: var(--ps-weight-semibold); }

/* ----- Featured pillar ----- */
.featured {
    background: var(--ps-color-surface);
    border: 1px solid var(--ps-color-border);
    border-radius: var(--ps-radius-2xl);
    padding: var(--ps-space-8);
    box-shadow: var(--ps-shadow-md);
    overflow: hidden;
    position: relative;
}
.featured::before {
    content: "";
    position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--ps-color-error), var(--ps-color-accent));
}
.featured .ps-badge { margin-bottom: var(--ps-space-3); }
.featured h2 {
    font-size: var(--ps-text-3xl);
    line-height: var(--ps-leading-tight);
    letter-spacing: -0.02em;
    margin: 0 0 var(--ps-space-4);
}
.featured p {
    font-size: var(--ps-text-lg);
    color: var(--ps-color-text-muted);
    line-height: var(--ps-leading-relaxed);
    margin-bottom: var(--ps-space-6);
}
.featured-meta {
    font-size: var(--ps-text-sm);
    color: var(--ps-color-text-subtle);
    margin-bottom: var(--ps-space-6);
}
.featured-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ps-space-3);
    align-items: center;
    margin-bottom: var(--ps-space-3);
}
@media (min-width: 768px) {
    .featured { padding: var(--ps-space-12); }
    .featured h2 { font-size: var(--ps-text-5xl); max-width: 22ch; }
}

/* ----- Category grid ----- */
.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--ps-space-4);
}
.category-card {
    display: block;
    padding: var(--ps-space-5);
    background: var(--ps-color-surface);
    border: 1px solid var(--ps-color-border);
    border-radius: var(--ps-radius-lg);
    text-decoration: none;
    color: var(--ps-color-text);
    transition: transform var(--ps-transition-base), box-shadow var(--ps-transition-base), border-color var(--ps-transition-base);
}
.category-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--ps-shadow-md);
    border-color: var(--ps-color-primary-soft);
    color: var(--ps-color-text);
    text-decoration: none;
}
.category-card .icon {
    display: inline-flex;
    align-items: center; justify-content: center;
    width: 48px; height: 48px;
    background: var(--ps-color-primary-soft);
    color: var(--ps-color-primary);
    border-radius: var(--ps-radius-md);
    font-size: 1.5rem;
    margin-bottom: var(--ps-space-3);
}
.category-card h3 {
    font-size: var(--ps-text-lg);
    margin: 0 0 var(--ps-space-1);
}
.category-card p {
    font-size: var(--ps-text-sm);
    color: var(--ps-color-text-muted);
    margin: 0;
}
@media (min-width: 640px) { .category-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .category-grid { grid-template-columns: repeat(6, 1fr); } }

/* ----- Latest articles card grid ----- */
.card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--ps-space-6);
}
@media (min-width: 640px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .card-grid { grid-template-columns: repeat(3, 1fr); } }

/* ----- Trust section ----- */
.trust-section {
    background: var(--ps-color-surface-muted);
    border-radius: var(--ps-radius-2xl);
    padding: var(--ps-space-12) var(--ps-space-6);
    text-align: center;
}
.trust-section h2 { font-size: var(--ps-text-3xl); margin-bottom: var(--ps-space-6); }
.trust-section p {
    max-width: 56ch;
    margin: 0 auto var(--ps-space-4);
    font-size: var(--ps-text-lg);
    line-height: var(--ps-leading-relaxed);
    color: var(--ps-color-text);
}
.trust-section .small { font-size: var(--ps-text-base); color: var(--ps-color-text-muted); }
.trust-section a {
    display: inline-block;
    margin-top: var(--ps-space-4);
    font-weight: var(--ps-weight-semibold);
}

/* ----- Subscribe ----- */
.subscribe {
    background: var(--ps-color-primary);
    color: var(--ps-color-text-inverse);
    border-radius: var(--ps-radius-2xl);
    padding: var(--ps-space-12) var(--ps-space-6);
    text-align: center;
}
.subscribe .ps-badge { background: rgba(255,255,255,0.15); color: var(--ps-color-text-inverse); }
.subscribe h2 {
    color: var(--ps-color-text-inverse);
    font-size: var(--ps-text-3xl);
    max-width: 24ch;
    margin: var(--ps-space-3) auto var(--ps-space-3);
}
.subscribe p {
    max-width: 50ch;
    margin: 0 auto var(--ps-space-6);
    color: rgba(255,255,255,0.8);
    font-size: var(--ps-text-base);
}
.subscribe-form {
    max-width: 440px;
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    gap: var(--ps-space-2);
}
.subscribe-form input {
    width: 100%;
    padding: var(--ps-space-4);
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.08);
    color: var(--ps-color-text-inverse);
    border-radius: var(--ps-radius-md);
    font-family: var(--ps-font-body);
    font-size: var(--ps-text-base);
    outline: none;
}
.subscribe-form input::placeholder { color: rgba(255,255,255,0.55); }
.subscribe-form input:focus { border-color: var(--ps-color-accent); }
@media (min-width: 640px) {
    .subscribe-form { flex-direction: row; }
    .subscribe-form input { flex: 1; }
}

/* ----- Site footer ----- */
.site-footer {
    background: #131A1F;
    color: rgba(255,255,255,0.7);
    padding-block: var(--ps-space-16) var(--ps-space-8);
    margin-top: var(--ps-space-20);
}
.footer-cols {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--ps-space-8);
    margin-bottom: var(--ps-space-12);
}
.footer-cols h4 {
    font-family: var(--ps-font-body);
    font-size: var(--ps-text-sm);
    text-transform: uppercase;
    letter-spacing: var(--ps-tracking-wide);
    color: rgba(255,255,255,0.55);
    margin: 0 0 var(--ps-space-4);
}
.footer-cols ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--ps-space-2); }
.footer-cols a { color: rgba(255,255,255,0.85); text-decoration: none; font-size: var(--ps-text-sm); }
.footer-cols a:hover { color: var(--ps-color-text-inverse); }
.footer-brand .site-logo { color: var(--ps-color-text-inverse); display: inline-block; margin-bottom: var(--ps-space-3); }
.footer-brand p { font-size: var(--ps-text-sm); margin: 0; max-width: 30ch; }
.footer-meta {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: var(--ps-space-6);
    font-size: var(--ps-text-xs);
    color: rgba(255,255,255,0.45);
    line-height: var(--ps-leading-relaxed);
}
.footer-meta p { margin: 0 0 var(--ps-space-2); }
@media (min-width: 768px) {
    .footer-cols { grid-template-columns: 2fr 1fr 1fr 1fr; }
}

/* =========================================================
   ARTICLE TEMPLATE — single post layout
   ========================================================= */
.breadcrumb {
    padding-block: var(--ps-space-4);
    font-size: var(--ps-text-sm);
    color: var(--ps-color-text-muted);
}
.breadcrumb ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.breadcrumb a { color: var(--ps-color-text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--ps-color-primary); }
.breadcrumb li[aria-current] { color: var(--ps-color-text); font-weight: var(--ps-weight-medium); }
.breadcrumb .sep { color: var(--ps-color-text-subtle); }

.article-header {
    padding-block: var(--ps-space-6) var(--ps-space-8);
    border-bottom: 1px solid var(--ps-color-border);
    margin-bottom: var(--ps-space-10);
}
.article-tags { display: flex; flex-wrap: wrap; gap: var(--ps-space-2); margin-bottom: var(--ps-space-5); }
.article-title {
    font-family: var(--ps-font-display);
    font-size: clamp(1.75rem, 5vw, 3rem);
    font-weight: var(--ps-weight-semibold);
    line-height: var(--ps-leading-tight);
    letter-spacing: -0.02em;
    margin: 0 0 var(--ps-space-4);
    max-width: 24ch;
}
.article-dek {
    font-size: var(--ps-text-xl);
    color: var(--ps-color-text-muted);
    line-height: var(--ps-leading-relaxed);
    margin: 0 0 var(--ps-space-6);
    max-width: 60ch;
}
.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ps-space-4) var(--ps-space-6);
    font-size: var(--ps-text-sm);
    color: var(--ps-color-text-muted);
}
.article-meta-item { display: inline-flex; align-items: center; gap: var(--ps-space-2); }
.article-meta-item strong { color: var(--ps-color-text); font-weight: var(--ps-weight-semibold); }
.article-meta-divider { color: var(--ps-color-border-strong); }

.article-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--ps-space-10);
    padding-bottom: var(--ps-space-16);
}
/* Mobile: TOC above the article body (DOM order keeps it after for the sidebar) */
.article-grid .article-toc { order: -1; }
@media (min-width: 1024px) {
    .article-grid { grid-template-columns: minmax(0, 1fr) 280px; gap: var(--ps-space-12); }
    .article-grid .article-toc { order: 0; }
}

.article-body {
    max-width: var(--ps-content-max-w);
    font-size: var(--ps-text-lg);
    line-height: var(--ps-leading-relaxed);
    color: var(--ps-color-text);
}
.article-body > p,
.article-body > ul,
.article-body > ol,
.article-body > blockquote { margin: 0 0 var(--ps-space-6); }
.article-body h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: var(--ps-weight-semibold);
    line-height: var(--ps-leading-tight);
    letter-spacing: -0.015em;
    margin: var(--ps-space-12) 0 var(--ps-space-4);
    color: var(--ps-color-text);
    scroll-margin-top: var(--ps-space-16);
}
.article-body h3 {
    font-size: var(--ps-text-xl);
    margin: var(--ps-space-8) 0 var(--ps-space-3);
}
.article-body h4 {
    font-size: var(--ps-text-lg);
    margin: var(--ps-space-6) 0 var(--ps-space-3);
}
.article-body ul, .article-body ol { padding-left: 1.5rem; }
.article-body li { margin-bottom: var(--ps-space-2); }
.article-body strong { color: var(--ps-color-text); font-weight: var(--ps-weight-semibold); }
.article-body blockquote {
    border-left: 4px solid var(--ps-color-primary);
    padding: var(--ps-space-1) var(--ps-space-5);
    margin-inline-start: 0;
    color: var(--ps-color-text-muted);
    font-style: italic;
}
.article-body figure { margin: var(--ps-space-8) 0; }
.article-body figure img { max-width: 100%; border-radius: var(--ps-radius-lg); display: block; }
.article-body figcaption { font-size: var(--ps-text-sm); color: var(--ps-color-text-subtle); margin-top: var(--ps-space-2); text-align: center; }

.compare-table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--ps-space-6) 0;
    font-size: var(--ps-text-base);
    background: var(--ps-color-surface);
    border: 1px solid var(--ps-color-border);
    border-radius: var(--ps-radius-md);
    overflow: hidden;
}
.compare-table th, .compare-table td {
    padding: var(--ps-space-3) var(--ps-space-4);
    text-align: left;
    border-bottom: 1px solid var(--ps-color-border);
    vertical-align: top;
}
.compare-table tr:last-child td { border-bottom: none; }
.compare-table th {
    background: var(--ps-color-surface-muted);
    font-family: var(--ps-font-body);
    font-weight: var(--ps-weight-semibold);
    font-size: var(--ps-text-sm);
    text-transform: uppercase;
    letter-spacing: var(--ps-tracking-wide);
    color: var(--ps-color-text-muted);
}

.article-cta {
    background: var(--ps-color-primary-soft);
    border: 1px solid var(--ps-color-primary);
    border-radius: var(--ps-radius-lg);
    padding: var(--ps-space-6);
    margin: var(--ps-space-10) 0;
    text-align: center;
}
.article-cta-label {
    display: inline-block;
    font-family: var(--ps-font-body);
    font-size: var(--ps-text-xs);
    font-weight: var(--ps-weight-bold);
    text-transform: uppercase;
    letter-spacing: var(--ps-tracking-wide);
    color: var(--ps-color-primary);
    margin-bottom: var(--ps-space-2);
}
.article-cta h3 {
    font-family: var(--ps-font-display);
    font-size: var(--ps-text-2xl);
    margin: 0 0 var(--ps-space-3);
    color: var(--ps-color-text);
}
.article-cta p { color: var(--ps-color-text-muted); margin: 0 0 var(--ps-space-5); }
.article-cta-note {
    display: block;
    margin-top: var(--ps-space-3);
    font-size: var(--ps-text-xs);
    color: var(--ps-color-text-subtle);
}

.article-references {
    margin-top: var(--ps-space-16);
    padding-top: var(--ps-space-8);
    border-top: 2px solid var(--ps-color-border);
}
.article-references h2 {
    font-size: var(--ps-text-xl);
    margin: 0 0 var(--ps-space-5);
}
.article-references ol {
    padding-left: 1.25rem;
    font-size: var(--ps-text-base);
    color: var(--ps-color-text-muted);
    line-height: var(--ps-leading-relaxed);
}
.article-references li { margin-bottom: var(--ps-space-3); }
.article-references a { color: var(--ps-color-primary); text-decoration-color: rgba(14, 94, 94, 0.4); word-break: break-word; }

/* Article body tables (legacy converted articles) */
.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--ps-space-6) 0;
    font-size: var(--ps-text-sm);
    background: var(--ps-color-surface);
    border: 1px solid var(--ps-color-border);
    border-radius: var(--ps-radius-md);
    overflow: hidden;
}
.article-body table th,
.article-body table td {
    padding: var(--ps-space-3) var(--ps-space-4);
    border-bottom: 1px solid var(--ps-color-border);
    text-align: left;
    vertical-align: top;
}
.article-body table tr:first-child td,
.article-body table th {
    background: var(--ps-color-surface-muted);
    font-weight: var(--ps-weight-semibold);
}
.article-body table tr:last-child td { border-bottom: 0; }
@media (max-width: 640px) {
    .article-body { overflow-x: visible; }
    .article-body table { display: block; overflow-x: auto; }
}

/* In-article CTA — the monetizable slot (Phase 1: HPAN, Phase 2: per-topic client) */
.article-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--ps-space-4);
    margin-top: var(--ps-space-10);
    padding: var(--ps-space-6);
    background: var(--ps-color-surface);
    border: 1px solid var(--ps-color-border);
    border-left: 4px solid var(--ps-color-primary);
    border-radius: var(--ps-radius-lg);
}
.article-cta-title {
    font-family: var(--ps-font-display);
    font-size: var(--ps-text-lg);
    font-weight: var(--ps-weight-semibold);
    margin: 0 0 var(--ps-space-1);
}
.article-cta-sub {
    font-size: var(--ps-text-sm);
    color: var(--ps-color-text-muted);
    margin: 0;
    max-width: 44ch;
}

.article-toc {
    background: var(--ps-color-surface);
    border: 1px solid var(--ps-color-border);
    border-radius: var(--ps-radius-lg);
    padding: var(--ps-space-5);
}
.article-toc-title {
    font-family: var(--ps-font-body);
    font-size: var(--ps-text-xs);
    font-weight: var(--ps-weight-bold);
    text-transform: uppercase;
    letter-spacing: var(--ps-tracking-wide);
    color: var(--ps-color-text-muted);
    margin: 0 0 var(--ps-space-3);
}
.article-toc ol { list-style: none; padding: 0; margin: 0; counter-reset: toc-counter; display: flex; flex-direction: column; gap: var(--ps-space-2); }
.article-toc li { counter-increment: toc-counter; font-size: var(--ps-text-sm); line-height: var(--ps-leading-snug); }
.article-toc li::before { content: counter(toc-counter) ". "; color: var(--ps-color-text-subtle); margin-right: var(--ps-space-1); }
.article-toc a { color: var(--ps-color-text); text-decoration: none; }
.article-toc a:hover { color: var(--ps-color-primary); text-decoration: underline; text-decoration-color: rgba(14, 94, 94, 0.3); text-underline-offset: 3px; }
@media (min-width: 1024px) {
    .article-toc { position: sticky; top: 88px; max-height: calc(100vh - 120px); overflow-y: auto; }
}

.related-section {
    background: var(--ps-color-surface-muted);
    padding-block: var(--ps-space-16);
}
.related-section h2 {
    font-size: var(--ps-text-3xl);
    margin: 0 0 var(--ps-space-8);
}

/* =========================================================
   HOMEPAGE — Symptom Compass (front-page.php)
   ========================================================= */
.symptom-hero {
    position: relative;
    padding-block: var(--ps-space-16) var(--ps-space-8);
    text-align: center;
    overflow: hidden;
}
/* Soft ambient blobs so the hero doesn't read as flat cream */
.symptom-hero::before,
.symptom-hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
}
.symptom-hero::before {
    width: 460px;
    height: 460px;
    background: rgba(14, 94, 94, 0.12);
    top: -180px;
    left: -140px;
}
.symptom-hero::after {
    width: 380px;
    height: 380px;
    background: rgba(217, 119, 6, 0.10);
    bottom: -160px;
    right: -110px;
}
.symptom-hero .container { position: relative; }
.hero-trust {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--ps-space-2) var(--ps-space-6);
    margin-top: var(--ps-space-5);
    font-size: var(--ps-text-sm);
    color: var(--ps-color-text-muted);
}
.hero-trust span {
    display: inline-flex;
    align-items: center;
    gap: var(--ps-space-2);
}
.hero-trust svg { color: var(--ps-color-primary); flex-shrink: 0; }
.symptom-hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin: 0 auto var(--ps-space-3);
    max-width: 20ch;
    letter-spacing: -0.02em;
}
.symptom-hero p {
    color: var(--ps-color-text-muted);
    font-size: var(--ps-text-lg);
    max-width: 52ch;
    margin: 0 auto var(--ps-space-6);
    line-height: var(--ps-leading-relaxed);
}

/* ----- Archive / blog index / search ----- */
.archive-hero {
    padding-block: var(--ps-space-12) var(--ps-space-8);
    text-align: center;
}
.archive-hero h1 {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    margin: 0 auto var(--ps-space-3);
    letter-spacing: -0.02em;
}
.archive-hero p {
    color: var(--ps-color-text-muted);
    font-size: var(--ps-text-base);
    max-width: 56ch;
    margin: 0 auto;
    line-height: var(--ps-leading-relaxed);
}
.archive-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--ps-space-5);
}
@media (min-width: 640px) { .archive-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .archive-grid { grid-template-columns: repeat(3, 1fr); } }
.archive-grid .ps-card {
    display: flex;
    flex-direction: column;
}
.archive-grid .ps-card-footer { margin-top: auto; }
.archive-empty {
    text-align: center;
    padding-block: var(--ps-space-12);
}
.archive-empty h2 { margin-bottom: var(--ps-space-3); }
.archive-empty p { color: var(--ps-color-text-muted); margin-bottom: var(--ps-space-6); }
.navigation.pagination {
    display: flex;
    justify-content: center;
    margin-top: var(--ps-space-10);
}
.navigation.pagination .nav-links {
    display: flex;
    gap: var(--ps-space-2);
    align-items: center;
}
.navigation.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding-inline: var(--ps-space-3);
    border: 1px solid var(--ps-color-border);
    border-radius: var(--ps-radius-md);
    font-size: var(--ps-text-sm);
    font-weight: var(--ps-weight-medium);
    color: var(--ps-color-text);
    text-decoration: none;
    background: var(--ps-color-surface);
}
.navigation.pagination .page-numbers.current {
    background: var(--ps-color-primary);
    border-color: var(--ps-color-primary);
    color: #fff;
}
.navigation.pagination a.page-numbers:hover {
    border-color: var(--ps-color-primary);
    color: var(--ps-color-primary);
}
.navigation.pagination .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.symptom-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--ps-space-3);
    padding-bottom: var(--ps-space-16);
}
@media (min-width: 640px) { .symptom-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .symptom-grid { grid-template-columns: repeat(4, 1fr); } }

.symptom-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--ps-space-2);
    padding: var(--ps-space-5) var(--ps-space-3);
    background: var(--ps-color-surface);
    border: 1px solid var(--ps-color-border);
    border-radius: var(--ps-radius-lg);
    color: var(--ps-color-text);
    text-decoration: none;
    text-align: center;
    transition: transform var(--ps-transition-base), border-color var(--ps-transition-base), box-shadow var(--ps-transition-base);
}
.symptom-btn:hover {
    transform: translateY(-2px);
    border-color: var(--ps-color-primary);
    box-shadow: var(--ps-shadow-md);
    color: var(--ps-color-text);
    text-decoration: none;
}
.symptom-btn .ico {
    width: 44px; height: 44px;
    display: grid; place-items: center;
    border-radius: var(--ps-radius-full);
    background: var(--ps-color-primary-soft);
    color: var(--ps-color-primary);
    font-size: 1.4rem;
    font-weight: var(--ps-weight-bold);
}
.symptom-btn .label {
    font-family: var(--ps-font-body);
    font-size: var(--ps-text-base);
    font-weight: var(--ps-weight-semibold);
}
.symptom-btn-more {
    background: transparent;
    border-style: dashed;
    color: var(--ps-color-primary);
}
.symptom-btn-more .ico {
    background: transparent;
    border: 1px dashed var(--ps-color-primary);
}

.editor-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--ps-space-6);
    margin-top: var(--ps-space-4);
}
@media (min-width: 768px) { .editor-row { grid-template-columns: 2fr 1fr; } }

.editor-main {
    background: var(--ps-color-surface);
    border: 1px solid var(--ps-color-border);
    border-radius: var(--ps-radius-xl);
    padding: var(--ps-space-6);
    box-shadow: var(--ps-shadow-sm);
}
.editor-main h3 {
    font-family: var(--ps-font-display);
    font-size: var(--ps-text-2xl);
    margin: var(--ps-space-3) 0 var(--ps-space-3);
    line-height: var(--ps-leading-tight);
}
.editor-main h3 a { color: inherit; text-decoration: none; }

.editor-side {
    background: var(--ps-color-primary-soft);
    border-radius: var(--ps-radius-xl);
    padding: var(--ps-space-6);
}
.editor-side h4 {
    font-family: var(--ps-font-display);
    font-size: var(--ps-text-lg);
    margin: 0 0 var(--ps-space-3);
}
.editor-side ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--ps-space-3);
}
.editor-side li {
    font-size: var(--ps-text-sm);
    padding-bottom: var(--ps-space-3);
    border-bottom: 1px solid rgba(14, 94, 94, 0.15);
}
.editor-side li:last-child { border-bottom: none; padding-bottom: 0; }
.editor-side a { color: var(--ps-color-text); text-decoration: none; font-weight: var(--ps-weight-medium); }
.editor-side a:hover { color: var(--ps-color-primary); }
