* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

/* =================================================================== */
/* == Globale Stile & Typografie                                     == */
/* =================================================================== */

/* ---  Einbindung der selbst-gehosteten Schriftart 'Lato' --- */
/* Annahme: Die Schriftdatei liegt im entsprechenden Ordner */
@font-face {
    font-family: 'Lato';
    font-style: normal;
    font-weight: 400;
    src: url(../assets/fonts/Lato-Regular.ttf); /* Passe den Pfad ggf. an */
}

@font-face {
    font-family: 'Special Elite';
    font-style: normal;
    font-weight: 400;
    src: url(../assets/fonts/SpecialElite-Regular.ttf);
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

body {
    /* ---  'Lato' als Standard-Schriftart für bessere Lesbarkeit --- */
    font-family: 'Lato', Arial, Helvetica, sans-serif;
    /* ---  Neuer, dunklerer Hintergrund für den "Tisch"-Effekt --- */
    background-color: #d1cdd4; 
    text-rendering: optimizelegibility;
    line-height: 1.6; /* ---  Erhöhter Zeilenabstand für bessere Lesbarkeit --- */
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    -webkit-text-size-adjust: none;
    -webkit-font-smoothing: antialiased;
    -moz-tap-highlight-color: rgba(0, 0, 0, 0);
    -moz-text-size-adjust: none;
    -moz-font-smoothing: antialiased;
    -ms-tap-highlight-color: rgba(0, 0, 0, 0);
    -ms-text-size-adjust: none;
    -ms-font-smoothing: antialiased;
    overflow-x: hidden;
}


/* =================================================================== */
/* == Header & Navigation                                          == */
/* =================================================================== */

header {
    background-color: #000000;
    color: #ffffff;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8% 4%; 
    box-sizing: border-box;
    transition: padding 0.3s ease-in-out, font-size 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    text-align: left;
    font-size: 140%; 
    box-shadow: 0 3px 7px rgba(0, 0, 0, 0.2);
}

header.shrink {
    padding: 0.1% 3%;
    font-size: 110%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

header a {
    color: #ffffff;
    text-decoration: none;
    margin: 0 10px;
    padding: 8px 15px; 
    border-radius: 3px;
    text-decoration-line: none;
    position: relative; 
    z-index: 1; 
    display: flex;
    align-items: flex-start; 
    transition: color 0.2s ease-out, padding-bottom 0.2s ease-out;
}


header a::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0; 
    background-color: #94314F; 
    z-index: -1; 
    transition: all 0.2s ease-out; 
    border-radius: 3px;
}

header a:hover::after {
    height: 150%; 
}

#logolink:hover {
    color: #ffffff;
}

#logolink::after {
    display: none;
}

header a.active::after {
    background-color: #542854;
    height: 150%; 
}

header a.active:hover::after {
    background-color: #94285F;
    height: 150%; 
}

.hamburger-menu {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.hamburger-menu div {
    width: 25px;
    height: 3px;
    background-color: white;
    margin: 4px 0;
}

nav {
    display: flex;
}

@media (max-width: 768px) {
    nav {
        display: none;
    }

    .hamburger-menu {
        display: flex;
    }

    .mobile-nav {
        display: none; 
        flex-direction: column;
        background-color: #000000;
        position: absolute;
        top: 100%;
        right: 0;
        width: 50%;
        border-radius: 0 0 0 8px;
        box-shadow: -3px 3px 5px rgba(0,0,0,0.2);
    }

    .mobile-nav a {
        margin: 0;
        padding: 15px 20px;
        border-bottom: 1px solid #333;
        border-radius: 0;
        position: static; 
        z-index: auto;
    }
    
    .mobile-nav a::after {
        display: none;
    }

    .mobile-nav a:last-child {
        border-bottom: none;
    }

    .mobile-nav.active {
        display: flex;
    }

    .mobile-nav.active a:hover {
        background-color: #94314F;
    }

    .mobile-nav.active a.active {
        background-color: #542854;
    }

    .mobile-nav.active a.active:hover {
        background-color: #94285F;
    }
}

@media (min-width: 769px) {
    .mobile-nav {
        display: none !important;
    }
}


/* =================================================================== */
/* == Hauptinhalt & Überschriften                                  == */
/* =================================================================== */

main {
    /*  Kombination aus prozentualer Breite und maximaler Pixel-Breite */
    width: 80%;
    max-width: 1250px;
    
    padding: 40px 4.5%;
    padding-top: 110px;
    margin: 0 auto;
    margin-bottom: 40px;
    background-color: #f0efef;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

@media (max-width: 1024px) {
    main {
        /* Auf kleineren Geräten überschreiben wir die prozentuale Breite für eine bessere Kontrolle */
        width: auto; 
        padding-top: 100px;
        padding-left: 10%;
        padding-right: 2%;
        margin-bottom: 20px;
        border-radius: 0;
    }
}

/* --- Komplette Überarbeitung des Überschriften-Stylings mit rechtsbündigem Akzent --- */
h1, h2, h3, h4 {
    display: flex;
    align-items: center;
    padding: 0.5em 0;
    background-color: transparent;
}

/* Korrigiert das Scroll-Verhalten bei Anker-Links, damit die Überschrift nicht vom Header verdeckt wird */
h1[id], h2[id], h3[id], h4[id] {
    scroll-margin-top: 110px;
}


h1::after, h2::after, h3::after, h4::after {
    content: '';
    height: 6px;
    background-color: #94314F;
    margin-left: 15px;
    border-radius: 3px;
}

h1 {
    font-family: 'Special Elite', cursive;
    font-size: 2.5em;
}

h1::after {
    flex-grow: 1;
    background-color: #542854;
    opacity: 0.95;
    height: 20pt;
}

h2::after {
    width: 45%;
    background-color: #94285F;
    opacity: 0.85;
    height: 15px;
}

h3::after {
    width: 30%;
    background-color: #7D528F;
    opacity: 0.6;
    height: 10px;
}

h4::after {
    width: 15%;
    background-color: #6C6274;
    opacity: 0.25;
    height: 5px;
}

/* =================================================================== */
/* == Inhaltsverzeichnis / Sticky TOC                              == */
/* =================================================================== */

.sticky-toc {
    position: absolute;
    top: 110px;
    left: 2%;
    width: 200px;
    max-width: 15%;
    padding: 10px;
    background-color: #f0efef;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 800;
}

.sticky-toc.is-stuck {
    position: fixed;
    top: 100px; 
}

.sticky-toc summary {
    cursor: pointer;
    font-weight: bold;
    padding: 5px;
    outline: none;
    list-style: none;
}

.sticky-toc summary::-webkit-details-marker {
    display: none;
}
.sticky-toc summary::before {
    content: '► ';
    font-size: 0.8em;
    display: inline-block;
    transition: transform 0.2s ease-in-out;
}
.sticky-toc[open] > summary::before {
    transform: rotate(90deg);
}


.sticky-toc ul {
    list-style-type: none;
    padding-left: 15px;
    margin-top: 10px;
}

.sticky-toc ul li {
    margin-bottom: 8px;
}

.sticky-toc ul li a {
    text-decoration: none;
    color: #542854;
}

.sticky-toc ul li a:hover {
    color: #94314F;
    text-decoration: underline;
}

@media (max-width: 1024px) {
    .sticky-toc {
        display: none;
    }
}


/* =================================================================== */
/* == Styling für die dynamische Download-Seite (OPTIMIERT)        == */
/* =================================================================== */

main details {
    background-color: transparent;
    border: none;
    padding: 0;
    margin: 0;
    border-top: 1px solid #dcdcdc;
}

main #download-list-container > details:first-of-type {
    border-top: none;
}

main #download-list-container > details:last-of-type {
    border-bottom: 1px solid #dcdcdc;
}

main details summary {
    position: relative;
    list-style: none;
    cursor: pointer;
    outline: none;
    padding: 0.8em 0.5em;
    transition: background-color 0.2s ease;
}

main details summary:hover {
    background-color: #e9e9e9;
}

main details summary::-webkit-details-marker {
    display: none;
}

main details summary .h-style {
    display: inline-block;
    font-weight: normal;
}

main details summary .h-style::before {
    content: '►';
    display: inline-block;
    font-size: 0.8em;
    margin-right: 12px;
    color: #542854;
    transition: transform 0.2s ease-in-out;
}

main details[open] > summary .h-style::before {
    transform: rotate(90deg);
}

main details summary .h-style-2,
main details summary .h-style-3,
main details summary .h-style-4 {
    display: flex;
    align-items: center;
    background-color: transparent;
    padding: 0.5em 0;
}

main details summary .h-style-2::after,
main details summary .h-style-3::after,
main details summary .h-style-4::after {
    content: '';
    height: 5px;
    margin-left: 15px;
    border-radius: 3px;
}

main details summary .h-style-2 {
    font-size: 1.5em;
}
main details summary .h-style-2::after {
    width: 250px;
    background-color: #94314f;
    opacity: 0.7;
}

main details summary .h-style-3 {
    font-size: 1.25em;
}
main details summary .h-style-3::after {
    width: 150px;
    background-color: #612436;
    opacity: 0.8;
}


main details summary .h-style-4 {
    font-size: 1.1em;
}
main details summary .h-style-4::after {
    width: 80px;
    background-color: #612436;
    opacity: 0.6;
}

main details > ul,
main details > details {
    padding-left: 2.5em;
}

main details > ul {
    list-style-type: none;
    margin-top: 15px;
    border-top: 1px dashed #ccc;
    padding-top: 15px;
    padding-left: 2.5em;
}

main details > ul li {
    margin-bottom: 0.7em;
    padding-left: 25px;
    background-image: url('../assets/misc/download.svg'); 
    background-repeat: no-repeat;
    background-position: left center;
    background-size: 20px;
}

main details > ul li a {
    color: #542854;
    text-decoration: none;
}

main details > ul li a:hover {
    color: #94314F;
    text-decoration: underline;
}


/* =================================================================== */
/* == Footer                                                       == */
/* =================================================================== */

footer {
    background-color: transparent;
    color: #333;
    text-align: center;
    padding: 40px 20px;
    position: relative;
    bottom: 0;
    width: 100%;
}

footer a {
    color: #542854;
    text-decoration: none;
    margin: 0 10px;
    font-weight: bold;
}

footer a:hover {
    color: #94314F;
}


/* =================================================================== */
/* == Zusätzliche UI-Elemente                                      == */
/* =================================================================== */

.floating-social {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background-color: #000000;
    padding: 10px;
    border-radius: 0 8px 8px 0;
    z-index: 1000;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
}

.floating-social img {
    display: block;
    margin: 10px 0;
    width: 30px;
    height: 30px;
    transition: transform 0.2s ease;
}

.floating-social a:hover img {
    transform: scale(1.15);
}

@media (max-width: 768px) {
    .floating-social img {
        width: 16px;
        height: 16px;
    }
}

#scrollTopBtn {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #000000;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 8px;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    transition: background-color 0.2s ease, transform 0.2s ease;
}

#scrollTopBtn:hover {
    background-color: #333333;
    transform: translateY(-3px);
}


/* =================================================================== */
/* == Galerie & Lightbox                                           == */
/* =================================================================== */

#galleryContainer {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    padding: 10px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Wendet den Rahmen, Schatten und Hover-Effekt auf den Container an */
.gallery-item {
    position: relative; /* Wichtig für die Positionierung des Play-Symbols */
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden; /* Stellt sicher, dass alles innerhalb des Rahmens bleibt */
}

.gallery-item:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Formatiert das Bild ODER Video innerhalb des Containers */
.gallery-item img,
.gallery-item video {
    width: 100%;
    height: 125px;
    object-fit: cover;
    display: block;
}

/* Erzeugt das Overlay mit dem Play-Symbol nur für Video-Elemente */
.gallery-item.video-item::after {
    content: '▶'; /* Das "Play"-Dreieck */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    /* Zentriert das Symbol */
    display: flex;
    justify-content: center;
    align-items: center;

    /* Styling des Symbols und des Overlays */
    background-color: rgba(0, 0, 0, 0.3);
    color: white;
    font-size: 40px;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    
    /* Sanfter Übergang für den Hover-Effekt */
    transition: background-color 0.2s ease;
}

/* Macht das Overlay beim Hovern etwas dunkler, um die Interaktion zu verdeutlichen */
.gallery-item.video-item:hover::after {
    background-color: rgba(0, 0, 0, 0.5);
}

#lightbox {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 20px;
}

#lightbox .lightbox-content {
    position: relative;
    max-width: 90%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Gilt jetzt für Bilder UND Videos in der Lightbox */
#lightbox .lightbox-content img,
#lightbox .lightbox-content video {
    display: block;
    max-width: 100%;
    max-height: 90vh; 
    width: auto;
    height: auto;
    object-fit: contain;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border-radius: 5px;
}

#lightbox .close-btn {
    position: absolute;
    top: -15px;
    right: -15px;
    color: white;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    line-height: 38px;
    text-align: center;
    user-select: none;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

#lightbox .close-btn:hover {
    background-color: rgba(255, 0, 0, 0.7);
    transform: rotate(90deg);
}

#lightbox .prev-btn,
#lightbox .next-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease, background-color 0.2s ease;
    padding: 10px 15px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    z-index: 10;
}

#lightbox .prev-btn:hover,
#lightbox .next-btn:hover {
    color: #cccccc;
    background-color: rgba(0, 0, 0, 0.6);
}

#lightbox .prev-btn {
    left: 10px;
}

#lightbox .next-btn {
    right: 10px;
}

@media (max-width: 768px) {
    #lightbox .prev-btn,
    #lightbox .next-btn {
        font-size: 30px;
        padding: 8px 10px;
    }

    #lightbox .prev-btn {
        left: 5px;
    }

    #lightbox .next-btn {
        right: 5px;
    }

    #lightbox .close-btn {
        top: -10px;
        right: -10px;
        width: 35px;
        height: 35px;
        line-height: 33px;
        font-size: 30px;
    }
}