/* ==========================================================================
   QuantaBible base styles — reset, body, typography, global utilities.
   Requires tokens.css to be loaded first.
   ========================================================================== */

/* ===== RESET & BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 100%; }
body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--line-height-normal);
    color: var(--text-primary);
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    transition: background-color 0.2s ease, color 0.2s ease;
}
:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}
/* Interactive elements get a consistent token-based focus ring */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
    box-shadow: var(--focus-ring);
}
/* Never leave keyboard users stranded by outline:none without a replacement */
:focus:not(:focus-visible) { outline: none; }

/* ===== TYPOGRAPHY ===== */
h1 { font-family: var(--font-heading); font-size: var(--text-3xl); line-height: var(--line-height-tight); color: var(--text-heading); }
h2 { font-family: var(--font-heading); font-size: var(--text-2xl); line-height: var(--line-height-tight); color: var(--text-heading); }
h3 { font-size: var(--text-xl); font-weight: 600; color: var(--text-heading); }
a { color: var(--color-accent); }

/* ===== LUCIDE ICONS ===== */
.lucide { width: 20px; height: 20px; stroke-width: 1.75; flex-shrink: 0; }
.lucide-sm { width: 16px; height: 16px; }
.lucide-lg { width: 24px; height: 24px; }
.lucide-xl { width: 48px; height: 48px; }

/* ===== CONTAINER ===== */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 var(--space-4);
}

/* ===== READING CONTENT ===== */
.reading-content { max-width: 42rem; margin: 0 auto; line-height: var(--line-height-relaxed); }

/* Screen-reader-only utility — visible to AT, invisible on screen */
.sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Respect the OS "reduce motion" preference everywhere.
   Individual components may still opt-in to essential motion. */
@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;
    }
}
