/* ==========================================================================
   FILE 1: base.css — Global Theme Variables, Reset, Typography & Buttons
   ==========================================================================
   HOW THIS FILE WORKS:
   - Defines all colors and fonts inside `:root` (Light Mode) and `[data-theme="dark"]` (Dark Mode).
   - If you ever want to tweak your brand orange, cobalt blue, or off-white backgrounds,
     change the hex codes here and the entire site updates automatically.
   - Contains shared utility classes (.container, .btn) used on every page.
   ========================================================================== */

:root,
[data-theme="light"] {
    /* --- Core Brand Accents (Orange & Cobalt Blue) --- */
    --brand-orange: #EA580C;
    --brand-orange-hover: #C2410C;
    --brand-orange-bright: #F97316;
    --brand-orange-tint: rgba(234, 88, 12, 0.11);
    --brand-orange-border: rgba(234, 88, 12, 0.35);

    --brand-blue: #1D4ED8;
    --brand-blue-hover: #1E40AF;
    --brand-blue-bright: #2563EB;
    --brand-blue-tint: rgba(29, 78, 216, 0.08);
    --brand-blue-border: rgba(29, 78, 216, 0.3);

    /* --- Light Mode Page Surfaces (Warm Off-Whites & High-Contrast Neutrals) --- */
    --bg-body: #F7F5F0;            /* Main page background (warm off-white) */
    --bg-section-alt: #EAE6DC;     /* Alternating section background (stone off-white) */
    --bg-surface: #FFFFFF;         /* Card & content box background */
    --bg-surface-muted: #F2EFE7;   /* Subtle interior box background */
    --bg-code-section: #161920;    /* Dark anchor block at bottom of content pages */

    /* --- High-Contrast Structural Zones (Stay dark in Light Mode so they POP) --- */
    --bg-utility: #0D0F12;         /* Very top utility strip */
    --bg-header: #15181E;          /* Main sticky navigation bar */
    --bg-hero: #11141A;            /* Homepage hero background */
    --bg-topic-banner: #181C24;    /* Compact title banner on content pages */
    --bg-footer: #101318;          /* Site footer background */

    /* --- Typography Colors (Light Mode) --- */
    --text-primary: #14171C;
    --text-secondary: #374151;
    --text-muted: #5B6472;
    --text-on-dark: #F7F5F0;
    --text-on-dark-muted: #B8C0CC;

    /* --- Borders & Drop Shadows --- */
    --border-subtle: #D8D3C6;
    --border-strong: #B8B1A1;
    --shadow-card: 0 4px 16px rgba(17, 20, 26, 0.07), 0 1px 3px rgba(17, 20, 26, 0.06);
    --shadow-elevated: 0 14px 34px rgba(17, 20, 26, 0.14);

    /* --- Font Families --- */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-display: 'Space Grotesk', 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

/* ==========================================================================
   Dark Mode Theme Overrides (Applied when <html data-theme="dark"> is active)
   ========================================================================== */
[data-theme="dark"] {
    --brand-orange: #F97316;
    --brand-orange-hover: #EA580C;
    --brand-orange-bright: #FB923C;
    --brand-orange-tint: rgba(249, 115, 22, 0.15);
    --brand-orange-border: rgba(249, 115, 22, 0.45);

    --brand-blue: #38BDF8;
    --brand-blue-hover: #0284C7;
    --brand-blue-bright: #60A5FA;
    --brand-blue-tint: rgba(56, 189, 248, 0.12);
    --brand-blue-border: rgba(56, 189, 248, 0.38);

    --bg-body: #111318;
    --bg-section-alt: #181B22;
    --bg-surface: #1D212A;
    --bg-surface-muted: #242934;
    --bg-code-section: #0C0E12;

    --bg-utility: #08090C;
    --bg-header: #0E1015;
    --bg-hero: #0B0D12;
    --bg-topic-banner: #151922;
    --bg-footer: #090B0E;

    --text-primary: #F5F3EE;
    --text-secondary: #D5D2C8;
    --text-muted: #9CA3B0;
    --text-on-dark: #F7F5F0;
    --text-on-dark-muted: #B8C0CC;

    --border-subtle: #2B313E;
    --border-strong: #3E4759;
    --shadow-card: 0 6px 20px rgba(0, 0, 0, 0.35);
    --shadow-elevated: 0 18px 40px rgba(0, 0, 0, 0.55);
}

/* ==========================================================================
   HTML Reset & Base Element Defaults
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.2s ease, color 0.2s ease;
    padding-bottom: 0;
}

@media (max-width: 768px) {
    body {
        padding-bottom: 64px; /* Leaves room for the fixed mobile click-to-call bar */
    }
}

a {
    color: var(--brand-blue);
    text-decoration: none;
    transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

a:hover {
    color: var(--brand-orange);
}

ul {
    list-style: none;
}

img, svg {
    display: inline-block;
    vertical-align: middle;
}

/* Standard centered page width container (1280px max) */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ==========================================================================
   Shared Buttons (.btn)
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0.7rem 1.25rem;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.12s ease, background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn:active {
    transform: translateY(1px);
}

/* Header Phone CTA Button */
.btn--call-header {
    background-color: var(--brand-orange);
    color: #FFFFFF !important;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    padding: 0.52rem 1rem;
    box-shadow: 0 2px 10px rgba(234, 88, 12, 0.35);
}

.btn--call-header:hover {
    background-color: var(--brand-orange-hover);
    color: #FFFFFF !important;
}

/* Primary Orange Action Button */
.btn--primary {
    background-color: var(--brand-orange);
    color: #FFFFFF !important;
    box-shadow: 0 4px 14px rgba(234, 88, 12, 0.35);
}

.btn--primary:hover {
    background-color: var(--brand-orange-hover);
    color: #FFFFFF !important;
}

/* Secondary Blue-Bordered Button on Dark Sections */
.btn--secondary-dark {
    background-color: rgba(29, 78, 216, 0.25);
    color: #F7F5F0 !important;
    border-color: #3B82F6;
}

.btn--secondary-dark:hover {
    background-color: #1D4ED8;
    color: #FFFFFF !important;
}

/* Outlined Button inside Sidebar CTA Card */
.btn--outline-sidebar {
    background-color: transparent;
    color: var(--text-primary) !important;
    border-color: var(--border-strong);
    margin-top: 0.6rem;
}

.btn--outline-sidebar:hover {
    border-color: var(--brand-blue);
    color: var(--brand-blue) !important;
}

.btn--lg {
    padding: 0.9rem 1.6rem;
    font-size: 1.02rem;
}

.btn--full {
    width: 100%;
}
