/*
   Design refresh layer — loads after styles.css and overrides it.
   Principles (from the Claude Code Course / Vault design notes):
   - one token system: color, type scale, spacing, elevation ladder
   - readable first: 18px body, ~68ch lines, large touch targets (older, mobile-heavy readers)
   - no "AI slop" tells: no frosted glass, no purple gradients, restrained motion with a job
   Keep new rules here instead of growing styles.css.
*/

/* ===== TOKENS ===== */
:root {
    /* Warm, trustworthy palette: deep navy + parchment + muted gold */
    --primary-blue: #1d3a6e;
    --primary-blue-dark: #142a52;
    --primary-blue-light: #2b5296;
    --gold-accent: #b8862b;
    --gold-light: #f6ecd6;
    --burgundy: #8c2333;
    --light-gray: #f7f3ec;
    --dark-gray: #1f2430;
    --medium-gray: #5a6070;

    --theme-primary-blue: var(--primary-blue);
    --theme-primary-blue-dark: var(--primary-blue-dark);
    --theme-primary-blue-light: var(--primary-blue-light);
    --theme-gold-accent: var(--gold-accent);
    --theme-gold-light: var(--gold-light);
    --theme-burgundy: var(--burgundy);
    --theme-surface: var(--light-gray);
    --theme-text: var(--dark-gray);
    --theme-text-secondary: var(--medium-gray);

    /* Fluid type scale (~1.25 steps; display ≈ 1.6× h3) */
    --step-0: 1.125rem;                                   /* body 18px */
    --step-1: 1.35rem;                                    /* h3 */
    --step-2: clamp(1.6rem, 1.35rem + 1.1vw, 2.2rem);     /* h2 */
    --step-3: clamp(2rem, 1.55rem + 2vw, 3rem);           /* h1 */
    --measure: 68ch;

    /* Elevation ladder */
    --elev-1: 0 1px 2px rgba(20, 24, 40, 0.06), 0 1px 3px rgba(20, 24, 40, 0.08);
    --elev-2: 0 4px 10px rgba(20, 24, 40, 0.08), 0 2px 4px rgba(20, 24, 40, 0.05);
    --elev-3: 0 14px 30px rgba(20, 24, 40, 0.12), 0 4px 8px rgba(20, 24, 40, 0.06);

    --radius-card: 14px;
    --focus-ring: 0 0 0 3px rgba(184, 134, 43, 0.55);
}

/* Dark theme: fix off-brand purple/pink accents */
.dark-theme {
    --dark-primary-blue: #8fb3f0;
    --dark-primary-blue-dark: #6d97e0;
    --dark-primary-blue-light: #b3cbf5;
    --dark-gold-accent: #e2b65c;
    --dark-gold-light: #3a2f1a;
    --dark-burgundy: #f08a98;
    --dark-burgundy-light: #4a1f27;
    --theme-surface: #15181f;
    --theme-background: #0f1116;
    --theme-text-on-primary: #0f1116;
}

/* ===== BASE TYPE ===== */
body {
    font-size: var(--step-0);
    line-height: 1.7;
}

h1, h2, h3 {
    letter-spacing: -0.01em;
    text-wrap: balance;
}

h1 { font-size: var(--step-3); line-height: 1.12; }
h2 { font-size: var(--step-2); line-height: 1.2; }
h3 { font-size: var(--step-1); line-height: 1.3; }

p { text-wrap: pretty; }

.container.narrow,
.narrow {
    max-width: 760px;
}

.narrow p,
.post-content p,
.faq-answer p {
    max-width: var(--measure);
}

/* ===== ACCESSIBILITY ===== */
:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
    border-radius: 4px;
}

.sr-only,
.ilgb-hp {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ===== HEADER — solid, no frosted glass ===== */
.header {
    background-color: var(--theme-background);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: 1px solid var(--theme-border);
    box-shadow: none;
}

.main-nav a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

/* Keep the logo and menu labels on one line */
.logo a,
.main-nav a,
.theme-toggle-btn {
    white-space: nowrap;
}

/* styles.css squeezes the desktop menu into 300px between 769–1024px, which wraps
   every label. Use the slide-out (hamburger) menu up to 1180px instead, and give the
   full menu its natural width above that. */
@media (min-width: 1181px) {
    .main-nav {
        width: auto;
    }

    .main-nav ul {
        gap: 1rem;
    }

    .header .container {
        gap: 2rem;
    }
}

@media (max-width: 1180px) {
    .mobile-nav-toggle {
        display: flex;
    }

    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: min(320px, 85vw);
        height: 100vh;
        overflow-y: auto;
        background-color: var(--theme-background);
        padding: var(--spacing-lg) var(--spacing-md);
        transition: right var(--transition-medium);
        box-shadow: -5px 0 15px var(--theme-shadow-color);
        z-index: 1000;
        border-left: 1px solid var(--theme-border);
    }

    .main-nav.active {
        right: 0;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 0;
        margin-top: var(--spacing-lg);
    }

    .main-nav li {
        margin: 0;
        border-bottom: 1px solid var(--theme-border);
    }

    .main-nav a {
        display: flex;
        width: 100%;
        padding: var(--spacing-xs) var(--spacing-sm);
        color: var(--theme-text);
    }

    .main-nav a:hover {
        background-color: var(--theme-surface);
        color: var(--theme-primary-blue);
    }

    .main-nav i {
        margin-right: var(--spacing-xs);
        width: 20px;
    }

    .theme-toggle-nav {
        border-left: none;
        padding-left: 0;
        margin-left: 0;
        margin-top: var(--spacing-sm);
        padding-top: var(--spacing-sm);
    }

    .theme-toggle-btn {
        width: 100%;
        justify-content: flex-start;
        padding: var(--spacing-xs) var(--spacing-sm);
    }
}

/* ===== BUTTONS — 48px touch targets, tactile press ===== */
.btn {
    min-height: 48px;
    padding: 0.8rem 1.6rem;
    border-radius: 999px;
    font-size: 1.05rem;
    letter-spacing: 0.01em;
    transition: transform 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: var(--theme-primary-blue);
    box-shadow: var(--elev-1);
}

.btn-primary:hover {
    box-shadow: var(--elev-2);
}

.btn[disabled] {
    opacity: 0.7;
    cursor: progress;
}

/* Hero: one strong CTA in warm gold so it stands out on navy */
.seo-hero {
    background-color: var(--primary-blue);
}

.seo-hero .btn-primary {
    background-color: var(--gold-accent);
    color: #1b1406;
}

.seo-hero .btn-primary:hover {
    background-color: #caa04a;
    color: #1b1406;
}

/* ===== BREADCRUMBS — same color as the header text (white on navy) ===== */
.pillar-breadcrumb,
.pillar-breadcrumb a,
.pillar-breadcrumb span {
    color: var(--theme-text-on-primary);
}

.pillar-breadcrumb {
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.pillar-breadcrumb a {
    text-decoration: underline;
    text-underline-offset: 3px;
    opacity: 0.9;
}

.pillar-breadcrumb a:hover {
    color: var(--theme-text-on-primary);
    opacity: 1;
}

/* ===== LEAD MAGNET — deep wine instead of bright red; all text high-contrast ===== */
.lead-magnet {
    background-color: #5e1a2c;
    color: #ffffff;
}

.lead-magnet h2,
.lead-magnet h3,
.lead-magnet p,
.lead-magnet label,
.lead-magnet a:not(.btn) {
    color: #ffffff;
}

.lead-magnet .form-privacy p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
}

.lead-magnet .btn-primary {
    background-color: var(--gold-accent);
    color: #1b1406;
}

.lead-magnet .btn-primary:hover {
    background-color: #caa04a;
    color: #1b1406;
}

/* ===== CARDS — one elevation ladder ===== */
.topic-card,
.testimonial-card,
.pillar-card,
.professional-item,
.faq-item {
    border-radius: var(--radius-card);
    box-shadow: var(--elev-1);
    transition: transform 200ms ease, box-shadow 200ms ease;
}

.topic-card:hover,
.pillar-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--elev-3);
}

/* ===== FORMS ===== */
input[type="text"],
input[type="email"],
select,
textarea {
    font-size: 1.05rem;          /* ≥16px stops iOS zoom-on-focus */
    min-height: 48px;
}

input[aria-invalid="true"] {
    border-color: var(--burgundy) !important;
}

.form-notice {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    max-width: min(92vw, 560px);
    padding: 1rem 1.4rem;
    border-radius: 12px;
    box-shadow: var(--elev-3);
    font-weight: 600;
    color: #fff;
    transition: opacity 400ms ease, transform 400ms ease;
}

.form-notice-success { background: #1f6b4a; }
.form-notice-error   { background: var(--burgundy); }

.form-notice.is-hidden {
    opacity: 0;
    transform: translate(-50%, -12px);
    pointer-events: none;
}

/* ===== NEW PAGE COMPONENTS ===== */
.resource-list {
    list-style: disc;
    padding-left: 1.4rem;
    margin: 1rem 0 1.5rem;
}

ol.resource-list { list-style: decimal; }

.resource-list li {
    margin-bottom: 0.75rem;
}

.resource-list a {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.resources-urgent {
    border-top: 4px solid var(--gold-accent);
    background: var(--theme-gold-light);
}

.media-kit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.media-kit-grid img {
    border-radius: var(--radius-card);
    box-shadow: var(--elev-2);
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
}

.media-kit-grid figcaption {
    margin-top: 0.6rem;
    font-weight: 600;
}

.copy-btn.is-copied::after {
    content: " ✓";
}

/* Hub page cards (Compact Keywords "Standard Hub Page Layout") */
.hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.hub-card {
    background: var(--theme-background);
    border: 1px solid var(--theme-border);
    border-top: 4px solid var(--gold-accent);
    border-radius: var(--radius-card);
    padding: 1.5rem 1.75rem;
    box-shadow: var(--elev-1);
}

.hub-card h2 {
    font-size: var(--step-1);
    margin-bottom: 0.75rem;
}

.hub-card ul {
    list-style: none;
}

.hub-card li + li {
    margin-top: 0.5rem;
}

.hub-card a {
    font-weight: 600;
}

/* ===== MOTION — every movement has a job; none for reduced-motion users ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {
    section {
        padding: 3rem 0;
    }

    .container {
        padding: 0 1rem;
    }

    .btn {
        width: 100%;
        max-width: 420px;
    }

    .seo-hero h1 {
        font-size: var(--step-3);
    }
}
