/* ScanRaise — Design tokens and base styles */

:root {
    --accent: #2563eb;
    --accent-light: #eff6ff;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --border: #e5e7eb;
    --bg: #ffffff;
    --bg-muted: #f9fafb;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-primary);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Global nav */
.site-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px 24px;
    background: white;
    position: sticky;
    top: 0;
    z-index: 1000;
}
.site-nav-border {
    border-bottom: 1px solid var(--border);
    background: white;
    position: sticky;
    top: 0;
    z-index: 1000;
}
.site-nav .logo {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.3px;
}
.site-nav .logo span { color: var(--accent); }
.site-nav .logo:hover { text-decoration: none; }
.site-nav .nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
}
.site-nav .nav-links a {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
}
.site-nav .nav-links a:hover {
    color: var(--text-primary);
    text-decoration: none;
}
.site-nav .nav-cta {
    display: inline-block;
    padding: 8px 18px;
    background: var(--accent);
    color: white !important;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: opacity 0.15s;
}
.site-nav .nav-cta:hover { opacity: 0.9; }

/* Tablet */
@media (max-width: 768px) {
    .grid-2 { grid-template-columns: 1fr !important; }
    .stats { grid-template-columns: repeat(2, 1fr) !important; }
    table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .wrap { padding: 20px 16px 60px; }
    .head { flex-direction: column; gap: 12px; }
    .head h1 { font-size: 24px; }
}

/* Small desktop — full nav bar, hamburger hidden */
@media (min-width: 1024px) {
    .site-nav .nav-links a.hide-mobile { display: inline; }
    .nav-hamburger { display: none !important; }
    .nav-close { display: none !important; }
    .site-nav .nav-links {
        position: static !important;
        width: auto !important;
        height: auto !important;
        flex-direction: row !important;
        box-shadow: none !important;
        padding: 0 !important;
        background: transparent !important;
    }
}

/* Standard desktop */
@media (min-width: 1440px) {
    .wrap { max-width: 1200px; }
}

/* Large desktop (1080p) */
@media (min-width: 1920px) {
    .wrap { max-width: 1400px; }
}

/* Ultra-wide / 4K */
@media (min-width: 2560px) {
    .wrap { max-width: 1600px; }
}

/* Mobile */
@media (max-width: 500px) {
    .site-nav .nav-links { gap: 14px; }
    .stats { grid-template-columns: 1fr 1fr !important; gap: 8px; }
    .stat { padding: 14px; }
    .stat .value { font-size: 22px; }
    .section { padding: 16px; }
    .section h2 { font-size: 16px; }
    .filter-bar { flex-direction: column; }
    .filter-bar input, .filter-bar select, .filter-bar button { width: 100%; }
    .btn { padding: 10px 16px; font-size: 13px; }
    .group-card { flex-direction: column; align-items: flex-start; }
}

/* Small mobile */
@media (max-width: 375px) {
    .site-nav { padding: 12px 16px; }
    .site-nav .logo { font-size: 20px; }
    .site-nav .nav-cta { padding: 6px 14px; font-size: 13px; }
    .wrap { padding: 16px 12px 60px; }
    .stats { grid-template-columns: 1fr !important; }
}

/* Nav icon sizing */
.logo-icon { width: 29px; height: 29px; vertical-align: -6px; margin-right: 3px; }

/* Hamburger menu button — hidden on desktop, visible below 1024px */
.nav-hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--text-primary);
    line-height: 0;
}
.nav-hamburger svg { width: 24px; height: 24px; }

/* Close button inside mobile menu — hidden on desktop */
.nav-close {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--text-primary);
    line-height: 0;
    align-self: flex-end;
}
.nav-close svg { width: 24px; height: 24px; }

/* Mobile nav (< 1024px) */
@media (max-width: 1023px) {
    .nav-hamburger { display: block; }
    .nav-close { display: block; }

    .site-nav .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: white;
        flex-direction: column;
        align-items: flex-start;
        padding: 24px;
        gap: 0;
        box-shadow: -4px 0 24px rgba(0,0,0,0.12);
        transition: right 0.25s ease;
        z-index: 10001;
        overflow-y: auto;
    }
    .site-nav .nav-links.nav-open {
        right: 0;
    }
    .site-nav .nav-links a.hide-mobile {
        display: block;
        width: 100%;
        padding: 14px 0;
        border-bottom: 1px solid var(--border);
        font-size: 16px;
    }
    .site-nav .nav-links .nav-cta {
        margin-top: 16px;
        text-align: center;
        width: 100%;
        padding: 12px 18px;
    }
}

/* Backdrop overlay when mobile menu is open */
.site-nav .nav-links.nav-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.4);
    z-index: -1;
}

/* ── Accessibility styles (moved from a11y.css so every page that loads
   scanraise.css gets them — the old a11y.css was only linked from 4 of 45
   pages, causing the skip-to-content link to render visibly unstyled and
   focus indicators to be missing on subpages). ───────────────────────── */

.sr-skip-link {
    position: absolute;
    top: -100px;
    left: 16px;
    background: #2563eb;
    color: #fff;
    padding: 12px 24px;
    border-radius: 0 0 8px 8px;
    font-weight: 700;
    font-size: 14px;
    z-index: 100000;
    text-decoration: none;
    transition: top 0.15s ease;
}
.sr-skip-link:focus {
    top: 0;
    outline: 3px solid #f59e0b;
    outline-offset: 2px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@media (forced-colors: active) {
    .nav-cta, .btn, button {
        border: 2px solid ButtonText;
    }
}
