*, *::before, *::after { box-sizing: border-box; }

html {
    background: #f5f5f5;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
}
body {
    background: #fff;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.06);
    color: #212529;
    font-family: Lato, Roboto, Helvetica, Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    margin: 0 auto;
    max-width: 1000px;
    padding: clamp(1rem, 4vw, 2rem) clamp(1rem, 4vw, 2rem) clamp(2.5rem, 6vw, 4rem);
    overflow-wrap: anywhere;
    word-wrap: break-word;
    hyphens: auto;
}
a, ul, li, button, input[type="button"], input[type="submit"] {
    transition: all 0.6s ease-in-out;
}
h1, h2, h3, h4, h5, h6 {
    color: #222;
    font-weight: 600;
    line-height: 1.3;
}
h1 { text-align: center; font-size: clamp(1.6rem, 5vw + 0.5rem, 2.25rem); }
h2 { margin-top: 1em; font-size: clamp(1.3rem, 3.5vw + 0.5rem, 1.75rem); }
h3 { padding: 0.5em 0 0; font-size: clamp(1.15rem, 2.5vw + 0.5rem, 1.5rem); }
#h3-new {
    font-size: clamp(1.15rem, 2.5vw + 0.5rem, 1.5rem);
    color: #222;
    font-weight: 600;
    line-height: 1.3;
    margin-top: 0;
}
a {
    text-decoration: none;
    border-bottom: 1px solid #38A1DA;
    color: #38A1DA;
}
a:hover, a:focus-visible {
    border-color: #E64116;
    color: #E64116;
}
a[href^="mailto:"] { border-bottom-color: transparent; }
a[href^="mailto:"]:hover { border-color: #E64116; }
b, strong { font-weight: 600; }
samp { display: none; }
p, h3 {
    margin-block-start: 0.75em;
    margin-block-end: 0.75em;
}

/* Medien */
img, video, iframe, svg {
    max-width: 100%;
}
img {
    animation: colorize 2s cubic-bezier(0, 0, .78, .36) 1;
    background: transparent;
    border: 10px solid rgba(0, 0, 0, 0.12);
    border-radius: 4px;
    display: block;
    margin: 1.3em auto;
    max-width: 100%;
    height: auto;
}
@keyframes colorize {
    0%   { filter: grayscale(100%); }
    100% { filter: grayscale(0%); }
}

/* Tabellen und Code dürfen nicht die Seite verbreitern */
table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
pre, code { white-space: pre-wrap; overflow-wrap: anywhere; }
pre { max-width: 100%; overflow-x: auto; }

#rahmen {
    border: 1px solid #aaa;
    margin: 0.5em;
    padding: 0 1em;
    background-color: #f9f9f9;
}

.d-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}
.d-flex > * { min-width: 0; flex: 1 1 280px; }

.toc, .toc ul, .toc li, .toc ul li {
    list-style: outside none none !important;
    padding: 0;
}
.toc {
    background: #f9f9f9;
    border: 1px solid #aaa;
    font-size: 95%;
    margin-bottom: 1em;
    padding: 20px;
    display: block;
}
.toc li { padding: 5px 20px !important; }

/* Tablet */
@media (max-width: 768px) {
    body { box-shadow: none; }
}

/* Smartphone */
@media (max-width: 600px) {
    html { background: #fff; }
    body { font-size: 1rem; line-height: 1.6; }
    .d-flex { flex-direction: column; }
    .d-flex > * { flex: 1 1 auto; width: 100%; }
    .toc { padding: 0.75rem; }
    .toc li { padding: 0.5rem 0.25rem !important; }   /* größere Tippfläche */
    #rahmen { margin-inline: 0; padding-inline: 0.75rem; }
    img { border-width: 4px; margin: 1em auto; }
    button, input[type="button"], input[type="submit"] {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Bewegung reduzieren */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { animation: none !important; transition: none !important; }
}