/* =====================================================================
 * base.css — global element styles (html, body, headings, links, text).
 * No hex literals.
 * ===================================================================== */

html {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: var(--fs-base);
    font-weight: var(--fw-regular);
    line-height: var(--lh-relaxed);
    background-color: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
}

/* Belt-and-braces against horizontal page scroll. The mobile navbar
 * bug (fixed in Phase 5) was caused by a flex row overflowing the
 * viewport; with no overflow-x rule, that overflow turned into page-
 * level horizontal scroll and pushed the hamburger off-screen. This
 * rule catches any future regression of the same class. Vertical
 * scroll is untouched. */
html, body { overflow-x: hidden; }

/* Headings ----------------------------------------------------------- */
h1 { font-size: clamp(2rem,    5vw,   var(--fs-3xl)); font-weight: var(--fw-bold); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.75rem, 4vw,   var(--fs-2xl)); font-weight: var(--fw-bold); letter-spacing: -0.015em; }
h3 { font-size: var(--fs-xl); font-weight: var(--fw-semibold); }
h4 { font-size: var(--fs-lg); font-weight: var(--fw-semibold); }
h5 { font-size: var(--fs-md); font-weight: var(--fw-semibold); }
h6 { font-size: var(--fs-base); font-weight: var(--fw-semibold); text-transform: uppercase; letter-spacing: 0.05em; }

p {
    margin-bottom: var(--space-4);
    max-width: 70ch;
}

p:last-child { margin-bottom: 0; }

small { font-size: var(--fs-sm); color: var(--color-text-muted); }

/* Links ------------------------------------------------------------- */
a {
    color: var(--color-link);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

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

/* Lists when used inside prose blocks --------------------------------- */
.prose ul, .prose ol {
    margin: 0 0 var(--space-4) var(--space-5);
}

.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }

.prose li + li { margin-top: var(--space-1); }

/* Strong / em --------------------------------------------------------- */
strong, b { font-weight: var(--fw-semibold); }
em, i { font-style: italic; }

/* Selection ----------------------------------------------------------- */
::selection {
    background: var(--color-accent);
    color: var(--color-text-inverse);
}

/* Arabic / Quranic class — used ONLY on snippet elements that carry
 * Arabic text (hadith, founder quote). Never global. */
.arabic-quote {
    font-family: var(--font-arabic);
    font-weight: var(--fw-regular);
    font-size: clamp(1.5rem, 3vw, 2rem);
    line-height: 1.8;
    direction: rtl;
    text-align: right;
}

/* Brand wordmark (no logo asset in v1; PROJECT_SPEC §10.8). */
.wordmark {
    font-family: var(--font-sans);
    font-weight: var(--fw-bold);
    letter-spacing: -0.01em;
    color: var(--color-primary);
}

/* SVG defaults ------------------------------------------------------- */
svg { color: inherit; flex-shrink: 0; }
