/* =============================================================================
   chrome.css — ElectionChamp site header & footer, reused on the WordPress blog.

   CLASH STRATEGY
   --------------
   The main site's global.css is deliberately NOT loaded here (its global `*`,
   `body`, `h1`-`h6`, `a`, `img` resets would fight WordPress core/blocks/plugins).
   Instead, every header/footer rule below is scoped under `.ec-chrome`, and the
   reused markup is wrapped in `.ec-chrome--header` / `.ec-chrome--footer`.
   Result: these styles can neither leak into blog/WordPress content nor be
   overridden by it. Only `:root` (design tokens) is global — variables are inert
   and shared intentionally with blog.css.
   ============================================================================= */

/* --- Design tokens (shared, harmless globally) ------------------------------ */
:root {
    --primary: #2563EB;
    --primary-dark: #1E3A8A;
    --primary-light: #3B82F6;
    --primary-subtle: rgba(37, 99, 235, 0.08);
    --primary-subtle-border: rgba(37, 99, 235, 0.15);

    --text-primary: #334155;
    --text-secondary: #475569;
    --text-muted: #64748B;
    --text-white: #FFFFFF;

    --bg-white: #FFFFFF;
    --bg-light: #F8F9FC;
    --bg-accent: #EFF6FF;
    --bg-dark: #0F172A;
    --bg-dark-lighter: #1E293B;
    --header-bg: #FAF9F5;
    --footer-bg: #F8FAFC;

    --accent-green: #10B981;
    --accent-green-dark: #059669;
    --accent-blue: #3B82F6;
    --accent-orange: #F59E0B;
    --accent-amber: #F59E0B;
    --accent-red: #EF4444;
    --line-accent: #E2E8F0;

    --cta-primary: #2563EB;
    --cta-primary-hover: #1E3A8A;
    --cta-secondary: #334155;
    --cta-secondary-hover: #2D2D3D;

    --font-heading: 'General Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    --container-width: 1280px;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

/* --- Scoped reset & base (chrome only) -------------------------------------- */
.ec-chrome {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.66;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.ec-chrome *,
.ec-chrome *::before,
.ec-chrome *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
.ec-chrome img { max-width: 100%; height: auto; display: block; }
.ec-chrome a { color: var(--primary); text-decoration: none; }
.ec-chrome .container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}
.ec-chrome .ec-icon {
    width: 1em;
    height: 1em;
    display: inline-block;
    vertical-align: -0.125em;
    flex-shrink: 0;
    color: var(--primary);
}

/* --- Buttons (as used in the header) --------------------------------------- */
.ec-chrome .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 700;
    padding: 16px 32px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    text-transform: capitalize;
    letter-spacing: 0.01em;
    gap: 8px;
    line-height: 1;
}
.ec-chrome .btn-primary {
    background: var(--cta-primary);
    color: var(--text-white);
    border-color: var(--cta-primary);
}
.ec-chrome .btn-primary:hover {
    background: var(--cta-primary-hover);
    border-color: var(--cta-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.3);
}
.ec-chrome .btn-sm { padding: 12px 24px; font-size: 15px; }
.ec-chrome .btn svg { width: 18px; height: 18px; transition: transform 0.3s ease; }
.ec-chrome .btn:hover svg { transform: translateX(3px); }

/* --- Header / navigation --------------------------------------------------- */
.ec-chrome--header .site-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--line-accent);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.ec-chrome .header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    max-width: var(--container-width);
    margin: 0 auto;
}
.ec-chrome .logo img { height: 36px; width: auto; }
.ec-chrome .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 22px;
    color: #1F3A8A;
}
.ec-chrome .logo-icon { width: 28px; height: 28px; object-fit: contain; flex-shrink: 0; }
.ec-chrome .main-nav { display: flex; align-items: center; gap: 32px; }
.ec-chrome .main-nav a {
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: capitalize;
}
.ec-chrome .main-nav a:hover { color: var(--primary); }
.ec-chrome .header-actions { display: flex; align-items: center; gap: 12px; }
.ec-chrome .header-actions .btn-vote {
    background: var(--primary-subtle);
    color: var(--primary);
    border-color: var(--primary-subtle-border);
}
.ec-chrome .header-actions .btn-vote:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: translateY(-2px);
}
.ec-chrome .mobile-nav-actions { display: none; }
.ec-chrome .mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 8px;
    background: none;
    border: 1px solid var(--line-accent);
    border-radius: var(--radius-sm);
    cursor: pointer;
    z-index: 1010;
    transition: all 0.2s ease;
}
.ec-chrome .mobile-menu-toggle:hover { background: var(--bg-light); }
.ec-chrome .hamburger-line {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}
.ec-chrome .mobile-menu-toggle.active .hamburger-line:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.ec-chrome .mobile-menu-toggle.active .hamburger-line:nth-child(2) { opacity: 0; }
.ec-chrome .mobile-menu-toggle.active .hamburger-line:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }
.ec-chrome .mobile-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 990;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.ec-chrome .mobile-nav-overlay.active { display: block; opacity: 1; }

/* --- Footer ---------------------------------------------------------------- */
.ec-chrome--footer .site-footer {
    padding: 64px 0 32px;
    background: var(--footer-bg);
    border-top: 1px solid var(--line-accent);
}
.ec-chrome .footer-grid {
    display: grid;
    grid-template-columns: 1.6fr repeat(5, 1fr);
    gap: 36px;
    margin-bottom: 48px;
}
.ec-chrome .footer-brand p {
    font-size: 15px;
    line-height: 1.65;
    color: var(--text-muted);
    margin-top: 16px;
    max-width: 300px;
}
.ec-chrome .footer-brand .footer-email {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    font-size: 15px;
    font-weight: 600;
    color: var(--primary);
}
.ec-chrome .footer-col h5 {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-primary);
    margin-bottom: 20px;
}
.ec-chrome .footer-col ul { list-style: none; }
.ec-chrome .footer-col ul li { margin-bottom: 10px; }
.ec-chrome .footer-col ul li a { font-size: 15px; color: var(--text-muted); }
.ec-chrome .footer-col ul li a:hover { color: var(--primary); }
.ec-chrome .footer-bottom {
    padding-top: 32px;
    border-top: 1px solid var(--line-accent);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.ec-chrome .footer-bottom p { font-size: 14px; color: var(--text-muted); }
.ec-chrome .footer-bottom-links { display: flex; gap: 24px; }
.ec-chrome .footer-bottom-links a { font-size: 14px; color: var(--text-muted); }
.ec-chrome .footer-bottom-links a:hover { color: var(--primary); }

/* --- Keep the sticky header below the WordPress admin bar ------------------- */
.admin-bar .ec-chrome--header .site-header { top: 32px; }

/* --- Responsive ------------------------------------------------------------ */
@media (max-width: 1100px) {
    .ec-chrome .footer-grid { grid-template-columns: repeat(3, 1fr); gap: 32px; }
    .ec-chrome .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 782px) {
    .admin-bar .ec-chrome--header .site-header { top: 46px; }
}

@media (max-width: 768px) {
    .ec-chrome .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-white);
        border-bottom: 1px solid var(--line-accent);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
        flex-direction: column;
        padding: 8px 0;
        z-index: 1000;
    }
    .ec-chrome .main-nav.active { display: flex; }
    .ec-chrome .main-nav a { padding: 14px 24px; font-size: 16px; border-bottom: 1px solid var(--line-accent); }
    .ec-chrome .main-nav a:last-of-type { border-bottom: none; }
    .ec-chrome .main-nav a:hover { background: var(--bg-light); }
    .ec-chrome .mobile-nav-actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 16px 24px;
        border-top: 1px solid var(--line-accent);
    }
    .ec-chrome .mobile-nav-actions .btn { width: 100%; text-align: center; justify-content: center; }
    .ec-chrome .mobile-nav-actions .btn-primary { color: #fff; }
    .ec-chrome .mobile-nav-actions .btn-vote { color: var(--primary); }
    .ec-chrome .header-actions { display: none; }
    .ec-chrome .mobile-menu-toggle { display: flex; }
    .ec-chrome--header .site-header { position: relative; }
    .ec-chrome .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 32px; }
    .ec-chrome .footer-bottom { flex-direction: column; gap: 16px; text-align: center; }
}

@media (max-width: 480px) {
    .ec-chrome .footer-grid { grid-template-columns: 1fr; }
}
