/* backend/static/css/base/reset.css */

/* 1. Modern CSS Reset */
*, *::before, *::after {
    box-sizing: border-box;
}

body, h1, h2, h3, h4, p, figure, blockquote, dl, dd {
    margin: 0;
}

ul, ol {
    list-style: none;
    padding: 0;
}

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

input, button, textarea, select {
    font: inherit;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

/* Base height - but don't strictly lock overflow here, 
   that should be managed by layout components */
html, body {
    min-height: 100vh;
}

/* 2. Global Base Styles */
html {
    scroll-behavior: smooth;
    scrollbar-gutter: stable; /* Prevents layout "jumping" when scrollbar appears */
}

body {
    background-color: var(--color-background);
    color: var(--color-text);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    transition: background-color 0.2s, color 0.2s;
}

/* 3. Typography Defaults */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.25;
    margin-bottom: 0.6em;
    font-weight: 700;
    color: var(--color-text);
}

p {
    margin-bottom: 1rem;
    max-width: 65ch; /* Optimal width for reading comfort */
}

/* 4. Global Scrollbar Polish */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background-color: rgba(var(--color-text-rgb), 0.2);
    border-radius: 20px;
    border: 2px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background-color: rgba(var(--color-text-rgb), 0.4);
}

/* 5. Accessibility */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}