/*
 * Base styles (WWW-08): reset, typography and page layout. Every color, radius and spacing
 * comes from tokens.css and the active theme; no literals.
 */

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

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

body {
    margin: 0;
    min-height: 100vh;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.5;
}

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

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

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0 0 var(--space-3);
    font-weight: var(--font-weight-heading);
    line-height: 1.25;
}

h1 {
    font-size: 1.75rem;
}

h2 {
    font-size: 1.375rem;
}

h3 {
    font-size: 1.125rem;
}

p,
ul,
ol {
    margin: 0 0 var(--space-3);
}

a {
    color: var(--color-accent);
    text-underline-offset: 2px;
}

code,
kbd,
samp,
pre {
    font-family: var(--font-mono);
    font-size: 0.875em;
}

/* Metadata (versions, identifiers, dates) in monospace. */
.meta {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

hr {
    border: 0;
    border-top: var(--line) solid var(--color-border);
    margin: var(--space-5) 0;
}

:focus-visible {
    outline: var(--line) solid var(--color-accent);
    outline-offset: 2px;
}

/* FocusOnNavigate focuses h1 after navigation; no outline for that programmatic focus. */
h1:focus {
    outline: none;
}

/* Page layout: header 56 px, content up to 1100 px, footer. */
.page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.page-header {
    height: var(--header-height);
    flex-shrink: 0;
    background: var(--color-surface);
    border-bottom: var(--line) solid var(--color-border);
}

.page-content {
    flex: 1;
    width: 100%;
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: var(--space-6) var(--space-4);
}

.page-footer {
    flex-shrink: 0;
    background: var(--color-surface);
    border-top: var(--line) solid var(--color-border);
}

/* Inner row of header and footer aligned with the content column. */
.page-width {
    width: 100%;
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0 var(--space-4);
}
