/* Reset and base typography. Values come from tokens.css. */
@layer reset {
    *,
    *::before,
    *::after {
        box-sizing: border-box;
    }

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

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

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

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

    @media (prefers-reduced-motion: reduce) {
        html {
            scroll-behavior: auto;
        }
    }

    body {
        position: relative;
        min-height: 100vh;
        background: var(--color-surface);
        color: var(--color-text);
        font-family: var(--font-body);
        font-size: var(--step-lead);
        line-height: var(--leading-text);
        overflow-wrap: break-word;
    }

    h1,
    .display {
        font-family: var(--font-display);
        font-size: var(--step-display);
        font-weight: 400;
        line-height: var(--leading-display);
        color: var(--color-heading);
    }

    h2,
    h3 {
        font-size: var(--step-lead);
        font-weight: 700;
        line-height: var(--leading-text);
        text-transform: uppercase;
        color: var(--color-brand);
    }

    h4, h5, h6 {
        font-size: inherit;
        font-weight: 700;
    }

    p + p,
    p + ul, ul + p,
    p + ol, ol + p {
        margin-block-start: 1lh;
    }

    a {
        color: var(--color-brand);
        text-decoration-thickness: 1px;
        text-underline-offset: 0.15em;
    }

    a:hover {
        color: var(--color-brand-dark);
    }

    :focus-visible {
        outline: var(--focus-ring);
        outline-offset: 3px;
    }

    strong, b {
        font-weight: 700;
    }

    ul {
        padding-inline-start: 1.25em;
    }

    li::marker {
        color: var(--color-brand);
    }

    main:focus {
        outline: none;
    }

    .skip-link {
        position: absolute;
        inset-block-start: var(--space-2xs);
        inset-inline-start: var(--space-2xs);
        z-index: 100;
        padding: var(--space-2xs) var(--space-s);
        background: var(--color-surface);
        color: var(--color-brand);
        font-weight: 700;
        border-radius: var(--radius-button);
        transform: translateY(-200%);
    }

    .skip-link:focus {
        transform: none;
    }

    .visually-hidden {
        position: absolute !important;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
        border: 0;
    }

    /* Short red rule under display headings */
    .rule::after {
        content: "";
        display: block;
        inline-size: var(--rule-width);
        block-size: var(--rule-height);
        margin-block-start: var(--space-s);
        background: currentColor;
        color: var(--color-brand);
    }

    /* Red pill button (CTA, "zum Artikel") */
    .button {
        display: inline-block;
        padding: 0.4em 1em;
        border-radius: var(--radius-button);
        background: var(--button-bg, var(--color-brand));
        color: var(--button-fg, var(--color-on-dark));
        font-size: var(--step-body);
        font-weight: 700;
        letter-spacing: var(--tracking-button);
        line-height: 1.5;
        text-transform: uppercase;
        text-decoration: none;
    }

    .button:hover {
        color: var(--button-fg, var(--color-on-dark));
        background: var(--button-bg-hover, var(--color-brand-dark));
    }
}
