/* ========================================
   eIMSS Public Website — Global Styles
   SAMRC · UNISA Partnership
   ======================================== */

/* Design tokens */
:root {
    --navy: #1a3a4a;
    --navy-dark: #0f2a36;
    --teal: #1a5568;
    --teal-light: #2a7a8a;
    --rust: #c45a3c;
    --rust-light: #e06a4a;
    --sand: #f5f0e8;
    --sand-light: #faf8f4;
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --max-width: 1200px;
    --header-height: 70px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    color: var(--gray-800);
    line-height: 1.6;
    background: var(--white);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--teal-light); }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }

/* ===== UTILITY BAR (top thin bar) ===== */
.utility-bar {
    background: var(--navy-dark);
    color: rgba(255,255,255,0.7);
    font-size: 0.75rem;
    padding: 0.4rem 0;
}
.utility-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.utility-bar a {
    color: rgba(255,255,255,0.7);
    margin-left: 1.25rem;
    font-size: 0.75rem;
}
.utility-bar a:hover { color: #fff; }

/* ===== MAIN NAVIGATION ===== */
.main-nav {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
}
.main-nav .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}
.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--navy);
}
.nav-logo-icon {
    width: 40px;
    height: 40px;
    background: var(--teal);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    font-weight: 800;
}
.nav-logo-text h1 { font-size: 1.15rem; font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; }
.nav-logo-text span { font-size: 0.7rem; color: var(--gray-500); display: block; line-height: 1.2; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
}
.nav-links a {
    padding: 0.5rem 0.85rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-600);
    border-radius: 6px;
    transition: all 0.15s;
}
.nav-links a:hover { color: var(--navy); background: var(--gray-50); }
.nav-links a.active { color: var(--teal); font-weight: 600; }

.nav-cta {
    background: var(--teal) !important;
    color: white !important;
    padding: 0.55rem 1.25rem !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    transition: background 0.2s !important;
}
.nav-cta:hover { background: var(--navy) !important; }

.nav-search {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-500);
    font-size: 1.1rem;
    padding: 0.4rem;
    border-radius: 50%;
    transition: background 0.15s;
}
.nav-search:hover { background: var(--gray-100); }

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--gray-700);
    font-size: 1.5rem;
}

/* ===== HERO SECTION ===== */
.hero {
    background: linear-gradient(135deg, #0a1628 0%, #122a3a 50%, #163040 100%);
    color: white;
    padding: 4rem 0 3rem;
    position: relative;
    overflow: hidden;
}
.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}
.hero-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--rust-light);
    font-weight: 600;
    margin-bottom: 1rem;
}
.hero h2 {
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 1.25rem;
}
.hero p {
    font-size: 1.05rem;
    line-height: 1.65;
    opacity: 0.9;
    margin-bottom: 2rem;
    max-width: 520px;
}
.hero-btns { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 2rem; }
.hero-logos { display: flex; align-items: center; gap: 0.75rem; opacity: 0.8; font-size: 0.8rem; }
.hero-logos span { padding: 0.3rem 0.75rem; background: rgba(255,255,255,0.15); border-radius: 4px; font-weight: 500; font-size: 0.75rem; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.btn-primary { background: var(--white); color: var(--navy); }
.btn-primary:hover { background: var(--sand); color: var(--navy); }
.btn-outline { background: transparent; color: white; border: 1.5px solid rgba(255,255,255,0.4); }
.btn-outline:hover { border-color: white; color: white; background: rgba(255,255,255,0.1); }
.btn-teal { background: var(--teal); color: white; }
.btn-teal:hover { background: var(--navy); color: white; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.8rem; }

/* Hero map */
.hero-map {
    position: relative;
    background: rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 1rem;
    min-height: 320px;
}
.hero-map-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
}
.hero-map-label .live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.4; } }
.hero-map-counter {
    position: absolute;
    bottom: 1.5rem;
    left: 1.5rem;
    background: rgba(255,255,255,0.95);
    color: var(--navy);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
}
.hero-map-counter strong { font-size: 1.5rem; font-weight: 800; }
.hero-map-counter span { font-size: 0.8rem; color: var(--gray-500); }

/* ===== STATS BAR ===== */
.stats-bar {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 1.875rem 0;
}
.stats-bar .container {
    display: flex;
    align-items: center;
    gap: 3rem;
}
.stat-item h3 {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--navy);
    line-height: 1;
    letter-spacing: -0.02em;
}
.stat-item p { font-size: 0.95rem; color: var(--gray-500); margin-top: 0.25rem; }
.stat-refresh {
    margin-left: auto;
    text-align: right;
    font-size: 1.05rem;
    color: var(--gray-600);
}
.stat-refresh p { font-size: 0.9rem; color: var(--gray-400); }

/* ===== AUDIENCE CARDS ===== */
.section { padding: 4rem 0; }
.section-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--rust);
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.section-title {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--gray-900);
    margin-bottom: 2rem;
    max-width: 500px;
}

.audience-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }
.audience-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 1.5rem;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.audience-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.06); border-color: var(--gray-300); }
.audience-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}
.audience-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--gray-900); }
.audience-card p { font-size: 0.85rem; color: var(--gray-500); line-height: 1.5; margin-bottom: 1rem; }
.audience-card a { font-size: 0.85rem; font-weight: 600; color: var(--teal); }

/* ===== DASHBOARD PREVIEW ===== */
.dashboard-preview {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 2.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: center;
}
.dashboard-preview-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--rust);
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.dashboard-preview h3 {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.15;
    color: var(--gray-900);
    margin-bottom: 0.75rem;
}
.dashboard-preview p { font-size: 0.9rem; color: var(--gray-500); line-height: 1.6; margin-bottom: 1.5rem; }
.top-causes-table { width: 100%; }
.top-causes-table th {
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-200);
}
.top-causes-table td { padding: 0.6rem 0; font-size: 0.9rem; color: var(--gray-700); }
.top-causes-table .bar-cell { width: 40%; }
.cause-bar {
    height: 8px;
    border-radius: 4px;
    background: var(--teal);
    transition: width 0.5s ease;
}
.top-causes-table .pct { font-size: 0.8rem; color: var(--gray-400); text-align: right; }
.top-causes-label { font-size: 0.7rem; color: var(--gray-400); margin-top: 0.25rem; }

/* ===== REPORTS SECTION ===== */
.reports-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.report-card {
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}
.report-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.06); }
.report-card-header {
    padding: 1.25rem 1.25rem 0.75rem;
    color: white;
}
.report-card-header p {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.8;
    margin-bottom: 0.25rem;
}
.report-card-header h4 { font-size: 2.5rem; font-weight: 800; }
.report-card-body { padding: 1rem 1.25rem 1.25rem; }
.report-card-body h5 { font-size: 0.9rem; font-weight: 600; margin-bottom: 0.35rem; color: var(--gray-800); }
.report-card-body p { font-size: 0.8rem; color: var(--gray-500); }
.report-card-body a { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; font-weight: 600; color: var(--rust); margin-top: 0.75rem; }

/* ===== PUBLICATIONS & EVENTS ===== */
.two-col-split { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.pub-list {}
.pub-item { padding: 1rem 0; border-bottom: 1px solid var(--gray-100); }
.pub-item-category {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.pub-item h4 { font-size: 0.95rem; font-weight: 600; color: var(--gray-800); margin-bottom: 0.2rem; }
.pub-item p { font-size: 0.8rem; color: var(--gray-500); }
.filter-pills { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filter-pill {
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.8rem;
    border: 1px solid var(--gray-300);
    background: white;
    cursor: pointer;
    color: var(--gray-600);
    transition: all 0.15s;
}
.filter-pill.active { background: var(--navy); color: white; border-color: var(--navy); }

.event-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--gray-100);
}
.event-date-box {
    min-width: 52px;
    height: 52px;
    background: var(--teal);
    color: white;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}
.event-date-box .day { font-size: 1.1rem; line-height: 1; }
.event-date-box .month { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.05em; }
.event-item-category {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    color: var(--teal);
}
.event-item h4 { font-size: 0.95rem; font-weight: 600; color: var(--gray-800); margin-bottom: 0.15rem; }
.event-item p { font-size: 0.8rem; color: var(--gray-500); }

/* ===== ABOUT / PARTNERSHIP ===== */
.about-section {
    padding: 4rem 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}
.about-links { display: flex; flex-direction: column; gap: 0; }
.about-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.1rem 1.25rem;
    border: 1px solid var(--gray-200);
    border-bottom: none;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--gray-700);
    transition: background 0.15s;
}
.about-link:first-child { border-radius: 8px 8px 0 0; }
.about-link:last-child { border-bottom: 1px solid var(--gray-200); border-radius: 0 0 8px 8px; }
.about-link:hover { background: var(--gray-50); }
.about-link .arrow { color: var(--gray-400); }

/* ===== FOOTER ===== */
.site-footer {
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    padding: 3rem 0 1.5rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2.5rem;
}
.footer-brand h3 { font-size: 1.1rem; font-weight: 700; color: var(--navy); margin-bottom: 0.5rem; }
.footer-brand p { font-size: 0.85rem; color: var(--gray-500); line-height: 1.5; margin-bottom: 1.25rem; }
.footer-support {
    background: var(--gray-100);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    color: var(--gray-600);
    line-height: 1.5;
}
.footer-col h4 { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gray-700); margin-bottom: 0.75rem; }
.footer-col a { display: block; font-size: 0.85rem; color: var(--gray-500); padding: 0.25rem 0; }
.footer-col a:hover { color: var(--teal); }
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
    font-size: 0.8rem;
    color: var(--gray-500);
}
.footer-bottom-links a { margin-left: 1.5rem; color: var(--gray-500); }
.footer-bottom-links a:hover { color: var(--teal); }

/* ===== PAGE HEADER (inner pages) ===== */
.page-header {
    padding: 2.5rem 0 2rem;
    border-bottom: 1px solid var(--gray-200);
}
.page-header .breadcrumb {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-bottom: 0.75rem;
}
.page-header .breadcrumb a { color: var(--gray-500); }
.page-header h1 {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}
.page-header p { font-size: 1rem; color: var(--gray-500); max-width: 600px; line-height: 1.6; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .hero .container { grid-template-columns: 1fr; }
    .hero-map { display: none; }
    .audience-grid { grid-template-columns: repeat(2, 1fr); }
    .reports-grid { grid-template-columns: repeat(2, 1fr); }
    .two-col-split { grid-template-columns: 1fr; }
    .about-section { grid-template-columns: 1fr; }
    .dashboard-preview { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .utility-bar { display: none; }
    .nav-links { display: none; }
    .mobile-toggle { display: block; }
    .hero h2 { font-size: 2rem; }
    .hero { padding: 2.5rem 0 2rem; }
    .stats-bar .container { flex-wrap: wrap; gap: 1.5rem; }
    .audience-grid { grid-template-columns: 1fr; }
    .reports-grid { grid-template-columns: 1fr; }
    .section-title { font-size: 1.5rem; }
    .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; gap: 0.75rem; text-align: center; }
    .footer-bottom-links a { margin-left: 0; margin-right: 1rem; }
}