/* * =========================================
 * THG RECKLINGHAUSEN - MASTER CSS (FINALMASTER V2)
 * Optimiert für Logo-DNA, Typografie & Harmonie
 * Fehlerbehebung Breakpoint & Z-Index Dropdown-Fix
 * =========================================
 */

/* 1. Die passende Logo-Schriftart laden (Montserrat) */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800&display=swap');

:root {
    /* --- 2. DIE EXAKTEN LOGO-FARBEN --- */
    --thg-grey: #525659;
    --thg-sand: #C6A77C;
    --thg-orange: #E85B1C;
    --thg-red: #C11520;
    --thg-blue: #001B4C;
    --thg-tag-bg: #5a7d95;
    
    /* Cassiopeia Overrides */
    --template-special-color: #ffffff !important; 
    --template-text-dark: var(--thg-grey) !important;
    
    /* --- 3. HARMONISCHE SCHRIFT-SKALA --- */
    --font-primary: 'Montserrat', sans-serif;
    
    /* Desktop-Werte */
    --text-xs: 0.75rem;    /* 12px */
    --text-sm: 0.875rem;   /* 14px */
    --text-base: 1rem;     /* 16px */
    --text-md: 1.25rem;    /* 20px */
    --text-lg: 1.5rem;     /* 24px */
    --text-xl: 2rem;       /* 32px */
    --text-xxl: 2.5rem;    /* 40px */
}

/* --- OPTIMIERUNG FÜR MOBILE SCHRIFTGRÖSSEN --- */
@media (max-width: 768px) {
    :root {
        --text-base: 0.95rem;
        --text-md: 1.1rem;
        --text-lg: 1.3rem;
        --text-xl: 1.6rem;
        --text-xxl: 1.9rem;
    }
}

/* =========================================
   0. BASIS-TYPOGRAFIE (GLOBAL)
   ========================================= */
body.site, html {
    background-color: #f7f9fc !important; 
    color: var(--thg-grey) !important;
    font-family: var(--font-primary) !important;
    font-size: var(--text-base) !important;
    line-height: 1.5 !important;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--thg-blue) !important; 
    font-family: var(--font-primary) !important;
    line-height: 1.2 !important;
    margin-bottom: 1rem !important;
    font-weight: 700 !important;
}

/* =========================================
   1. HEADER & TOPBAR (FLEX-GRID MASTER FIX)
   ========================================= */
body.site header.header.container-header {
    background: #ffffff !important;
    background-image: none !important;
    border-bottom: none !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05) !important;
    
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important; 
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0 !important; 
    
    /* WICHTIG FÜR DAS DROPDOWN: Die Kopfzeile MUSS immer auf oberster Ebene liegen! */
    position: relative !important;
    z-index: 9999 !important; 
    overflow: visible !important;
}

/* --- ZEILE 1: DIE WEISSE, DEZENTE TOPBAR (INKL. SUCHE) --- */
body.site header.header .container-topbar {
    order: 1 !important; 
    flex: 0 0 100% !important; 
    width: 100% !important;
    max-width: 100% !important;
    
    background-color: #ffffff !important;
    border-bottom: 1px solid #f0f0f0 !important; 
    padding: 8px 20px !important;
    box-sizing: border-box !important;
    
    display: flex !important;
    justify-content: flex-end !important; 
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 15px !important; 
}

/* Text in der Topbar (Telefon & E-Mail) */
body.site header.header .container-topbar p,
.container-topbar .mod-custom p { 
    margin: 0 !important; 
    padding: 0 !important; 
    font-family: var(--font-primary) !important;
    font-size: var(--text-xs) !important;
    color: var(--thg-grey) !important; 
    font-weight: 500 !important;
    letter-spacing: 0.5px !important;
}

body.site header.header .container-topbar a,
.container-topbar .mod-custom a {
    color: var(--thg-grey) !important;
    text-decoration: none !important;
    font-weight: 700 !important;
    transition: color 0.3s ease !important;
}

body.site header.header .container-topbar a:hover,
.container-topbar .mod-custom a:hover { 
    color: var(--thg-orange) !important; 
}

/* Das Suchfeld (Lupe - Ruhezustand für Desktop & Mobile gleich) */
.container-topbar search,
.container-topbar .mod-finder {
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
}

.container-topbar .js-finder-search-query {
    width: 28px !important;
    height: 28px !important;
    padding: 0 !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 15px !important;
    
    /* 10% Deckkraft */
    background-color: rgba(255, 255, 255, 0.1) !important; 
    backdrop-filter: blur(5px) !important;
    
    /* Lupen-Icon */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='%23525659' d='M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 13px !important;
    
    color: transparent !important; 
    cursor: pointer !important;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    box-shadow: none !important;
}

.container-topbar .js-finder-search-query::placeholder {
    color: transparent !important;
}

.container-topbar .js-finder-search-query:hover {
    background-color: rgba(255, 255, 255, 0.2) !important; 
}

/* Label für Screenreader verstecken */
.container-topbar label.finder {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0;
}


/* =========================================
   2. LOGO- & MENÜ-CONTAINER
   ========================================= */

/* --- ZEILE 2 (LINKS): DAS LOGO --- */
body.site header.header > .grid-child:not(.container-nav):not(.container-topbar) {
    order: 2 !important; 
    flex: 0 1 auto !important;
    width: auto !important;
    padding: 10px 0 10px 20px !important;
    margin: 0 !important;
}

.navbar-brand img {
    max-height: 100px !important; 
    width: auto !important;
}

/* --- ZEILE 2 (RECHTS): DER MENÜ-CONTAINER --- */
body.site header.header > .grid-child.container-nav {
    order: 3 !important; 
    flex: 0 1 auto !important;
    width: auto !important;
    padding: 10px 20px 10px 0 !important;
    margin: 0 !important;
    
    /* Verhindert das Abschneiden der Dropdowns */
    overflow: visible !important; 
}

body.site header.header .nav-link, 
body.site header.header ul.metismenu a {
    color: var(--thg-grey) !important;
    font-family: var(--font-primary) !important;
    font-size: var(--text-sm) !important;
    font-weight: 600 !important;
    letter-spacing: 1px !important;
    text-transform: uppercase !important;
    text-decoration: none !important;
    transition: color 0.3s ease !important;
}

body.site header.header ul.metismenu a:hover {
    color: var(--thg-red) !important;
}


/* ==========================================================================
   3. MASTER MOBILE & INTERMEDIATE VIEW (bis 1199px)
   ========================================================================== */

/* --- A. DESKTOP: Menü ist horizontal, Button ist weg --- */
@media (min-width: 1200px) {
    .thg-mobile-toggler { display: none !important; }
    .container-nav .mod-list { display: flex !important; }

    /* Fokus-Zustand Suche (Desktop) */
    .container-topbar .js-finder-search-query:focus {
        width: 170px !important;
        background-color: rgba(255, 255, 255, 0.9) !important;
        border: 1px solid var(--thg-blue) !important; 
        padding: 2px 10px 2px 30px !important; 
        font-size: 0.8rem !important;
        color: var(--thg-grey) !important;
        cursor: text !important;
        outline: none !important;
    }

    .container-topbar .js-finder-search-query:focus::placeholder {
        color: #aaaaaa !important;
    }
}

/* --- B. MOBIL & ZWISCHENGRÖSSE (<1200px) --- */
@media (max-width: 1199px) {
    
    body.site header.header > .grid-child:not(.container-nav):not(.container-topbar) {
        flex: 1 1 auto !important; 
        max-width: calc(100% - 80px) !important; 
    }
    
    body.site header.header > .grid-child.container-nav {
        flex: 0 0 auto !important;
        width: auto !important;
        padding: 10px 20px 10px 0 !important;
        position: static !important; 
    }

    /* Burger-Button Design */
    .thg-mobile-toggler {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 45px !important;
        height: 45px !important;
        padding: 0 !important;
        background: var(--thg-blue, #001B4C) !important;
        color: #fff !important;
        border: none !important;
        border-radius: 6px !important;
        font-size: 26px !important;
        margin: 0 !important;
        cursor: pointer;
    }

    /* Das Aufklapp-Menü */
    .container-nav .mod-list {
        display: none !important; 
        flex-direction: column !important;
        position: absolute !important; 
        top: 100% !important;
        left: 0 !important;
        width: 100% !important;
        background: #fff !important;
        border-top: 3px solid var(--thg-red) !important; 
        padding: 0 !important;
        box-shadow: 0 10px 20px rgba(0,0,0,0.15) !important;
        z-index: 9999 !important; 
    }

    .container-nav .mod-list.active { display: flex !important; }

    /* Einzelpunkte Formatierung */
    .container-nav .mod-list.active li {
        width: 100% !important;
        border-bottom: 1px solid #f0f0f0 !important;
    }
    
    .container-nav .mod-list.active > li > a {
        padding: 15px 20px !important;
        display: block !important;
        width: calc(100% - 60px) !important; 
    }

    /* UNTERMENÜS Ziehharmonika */
    .container-nav .mod-list.active .mm-collapse {
        display: none !important; 
        position: static !important;
        background: #f9f9f9 !important;
        padding-left: 0 !important;
        box-shadow: inset 0 3px 6px rgba(0,0,0,0.03) !important;
    }

    .container-nav .mod-list.active .mm-collapse.mm-show {
        display: block !important; 
    }
    
    .container-nav .mod-list.active .mm-collapse a {
        padding: 12px 20px 12px 40px !important; 
        font-size: 0.95rem !important;
        display: block !important;
        width: 100% !important;
    }

    /* Klick-Pfeil Bereich */
    .container-nav .mod-list.active li.parent {
        position: relative !important;
    }

    .container-nav .mod-list.active .mm-toggler {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        position: absolute !important;
        right: 0 !important;
        top: 0 !important;
        height: 54px !important; 
        width: 60px !important;
        background: transparent !important;
        border: none !important;
        border-left: 1px solid #f0f0f0 !important; 
        color: var(--thg-blue) !important;
        font-size: 1.2rem !important;
        z-index: 10 !important;
        cursor: pointer;
    }
    
    .container-nav .mod-list.active .mm-toggler[aria-expanded="true"] {
        color: var(--thg-red) !important;
        background: #f9f9f9 !important;
    }

    /* Smartphone-Ansicht Suche */
    body.site header.header .container-topbar {
        justify-content: center !important;
        flex-direction: row !important;
        gap: 10px !important;
        padding: 10px !important;
    }
    
    body.site header.header .container-topbar p,
    .container-topbar .mod-custom p {
        font-size: 0.75rem !important;
    }

    .container-topbar .js-finder-search-query:focus {
        width: 100% !important; 
        background-color: #ffffff !important;
        border: 1px solid var(--thg-blue) !important; 
        padding: 2px 10px 2px 30px !important; 
        font-size: 0.9rem !important;
        color: var(--thg-grey) !important;
        margin-top: 5px !important;
        outline: none !important;
    }

    .navbar-brand img {
        max-height: 80px !important; 
        width: auto !important;
    }
}


/* ==========================================================================
   4. HERO SLIDER: PREMIUM EDITION (FINAL SCRIPT-FIX)
   ========================================================================== */

body.view-article #mod-custom110,
body.site:not(.view-featured) #mod-custom110 {
    display: none !important;
}

.container-banner {
    background: #f0f2f5 !important; 
    width: 100% !important;
    position: relative;
    z-index: 1 !important; /* <--- Hier liegt der Slider, der das Dropdown überlagert hatte! */
}

#thgSlider {
    max-width: 1600px !important; 
    margin: 0 auto !important; 
    box-shadow: 0 20px 50px rgba(0,0,0,0.1) !important;
    overflow: hidden;
    position: relative;
}

#thgSlider .carousel-item img {
    width: 100% !important;
    height: clamp(400px, 35vw, 600px) !important;        
    object-fit: cover !important;
    object-position: center 15% !important; 
}

/* Pfeile & Navigation */
#thgSlider .carousel-control-prev-icon,
#thgSlider .carousel-control-next-icon {
    filter: invert(1) grayscale(100%) brightness(0.2) !important; 
}

#thgSlider .carousel-control-prev,
#thgSlider .carousel-control-next {
    width: 60px !important;
    height: 60px !important;
    background: rgba(255, 255, 255, 0.4) !important; 
    border-radius: 50% !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    margin: 0 20px !important;
    opacity: 0.7 !important;
    transition: all 0.3s ease !important;
    z-index: 100 !important; 
}

#thgSlider .carousel-control-prev:hover,
#thgSlider .carousel-control-next:hover {
    background: rgba(255, 255, 255, 0.8) !important;
    opacity: 1 !important;
}

#thgSlider .carousel-indicators {
    z-index: 101 !important; 
}

#thgSlider .carousel-indicators [data-bs-target] {
    background-color: var(--thg-grey) !important; 
    width: 40px !important;
    height: 6px !important;
    border-radius: 3px !important;
    border: none !important;
    margin: 0 5px !important;
    opacity: 0.4 !important;
}

#thgSlider .carousel-indicators .active {
    opacity: 1 !important;
    background-color: var(--thg-red) !important; 
    width: 60px !important; 
}

/* Floating Glass-Card Textbox */
#thgSlider .carousel-caption.thg-caption {
    position: absolute !important;
    left: 5% !important;
    right: auto !important;
    bottom: 8% !important; 
    width: auto !important;
    max-width: 550px !important;
    background: rgba(255, 255, 255, 0.88) !important; 
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    padding: 30px 40px !important;
    border-radius: 20px !important; 
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12) !important;
    text-align: left !important;
    margin: 0 !important;
    opacity: 0;
    transform: translateY(30px);
    z-index: 10 !important;
}

#thgSlider .carousel-item.active .carousel-caption.thg-caption {
    animation: heroTextPop 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.4s forwards !important;
}

#thgSlider .carousel-caption.thg-caption h3 {
    margin: 0 !important;
    color: var(--thg-grey) !important;
    font-family: var(--font-primary) !important;
    font-size: var(--text-xxl) !important; 
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: -0.5px !important;
    line-height: 1.2 !important;
    border-left: 6px solid var(--thg-red) !important;
    padding-left: 20px !important;
}

@keyframes heroTextPop {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

@media (max-width: 991px) {
    #thgSlider .carousel-caption.thg-caption {
        left: 5% !important;
        right: 5% !important;
        bottom: 5% !important;
        max-width: 90% !important;
        padding: 15px 20px !important; 
    }
    
    #thgSlider .carousel-caption.thg-caption h3 {
        font-size: 1.4rem !important; 
        line-height: 1.3 !important;
        border-left: 4px solid var(--thg-red) !important; 
        padding-left: 12px !important;
    }

    #thgSlider .carousel-control-prev,
    #thgSlider .carousel-control-next {
        display: none !important; 
    }
}


/* =========================================
   5. NEWS-GRID & KATEGORIE-BLOG
   ========================================= */
#main .container-component {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

.blog-items {
    display: block !important;
    column-count: 2 !important;
    column-gap: 35px !important;
    margin-top: 0 !important; 
    padding-top: 0 !important;
    column-fill: balance !important; 
}

.blog-item {
    display: block !important; 
    break-inside: avoid !important;
    margin-top: 0 !important; 
    margin-bottom: 35px !important;
    width: 100% !important;
    background: #ffffff !important;
    border: none !important; 
    border-radius: 12px !important; 
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06) !important; 
    overflow: hidden !important; 
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}

.blog-item:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12) !important;
}

.blog-item .item-image img {
    width: 100% !important;
    height: auto !important; 
    display: block !important;
}

.blog-item .item-content { 
    padding: 25px !important; 
}

.blog-item h2 a,
.blog-item .item-title a {
    color: var(--thg-blue) !important;
    font-family: var(--font-primary) !important;
    font-size: var(--text-md) !important;
    font-weight: 800 !important;
    text-decoration: none !important;
    line-height: 1.3 !important;
    display: block !important;
    margin-bottom: 10px !important;
}

.blog-item h2 a:hover,
.blog-item .item-title a:hover {
    color: var(--thg-red) !important;
    text-decoration: none !important;
}

.blog-item .page-header, 
.blog-item h2 {
    border-left: none !important;
    padding-left: 0 !important;
    margin: 0 0 10px 0 !important;
}

.tags.js-category-tags a {
    background: var(--thg-tag-bg) !important;
    color: #fff !important;
    padding: 4px 10px !important;
    font-size: var(--text-xs) !important;
    font-family: var(--font-primary) !important;
    font-weight: 700 !important;
    border-radius: 4px !important;
}

@media (max-width: 991px) {
    .blog-items { column-count: 1 !important; }
}

.com-content-category-blog h2 a, 
.blog-item h2 a {
    color: inherit !important;
    text-decoration: none !important;
}
.com-content-category-blog h2 a:hover, 
.blog-item h2 a:hover {
    color: inherit !important;
    text-decoration: none !important;
    opacity: 0.8;
}


/* =========================================
   6. SIDEBAR: TERMINE & QUICKLINKS
   ========================================= */
#main .sidebar-right {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

.sidebar-right .card {
    background: #ffffff !important;
    margin-top: 0 !important; 
    margin-bottom: 35px !important;
    border: none !important; 
    border-radius: 12px !important; 
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06) !important;
    overflow: hidden !important;
}

.sidebar-right .card-header, 
.sidebar-right h3,
.sidebar-right .mod-dpcalendar-items-title {
    background: transparent !important;
    color: var(--thg-blue) !important; 
    font-family: var(--font-primary) !important;
    font-weight: 800 !important;
    font-size: var(--text-md) !important;
    padding: 20px 20px 10px 20px !important;
    margin: 0 !important;
    border-bottom: 2px solid #f0f0f0 !important;
    line-height: 1.2 !important;
}

.sidebar-right .card-body {
    padding: 20px !important;
}

.sidebar-right .mod-dpcalendar-items-event-title,
.sidebar-right a,
.sidebar-right p,
.sidebar-right li {
    font-family: var(--font-primary) !important;
    font-size: var(--text-sm) !important;
    color: var(--thg-grey) !important;
}

.mod-custom ul { list-style: none !important; padding: 0 !important; margin: 0 !important; }
.mod-custom ul li {
    padding: 12px 0 !important;
    border-bottom: 1px solid #f0f0f0 !important;
    transition: padding-left 0.3s ease !important;
}
.mod-custom ul li:hover { padding-left: 5px !important; }

.mod-custom ul li a {
    color: var(--thg-grey) !important;
    font-weight: 600 !important;
    text-decoration: none !important;
}
.mod-custom ul li a:hover { color: var(--thg-orange) !important; }

.sidebar-right .mod-dpcalendar-items-date {
    font-family: var(--font-primary) !important;
    font-weight: 700 !important;
}


/* =========================================
   7. FOOTER
   ========================================= */
body.site footer#footer,
body.site .container-footer,
footer.full-width {
    background-color: #f8f9fa !important; 
    background-image: none !important;
    border-top: 1px solid #eeeeee !important;
    padding: 20px 0 !important; 
    margin-top: 20px !important; 
    color: var(--thg-grey) !important;
}

footer.footer .grid-child,
footer.footer .container,
footer.footer .mod-custom {
    display: block !important;
    width: 100% !important;
    text-align: center !important;
    margin: 0 auto !important;
}

footer.footer .mod-custom,
footer.footer .mod-custom p {
    color: var(--thg-grey) !important;
    font-family: var(--font-primary) !important;
    font-size: var(--text-sm) !important;
    margin: 0 !important;
}

footer.footer a {
    color: var(--thg-grey) !important;
    text-decoration: none !important;
    margin: 0 10px !important;
    transition: color 0.3s ease !important;
}
footer.footer a:hover { color: var(--thg-orange) !important; }


/* ==========================================================================
   8. SEITENTITEL MIT ROTEM AKZENTBALKEN (KORRIGIERT)
   ========================================================================== */

/* Den roten Balken direkt auf die Hauptüberschriften anwenden */
.page-header h1, 
.com-content-category-blog h1,
.item-page h1 {
    display: block !important;
    border-left: 6px solid var(--thg-red) !important;
    padding: 0.2rem 0 0.2rem 20px !important; 
    margin: 2rem 0 2rem 0 !important; 
    font-size: 2.6rem !important;
    font-weight: 800 !important;
    color: var(--thg-blue) !important;
    line-height: 1.1 !important;
    letter-spacing: -0.5px !important;
    background: transparent !important;
}

/* Verhindert doppelte Rahmen/Abstände, falls Joomla noch einen Wrapper drumherum legt */
.page-header {
    border-left: none !important;
    padding-left: 0 !important;
    margin: 0 !important;
}

/* Abstand unter der Kategorie-Beschreibung anpassen */
.com-content-category-blog .category-desc {
    margin-top: 1rem !important; 
    margin-bottom: 2.5rem !important;
}

/* =========================================
   11. DESKTOP NAVIGATION DROPDOWN-FIX
   ========================================= */
@media (min-width: 1200px) {

  .container-nav ul.metismenu {
      overflow: visible !important;
  }

  .container-nav ul.metismenu > li.parent {
      position: relative !important;
      overflow: visible !important;
  }

  /* Die Dropdown-Box */
  .container-nav ul.metismenu ul.mm-collapse {
      display: none !important;
      position: absolute !important;
      top: 100% !important;
      left: 0 !important; /* Standard: nach rechts ausklappen */
      background-color: #ffffff !important;
      
      min-width: 250px !important;    
      max-width: 320px !important;    
      width: auto !important;

      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
      padding: 0.5rem 0 !important;
      z-index: 1050 !important;
      border-radius: 4px !important;
      border-top: 3px solid var(--thg-blue) !important; 
      margin: 0 !important;
  }

  /* LOGIK: Wenn ein Menüpunkt am rechten Rand steht (hier: "SERVICE" ist der letzte Punkt), 
     klappen wir ihn nach LINKS aus. */
  .container-nav ul.metismenu > li.parent:last-child > ul.mm-collapse {
      left: auto !important;
      right: 0 !important; /* Heftet das Dropdown an den rechten Rand an */
  }

  /* Trigger bei Hover: Einblenden */
  .container-nav ul.metismenu > li.parent:hover > ul.mm-collapse,
  .container-nav ul.metismenu > li.parent.mm-active > ul.mm-collapse,
  .container-nav ul.metismenu > li.parent:focus-within > ul.mm-collapse {
      display: block !important;
      height: auto !important;
      visibility: visible !important;
      opacity: 1 !important;
  }

  /* Textformatierung */
  .container-nav ul.metismenu ul.mm-collapse li a {
      color: #495057 !important;
      display: block !important;
      text-decoration: none !important;
      font-size: 0.95rem !important;
      white-space: normal !important;   
      word-wrap: break-word !important; 
      line-height: 1.2 !important;      
      padding: 8px 20px !important; 
      background-color: transparent !important;
  }

  .container-nav ul.metismenu ul.mm-collapse li a:hover {
      background-color: #f0f4fb !important; 
      color: var(--thg-blue) !important;
  }
}

/* =========================================
   12. THG DESIGN: INTERAKTIVES FÄCHER BOARD
   ========================================= */
.thg-board-container { margin: 20px 0; clear: both; }
.thg-hero-box {
  background: var(--thg-blue) !important; color: #ffffff !important;
  padding: 30px 20px; border-radius: 6px; margin-bottom: 30px; text-align: center;
}
.thg-hero-box h1 { color: #ffffff !important; margin: 0 0 10px 0 !important; font-size: 28px !important; }
.thg-hero-box p { color: #f0f4fb !important; margin: 0 !important; }
.thg-board-grid {
  display: grid !important; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
  gap: 15px !important; width: 100% !important;
}
.thg-card {
  background: #ffffff !important; border: 1px solid #e9ecef !important; border-radius: 6px !important;
  padding: 15px !important; box-shadow: 0 2px 4px rgba(0,0,0,0.04) !important; display: flex !important;
  flex-direction: column !important; transition: all 0.2s ease;
}
.thg-board-grid a.thg-card:hover {
  border-color: var(--thg-blue) !important; box-shadow: 0 4px 10px rgba(0,27,76,0.1) !important;
  transform: translateY(-3px); text-decoration: none !important;
}
.thg-card h3 { font-size: 18px !important; color: var(--thg-blue) !important; margin: 0 0 5px 0 !important; padding: 0 !important; font-weight: 700 !important; }
.thg-card p { font-size: 13px !important; line-height: 1.4 !important; color: #495057 !important; margin: 0 !important; }
.thg-meta { font-size: 10px !important; font-weight: bold !important; text-transform: uppercase !important; margin-bottom: 5px !important; display: block !important; }
.card-af1 { border-left: 4px solid #3182ce !important; } .card-af1 .thg-meta { color: #3182ce !important; }
.card-af2 { border-left: 4px solid #319795 !important; } .card-af2 .thg-meta { color: #319795 !important; }
.card-af3 { border-left: 4px solid #dd6b20 !important; } .card-af3 .thg-meta { color: #dd6b20 !important; }
.card-weitere { border-left: 4px solid #6c757d !important; } .card-weitere .thg-meta { color: #6c757d !important; }
.card-diff { border-left: 4px solid #6366f1 !important; background-color: #f0f4fb !important; } .card-diff .thg-meta { color: #6366f1 !important; }


/* ==========================================================================
   13. THG FÄCHER- & PROFIL-DETAILSEITEN
   ========================================================================== */
.thg-fach-detail {
    font-family: var(--font-primary), sans-serif; line-height: 1.6; color: var(--thg-grey); max-width: 100%; margin: 0 auto; padding: 10px 0;
}
.thg-fach-lead {
    font-size: 1.2rem; font-weight: 500; line-height: 1.7; color: #222; margin-bottom: 30px; padding-left: 15px; border-left: 4px solid var(--thg-blue);
}
.thg-fach-section { margin-bottom: 35px; }
.thg-fach-section h3 { font-size: 1.4rem; color: #111 !important; margin-bottom: 15px; font-weight: 600; border-bottom: 1px solid #eee; padding-bottom: 5px; }
.thg-fach-section p { margin-bottom: 15px; }
.thg-fach-section ul { list-style-type: none; padding-left: 0; margin-bottom: 20px; }
.thg-fach-section ul li { position: relative; padding-left: 20px; margin-bottom: 8px; }
.thg-fach-section ul li::before { content: "•"; color: var(--thg-blue); font-weight: bold; font-size: 1.2rem; position: absolute; left: 0; top: -2px; }
.thg-fach-detail blockquote { background-color: #f8f9fa; border-left: 4px solid #6c757d; padding: 15px 20px; margin: 20px 0; font-style: italic; }
.thg-fach-detail blockquote p { margin-bottom: 5px !important; }
.thg-fach-detail blockquote cite { font-size: 0.9rem; color: #666; font-style: normal; font-weight: bold; display: block; }
.card-af1 .thg-fach-lead { border-left-color: #3182ce; } .card-af3 .thg-fach-lead { border-left-color: #dd6b20; } .card-weitere .thg-fach-lead { border-left-color: #6c757d; } 

.thg-table { width: 100%; margin: 20px 0 30px 0; border-collapse: collapse; }
.thg-table th { background-color: #f3f4f6; color: #1f2937; font-weight: bold; padding: 12px; border-bottom: 2px solid #e5e7eb; }
.thg-table td { padding: 12px; border-bottom: 1px solid #f3f4f6; color: #4b5563; }
.thg-table tr:hover { background-color: #fafafa; }
.thg-download-box { background-color: #f9fafb; border: 1px solid #e5e7eb; border-radius: 6px; padding: 25px; margin-top: 40px; }
.thg-download-box h3 { margin-top: 0; font-size: 1.25rem; color: #111 !important; margin-bottom: 15px; }
.thg-download-list { list-style: none !important; padding-left: 0 !important; margin-bottom: 0 !important; }
.thg-download-item { padding: 10px 12px; background: #ffffff; border: 1px solid #f3f4f6; border-radius: 4px; margin-bottom: 10px; transition: all 0.2s ease-in-out; }
.thg-download-item:last-child { margin-bottom: 0; }
.thg-download-item:hover { border-color: #cbd5e1; background-color: #f8fafc; transform: translateX(2px); }
.thg-download-item a { color: var(--thg-blue); text-decoration: none; font-weight: 500; display: flex; align-items: center; }
.thg-download-item a:hover { color: var(--thg-red); text-decoration: underline; }
.thg-download-icon { margin-right: 10px; font-size: 1.1rem; }
.thg-fach-detail img.alignleft { float: left; margin: 0 20px 20px 0; max-width: 300px; height: auto; }
.thg-fach-detail img.alignright { float: right; margin: 0 0 20px 20px; max-width: 300px; height: auto; }

/* =========================================
   14. ARTIKELBILDER TEXTUMFLUSS
   ========================================= */
.com-content-article .item-image { float: right !important; width: 40% !important; max-width: 500px !important; margin: 0 0 20px 30px !important; clear: none !important; }
.com-content-article .item-image img { display: block !important; width: 100% !important; height: auto !important; border-radius: 8px !important; }
.com-content-article::after { content: ""; display: block; clear: both; }
@media (max-width: 768px) {
    .com-content-article .item-image { float: none !important; width: 100% !important; max-width: 100% !important; margin: 0 0 20px 0 !important; }
}

/* ==========================================================================
   16. SCHULPROGRAMM-TABELLEN: MOBILE OPTIMIERUNG
   ========================================================================== */
@media (max-width: 991px) {
    .thg-table, .thg-table thead, .thg-table tbody, .thg-table th, .thg-table td, .thg-table tr { display: block !important; width: 100% !important; }
    .thg-table thead { display: none !important; }
    .thg-table tr { margin-bottom: 20px !important; border: 1px solid #ddd !important; border-radius: 8px !important; overflow: hidden !important; background: #fff !important; }
    .thg-table td { padding: 15px !important; border: none !important; border-bottom: 1px solid #eee !important; }
    .thg-table td:first-child { background-color: var(--thg-blue) !important; color: #fff !important; font-weight: bold !important; }
}

/* ==========================================================================
   17. KATEGORIE-BLOG & STARTSEITE: KOMPAKTES KARTEN-DESIGN
   ========================================================================== */
.com-content-category-blog.blog .blog-items { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)) !important; gap: 30px !important; margin-top: 20px !important; }
.com-content-category-blog .blog-item { background: #ffffff !important; padding: 25px !important; border-radius: 12px !important; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06) !important; transition: transform 0.3s ease, box-shadow 0.3s ease !important; display: flex !important; flex-direction: column !important; }
.com-content-category-blog .blog-item:hover { transform: translateY(-5px) !important; box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12) !important; }
.com-content-category-blog .blog-item h2 { font-size: var(--text-md) !important; color: var(--thg-blue) !important; font-weight: 800 !important; margin-bottom: 15px !important; line-height: 1.3 !important; }

/* WEITERLESEN-BUTTON (GLOBAL FÜR STARTSEITE UND BLOGS) */
.blog-item .readmore a,
.com-content-category-blog .readmore a,
.blog-featured .readmore a { 
    display: inline-block !important; 
    margin-top: 15px !important; 
    padding: 8px 15px !important; 
    background: var(--thg-blue) !important; 
    color: #ffffff !important; 
    border: none !important;
    border-radius: 6px !important; 
    font-size: var(--text-xs) !important; 
    font-weight: 600 !important; 
    text-decoration: none !important; 
    transition: background 0.3s ease !important; 
}

.blog-item .readmore a:hover,
.com-content-category-blog .readmore a:hover,
.blog-featured .readmore a:hover { 
    background: var(--thg-red) !important; 
    color: #ffffff !important;
}

@media (max-width: 768px) { .com-content-category-blog.blog .blog-items { grid-template-columns: 1fr !important; } }


/* ==========================================================================
   19. PERSONEN-PROFIL-KARTEN (OPTIMIERT & ROBUST)
   ========================================================================== */
.thg-profil-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 25px; margin: 30px 0; }
.thg-profil-card { background: #ffffff; border-radius: 8px; padding: 15px; box-shadow: 0 2px 10px rgba(0,0,0,0.08); display: flex; align-items: center; gap: 15px; border-left: 4px solid var(--thg-blue); transition: all 0.3s ease-in-out !important; border-left: 4px solid var(--thg-blue) !important; }
.thg-profil-card img { width: 90px !important; height: 90px !important; object-fit: cover !important; border-radius: 4px; flex-shrink: 0; transition: transform 0.3s ease-in-out !important; }
.thg-profil-info h4 { margin: 0 0 4px 0 !important; color: var(--thg-blue) !important; font-size: 1.1rem !important; font-weight: 700 !important; }
.thg-profil-info p { margin: 0 0 8px 0 !important; font-size: 0.9rem !important; color: var(--thg-grey); line-height: 1.3 !important; }
.thg-profil-info a { font-weight: 600; font-size: 0.85rem; color: var(--thg-red); text-decoration: none; }
.thg-profil-card:hover { transform: translateY(-5px) !important; box-shadow: 0 15px 30px rgba(0, 0, 0, 0.12) !important; border-left-color: var(--thg-red) !important; background-color: #ffffff !important; }
.thg-profil-card:hover img { transform: scale(1.05) !important; }


/* ==========================================================================
   21. - Barrierefreie Kollegiums-Tabelle
   ========================================================================== */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 30px; }
.thg-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; background-color: #ffffff; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); }
.thg-table th { background-color: #00205b; color: #ffffff; text-align: left; padding: 12px 15px; font-weight: bold; }
.thg-table td { padding: 12px 15px; border-bottom: 1px solid #eeeeee; color: #333333; vertical-align: top; }
.thg-table tbody tr:nth-of-type(even) { background-color: #f9f9f9; }
.thg-table tbody tr:hover, .thg-table tbody tr:focus-within { background-color: #f0f4f8; }
.thg-table a { color: #b21b2a; font-weight: bold; text-decoration: none; padding: 2px 4px; border-radius: 3px; }
.thg-table a:hover { text-decoration: underline; }
.thg-table a:focus-visible { outline: 3px solid #00205b; outline-offset: 2px; text-decoration: underline; }

/* Startseiten-Beiträge im Zick-Zack anordnen UND auf gleiche Höhe bringen */
@media (min-width: 768px) {
    .blog-items.columns-2 {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        column-count: auto !important; /* Schaltet das alte Layout sicher ab */
        gap: 2rem;
    }
    
    .blog-items.columns-2 .blog-item {
        display: flex;
        flex-direction: column;
        margin-bottom: 0 !important; /* Verhindert doppelte Abstände */
        break-inside: auto !important;
        height: 100%; /* Zieht die Boxen auf die exakt gleiche Höhe */
    }
}

/* ==========================================================================
   22. STARTSEITEN-BILDER BÜNDIG (OHNE WEISSEN RAND)
   ========================================================================== */
.blog-items .blog-item {
    padding: 0 !important; 
    overflow: hidden !important; 
}

.blog-items .blog-item figure.item-image {
    float: none !important; 
    margin: 0 !important;
    width: 100% !important;
}

.blog-items .blog-item figure.item-image img {
    width: 100% !important;
    height: auto !important;
    display: block !important; 
    border-radius: 0 !important; 
}

.blog-items .blog-item .item-content {
    padding: 25px !important; /* Gibt dem Text exakt Ihren gewünschten Abstand zurück */
}

