/* EDsmart Data - Base Styles */
/* Master UI Design System - Light-first, data-first aesthetic */
/* Statista × Bloomberg Intelligence × modern government data portal */

:root {
    /* ========================================
       EDsmartData Color System
       ======================================== */
    
    /* Primary Brand Colors (light + Stitch-inspired accents) */
    --color-primary: #0A1C4A;            /* Primary brand color - dark navy */
    --color-aqua: #00B3C6;               /* Aqua accent color */
    --color-aqua-soft: #E6F7F9;          /* Soft aqua wash for hovers / key blocks */
    --color-link: #0A5F6D;               /* Teal links — ≥4.5:1 on white */
    --color-link-hover: #064A55;
    --border-accent: rgba(0, 179, 198, 0.45);
    --color-button: #D51C31;             /* Legacy CTA / negative accent */
    --color-white: #FFFFFF;
    --color-gray-text: #6B7885;
    
    /* Background Colors */
    --background-color: #F5F7FB;         /* Cool page tint */
    --background: var(--background-color);
    --surface: #FFFFFF;
    --surface-alt: #EEF2F8;              /* Muted panels, inputs */
    
    /* Text Colors */
    --text-color: #1A2332;               /* Primary body text */
    --text-primary: var(--text-color);
    --text-color-light: #4A5A6B;
    --text-secondary: var(--text-color-light);
    --text-meta: #5C6B7A;
    
    /* Banner Colors */
    --banner-background-color: #FF3500;  /* Primary banner background - red/orange */
    --banner-text-color: #FFFFFF;        /* Banner text - white */
    --secondary-banner-background-color: #FFD6F8; /* Secondary banner - pink */
    --secondary-banner-text-color: #FF3500; /* Secondary banner text - red/orange */
    
    /* Button Colors — primary actions use navy (see .btn-primary) */
    --button-color: #0A1C4A;
    --button-color-hover: #152A52;
    --button-color-active: #07142E;
    --button-color-disabled: #8A9AAD;
    --button-text-color: #FFFFFF;
    --button-success: #5A8F6F;
    --button-success-hover: #4C7B5A;
    
    /* Menu Colors */
    --menu-background: #fffefc;          /* Menu background */
    --menu-background-grey-light: #f9f9f9; /* Light gray menu background */
    --menu-background-grey-dark: #efefef; /* Dark gray menu background */
    --menu-background-highlight: #f8f5f1; /* Menu highlight background */
    --menu-border: #D8E0ED;
    --menu-text: #210803;                /* Menu text color */
    --menu-text-light: #4A5A6B;          /* Light menu text - darker bluish-gray (WCAG AA: 7.1:1 contrast) */
    --menu-grey-dark: #737373;           /* Dark gray for menu (WCAG AA compliant: 4.8:1 contrast) */
    
    /* Legacy/Compatibility Colors */
    --primary: var(--color-primary);     /* Legacy primary - maps to color-primary */
    --primary-hover: #07142E;            /* Darker primary for hover */
    --secondary: var(--color-aqua);      /* Legacy secondary - maps to aqua */
    --warning: #FFB020;                  /* Warning color - amber */
    --negative: var(--color-button);     /* Negative/error - maps to button red */
    
    /* Borders & Dividers */
    --border: #D8E0ED;
    --border-light: #E2E8F0;
    
    /* Switch/Toggle */
    --switch-color: #FF3500;             /* Switch/toggle color */
    
    /* Layout */
    --container-max-width: 1320px;       /* Wide max-width for data display */
    --spacing-unit: 8px;                 /* 8px spacing system */
    
    /* Typography */
    --font-body: 'Open Sans', sans-serif;
    --font-heading: 'Montserrat', sans-serif;
    --font-primary: var(--font-body);
}

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

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background);
    font-size: 17px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-variant-numeric: tabular-nums; /* Tabular numerals for all data */
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: calc(var(--spacing-unit) * 2);
    color: var(--text-color);
}

h1 {
    font-size: 2.75rem;                 /* Large, confident headlines */
    font-weight: 700;
    margin-bottom: calc(var(--spacing-unit) * 3);
}

h2 {
    font-size: 2rem;
    margin-top: calc(var(--spacing-unit) * 6);
    margin-bottom: calc(var(--spacing-unit) * 3);
    font-weight: 600;
}

h3 {
    font-size: 1.5rem;
    margin-top: calc(var(--spacing-unit) * 4);
    margin-bottom: calc(var(--spacing-unit) * 2);
    font-weight: 600;
}

h4 {
    font-size: 1.25rem;
    font-weight: 600;
}

p {
    margin-bottom: calc(var(--spacing-unit) * 2);
    line-height: 1.7;
}

/* Numbers - Always use tabular numerals */
.number, .metric, .stat {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

/* Links (static HTML; keep in sync with edsmart-data-theme/assets/css/base.css) */
a {
    color: var(--color-link);
    text-decoration: none;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

a:hover {
    color: var(--color-link-hover);
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

a:focus-visible {
    outline: 2px solid var(--color-aqua);
    outline-offset: 2px;
    border-radius: 2px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[role="button"]:focus-visible {
    outline: 2px solid var(--color-aqua);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Skip link for keyboard + screen reader users */
.skip-link {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--color-primary);
    color: #FFFFFF;
    z-index: 9999;
    transform: translateY(-200%);
    transition: transform 0.15s ease;
    text-decoration: none;
    font-weight: 700;
}

.skip-link:focus,
.skip-link:focus-visible {
    transform: translateY(0);
}

/* Visually hidden utility for accessible captions/labels */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Header & Navigation */
header {
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 0 0 rgba(0, 179, 198, 0.12);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 calc(var(--spacing-unit) * 3);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: calc(var(--spacing-unit) * 3) 0;
    gap: calc(var(--spacing-unit) * 3);
}

/* Logo styles are in logo.css */

a.logo:focus-visible {
    outline: 2px solid var(--color-aqua);
    outline-offset: 4px;
    border-radius: 4px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: calc(var(--spacing-unit) * 4);
    align-items: center;
    margin: 0;
    padding: 0;
}

.nav-menu a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: color 0.2s ease;
}

.nav-menu a:hover {
    color: var(--color-primary);
}

/* Search Bar in Header */
.header-search {
    flex: 1;
    max-width: 500px;
    margin: 0 calc(var(--spacing-unit) * 3);
}

.header-search input {
    width: 100%;
    padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 3);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    background-color: var(--surface-alt);
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: var(--font-body);
}

.header-search input:focus {
    outline: 2px solid var(--color-aqua);
    outline-offset: 2px;
    border-color: var(--color-aqua);
}

.header-search input::placeholder {
    color: var(--text-secondary);
}

/* Main Content Container */
main {
    background-color: var(--background);
    min-height: calc(100vh - 200px);
    padding: calc(var(--spacing-unit) * 6) 0;
    min-width: 0;
    max-width: 100%;
}

.container {
    max-width: var(--container-max-width);
    width: 100%;
    min-width: 0; /* flex/grid child: allow shrinking so inner scroll areas respect viewport */
    margin: 0 auto;
    padding: 0 calc(var(--spacing-unit) * 3);
    box-sizing: border-box;
}

/* Content Cards - White cards, thin border, no shadows */
.content-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: calc(var(--spacing-unit) * 4);
    margin-bottom: calc(var(--spacing-unit) * 3);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.content-card:hover {
    border-color: rgba(0, 179, 198, 0.4);
    box-shadow: 0 8px 24px rgba(10, 28, 74, 0.08);
}

article {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-top: 3px solid var(--color-primary);
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(10, 28, 74, 0.06);
    padding: calc(var(--spacing-unit) * 5);
    margin-bottom: calc(var(--spacing-unit) * 3);
    min-width: 0; /* lets wide children (e.g. scrollable tables) respect the article max-width */
}

/* Breadcrumbs */
.breadcrumbs {
    margin-bottom: calc(var(--spacing-unit) * 4);
    padding-bottom: calc(var(--spacing-unit) * 2);
}

.breadcrumbs ol {
    list-style: none;
    display: flex;
    gap: 0.5rem;
    font-size: 1rem;
}

.breadcrumbs li::after {
    content: '/';
    margin-left: 0.5rem;
    color: var(--text-secondary);
}

.breadcrumbs li:last-child::after {
    content: '';
}

.breadcrumbs a {
    color: var(--text-meta);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--color-link);
}

.breadcrumbs li[aria-current="page"] {
    color: var(--text-primary);
}

/* Buttons - Rectangular with soft rounding */
.btn-primary {
    display: inline-block;
    padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 4);
    background: linear-gradient(135deg, var(--color-primary) 0%, #152A52 100%);
    color: var(--button-text-color) !important;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    transition: filter 0.2s ease, background-color 0.2s ease;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
}

.btn-primary:hover {
    filter: brightness(1.08);
}

.btn-primary:active {
    filter: brightness(0.96);
}

.btn-primary:disabled {
    background: var(--button-color-disabled);
    filter: none;
    cursor: not-allowed;
    opacity: 0.85;
}

.btn-secondary {
    display: inline-block;
    padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 4);
    background-color: transparent;
    color: var(--color-link) !important;
    text-decoration: none;
    border: 2px solid var(--color-aqua);
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    font-family: var(--font-body);
}

.btn-secondary:hover {
    background-color: var(--color-aqua-soft);
    border-color: var(--color-aqua);
}

.btn-success {
    background-color: var(--button-success);
    color: var(--button-text-color);
}

.btn-success:hover {
    background-color: var(--button-success-hover);
}

/* Footer — static HTML pages only (plain <footer>). WP uses <footer class="wp-block-template-part">. */
footer:not(.wp-block-template-part) {
    background-color: var(--color-primary);
    color: rgba(255, 255, 255, 0.9);
    padding: calc(var(--spacing-unit) * 8) 0 calc(var(--spacing-unit) * 4);
    margin-top: calc(var(--spacing-unit) * 10);
}

.footer-content {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 calc(var(--spacing-unit) * 3);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: calc(var(--spacing-unit) * 6);
    margin-bottom: calc(var(--spacing-unit) * 6);
}

.footer-section h3 {
    color: white;
    margin-bottom: calc(var(--spacing-unit) * 3);
    font-size: 1.1rem;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    margin-bottom: calc(var(--spacing-unit) * 2);
    line-height: 1.6;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.footer-section a {
    color: #9CF0FF;
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.2s ease;
}

.footer-section a:hover {
    color: #FFFFFF;
}

.footer-bottom {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: calc(var(--spacing-unit) * 3) calc(var(--spacing-unit) * 3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

/* Section Spacing - Generous whitespace */
section {
    margin: calc(var(--spacing-unit) * 6) 0;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .header-search {
        max-width: 100%;
        margin: 0;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    .container {
        padding: 0 calc(var(--spacing-unit) * 2);
    }
    
    nav {
        padding: calc(var(--spacing-unit) * 2) 0;
    }
}
