/*
 * eHealify — Global Base CSS
 * Loaded on ALL pages. Resets GeneratePress defaults to Ayurveda theme.
 * Mobile-safe, AI-post-safe.
 *
 * CRITICAL: GP uses body class "right-sidebar" on homepage
 * but has NO actual sidebar element. This CSS forces full-width.
 */

/* ── Global Design Tokens ─────────────────────────────────────── */
:root {
    --c-bg:          #FDFBF7; /* Warm Cream */
    --c-surface:     #ffffff;
    --c-text:        #1A1208;
    --c-muted:       #5C5448;
    --c-border:      #E8E2D9;
    
    /* Ayurveda Forest Greens (Desaturated) */
    --c-green:       #1A2E1C; 
    --c-green-mid:   #2D4A2B;
    --c-green-lt:    #567C52;
    --c-green-pale:  #F2F6ED;
    
    /* Accent Tones */
    --c-accent:      #B57318; /* Desaturated Turmeric */
    --c-earth:       #7A5235;
    --c-rose:        #8C4251;
    --c-moon:        #42517A;
    
    /* Typography */
    --font-head:     'Cormorant Garamond', Georgia, serif;
    --font-body:     'Jost', system-ui, sans-serif;
    --fw-body:       450; /* Medium for premium feel */
    --ls-head:       -0.02em;
    
    /* Layout */
    --wrap:          1200px;
    --radius-sm:     8px;
    --radius-md:     14px;
    --radius-lg:     24px;
    
    /* Shadows (Diffused) */
    --shadow-sm:     0 4px 12px rgba(26,46,28,0.04);
    --shadow-md:     0 12px 32px rgba(26,46,28,0.08);
}

/* ── Global reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: clip; }
img, video, iframe, svg, canvas { max-width: 100%; height: auto; }

/* ── Body & background ─────────────────────────────────────────── */
body {
    background: var(--c-bg);
    font-family: var(--font-body);
    font-weight: var(--fw-body);
    color: var(--c-text);
    line-height: 1.6;
    letter-spacing: 0.01em;
    -webkit-font-smoothing: antialiased;
}

/* Headlines */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-head);
    letter-spacing: var(--ls-head);
    font-weight: 700;
}

/* ── Contain GeneratePress content wrappers ────────────────────── */
#page, .site, .site-content, .content-area,
.site-main, article, .inside-article,
.entry-content, .page-content {
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

.entry-content, .page-content {
    overflow-wrap: break-word;
    word-break: normal;
}

/* ══════════════════════════════════════════════════════════════
   HOMEPAGE FULL-WIDTH FIX
   GP body class "right-sidebar" forces content to ~75% width
   but NO sidebar element exists. Override to 100%.
   ══════════════════════════════════════════════════════════════ */
body.home .site-content,
body.home .inside-page,
body.home #primary,
body.home .content-area {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    flex: 1 1 100% !important;
}

/* Remove any GP container max-width on homepage */
body.home .site-content .grid-container,
body.home .inside-page {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
}

/* Hide sidebar on ALL pages on mobile */
@media (max-width: 768px) {
    .widget-area, .sidebar-primary, #right-sidebar { display: none !important; }
    .content-area, #primary { width: 100% !important; flex: 1 !important; float: none !important; }
}

/* ── Global link colors ────────────────────────────────────────── */
a { 
    color: var(--c-green-mid); 
    text-decoration: none; 
    transition: color 0.2s ease, opacity 0.2s ease; 
}
a:hover { color: var(--c-green-lt); }

/* ── Remove GeneratePress default entry padding on posts ───────── */
.single-post .site-content { padding-top: 0 !important; padding-bottom: 0 !important; }
.single-post .content-area { max-width: 100% !important; }
.single-post .site-main { max-width: 100% !important; margin: 0 !important; padding: 0 !important; }
.single-post .inside-article { background: transparent !important; border: none !important; box-shadow: none !important; padding: 0 !important; margin: 0 !important; border-radius: 0 !important; }

/* ── Category page: remove GeneratePress archive padding ───────── */
.archive .site-content { padding-top: 0 !important; }
.archive .inside-article { padding: 0 !important; border: none !important; box-shadow: none !important; background: transparent !important; }

/* ── Table overflow fix (mobile AI posts) ──────────────────────── */
.entry-content table, .page-content table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

/* ── WP Admin bar spacing ──────────────────────────────────────── */
@media (max-width: 782px) {
    #wpadminbar { position: fixed !important; }
}

/* ── Homepage: remove GP default content padding ───────────────── */
body.home .site-content { padding: 0 !important; }

/* ── Branded 404 page ─────────────────────────────────────────── */
.eh-error-page {
    display: grid;
    min-height: 62vh;
    place-items: center;
    padding: 88px 24px 110px;
    background: var(--c-bg);
}
.eh-error-page__inner { max-width: 720px; text-align: center; }
.eh-error-page__eyebrow {
    margin: 0 0 14px;
    color: var(--c-accent);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.eh-error-page h1 {
    margin: 0;
    color: var(--c-green);
    font-size: clamp(3rem, 8vw, 6.5rem);
    line-height: 0.96;
}
.eh-error-page__copy {
    max-width: 610px;
    margin: 24px auto 0;
    color: var(--c-muted);
    font-size: 1.08rem;
}
.eh-error-page__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 32px;
}
.eh-error-page__actions a {
    border-radius: 999px;
    padding: 13px 22px;
    font-weight: 700;
}
.eh-error-page__primary { background: var(--c-green-mid); color: #fff; }
.eh-error-page__primary:hover { background: var(--c-green); color: #fff; }
.eh-error-page__secondary { border: 1px solid var(--c-border); background: var(--c-surface); }
