html {
    scroll-padding-top: 100px; /* Platz für sticky Header bei Anker-Links reservieren */
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #1a1a1a;
    color: #f0f0f0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    position: relative;
}

/* Hintergrundbild mit Transparenz (Optimiert) */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../Bilder/hintergrund-opt.jpg');
    background-size: cover;
    background-position: center;
    opacity: 0.12;
    pointer-events: none;
    z-index: -1;
}

header {
    background: #222;
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

header.scrolled {
    background: transparent;
    box-shadow: none;
}

header.scrolled .logo img {
    filter: none;
}

header.scrolled nav a {
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

header.scrolled nav a:hover {
    color: #00ff00;
}

header.scrolled .burger-menu span {
    background-color: #00ff00;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 1rem; /* small inner padding so it doesn't hug edges on tiny screens */
    box-sizing: border-box;
}

.logo img {
    height: 50px;
}

/* Burger Menu Button (Standard versteckt) */
.burger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.burger-menu span {
    width: 100%;
    height: 3px;
    background-color: #00ff00;
    border-radius: 2px;
    transition: all 0.3s ease;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
}

nav a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
}

nav a:hover {
    color: #00ff00;
}

/* Container: Bild links, Text rechts, Bild vertikal zentriert */
.about-container {
    display: flex;
    align-items: center; /* Bild in der Texthöhe zentrieren */
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto;
}

/* Rundes Profilbild mit Textumfluss */
.about-container {
    display: block;
    overflow: hidden;
    max-width: 1000px;
    margin: 0 auto;
}

.profile-img {
    width: 250px;
    height: 250px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid #00ff00;
    float: left;
    shape-outside: circle(50%);
    margin-right: 30px;
    margin-bottom: 20px;
}

.about-text {
    text-align: justify;
    text-justify: inter-word;
}

/* Mobile: Bild zentriert über dem Text */
@media (max-width: 768px) {
    .profile-img {
        float: none;
        display: block;
        margin: 0 auto 20px auto;
        shape-outside: none;
        width: 200px;
        height: 200px;
    }

    .about-text {
        text-align: justify;
    }
}

section {
    padding: 2rem 2rem;
    max-width: 1000px;
    width: 100%;
    box-sizing: border-box;
    margin: 0 auto; /* Zentriert die Sektion im Flex-Body */
    align-self: center; /* Wichtiger Zusatz für Flex-Container! */
}

/* Textblöcke im Blocksatz, zentriert auf der Seite */
section p,
.kontakt-text {
    text-align: justify;
    text-justify: inter-word;
    font-size: 1.1rem;
    color: #ccc;
    margin-bottom: 1.5rem;
}

#ich .about-text p {
    text-align: justify;
}

/* Spezifische Zentrierung für Kontakt-Text, falls gewünscht */
#kontakt .kontakt-text {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 2rem auto;
}

/* Überschriften zentrieren */
section h1,
section h2,
section h3 {
    text-align: center;
}

/* Galerie mit Buttons */
.gallery-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.gallery-row {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding: 10px 0;
    margin-bottom: 2rem;
    scrollbar-width: none; /* Firefox */
    scroll-snap-type: x mandatory; /* Bilder flüssig anspringen */
}

.gallery-row::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.scroll-btn {
    background: rgba(0, 255, 0, 0.2);
    color: #fff;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 24px;
    margin: 0 10px;
    border-radius: 5px;
}

.scroll-btn:hover {
    background: rgba(0, 255, 0, 0.4);
}

.gallery-item {
    flex: 0 0 auto;
    cursor: pointer;
    scroll-snap-align: center; /* Bild zentrieren beim Snappen */
}

.gallery-item img {
    height: 250px;
    width: auto;
    border: 2px solid #333;
    transition: transform 0.3s;
}

.gallery-item img:hover {
    border-color: #00ff00;
    transform: scale(1.02);
}

.link-grid {
    display: grid;
    gap: 15px;
}

.link-grid a {
    display: block;
    background: #333;
    padding: 1rem;
    text-align: center;
    color: #fff;
    text-decoration: none;
    border-left: 5px solid #00ff00;
}

.link-grid a:hover {
    background: #444;
}

/* Events-Liste (Nächste Events) */
.event-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.event-item {
    display: block;
    background: #333;
    padding: 1rem 1.25rem;
    text-decoration: none;
    color: #fff;
    border-left: 5px solid #00ff00;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.event-item:hover {
    background: #444;
}

.event-item .event-title {
    font-weight: bold;
    font-size: 1.05rem;
    margin-bottom: 4px;
    color: #fff;
}

.event-item .event-meta {
    font-size: 0.9rem;
    color: #ccc;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.event-item .event-date,
.event-item .event-time {
    color: #00ff00;
    font-weight: 600;
}

.event-item .event-location {
    color: #aaa;
}

.event-item .event-description {
    font-size: 0.85rem;
    color: #bbb;
    margin-top: 6px;
    line-height: 1.4;
}

.event-item .event-description a {
    color: #00ff00;
    text-decoration: underline;
}

.event-item .event-description a:hover {
    color: #33ff33;
}

/* Links im Fließtext (z. B. Impressum, Datenschutz) – sonst färbt der Browser sie blau/lila.
   Gilt nur für Links innerhalb von Absätzen (<p>) und Listen (<li>) in einer <section>,
   Buttons, Navigation und die Link-Kacheln haben eigene Regeln. */
section p a,
section li a {
    color: #00ff00;
    text-decoration: underline;
}

section p a:hover,
section li a:hover {
    color: #33ff33;
}

#events-loading {
    color: #888;
    text-align: center;
    padding: 2rem;
}

#events-container:empty::before {
    content: "Keine bevorstehenden Termine.";
    color: #888;
    text-align: center;
    display: block;
    padding: 2rem;
}

.kontakt-text {
    font-size: 1.1rem;
    max-width: 1000px;
    margin-bottom: 2rem;
    color: #ccc;
}

.kontakt-buttons {
    display: flex;
    justify-content: center; /* Zentriert die Buttons horizontal */
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.kontakt-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: #282828;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    border: 1px solid #444;
    transition: all 0.3s ease;
}

.kontakt-btn svg {
    stroke: #00ff00;
}

.kontakt-btn:hover {
    background: #333;
    border-color: #00ff00;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 255, 0, 0.2);
}

/* Media Queries für mobile Geräte (Tablets & Smartphones) */
@media (max-width: 768px) {
    .burger-menu {
        display: flex;
    }

    nav ul {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background: rgba(26, 26, 26, 0.95);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 30px;
        transition: right 0.3s ease-in-out;
        box-shadow: -5px 0 15px rgba(0,0,0,0.5);
        z-index: 1000;
        margin: 0;
        padding: 0;
        display: flex; /* Immer flex, Positionierung über right */
    }

    nav ul.show {
        right: 0;
    }

    .burger-menu.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
    .burger-menu.active span:nth-child(2) { opacity: 0; }
    .burger-menu.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

    nav ul li a {
        font-size: 1.2rem;
    }

    .scroll-btn {
        display: none;
    }

    section {
        padding: 1rem; /* Halbiert (war 2rem) */
    }

    .hero {
        padding: 2rem 1rem; /* Halbiert (war 4rem) */
    }

    .gallery-item img {
        height: 200px; /* Leicht kleinere Höhe für Mobilgeräte */
    }
}

/* Footer am unteren Ende der Seite */
footer {
    margin-top: auto;
    text-align: center;
    padding: 2rem 1rem;
    background: #111;
    color: #888;
    border-top: 1px solid #333;
    width: 100%; /* Volle Bildschirmbreite */
    box-sizing: border-box;
}

footer a {
    color: #00ff00;
    text-decoration: none;
    margin: 0 5px;
}

footer a:hover {
    text-decoration: underline;
}

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.lightbox img {
    max-width: 90%;
    max-height: 80%;
}

/* ==================== Bildrelease-Archiv (links.html) ====================
   Aufbau: <details class="year-block"> → <details class="quarter-block"> → .link-grid
   Das Auf-/Zuklappen animiert js/accordion.js. */

/* Jahres-Überschrift (vorher inline im HTML) */
.year-header {
    font-size: 1.5rem;
    color: #00ff00;
    margin-top: 3rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #00ff00;
    cursor: pointer;
}

/* Das erste Jahr hat weniger Abstand nach oben */
.year-block:first-of-type > .year-header {
    margin-top: 2rem;
}

/* Quartals-Überschrift (vorher inline im HTML) */
.quarter-header {
    color: #aaa;
    margin: 1.5rem 0 0.75rem 0;
    font-size: 1.1rem;
    cursor: pointer;
}

/* Inhalt eines Jahres (alle Quartale). display: flow-root sorgt dafür, dass
   Außenabstände (margin) innerhalb bleiben – sonst würde der Abstand am Ende
   der Animation kurz "springen". */
.accordion-body {
    display: flow-root;
}

/* Erstes Quartal: Abstand so, dass es wie vorher aussieht (1rem + 0.5rem = 1.5rem) */
.accordion-body > .quarter-block:first-child > .quarter-header {
    margin-top: 0.5rem;
}

/* Pfeil vor Jahr/Quartal: ▼ = offen, ▶ (um -90° gedreht) = zu */
.arrow {
    display: inline-block;
    transition: transform 0.3s ease;
    transform-origin: center;
    margin-right: 0.5rem;
}

/* Zu – oder gerade beim Zuklappen (Klasse .closing setzt accordion.js sofort beim Klick,
   damit der Pfeil gleichzeitig mit der Animation dreht) */
.year-block:not([open]) > .year-header .arrow,
.quarter-block:not([open]) > .quarter-header .arrow,
.year-block.closing > .year-header .arrow,
.quarter-block.closing > .quarter-header .arrow {
    transform: rotate(-90deg);
}

/* Kurzzeitig gesetzt von accordion.js: Pfeil ohne Dreh-Animation umstellen */
.no-arrow-transition .arrow {
    transition: none;
}

/* Standard-Dreieck des Browsers bei <summary> ausblenden */
details summary {
    list-style: none;
}
details summary::-webkit-details-marker {
    display: none;
}

/* ==================== Barrierefreiheit ==================== */

/* Skip-Link „Zum Inhalt springen“ (Nr. 18):
   normalerweise außerhalb des Bildschirms, erscheint erst,
   wenn man ihn mit der Tab-Taste ansteuert. */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
}

.skip-link:focus {
    left: 1rem;
    top: 1rem;
    z-index: 3000; /* über Header (1000) und Lightbox (2000) */
    background: #00ff00;
    color: #000;
    padding: 0.75rem 1.25rem;
    font-weight: bold;
    text-decoration: none;
    border-radius: 5px;
}

/* Sichtbarer Rahmen, wenn ein Galeriebild per Tastatur angesteuert ist (Nr. 15).
   :focus-visible greift nur bei Tastatur, nicht bei Mausklick. */
.gallery-item:focus-visible {
    outline: 3px solid #00ff00;
    outline-offset: 3px;
}

/* Schließen-Knopf der Lightbox (Nr. 15): oben rechts */
.lightbox .close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 3rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem 0.75rem;
}

.lightbox .close:hover,
.lightbox .close:focus-visible {
    color: #00ff00;
    outline: 2px solid #00ff00;
    border-radius: 5px;
}

/* Weniger Bewegung (Nr. 20): Wer im Betriebssystem „Bewegung reduzieren“
   eingestellt hat, bekommt keine Übergangs-Animationen. */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .gallery-item img:hover {
        transform: none;
    }
}
