/* ============================================================
   base.css — Reset, typography, global utility classes
   ============================================================ */

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

html {
    font-size: var(--font-size-base);
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

a {
    color: var(--burgundy);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--burgundy-light);
}

img,
svg {
    display: block;
    max-width: 100%;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

/* ── Utilities ───────────────────────────────────────────── */

.text-sm {
    font-size: var(--font-size-sm);
}

.text-xs {
    font-size: var(--font-size-xs);
}

.text-lg {
    font-size: var(--font-size-lg);
}

.text-muted {
    color: var(--text-secondary);
}

.text-burg {
    color: var(--burgundy);
}

.text-forest {
    color: var(--forest);
}

.font-medium {
    font-weight: 500;
}

.font-semi {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.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;
}

/* ── Scrollbars ──────────────────────────────────────────── */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-light);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray);
}

/* ── Focus ring ──────────────────────────────────────────── */
:focus-visible {
    outline: 2px solid var(--burgundy);
    outline-offset: 2px;
}

/* ── Loading spinner ─────────────────────────────────────── */

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--burgundy);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Empty / error states ────────────────────────────────── */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state svg {
    margin: 0 auto 16px;
    opacity: 0.35;
}

.empty-state h3 {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    margin-bottom: 8px;
}