/* ============================================================
   INHALTSVERZEICHNIS
   ============================================================
   1.  Schriftarten lokal laden
   2.  Grundeinstellungen
   3.  Typografie
   4.  Layout: einspaltig zentriert
   5.  Sticky Header
   6.  Hero-Bereich
   7.  Hauptinhalt
   8.  Listen
   9.  Code
   10. Tabelle
   11. Horizontale Linie
   12. Bild + Bildunterschrift
   13. Details / Summary
   14. Inline-Elemente
   15. Blockquote
   16. Autorenbox
   17. Footer
   18. Scroll-Animationen
   19. Responsive Design
   ============================================================ */


/* === 1. Schriftarten lokal laden === */

@font-face {
    font-family: 'Poppins';
    src: url('fonts/Poppins-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Poppins';
    src: url('fonts/Poppins-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

/* === 2. Grundeinstellungen === */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
}

/* === 3. Typografie ===
   Alle font-size Werte in em, damit sie relativ zur body-Groesse sind.
   Aendert man body font-size, skalieren alle Ueberschriften automatisch mit. */

body {
    font-family: 'Poppins', Arial, Helvetica, sans-serif;
    font-weight: 400;
    font-size: 20px;
    line-height: 1.6;
    margin: 0;
    letter-spacing: 0;
    color: #444;
}

h1 {
    font-weight: 500;
    font-size: 2.488em;
    line-height: 1.25;
    margin: 0 0 1.6rem;
    letter-spacing: -0.02em;
    color: #1a1a1a;
}

h2 {
    font-weight: 500;
    font-size: 2.074em;
    line-height: 1.25;
    margin: 2.8rem 0 1.4rem;
    letter-spacing: -0.015em;
    color: #1a1a1a;
}

h3 {
    font-weight: 500;
    font-size: 1.728em;
    line-height: 1.25;
    margin: 2.4rem 0 1.2rem;
    letter-spacing: -0.01em;
    color: #1a1a1a;
}

h4 {
    font-weight: 500;
    font-size: 1.44em;
    line-height: 1.2;
    margin: 2.1rem 0 1rem;
    letter-spacing: -0.005em;
    color: #1a1a1a;
}

h5 {
    font-weight: 500;
    font-size: 1.2em;
    line-height: 1.2;
    margin: 1.6rem 0 1rem;
    letter-spacing: 0;
    color: #1a1a1a;
}

h6 {
    font-weight: 500;
    font-size: 1.2em;
    line-height: 1.2;
    margin: 1.4rem 0 1rem;
    letter-spacing: 0;
    color: #1a1a1a;
}

small {
    font-weight: 400;
    font-size: 0.833em;
    line-height: 1.5;
    letter-spacing: 0;
}

.x-small {
    font-weight: 400;
    font-size: 0.694em;
    line-height: 1.4;
    letter-spacing: 0;
}

.display-large-size {
    font-weight: 500;
    font-size: 2.985em;
    line-height: 1.15;
    letter-spacing: 0.025em;
}

.display-x-large-size {
    font-weight: 500;
    font-size: 3.582em;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

/* === 4. Layout: einspaltig zentriert === */

main {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* === 5. Sticky Header === */

.header-wrap {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: #fff;
    border-bottom: 1px solid #e5e5e5;
}

header {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    padding: 1rem 1.5rem;
}

header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Domainname oben links */
.site-name {
    font-weight: 500;
    font-size: 1.4em;
    text-decoration: none;
    color: #1a1a1a;
}

.site-name:hover,
.site-name:active {
    color: #ff2b05;
}

/* Button oben rechts */
.btn-cta {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    font-size: 0.9em;
    font-weight: 500;
    text-decoration: none;
    border-radius: 10px;
    background-color: #000;
    color: #fff;
    transition: background-color 0.2s, color 0.2s;
}

.btn-cta:hover {
    background-color: #ff2b05;
    color: #fff;
}

/* === 6. Hero-Bereich === */

.hero {
    background-color: #f4f4f4;
    padding: 6rem 1.5rem;
    text-align: center;
}

.hero-inner {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.hero h1 {
    font-size: 3.2em;
    letter-spacing: -0.03em;
}

.hero-subtitle {
    font-size: 1.15em;
    color: #666;
    line-height: 1.5;
}

/* === 7. Hauptinhalt === */

main {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

main p {
    margin-bottom: 1.2rem;
}

main a {
    color: #ff2b05;
    text-decoration: none;
    padding: 1px 4px 4px 4px;
    margin-left: -4px;
    margin-right: -4px;
}

main a:hover,
main a:active {
    background-color: #ff2b05;
    color: #fff;
}

/* === 8. Listen === */

main ul,
main ol {
    margin: 1.2rem 0;
    padding-left: 1.5em;
}

main li {
    margin-bottom: 0.4rem;
    line-height: 1.6;
}

main li ul,
main li ol {
    margin-top: 0.4rem;
    margin-bottom: 0;
}

/* Definitionsliste */
main dl {
    margin: 1.2rem 0;
}

main dt {
    font-weight: 500;
    color: #1a1a1a;
    margin-top: 1rem;
}

main dd {
    margin-left: 1.5em;
    margin-bottom: 0.5rem;
}

/* === 9. Code === */

code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85em;
    background-color: #f4f4f4;
    padding: 0.15em 0.4em;
    border-radius: 4px;
}

pre {
    background-color: #1a1a1a;
    color: #e5e5e5;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
    line-height: 1.5;
}

pre code {
    background: none;
    padding: 0;
    font-size: 0.85em;
    color: inherit;
}

/* === 10. Tabelle === */

/* Wrapper fuer horizontales Scrollen auf schmalen Bildschirmen */
.table-wrap {
    overflow-x: auto;
    margin: 1.5rem 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

th, td {
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e5e5;
}

th {
    font-weight: 500;
    color: #1a1a1a;
    background-color: #f4f4f4;
}

/* === 11. Horizontale Linie === */

hr {
    border: none;
    border-top: 2px solid #e5e5e5;
    margin: 2rem 0;
}

/* === 12. Bild + Bildunterschrift === */

figure {
    margin: 2rem 0;
}

figcaption {
    font-size: 0.833em;
    color: #999;
    margin-top: 0.5rem;
}

/* === 13. Details / Summary === */

details {
    margin: 1.5rem 0;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 1rem 1.5rem;
}

summary {
    font-weight: 500;
    color: #1a1a1a;
    cursor: pointer;
}

details:hover {
    border-color: #ff2b05;
}

details[open] summary {
    margin-bottom: 0.75rem;
}

/* === 14. Inline-Elemente === */

mark {
    background-color: #fff3cd;
    padding: 0.1em 0.3em;
}

kbd {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85em;
    background-color: #f4f4f4;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 0.15em 0.4em;
}

/* === 15. Blockquote === */

/* Default: Rote Linie links */
blockquote {
    border-left: 5px solid #ff2b05;
    padding: 1.5rem 2rem;
    margin: 2rem 0;
    font-size: 1.3em;
    font-weight: 500;
    line-height: 1.4;
    color: #1a1a1a;
    background-color: #f4f4f4;
}

/* Alternative: Roter Hintergrund */
blockquote.bq-highlight {
    border-left: none;
    background-color: #ff2b05;
    color: #fff;
    padding: 2rem 2.5rem;
    border-radius: 8px;
}

/* Alternative: Grosses Anfuehrungszeichen */
blockquote.bq-quote {
    border-left: none;
    background-color: transparent;
    position: relative;
    padding: 2rem 2rem 2rem 4.5rem;
    border-top: 3px solid #ff2b05;
    border-bottom: 3px solid #ff2b05;
}

blockquote.bq-quote::before {
    content: "\201E";
    position: absolute;
    left: 0;
    top: 0.2em;
    font-size: 3.5em;
    line-height: 1;
    color: #ff2b05;
    font-weight: 500;
}

/* === 16. Autorenbox === */

.author-box {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    margin-top: 3rem;
    padding: 2rem;
    background-color: #f4f4f4;
    border-radius: 8px;
}

.author-photo {
    width: 100px;
    height: 100px;
    min-width: 100px;
    border-radius: 50%;
    object-fit: cover;
}

.author-info p {
    margin-bottom: 0.5rem;
}

.author-name {
    font-weight: 500;
    font-size: 1.1em;
    color: #1a1a1a;
}

/* === 17. Footer === */

footer {
    max-width: none;
    background-color: #f4f4f4;
    border-top: none;
    margin-top: 3rem;
    padding: 1.2rem 1.5rem;
}

.footer-inner {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

footer nav {
    margin-bottom: 0;
}

footer nav a {
    margin-right: 1.5rem;
    text-decoration: none;
    color: #1a1a1a;
    font-size: 0.9em;
}

footer nav a:last-child {
    margin-right: 0;
}

footer nav a:hover {
    color: #ff2b05;
}

footer p {
    color: #666;
}

/* === 18. Scroll-Animationen === */

/* Elemente starten nur unsichtbar, wenn body.has-animations gesetzt ist.
   Das Script setzt diese Klasse – Seiten ohne Script (Impressum, Datenschutz)
   bleiben davon unberuehrt und zeigen den Inhalt sofort. */
body.has-animations main > article > *,
body.has-animations .hero h1,
body.has-animations .hero .hero-subtitle {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* Sichtbar-Klasse: wird per IntersectionObserver hinzugefuegt */
body.has-animations main > article > .visible,
body.has-animations .hero h1.visible,
body.has-animations .hero .hero-subtitle.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Hero-Subtitle fadet etwas verzoegert ein (Staffelung) */
body.has-animations .hero .hero-subtitle.visible {
    transition-delay: 0.2s;
}

/* Barrierefreiheit: Keine Animationen, wenn der Nutzer das im System deaktiviert hat */
@media (prefers-reduced-motion: reduce) {
    body.has-animations main > article > *,
    body.has-animations .hero h1,
    body.has-animations .hero .hero-subtitle {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* === 19. Responsive Design === */

/* Tablet: 601px – 768px */
@media (max-width: 768px) {
    body {
        font-size: 18px;
    }

    .hero {
        padding: 4rem 1.5rem;
    }

    .hero h1 {
        font-size: 2.6em;
    }

    blockquote {
        padding: 1.2rem 1.5rem;
        font-size: 1.15em;
    }

    blockquote.bq-highlight {
        padding: 1.5rem 2rem;
    }

    blockquote.bq-quote {
        padding: 1.5rem 1.5rem 1.5rem 3.5rem;
    }

    blockquote.bq-quote::before {
        font-size: 2.8em;
    }
}

/* Smartphone: bis 600px */
@media (max-width: 600px) {
    body {
        font-size: 17px;
    }

    header {
        padding: 0.75rem 1rem;
    }

    .site-name {
        font-size: 1.15em;
    }

    .btn-cta {
        padding: 0.4rem 1rem;
        font-size: 0.85em;
    }

    .hero {
        padding: 3rem 1rem;
    }

    .hero h1 {
        font-size: 2em;
    }

    .hero-subtitle {
        font-size: 1em;
    }

    main,
    footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    h2 {
        margin: 2.2rem 0 1rem;
    }

    h3 {
        margin: 1.8rem 0 0.8rem;
    }

    blockquote {
        padding: 1rem 1.2rem;
        font-size: 1.1em;
    }

    blockquote.bq-highlight {
        padding: 1.2rem 1.5rem;
    }

    blockquote.bq-quote {
        padding: 1.2rem 1rem 1.2rem 3rem;
    }

    blockquote.bq-quote::before {
        font-size: 2.4em;
    }

    /* Autorenbox: Foto oben, Text darunter */
    .author-box {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1.5rem;
    }

    .author-photo {
        width: 80px;
        height: 80px;
        min-width: 80px;
    }

    /* Footer: untereinander statt nebeneinander */
    .footer-inner {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    footer nav a {
        margin-right: 1rem;
    }

    footer nav a:last-child {
        margin-right: 0;
    }
}
