body {
    margin: 0 auto; /* Zentriert den Body horizontal */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    padding-top: 60px; /* Platz für das obere Banner */
    padding-bottom: 70px; /* Platz für die Navigationsleiste lassen */
    max-width: 600px; /* Maximale Breite der Seite */
    position: relative; /* Wichtig für die Positionierung der fixierten Elemente */
    box-shadow: 0 0 10px rgba(0,0,0,0.1); /* Optional: ein Schatten für den Rahmen */
    min-height: 100vh; /* Stellt sicher, dass der Body mindestens die Höhe des Viewports hat */
    box-sizing: border-box; /* Sorgt dafür, dass Padding in die Höhe einberechnet wird */
}

main {
    padding: 1rem 1.5rem; /* Oben/Unten 1rem, Links/Rechts 1.5rem */
}

.top-banner {
    position: fixed; /* Geändert von absolute zu fixed */
    top: 0;
    left: 50%; /* Zentriert das Element */
    transform: translateX(-50%); /* Feinjustierung der Zentrierung */
    width: 100%;
    max-width: 600px; /* Stellt sicher, dass es nicht breiter als der Body wird */
    height: 50px;
    background-color: #f8f8f8;
    border-bottom: 1px solid #e7e7e7;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2001; /* Stellt sicher, dass das Banner über dem Inhalt liegt */
}

.top-banner a {
    text-decoration: none;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.top-banner a img {
    height: 25px; /* Passen Sie die Höhe des Logos nach Bedarf an */
}

.search-container {
    margin-bottom: 1.5rem;
}

#searchInput {
    width: 100%;
    padding: 12px 15px;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 25px;
    box-sizing: border-box;
    outline: none;
}

#searchInput:focus {
    border-color: #000000;
    opacity: 0.8; /* Deckkraft auf 80% setzen */
}

.search-prompt {
    color: #888;
    text-align: center;
    padding: 2rem 0;
}

.topic-list {
    display: flex;
    flex-direction: column;
    gap: 1rem; /* Abstand zwischen den Elementen */
}

.topic-item {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #333;
    background-color: #f8f8f8;
    padding: 10px;
    border-radius: 10px;
}

.topic-item:hover {
    background-color: #e9e9e9;
}

.topic-item img {
    width: 60px;
    height: 60px;
    border-radius: 50%; /* Macht das Bild rund */
    object-fit: cover; /* Stellt sicher, dass das Bild den Kreis ausfüllt */
    margin-right: 15px;
}

.topic-item span {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
    font-size: 0.9rem;
    font-weight: 400;
}

.topic-header {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
}

.topic-main-image {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #f0f0f0;
}

.overlay-link {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    justify-content: center;
    align-items: center;
}

.overlay-link img {
    width: 45px;
    height: 45px;
    opacity: 0.6;
}

.overlay-link img:hover {
        opacity: 0.9;
}

.back-link {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

.back-link img {
    width: 20px;
    height: 20px;
}

.topic-content {
    text-align: left;
}

.topic-content h1 {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
    text-align: center;
    margin-bottom: 3rem; /* Reduzierter Abstand nach unten */
    font-size: 1.3rem; /* Kleinere Schriftgröße für H1 */
    font-weight: 300;
}

/* Anpassung für das Repository-Icon und den Link */
.repo-link {
    display: inline-flex; /* Stellt sicher, dass Icon und Text nebeneinander sind */
    align-items: center;
    gap: 8px; /* Abstand zwischen Icon und Text */
    text-decoration: none;
    color: black;
    opacity: 0.5;
    transition: color 0.2s ease;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
    background-color: #f0f0f0;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 0.85em;
}

/* NEU: Verhindert, dass der Link nach dem Besuch die Farbe ändert */
.repo-link:visited {
    color: black; 
    opacity: 0.5;/* Erzwingt die gleiche Farbe wie bei einem unbesuchten Link */
}

.repo-link:hover {
    color: #000000;
    opacity: 0.8;
}

.repo-link img {
    height: 20px;
    width: 20px;
    opacity: 0.5;
}

.repo-link:hover img {
    opacity: 1;
}

.topic-content h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

/* NEU: Styling für die h3-Überschrift, die den Link enthält */
.topic-content h3 {
    font-size: 0.9rem;
    font-weight: 400;
}

.topic-content p {
    font-size: 0.9rem;
    font-weight: 300; /* Dünnere Schrift */
    line-height: 1.6; /* Verbessert die Lesbarkeit bei langen Texten */
    margin-top: 0.1rem;
}

/* NEU: Styling für die Bildergalerie */
.image-gallery {
    display: flex;
    justify-content: space-around;
    align-items: flex-start; /* Stellt sicher, dass die Elemente oben ausgerichtet sind */
    margin: 2rem 0;
    gap: 1rem; /* Abstand zwischen den Bildern */
}

/* NEU: Container für Bild und Unterschrift */
.image-gallery figure {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer; /* Zeigt an, dass der ganze Block klickbar ist */
}

.image-gallery img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #f0f0f0;
    transition: transform 0.2s ease;
}

/* NEU: Styling für die Bildunterschrift */
.image-gallery figcaption {
    margin-top: 0.5rem;
    text-decoration: none;
    color: black;
    opacity: 0.5;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
    background-color: #f0f0f0;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 0.65em;
}

/* Ändert die Unterschrift, wenn man über das Element fährt ODER es berührt */
.image-gallery figure:hover figcaption,
.image-gallery figure:active figcaption {
    color: #000000;
    opacity: 0.8;
}

/* Vergrößert das Bild, wenn man über das Element fährt ODER es berührt */
.image-gallery figure:hover img,
.image-gallery figure:active img {
    transform: scale(1.1);
}

/* --- KORREKTUR: Styling für das Bild-Modal --- */
.image-modal-container {
    display: none; /* Standardmäßig unsichtbar */
    /* Alle position:fixed und Positionierungsregeln werden entfernt */
    width: 100%;
    height: 100%;
    max-width: 600px;
    background-color: white;
    justify-content: center;
    align-items: center;
    padding: 60px 1rem 70px 1rem;
    box-sizing: border-box;
}

/* NEU: Der Wrapper für Bild und Button */
.image-modal-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 600px;
    width: 100%;
    height: 100%;
}

.image-modal-container.visible {
    display: flex;
    /* Positionierung wird NUR HIER angewendet */
    position: fixed;
    z-index: 1500;
    left: 50%;
    transform: translateX(-50%);
    top: 0;
}

/* Das Bild im Modal */
.modal-content {
    max-width: 85%;
    max-height: 85%;
    object-fit: contain;
    border-radius: 5%;
    border: 2px solid #f0f0f0;
}

.close-image-btn {
    position: absolute;
    /* Positionierung in der oberen rechten Ecke des Wrappers */
    top: 10px;
    right: 10px;
    color: #000000;
    opacity: 0.5;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1501;
    background: none;
    box-shadow: none;
    width: auto;
    height: auto;
    line-height: 1;
}

.close-image-btn:hover {
    background-color: transparent; /* Hintergrundänderung entfernen */
    opacity: 0.8; /* Deckkraft auf 80% setzen */
}

mark {
    background-color: #b5cdf1;
    color: black;
    padding: 1px 0;
}

.topic-content strong {
    font-weight: 600; /* Extra fette Schrift */
}

.topic-content code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
    background-color: #f0f0f0;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 0.85em;
}

.topic-content ul {
    list-style-type: none; /* Standard-Aufzählungszeichen entfernen */
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
    font-size: 0.8em; /* Angepasst für bessere Lesbarkeit */
}

.topic-content ul li {
    position: relative;
    padding-left: 25px; /* Platz für das neue Aufzählungszeichen */
    margin-bottom: 0.75rem; /* Abstand zwischen den Listenelementen */
}

.topic-content ul li::before {
    content: '-'; /* Pfeil als Aufzählungszeichen */
    position: absolute;
    left: 0;
    top: 1px;
    font-weight: bold;
    opacity: 0.5;
}

/* Styling für das Iframe-Modal */
.iframe-modal-container {
    display: none; /* Standardmäßig unsichtbar */
    /* Alle position:fixed und Positionierungsregeln werden entfernt */
    width: 100%;
    height: 100%;
    max-width: 600px;
    padding-top: 50px;
    padding-bottom: 50px;
    box-sizing: border-box;
    align-items: center;
}

.iframe-modal-container.visible {
    display: block;
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1500;
    background-color: white;
}

#external-content-frame {
    position: absolute; /* NEU: Absolut positionieren */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    padding-top: 50px; /* Platz für das Banner schaffen */
    padding-bottom: 50px; /* Platz für die Nav-Leiste schaffen */
    box-sizing: border-box; /* Stellt sicher, dass padding die Größe nicht sprengt */
}

/* WICHTIG: Wir positionieren den Schließen-Button jetzt relativ zum Modal-Container,
   der die gleiche Größe und Position wie der Body hat. */
#iframe-modal .back-link {
    /* Diese Regel stellt sicher, dass der Pfeil im Modal sichtbar ist */
    display: block;
    position: absolute;
    /* Positionierung exakt wie der normale .back-link */
    left: 1.5rem;
    top: 125px;
    z-index: 1501; /* Stellt sicher, dass der Pfeil über dem Iframe liegt */
}

.bottom-nav {
    position: fixed; /* Geändert von absolute zu fixed */
    bottom: 0;
    left: 50%; /* Zentriert das Element */
    transform: translateX(-50%); /* Feinjustierung der Zentrierung */
    width: 100%;
    max-width: 600px; /* Stellt sicher, dass es nicht breiter als der Body wird */
    height: 50px;
    background-color: #f8f8f8;
    border-top: 1px solid #e7e7e7;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 2001; 
}

.nav-item {
    text-decoration: none;
    text-align: center;
    padding: 10px;
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0.5;
}

.nav-item img {
    height: 20px;
}

.nav-item:hover {
    background-color: transparent; /* Hintergrundänderung entfernen */
    opacity: 0.8; /* Deckkraft auf 80% setzen */
}

/* Stil für den aktiven Link */
.nav-item.active {
    opacity: 0.8;
}

/* Wenn über die Navigationsleiste gehovert wird, bekommen alle Items die Standard-Deckkraft */
.bottom-nav:hover .nav-item {
    opacity: 0.5;
}

/* Das spezifische Item, über das gerade gehovert wird (egal ob aktiv oder nicht), bekommt volle Deckkraft */
.bottom-nav .nav-item:hover {
    opacity: 0.8;
}
