/* ==========================================================================
   BC Theme — CSS base
   Consome tokens de design-system/tokens/design-tokens.css.
   Zero hardcoded colors/spacing/radius — sempre var(--token).
   ========================================================================== */

/* Reset básico */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    background: var(--bg-base);
    color: var(--text-primary);
    line-height: var(--leading-normal);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Transition only on theme toggle (added via JS), not on page load — avoids CLS. */
}

.site-main {
    overflow-x: clip;
}

img, svg, video, iframe {
    max-width: 100%;
    height: auto;
}

/* Prevent long tokens (URLs, code, unbroken words) from forcing horizontal scroll */
p, li, td, dd, dt, blockquote, figcaption, h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* Links default */
a {
    color: var(--text-link);
    text-decoration: none;
    transition: color var(--duration-fast);
}
a:hover {
    color: var(--accent-primary);
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: var(--fw-extrabold);
    letter-spacing: var(--tracking-tight);
    line-height: var(--leading-tight);
    color: var(--text-primary);
}

/* Container utility */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.container-prose {
    max-width: var(--container-prose);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

/* Screen reader only */
.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;
}

/* Focus visible */
:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Reduced 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;
    }
}

/* Button reset */
button {
    font-family: inherit;
    cursor: pointer;
}

/* Form elements inherit font */
input, textarea, select, button {
    font-family: inherit;
    color: inherit;
}

/* Selection highlight */
::selection {
    background: var(--accent-primary);
    color: var(--navy-950);
}
