/* =========================================================
   Grundlegende Dokumentregeln
   ========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background-color: var(--color-background);
    color: var(--color-text);
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-base);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body,
button,
input,
select,
textarea {
    font-family: var(--font-family-base);
}

/* =========================================================
   Überschriften
   ========================================================= */

h1,
h2,
h3,
h4,
h5,
h6 {
    margin-top: 0;
    margin-bottom: var(--space-4);
    color: var(--color-text);
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-heading);
    text-wrap: balance;
}

h1 {
    font-size: clamp(2rem, 4vw, 3.5rem);
}

h2 {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
}

h3 {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
}

h4 {
    font-size: clamp(1.25rem, 2vw, 1.5rem);
}

h5 {
    font-size: 1.125rem;
}

h6 {
    font-size: 1rem;
}

/* =========================================================
   Fließtext
   ========================================================= */

p {
    margin-top: 0;
    margin-bottom: var(--space-4);
}

p:last-child {
    margin-bottom: 0;
}

strong,
b {
    font-weight: var(--font-weight-bold);
}

small {
    font-size: var(--font-size-small);
}

/* =========================================================
   Links
   ========================================================= */

a {
    color: var(--color-primary);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
    transition:
        color var(--transition-fast),
        text-decoration-color var(--transition-fast);
}

a:hover,
a:focus-visible {
    color: var(--color-primary-soft);
}

a:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 3px;
}

/* =========================================================
   Listen
   ========================================================= */

ul,
ol {
    margin-top: 0;
    margin-bottom: var(--space-4);
    padding-left: 1.5rem;
}

li + li {
    margin-top: var(--space-2);
}

/* =========================================================
   Medien
   ========================================================= */

img,
svg,
video,
canvas,
iframe {
    max-width: 100%;
}

img,
svg,
video {
    height: auto;
}

img {
    display: block;
}

/* =========================================================
   Formularelemente
   ========================================================= */

button,
input,
select,
textarea {
    font-size: 1rem;
}

input,
select,
textarea {
    max-width: 100%;
}

textarea {
    resize: vertical;
}

/* =========================================================
   Markierungen und Trennlinien
   ========================================================= */

::selection {
    background-color: var(--color-accent);
    color: var(--color-text);
}

hr {
    margin: var(--space-6) 0;
    border: 0;
    border-top: 1px solid var(--color-border);
}

/* =========================================================
   Barrierefreiheit
   ========================================================= */

.screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.screen-reader-text:focus {
    position: fixed !important;
    top: var(--space-4);
    left: var(--space-4);
    z-index: 100000;
    width: auto;
    height: auto;
    padding: var(--space-3) var(--space-4);
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    background-color: var(--color-surface);
    color: var(--color-text);
    box-shadow: var(--shadow-medium);
}