/* ==========================================================================
   1. Grundstyling & Layout
   ========================================================================== */
body {
    margin: 0;
    font-family: Arial, sans-serif;
}
main {
    padding: 20px;
    font-family: sans-serif;
}

/* ==========================================================================
   2. Navigation & Menü (Desktop & allgemeine Dropdown-Basis)
   ========================================================================== */
.navbar {
    background-color: #E41B2B;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.nav-menu li {
    position: relative; /* Wichtig für die Positionierung des schwebenden Desktop-Menüs */
}

.nav-menu a {
    display: block;
    color: white;
    padding: 15px 20px;
    text-decoration: none;
    transition: background 0.3s;
    cursor: pointer;
}

.nav-menu a:hover, 
.nav-menu a.active {
    background-color: #111;
    color: #00bcd4; /* Highlight-Farbe */
}

/* Hilfsklassen für Untermenü-Struktur */
.menu-item-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dropdown-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 10px;
    padding: 15px 15px 15px 5px; /* Angenehmes Klick-Feld für Handys */
    cursor: pointer;
    transition: transform 0.2s ease;
}

/* --- Dropdown Logik (Desktop Standard) --- */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #E41B2B;
    min-width: 180px; /* Leicht erhöht für längere Unterpunkte */
    list-style: none;
    padding: 0;
    margin: 0;
    box-shadow: 0px 8px 16px rgba(0,0,0,0.2);
    z-index: 1000;
}

.dropdown-menu li {
    width: 100%;
}

.dropdown-menu a {
    padding: 12px 16px;
    white-space: nowrap; /* Verhindert hässliche Zeilenumbrüche im Text */
}

/* Desktop Hover-Effekt: Zeigt das Menü beim Drüberfahren */
.has-dropdown:hover .dropdown-menu {
    display: block;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 10px;
}

/* ==========================================================================
   3. Hero-Bereiche & Overlays
   ========================================================================== */
.rsc-home-hero,
.rsc-allgemein-hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-repeat: no-repeat;
    background-position: center center;
    background-attachment: fixed;
    background-size: cover;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #ffffff;
    padding: 40px 20px;
    box-sizing: border-box;
    align-items: flex-start; /* Richtet den Inhalt ganz oben aus */
    
    padding-top: 40px; /* Ein kleiner, sauberer Abstand zum oberen Rand / zur Navigationsleiste */
}

.rsc-home-hero {
    background-image: url('../images_rsc/WaswhreHamburgohneRahlstedt.jpg');
}

.rsc-allgemein-hero {
    background-image: url('../images_rsc/Kabinen.jpg');
}

/* Dunkler Overlay-Schleier für Lesbarkeit */
.rsc-home-hero::before,
.rsc-allgemein-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 1;
}

/* ==========================================================================
   4. Content-Komponenten (Glassmorphismus)
   ========================================================================== */
.rsc-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    width: 90%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 40px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    margin-top: 0;
    margin-bottom: auto; /* Zieht den Container strikt nach oben */
}

.rsc-ueberschrift {
    text-align: center;
    font-size: 2.5rem;
    position: relative;
    z-index: 2;
    margin-bottom: 20px;
}

.rsc-content h1 {
    font-size: 2.5rem;
    color: #E41B2B;
    margin-bottom: 5px;
    text-transform: uppercase;
    font-weight: 800;
}

.rsc-content h2 {
    font-size: 1.5rem;
    color: #4aa1f1;
    margin-top: 0;
    margin-bottom: 25px;
    font-weight: 400;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 15px;
}

.rsc-content h3 {
    font-size: 1.3rem;
    margin-top: 30px;
    color: #4aa1f1;
}

.rsc-content p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

.read-more {
    color: #ffffff;
    font-weight: bold;
    text-decoration: underline;
}

/* Features-Listen */
.rsc-features {
    list-style: none;
    padding: 0;
    margin: 25px 0;
}

.rsc-features li {
    font-size: 1.05rem;
    line-height: 1.5;
    margin-bottom: 15px;
    padding-left: 35px;
    position: relative;
}

.rsc-features li .emoji {
    position: absolute;
    left: 0;
    top: 0;
    font-size: 1.2rem;
}

.rsc-features strong {
    color: #fff;
    display: inline;
}

/* ==========================================================================
   5. Footer & Cookie-Banner
   ========================================================================== */
.site-footer {
    background-color: #1a1a1a;
    color: #999;
    padding: 20px;
    font-family: sans-serif;
    font-size: 14px;
    margin-top: 40px;
    border-top: 1px solid #333;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.footer-content p {
    margin: 0;
}

.footer-links a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #3498db;
}

.footer-links .separator {
    margin: 0 10px;
    color: #444;
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #222;
    color: #fff;
    padding: 20px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
    z-index: 99999;
    font-family: sans-serif;
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.cookie-content p {
    margin: 0;
    font-size: 14px;
    max-width: 70%;
}

.cookie-content a {
    color: #3498db;
    text-decoration: underline;
}

.cookie-buttons {
    display: flex;
    gap: 10px;
}

.cookie-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
}

.btn-accept {
    background-color: #2ecc71;
    color: white;
}

.btn-decline {
    background-color: #e74c3c;
    color: white;
}

/* ==========================================================================
   6. Responsive Design / Media Queries
   ========================================================================== */
@media (min-width: 769px) {
    /* Ausblenden des mobilen Pfeils auf Desktop-Bildschirmen */
    .dropdown-toggle {
        display: none;
    }
}

@media (max-width: 768px) {
    .navbar {
        position: relative;
        z-index: 9999;
    }

    .menu-toggle {
        display: block;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        background-color: #E41B2B;
        z-index: 9999;
    }

    .nav-menu.mobile-open {
        display: flex;
    }

    /* Flex-Verhalten anpassen für Mobile */
    .nav-menu li {
        width: 100%;
    }
    
    .nav-menu a {
        flex-grow: 1;
    }

    /* Auf Mobile wird das Dropdown statisch untereinander gelistet */
    .dropdown-menu {
        position: static;
        background-color: #c7121f; /* Dunkleres Rot zur optischen Trennung mobil */
        width: 100%;
        box-shadow: none;
    }

    /* Verhindert, dass unabsichtlicher Hover auf Mobile stört */
    .has-dropdown:hover .dropdown-menu {
        display: none; 
    }
    
    /* Aktiv-Zustand für mobiles Aufklappen per Klick */
    .has-dropdown.open .dropdown-menu {
        display: block;
    }
}

@media (max-width: 600px) {
    .rsc-content {
        padding: 2cqmin;
    }
    .rsc-content h1 {
        font-size: 1.8rem;
    }
    .rsc-content h2 {
        font-size: 1.2rem;
    }
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

/* ==========================================================================
   7. News- & Inhalts-Raster (Kacheldesign)
   ========================================================================== */
.news-grid {
    display: grid;
    grid-template-columns: 1fr; 
    gap: 20px; 
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.news-entry {
    position: relative;
    z-index: 2;
    width: 100%;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.1); 
    backdrop-filter: blur(8px); 
    -webkit-backdrop-filter: blur(8px);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, background 0.2s ease;
    margin-bottom: 10px;
}

.news-entry img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
}

.news-entry img.img-small {
    display: block;
    width: 50%;
    aspect-ratio: auto;   /* Hebt das 1:1 Quadrat-Format auf */
    object-fit: contain;  /* Verhindert das Bescheiden des Bildes */
    margin: 0 0 15px 0;
}

.news-entry h2 {
    font-size: 1.4rem;
    color: #E41B2B; 
    margin-top: 0;
    margin-bottom: 10px;
    text-transform: uppercase;
    font-variant-numeric: normal; 
    font-feature-settings: "case" on;
    font-weight: 800;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 5px;
}

.news-entry h3 {
    font-size: 1.1rem;
    color: #fff;
    margin-top: 15px;
    margin-bottom: 5px;
    text-transform: uppercase;
    font-variant-numeric: normal; 
    font-feature-settings: "case" on;
}

.news-entry p {
    font-size: 0.95rem;
    color: #fff;
    line-height: 1.5;
    margin-bottom: 12px;
}

.news-entry p.klein {
    font-size: 0.75rem;
    color: #ccc;
    line-height: 1.1;
    margin-bottom: 15px;
}

.news-entry ul, 
.news-entry ol {
    padding-left: 20px;
    margin-bottom: 15px;
}

.news-entry li {
    font-size: 0.95rem;
    margin-bottom: 5px;
    color: #fff;
}

.news-entry a {
    color: #fff;
    text-decoration: underline;
    font-weight: bold;
}

.news-entry a:hover {
    color: #E41B2B;
}

@media (min-width: 768px) {
    .news-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ==========================================================================
   8. Spezifisches Gremien- & Organigramm-Raster
   ========================================================================== */
.gremien-main-grid {
    display: grid;
    grid-template-columns: 1fr; 
    gap: 30px; 
    padding: 20px;
    max-width: 1400px;
    margin: 0;
    /* Verhindert das vertikale Springen & Auszentrieren beim Aufklappen */
    align-items: stretch;
    justify-items: start;
    align-content: start; /* Richtet die Grid-Zeilen direkt oben am Container aus */
    margin-top: 0;
}

/* Kategoriespalte (Sparte) */
.category-column {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    width: 100%;
    box-sizing: border-box;
}

.category-column .category-title {
    width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 0 20px 0 !important;
    text-align: left !important;
    padding: 10px 15px !important;
    display: block !important;
    color: #E41B2B !important;
}

.category-column h2 {
    position: relative;
    z-index: 2;
    width: 100%;
    box-sizing: border-box;
    font-size: 1.5rem;
    color: #E41B2B;
    margin-top: 0;
    margin-bottom: 20px;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-align: left;
    
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 10px 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Bereichsspalte (M_JUNGS) */
.art-column {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 10px;
}

.art-column .art-title {
    width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 0 15px 0 !important;
    text-align: left !important;
    padding: 10px 15px !important;
    display: flex !important;
    justify-content: space-between;
    align-items: center;
}

.art-column h2 {
    position: relative;
    z-index: 2;
    width: 100%;
    box-sizing: border-box;
    font-size: 1.3rem;
    color: #3498db;
    margin-top: 0;
    margin-bottom: 20px;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-align: left;
    
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 10px 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.art-title.klickbar {
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.art-title.klickbar:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Akkordeon-Steuerung für Bereiche & Teams */
.bereich-wrapper {
    display: none;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 15px;
}

.bereich-wrapper.active {
    display: block;
}

.team-header-klick {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.team-details {
    position: relative;
    z-index: 2;
    width: 100%;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, background 0.2s ease;
    display: none;
    margin-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.team-details.active {
    display: block;
}

/* Personenliste (Vorstände / Ansprechpartner) */
.persons-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    align-items: flex-start;
}

.persons-list .news-entry {
    text-align: left;
    width: 100%;
}

.persons-list .news-entry img.img-small {
    display: block;
    width: 80px;
    height: auto;
    aspect-ratio: auto;
    object-fit: contain;
    margin: 0 0 12px 0;
}

.persons-list .news-entry:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.persons-list .news-entry h3 {
    font-size: 1.2rem;
    color: #fff;
    margin: 0 0 6px 0;
    font-weight: 700;
    text-align: left;
}

.persons-list .news-entry p {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
    margin: 0;
    text-align: left;
}

.persons-list .news-entry p.contact-info {
    font-size: 0.85rem;
    color: #fff;
    margin-top: 8px;
    word-break: break-all;
    text-align: left;
}

@media (min-width: 576px) and (max-width: 991px) {
    .gremien-main-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .gremien-main-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}