/* ============================================================
   MD3 2026 FOUNDATION - Shared Shell Styles
   File: /2/include/css/md3_foundation.css
   Created: 2026-04-10 by Claude
   Purpose: Shared CSS for all MD3 pages (header, nav, footer,
            reset, variables, responsive shell)
   
   Page-specific styles stay in each page's inline <style> block.
   ============================================================ */

/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
    --bg-body: #ffffff;
    --bg-header: #136bbe;
    --bg-nav: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-chip: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-nav: #475569;
    --text-link: #136bbe;
    --text-on-primary: #ffffff;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --border-subtle: #e2e8f0;
    --border-radius: 16px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    --max-width: 1020px;
    --transition: 0.2s ease;
    --primary: #136bbe;
    --primary-hover: #0d4a8a;
    --primary-dark: #0d4a8a;
}

/* Dark mode */
[data-theme="dark"] {
    --bg-body: #0f172a;
    --bg-header: #0d4a8a;
    --bg-nav: #1e293b;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --bg-chip: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-nav: #cbd5e1;
    --text-link: #60a5fa;
    --text-on-primary: #ffffff;
    --border-color: #334155;
    --border-light: #334155;
    --border-subtle: #334155;
    --primary: #60a5fa;
    --primary-hover: #93c5fd;
    --primary-dark: #3b82f6;
}

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ============================================================
   BASE
   ============================================================ */
html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition);
}

a:hover {
    color: var(--text-link);
}

/* Focus styles for accessibility (WCAG 2.1 AA) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--text-link);
    outline-offset: 2px;
}

a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
    outline: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* ============================================================
   EMPLOYER TOP BANNER
   ============================================================ */
.employer-banner {
    background: #1e293b;
    color: #94a3b8;
    text-align: center;
    padding: 6px 16px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.employer-banner a {
    color: #ffffff;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.employer-banner a:hover {
    color: #60a5fa;
}

[data-theme="dark"] .employer-banner {
    background: #0f172a;
    border-bottom: 1px solid #334155;
}

/* Skip Link (Accessibility) */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--bg-header);
    color: var(--text-on-primary);
    padding: 8px 16px;
    z-index: 10000;
    text-decoration: none;
    font-weight: 600;
    border-radius: 0 0 4px 0;
}
.skip-link:focus {
    top: 0;
}

/* ============================================================
   HEADER
   ============================================================ */
.md3-header {
    background: var(--bg-header);
    position: sticky;
    top: 0;
    z-index: 100;
}

.md3-header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.md3-logo {
    display: flex;
    align-items: center;
}

.md3-logo img {
    height: 64px;
    width: auto;
}

.md3-logo-text {
    color: var(--text-on-primary);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.md3-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Header Search */
.md3-header-search {
    display: flex;
    align-items: center;
}

.md3-header-search form {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 24px;
    padding: 6px 16px;
    transition: all var(--transition);
}

.md3-header-search form:focus-within {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.4);
}

.md3-header-search input {
    border: none;
    background: transparent;
    padding: 4px 8px;
    font-size: 14px;
    color: var(--text-on-primary);
    width: 180px;
    outline: none;
}

.md3-header-search input::placeholder {
    color: rgba(255,255,255,0.7);
}

.md3-header-search button {
    background: transparent;
    border: none;
    padding: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    color: rgba(255,255,255,0.8);
    transition: color var(--transition);
}

.md3-header-search button:hover {
    color: var(--text-on-primary);
}

/* Theme Toggle Button */
.md3-theme-toggle {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    color: var(--text-on-primary);
}

.md3-theme-toggle:hover {
    background: rgba(255,255,255,0.25);
}

.md3-theme-toggle svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.md3-theme-toggle .icon-dark { display: block; }
.md3-theme-toggle .icon-light { display: none; }

[data-theme="dark"] .md3-theme-toggle .icon-dark { display: none; }
[data-theme="dark"] .md3-theme-toggle .icon-light { display: block; }

/* Login pill (CTA - only pill in header) */
.md3-header-login {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.15);
    color: var(--text-on-primary);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid rgba(255,255,255,0.2);
    transition: all var(--transition);
}

.md3-header-login:hover {
    background: rgba(255,255,255,0.25);
}

.md3-header-login svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Logout text link (subtle, not a pill) */
.md3-header-logout {
    display: flex;
    align-items: center;
    gap: 5px;
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    font-weight: 400;
    padding: 6px 8px;
    transition: color var(--transition);
}

.md3-header-logout:hover {
    color: rgba(255,255,255,1);
}

.md3-header-logout svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.md3-menu-toggle {
    display: none;
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 8px;
    width: 44px;
    height: 44px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.md3-menu-toggle svg {
    width: 24px;
    height: 24px;
    fill: var(--text-on-primary);
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.md3-nav {
    background: var(--bg-nav);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.md3-nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

.md3-nav-list {
    display: flex;
    align-items: center;
    list-style: none;
    height: 48px;
    gap: 0;
}

.md3-nav-list li a {
    display: flex;
    align-items: center;
    height: 48px;
    padding: 0 16px;
    color: var(--text-nav);
    font-size: 14px;
    font-weight: 500;
    position: relative;
    transition: color var(--transition), background var(--transition);
}

.md3-nav-list li a:hover {
    color: var(--text-link);
    background: var(--bg-card-hover);
}

.md3-nav-list li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 16px;
    right: 16px;
    height: 3px;
    background: var(--text-link);
    border-radius: 3px 3px 0 0;
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

.md3-nav-list li a:hover::after {
    transform: scaleX(1);
}

.md3-nav-list li a.active {
    color: var(--text-link);
}

.md3-nav-list li a.active::after {
    transform: scaleX(1);
}

/* Job Alerts nav link */
.md3-nav-list li a.nav-job-alerts {
    color: var(--primary);
}
.md3-nav-list li a.nav-job-alerts:hover {
    color: var(--primary-hover);
}

/* Member Center - pushed to right end of nav */
.md3-nav-list li.nav-member-center {
    margin-left: auto;
}
.md3-nav-list li.nav-member-center a {
    color: var(--primary);
    font-weight: 600;
}
.md3-nav-list li.nav-member-center a:hover {
    color: var(--primary-hover);
}

/* Nav Dropdown */
.md3-nav-list li.has-dropdown {
    position: relative;
}
.md3-nav-list li.has-dropdown > a {
    display: flex;
    align-items: center;
    gap: 4px;
}
.md3-nav-list li.has-dropdown > a svg.dropdown-arrow {
    transition: transform 0.2s ease;
}
.md3-nav-list li.has-dropdown:hover > a svg.dropdown-arrow {
    transform: rotate(180deg);
}
.nav-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 180px;
    background: var(--bg-card);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-subtle);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 1000;
    padding: 8px 0;
}
.md3-nav-list li.has-dropdown:hover .nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.nav-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 400;
    transition: background 0.15s, color 0.15s;
}
.nav-dropdown a:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}
.nav-dropdown a svg {
    width: 18px;
    height: 18px;
    opacity: 0.7;
}
.nav-dropdown a:hover svg {
    opacity: 1;
}

/* Mobile Nav */
.md3-nav-close {
    display: none;
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--bg-chip);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.md3-nav-close svg {
    width: 24px;
    height: 24px;
    fill: var(--text-secondary);
}

/* Mobile-only elements - hidden on desktop */
.md3-nav-mobile-search,
.md3-nav-mobile-account {
    display: none;
}

.md3-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.md3-nav-overlay.open {
    display: block;
}

/* ============================================================
   MAIN CONTENT CONTAINER
   ============================================================ */
.md3-main {
    flex: 1;
    width: 100%;
}

.md3-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 16px 20px 40px;
    margin-bottom: 24px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.md3-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.md3-footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 40px 20px 24px;
}

.md3-footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr) auto;
    gap: 32px;
    margin-bottom: 32px;
}

.md3-footer-section h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-link);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-color);
}

.md3-footer-section a {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    transition: color var(--transition);
}

.md3-footer-section a:hover {
    color: var(--text-link);
}

.md3-footer-security {
    text-align: right;
}

.md3-footer-security img {
    max-height: 50px;
    margin-bottom: 8px;
}

.md3-footer-security p {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.md3-footer-bottom {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.md3-footer-bottom img {
    width: 50px;
    height: auto;
    flex-shrink: 0;
}

.md3-footer-bottom .copyright {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.md3-footer-bottom .copyright strong {
    color: var(--text-primary);
}

/* ============================================================
   RESPONSIVE - Shell only (page-specific responsive stays inline)
   ============================================================ */
@media (max-width: 768px) {
    /* Header */
    .md3-header-inner {
        height: 56px;
        padding: 0 16px;
    }
    
    .md3-logo img {
        height: 36px;
    }
    
    .md3-header-search {
        display: none;
    }
    
    .md3-menu-toggle {
        display: flex;
    }
    
    /* Mobile Nav - Slide from right */
    .md3-nav {
        position: fixed;
        top: 0;
        right: -300px;
        width: 280px;
        height: 100vh;
        background: var(--bg-nav);
        box-shadow: -4px 0 20px rgba(0,0,0,0.15);
        z-index: 1000;
        transition: right 0.3s ease;
        border-bottom: none;
        padding-top: 60px;
        overflow-y: auto;
    }
    
    .md3-nav.open {
        right: 0;
    }
    
    .md3-nav-close {
        display: flex;
    }
    
    .md3-nav-inner {
        padding: 0;
    }
    
    .md3-nav-list {
        flex-direction: column;
        height: auto;
        align-items: stretch;
    }
    
    .md3-nav-list li a {
        height: auto;
        padding: 16px 24px;
        border-bottom: 1px solid var(--border-color);
        font-size: 16px;
    }
    
    .md3-nav-list li a::after {
        display: none;
    }
    
    /* Mobile: show search in nav */
    .md3-nav-mobile-search {
        display: block;
        padding: 16px;
        border-bottom: 1px solid var(--border-color);
    }
    
    .md3-nav-mobile-search form {
        display: flex;
        background: var(--bg-card-hover);
        border: 1px solid var(--border-color);
        border-radius: 24px;
        padding: 8px 16px;
    }
    
    .md3-nav-mobile-search input {
        flex: 1;
        border: none;
        background: transparent;
        padding: 4px;
        font-size: 15px;
        color: var(--text-primary);
        outline: none;
    }
    
    .md3-nav-mobile-search button {
        background: transparent;
        border: none;
        padding: 4px;
        color: var(--text-secondary);
    }
    
    /* Mobile: Account section */
    .md3-nav-mobile-account {
        display: block;
        padding: 16px;
        background: var(--bg-card-hover);
    }
    
    .md3-nav-mobile-account a {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        background: var(--text-link);
        color: var(--text-on-primary);
        padding: 12px 20px;
        border-radius: 24px;
        font-weight: 600;
        margin-bottom: 8px;
    }
    
    .md3-nav-mobile-account a.secondary {
        background: transparent;
        color: var(--text-link);
        border: 1px solid var(--border-color);
    }
    
    .md3-nav-mobile-account a.postjob {
        background: #22c55e;
    }
    
    /* Content */
    .md3-container {
        padding: 20px 16px 32px;
    }
    
    /* Footer */
    .md3-footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
    
    .md3-footer-security {
        grid-column: span 2;
        text-align: center;
    }
    
    .md3-footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .md3-footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .md3-footer-security {
        grid-column: 1;
    }
}
