/*
 * eHealify Posts CSS — Ayurveda Edition
 * AI-proof content, reading progress, TOC, affiliate suite, related posts.
 */
:root {
    --p-green: var(--c-green);
    --p-green-mid: var(--c-green-mid);
    --p-green-lt: var(--c-green-lt);
    --p-green-pale: var(--c-green-pale);
    --p-earth: var(--c-earth);
    --p-earth-lt: #f5e6d3;
    --p-muted: var(--c-muted);
    --p-border: var(--c-border);
    --p-text: var(--c-text);
    --p-surface: var(--c-surface);
    --p-bg: var(--c-bg);
}

/* ── Post Header ──────────────────────────────────── */
.eh-post-header-wrap { margin-bottom: 32px; }

.eh-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--c-muted);
    margin-bottom: 20px;
    line-height: 1.4;
}
.eh-breadcrumb a {
    color: var(--c-green-light);
    text-decoration: none;
    transition: color 0.2s ease;
}
.eh-breadcrumb a:hover {
    color: var(--c-accent);
    text-decoration: underline;
}
.eh-breadcrumb span[aria-hidden="true"] {
    color: var(--c-border);
    font-size: 0.7rem;
}
.eh-breadcrumb > span:last-child {
    color: var(--c-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 280px;
}

.eh-category-pill {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 5px 18px;
    border-radius: 40px;
    background: var(--c-green-pale);
    color: var(--c-green);
    text-decoration: none;
    margin-bottom: 16px;
    border: 1px solid rgba(122,170,80,0.25);
    transition: all 0.25s ease;
}
.eh-category-pill:hover {
    background: var(--c-green);
    color: #fff;
    border-color: var(--c-green);
}

.eh-post-header h1 {
    font-family: var(--font-head);
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.02em;
    color: var(--c-text);
    margin: 0 0 16px;
}

.eh-post-dek {
    font-size: 1.15rem;
    line-height: 1.6;
    color: var(--c-muted);
    margin: 0 0 20px;
    max-width: 680px;
}

.eh-post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--c-muted);
    margin-bottom: 24px;
}
.eh-post-meta strong {
    color: var(--c-green);
    font-weight: 700;
}

.eh-meta-dot {
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--c-border);
}

@media (max-width: 768px) {
    .eh-breadcrumb { font-size: 0.72rem; gap: 4px; }
    .eh-breadcrumb > span:last-child { max-width: 180px; }
    .eh-post-dek { font-size: 1rem; }
    .eh-post-meta { font-size: 0.82rem; gap: 6px; }
}

/* Reading Progress */
.eh-reading-progress {
    position: fixed; top: 0; left: 0; width: 100%; height: 4px;
    background: rgba(255,255,255,0.1); z-index: 10000; pointer-events: none;
}
.eh-reading-progress span {
    display: block; height: 100%; width: 0;
    background: linear-gradient(90deg, var(--c-accent), #F0C27F);
    transition: width 0.1s ease-out;
}

/* Post shell */
.eh-post-shell { max-width: 840px; margin: 0 auto; padding: 0 32px 80px; background: var(--c-bg); }

/* Editor note — Fixed bleed and colors */
.eh-editor-note {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #FDFBF7; 
    border: 1.5px solid var(--c-green-mid);
    border-radius: 14px;
    padding: 16px 20px;
    margin: 24px 0;
    box-shadow: 0 4px 12px rgba(26,46,28,0.05);
    overflow: hidden;
}
.eh-editor-note-icon { color: var(--c-accent); font-weight: 900; }
.eh-editor-note p { font-size: 0.85rem; color: var(--c-muted); margin: 0; line-height: 1.6; }
.eh-editor-note strong { color: var(--c-green); }

/* Trust Badges */
.eh-trust-badges { display: flex; gap: 10px; margin: 24px 0; flex-wrap: wrap; }
.eh-badge {
    font-size: 0.65rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: 0.12em; padding: 6px 16px; border-radius: 40px;
    display: inline-flex; align-items: center; gap: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.eh-badge--verified { background: #F2F6ED; color: #1A2E1C; border: 1px solid rgba(86,124,82,0.3); }
.eh-badge--affiliate { background: #FFF9F0; color: #B57318; border: 1px solid rgba(181,115,24,0.3); }

/* Featured image */
.eh-featured-image{margin:0 0 28px;border-radius:16px;overflow:hidden}
.eh-featured-image img{width:100%;height:auto;display:block}

/* TOC */
.eh-toc{background:var(--p-green-pale);border:1px solid rgba(122,170,80,.25);border-left:4px solid var(--p-green-lt);border-radius:0 12px 12px 0;margin:0 0 32px;padding:18px 22px}
.eh-toc-inner h2{font-size:.72rem;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--p-green);margin:0 0 10px}
.eh-toc ol{margin:0;padding-left:1.2em;display:flex;flex-direction:column;gap:5px}
.eh-toc li{font-size:.88rem}
.eh-toc a{color:var(--p-green);text-decoration:none;line-height:1.5}.eh-toc a:hover{color:var(--p-earth);text-decoration:underline}

/* Topic pathway */
.eh-topic-pathway {
    margin: 0 0 36px;
    padding: 24px;
    border: 1px solid rgba(86,124,82,0.18);
    border-radius: 22px;
    background: linear-gradient(180deg, #fff 0%, #fbf8f1 100%);
    box-shadow: var(--shadow-sm);
}
.eh-topic-pathway__head { margin-bottom: 18px; }
.eh-topic-pathway__eyebrow {
    display: block;
    margin-bottom: 6px;
    color: var(--c-accent);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.eh-topic-pathway h2 {
    margin: 0 0 6px;
    color: var(--c-green);
    font-family: var(--font-head);
    font-size: clamp(1.35rem, 3vw, 1.8rem);
    line-height: 1.15;
}
.eh-topic-pathway p {
    max-width: 620px;
    margin: 0;
    color: var(--c-muted);
    font-size: 0.92rem;
    line-height: 1.6;
}
.eh-topic-pathway__links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.eh-topic-pathway__link {
    display: block;
    min-height: 100%;
    padding: 14px 16px;
    border: 1px solid var(--c-border);
    border-radius: 16px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.eh-topic-pathway__link:hover {
    border-color: var(--c-green-lt);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}
.eh-topic-pathway__link strong {
    display: block;
    margin-bottom: 4px;
    color: var(--c-green);
    font-size: 0.92rem;
}
.eh-topic-pathway__link span {
    display: block;
    color: var(--c-muted);
    font-size: 0.78rem;
    line-height: 1.45;
}
.eh-topic-pathway__link.is-current {
    border-color: rgba(181,115,24,0.26);
    background: #fff9f0;
}

/* Article body — AI-proof */
.eh-article-body {
    font-family: var(--font-body);
    font-size: 1.125rem;
    font-weight: var(--fw-body);
    line-height: 1.8;
    color: var(--p-text);
    word-break: normal;
    overflow-wrap: break-word;
}
.eh-article-body * { max-width: 100% !important; box-sizing: border-box !important; }
.eh-article-body p { margin-bottom: 1.5em; }
.eh-article-body strong, .eh-article-body b { color: var(--p-green); font-weight: 700; }
.eh-article-body em, .eh-article-body i { color: var(--p-earth); }

.eh-article-body h2 {
    font-family: var(--font-head);
    font-size: clamp(1.8rem, 4.5vw, 2.8rem);
    color: var(--p-green);
    margin: 2.5rem 0 1rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.01em;
}
.eh-article-body h2::after {
    content: ''; display: block; width: 50px; height: 4px;
    background: linear-gradient(90deg, var(--p-green-lt), transparent);
    border-radius: 2px; margin-top: 10px;
}
.eh-article-body h3 {
    font-family: var(--font-head);
    font-size: clamp(1.4rem, 3.5vw, 2rem);
    color: var(--p-green);
    margin: 2rem 0 0.8rem;
    font-weight: 700;
    line-height: 1.2;
}

/* Author box — Definitive Site-Wide Visibility */
.eh-author-box {
    display: flex;
    align-items: center;
    gap: 28px;
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: 24px;
    padding: 32px;
    margin: 64px 0 40px;
    box-shadow: var(--shadow-sm);
    position: relative;
    z-index: 10;
}
.eh-author-avatar-img {
    width: 90px !important; height: 90px !important;
    min-width: 90px; min-height: 90px;
    border-radius: 50%;
    object-fit: cover !important;
    border: 3px solid var(--c-green-pale);
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}
.eh-author-box > div { flex: 1; min-width: 0; }
.eh-author-kicker { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.15em; color: var(--c-accent); margin-bottom: 6px; }
.eh-author-box h2 { font-family: var(--font-head); font-size: 1.6rem; font-weight: 700; color: var(--c-green); margin: 0 0 6px; }
.eh-author-role { font-size: 0.85rem; color: var(--c-muted); margin-bottom: 12px; display: block; font-weight: 600; }
.eh-author-box p { font-size: 0.95rem; color: var(--c-muted); line-height: 1.65; margin: 0; }

/* Author Pinterest Link */
.eh-author-pinterest {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 10px 20px;
    background: #BD081C;
    color: #fff !important;
    font-size: 0.82rem;
    font-weight: 700;
    border-radius: 40px;
    text-decoration: none !important;
    border-bottom: none !important;
    box-shadow: 0 4px 14px rgba(189,8,28,0.25);
    transition: background 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
}
.eh-author-pinterest:hover {
    background: #a5071a;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(189,8,28,0.35);
    color: #fff !important;
    border-bottom: none !important;
}
.eh-author-pinterest svg { fill: #fff; flex-shrink: 0; }

/* Related posts — Solid Uniform Grid */
.eh-related {
    margin: 80px 0 20px;
    padding-top: 48px;
    border-top: 2px solid var(--p-green-pale);
}
.eh-related__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}
.eh-related__card {
    background: #fff;
    border: 1px solid var(--p-border);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: var(--shadow-sm);
}
.eh-related__card:hover { transform: translateY(-8px); box-shadow: var(--shadow-md); border-color: var(--c-green-lt); }

.eh-related__link { display: flex; flex-direction: column; text-decoration: none; color: inherit; height: 100%; }

.eh-related__card img {
    width: 100% !important;
    height: 180px !important;
    object-fit: cover !important;
    display: block !important;
}

.eh-related__body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.eh-related__cat { font-size: 0.65rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--c-green-lt); margin-bottom: 8px; }
.eh-related__body h3 {
    font-family: var(--font-head);
    font-size: 1.2rem !important;
    font-weight: 700;
    color: var(--c-green);
    margin: 0 0 16px;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.eh-related__cta {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--c-accent);
    margin-top: auto;
}

/* Next-step CTA */
.eh-next-step {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: center;
    margin: 56px 0 28px;
    padding: 28px;
    border: 1px solid rgba(86,124,82,0.18);
    border-radius: 24px;
    background:
        radial-gradient(circle at 92% 8%, rgba(240,194,127,0.18), transparent 30%),
        linear-gradient(135deg, #fff 0%, #fbf8f1 100%);
    box-shadow: var(--shadow-sm);
}
.eh-next-step__eyebrow {
    display: block;
    margin-bottom: 7px;
    color: var(--c-accent);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.eh-next-step h2 {
    margin: 0 0 8px;
    color: var(--c-green);
    font-family: var(--font-head);
    font-size: clamp(1.45rem, 3vw, 2rem);
    line-height: 1.12;
}
.eh-next-step p {
    margin: 0;
    color: var(--c-muted);
    font-size: 0.92rem;
    line-height: 1.6;
}
.eh-next-step__actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 220px;
}
.eh-next-step__primary,
.eh-next-step__secondary {
    display: inline-flex;
    justify-content: center;
    padding: 12px 18px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 800;
    text-decoration: none !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.eh-next-step__primary {
    background: var(--c-green);
    color: #fff !important;
    box-shadow: 0 8px 20px rgba(26,46,28,0.18);
}
.eh-next-step__secondary {
    border: 1px solid rgba(86,124,82,0.22);
    background: #fff;
    color: var(--c-green) !important;
}
.eh-next-step__primary:hover,
.eh-next-step__secondary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* ══ STICKY AFFILIATE SUITE ════════════════════════ */

/* 1. Main Glass Bar — Desktop: Centered horizontal. Mobile: Full-width bottom */
.eh-aff-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(150%);
    width: min(600px, 94vw);
    z-index: 10001;
    will-change: transform;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.eh-aff-bar.eh-aff-bar--visible { transform: translateX(-50%) translateY(0); }

.eh-aff-bar__inner {
    background: rgba(10,20,12,0.97);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1.5px solid rgba(255,255,255,0.22);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    width: 100%;
}

.eh-aff-bar__content { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.eh-aff-bar__eyebrow { font-size: 0.6rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.15em; color: #A8D88A; line-height: 1; margin-bottom: 4px; }
.eh-aff-bar__note { font-size: 0.75rem; color: rgba(255,255,255,0.9); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1; }

.eh-aff-bar__actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.eh-aff-bar__btn {
    background: var(--c-accent);
    color: #fff !important;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 11px 20px;
    border-radius: 40px;
    text-decoration: none !important;
    border-bottom: none !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    transition: background 0.2s ease, transform 0.2s ease;
}
.eh-aff-bar__btn:hover { background: #d48a1a; transform: translateY(-1px); }

/* Close button — guaranteed visible on ALL devices */
.eh-aff-bar__close {
    background: rgba(255,255,255,0.15) !important;
    border: 1.5px solid rgba(255,255,255,0.2) !important;
    color: #fff !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.1rem !important;
    line-height: 1 !important;
    transition: background 0.2s ease !important;
    flex-shrink: 0 !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    padding: 0 !important;
}
.eh-aff-bar__close:hover { background: #BD081C !important; border-color: #BD081C !important; }

/* 2. Persistent Mini-Link (Post-Dismissal) — Works on both desktop and mobile */
.eh-aff-mini {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: rgba(10,20,12,0.98);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(168,216,138,0.3);
    color: #A8D88A !important;
    padding: 12px 20px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none !important;
    border-bottom: none !important;
    box-shadow: 0 12px 32px rgba(0,0,0,0.5);
    z-index: 10000;
    transform: translateY(150px);
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.eh-aff-mini.active { transform: translateY(0); }
.eh-aff-mini:hover { background: #000; color: #fff !important; }

/* ── Mobile ≤ 768px Components ─── */
@media (max-width: 768px) {
    .eh-post-shell { padding: 0 16px 40px; }
    .eh-author-box { flex-direction: column; text-align: center; gap: 16px; padding: 32px 24px; }
    .eh-author-avatar-img { width: 80px !important; height: 80px !important; }
    .eh-related__grid { grid-template-columns: 1fr; gap: 24px; }
    .eh-next-step { grid-template-columns: 1fr; }
    .eh-next-step__actions { min-width: 0; }

    /* ── MOBILE AFFILIATE BAR — Full-width bottom bar ── */
    .eh-aff-bar {
        width: 100vw !important;
        left: 0 !important;
        bottom: 0 !important;
        transform: translateX(0) translateY(100%) !important;
    }
    .eh-aff-bar.eh-aff-bar--visible {
        transform: translateX(0) translateY(0) !important;
    }
    .eh-aff-bar__inner {
        border-radius: 0 !important;
        padding: 14px 16px !important;
        gap: 12px !important;
        box-shadow: 0 -8px 30px rgba(0,0,0,0.4) !important;
        border: none !important;
        border-top: 1px solid rgba(255,255,255,0.1) !important;
    }
    .eh-aff-bar__content {
        flex: 1;
        min-width: 0;
    }
    .eh-aff-bar__eyebrow { font-size: 0.55rem; }
    .eh-aff-bar__note { font-size: 0.7rem; }
    .eh-aff-bar__actions {
        display: flex !important;
        align-items: center;
        gap: 10px;
        flex-shrink: 0;
    }
    .eh-aff-bar__btn {
        font-size: 0.78rem;
        padding: 10px 16px;
    }

    /* Mobile persistent mini link — full width bottom strip */
    .eh-aff-mini {
        bottom: 0 !important;
        right: 0 !important;
        left: 0 !important;
        width: 100% !important;
        border-radius: 0 !important;
        justify-content: center;
        padding: 14px 20px !important;
        border: none !important;
        border-top: 1px solid rgba(168,216,138,0.2) !important;
        box-shadow: 0 -4px 16px rgba(0,0,0,0.3) !important;
    }
}

@media (max-width: 640px) {
    .eh-topic-pathway { padding: 20px; }
    .eh-topic-pathway__links { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .eh-aff-bar__note { display: none; }
    .eh-aff-bar__btn { font-size: 0.72rem; padding: 9px 12px; }
}
