/* actuary.info - Base Stylesheet
   Shared across all pages: reset, variables, header, nav, footer, responsive */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #fafafa;
    --bg-card: #ffffff;
    --bg-dark: #1a1a2e;
    --text-primary: #1a1a2e;
    --text-secondary: #5a5a72;
    --text-muted: #8a8a9a;
    --border: #e8e8ec;
    --border-light: #f0f0f4;
    --accent-blue: #2563eb;
    --accent-green: #059669;
    --accent-cyan: #0891b2;
    --accent-ai: #0891b2;
    --accent-pc: #2563eb;
    --accent-health: #059669;
    --accent-life: #7c3aed;
    --accent-reinsurance: #dc2626;
    --accent-qfi: #0ea5e9;
    --accent-retirement: #ea580c;
    --accent-soa: #b45309;
    --accent-cas: #0d9488;
    --accent-aaa: #6366f1;
    --accent-ai-bg: rgba(8, 145, 178, 0.08);
    --accent-pc-bg: rgba(37, 99, 235, 0.08);
    --accent-health-bg: rgba(5, 150, 105, 0.08);
    --accent-life-bg: rgba(124, 58, 237, 0.08);
    --accent-reinsurance-bg: rgba(220, 38, 38, 0.08);
    --accent-qfi-bg: rgba(14, 165, 233, 0.08);
    --accent-retirement-bg: rgba(234, 88, 12, 0.08);
    --accent-soa-bg: rgba(180, 83, 9, 0.08);
    --accent-cas-bg: rgba(13, 148, 136, 0.08);
    --accent-aaa-bg: rgba(99, 102, 241, 0.08);
}

body {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

/* =========================================
   HEADER
   ========================================= */
header {
    background: var(--bg-dark);
    color: white;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    font-family: 'IBM Plex Serif', Georgia, serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
    text-decoration: none;
}

.logo span { color: #60a5fa; }

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: rgba(255,255,255,0.9);
    background: rgba(255,255,255,0.1);
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-subscribe {
    padding: 0.5rem 1rem;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn-subscribe:hover {
    background: #1d4ed8;
}

/* =========================================
   NAVIGATION
   ========================================= */
nav {
    display: flex;
    justify-content: center;
    background: rgba(0,0,0,0.15);
    border-top: 1px solid rgba(255,255,255,0.08);
}

nav a {
    padding: 0.4rem 1.5rem;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.15s ease;
}

nav a:hover { color: white; }

nav a.active {
    color: white;
    border-bottom-color: white;
}

/* =========================================
   PAGE HERO — Centered dark hero (compact)
   ========================================= */
.page-hero {
    background: linear-gradient(175deg, #1a1a2e 0%, #252a40 100%);
    text-align: center;
    padding: 2.5rem 2rem 2rem;
    position: relative;
    overflow: hidden;
}

/* Subtle radial glow */
.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(96, 165, 250, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

/* Faint grid texture */
.page-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
}

.page-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 640px;
    margin: 0 auto;
}

.page-hero-emoji {
    font-size: 2.25rem;
    margin-bottom: 0.75rem;
    display: block;
}

.page-hero h1 {
    font-family: 'IBM Plex Serif', Georgia, serif;
    font-size: 2.25rem;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: -0.01em;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.page-hero p {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.45);
    line-height: 1.5;
    max-width: 500px;
    margin: 0 auto;
}

.page-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1rem;
    padding: 0.4rem 1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
}

.page-hero-badge .badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 6px rgba(74, 222, 128, 0.4);
}

/* Hero metadata (for article pages like Become an Actuary) */
.page-hero-meta {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.3);
    margin-top: 0.5rem;
}

/* Filter pills inside the hero */
.page-hero-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.9rem;
}

.page-hero-filters .filter-pill {
    padding: 0.4rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.page-hero-filters .filter-pill:hover {
    border-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.page-hero-filters .filter-pill.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

/* Gradient fade from hero to content */
.page-hero-fade {
    height: 1.5rem;
    background: linear-gradient(to bottom, #252a40, var(--bg-primary));
}

@media (max-width: 768px) {
    .page-hero {
        padding: 1.25rem 1.5rem 1rem;
    }
    .page-hero h1 {
        font-size: 1.4rem;
    }
    .page-hero p {
        font-size: 0.8rem;
    }
}

/* =========================================
   HEADER SEARCH BAR + SEARCH PAGE
   ========================================= */
.header-search {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    overflow: hidden;
    transition: border-color 0.15s, background 0.15s;
}
.header-search:focus-within {
    border-color: rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.15);
}
.header-search input {
    border: none;
    outline: none;
    background: transparent;
    color: white;
    font-family: inherit;
    font-size: 0.82rem;
    padding: 0.4rem 0.65rem;
    width: 90px;
    transition: width 0.2s ease;
}
.header-search input::placeholder {
    color: rgba(255,255,255,0.45);
}
.header-search input:focus {
    width: 190px;
}
.header-search button {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.6);
    padding: 0.4rem 0.5rem;
    cursor: pointer;
    transition: color 0.15s;
}
.header-search button:hover {
    color: white;
}

/* Search page */
.search-page {
    min-height: 60vh;
    padding: 2rem;
}
.search-page-inner {
    max-width: 700px;
    margin: 0 auto;
}
.search-page h1 {
    font-family: 'IBM Plex Serif', Georgia, serif;
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 1rem;
}
.search-form {
    margin-bottom: 1.5rem;
}
.search-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.search-input-icon {
    flex-shrink: 0;
    color: var(--text-muted);
}
.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-primary);
    background: transparent;
}
.search-input::placeholder {
    color: var(--text-muted);
}
.search-submit {
    padding: 0.45rem 1.1rem;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.search-submit:hover {
    background: #1d4ed8;
}

/* Results */
.search-results {
    padding: 0;
}
.search-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}
.search-group {
    margin-bottom: 1.5rem;
}
.search-group-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 0.25rem;
}
.search-result-item {
    display: block;
    padding: 0.65rem 0.5rem;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: background 0.1s;
}
.search-result-item:hover {
    background: var(--bg-card);
}
.search-result-title {
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.35;
}
.search-result-title mark,
.search-result-desc mark {
    background: rgba(37, 99, 235, 0.15);
    color: inherit;
    border-radius: 2px;
    padding: 0 1px;
}
.search-result-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
    line-height: 1.45;
}
.search-result-meta {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.2rem;
    font-size: 0.72rem;
    color: var(--text-muted);
}
.search-empty,
.search-loading {
    padding: 2rem 1rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .search-page { padding: 1.25rem 1rem; }
    .search-page h1 { font-size: 1.35rem; }
}

/* =========================================
   FOOTER
   ========================================= */
footer {
    background: var(--bg-dark);
    color: rgba(255,255,255,0.7);
    padding: 3rem 2rem;
    margin-top: 2rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
}

.footer-brand .logo {
    display: inline-block;
    margin-bottom: 1rem;
}

.footer-brand p {
    font-size: 0.875rem;
    line-height: 1.6;
    max-width: 280px;
}

.footer-section h4 {
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 1rem;
}

.footer-section ul { list-style: none; }
.footer-section li { margin-bottom: 0.5rem; }

.footer-section a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.875rem;
}

.footer-section a:hover { color: white; }

.coming-soon {
    font-size: 0.6rem;
    background: rgba(255,255,255,0.15);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    margin-left: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.footer-bottom {
    max-width: 1400px;
    margin: 2rem auto 0;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 1024px) {
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        gap: 1rem;
    }
    .header-right {
        flex-direction: column;
        gap: 0.75rem;
    }
    nav {
        overflow-x: auto;
        justify-content: flex-start;
        padding: 0 1rem;
    }
    nav a {
        white-space: nowrap;
    }
    .footer-content {
        grid-template-columns: 1fr;
    }
    .footer-bottom {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}
