/*
Theme Name: WRD-Theme
Author: Gemini Code Assist
Description: Ein Theme mit Header-Bild, 3-teiligem Menü und Boxed-Layout Optionen.
Version: 1.0
*/

:root {
    --wrd-content-width: 1200px;
    --wrd-content-margin: 20px;
    --wrd-bg-color: #ffffff;
    --wrd-footer-bg: #f0f0f0;
    --wrd-menu-bg: #ffffff;
    --wrd-menu-text: #000080;
    --wrd-menu-height: 49px;
    --wrd-menu-font: sans-serif;
}

body {
    margin: 0;
    font-family: sans-serif;
    background-color: #eee; /* Hintergrund für Boxed Design sichtbar machen */
}

/* --- Header Image --- */
.wrd-header-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    max-height: 400px; /* Optional: Begrenzung */
}

/* --- Sticky Menu Band --- */
.wrd-menu-band {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background-color: var(--wrd-menu-bg);
    color: var(--wrd-menu-text);
    width: 100%;
    z-index: 1000;
    position: sticky; /* Modernes Sticky */
    top: 0;
    box-shadow: none;
    min-height: var(--wrd-menu-height);
    font-weight: bold;
    font-family: var(--wrd-menu-font);
}

.wrd-menu-left, .wrd-menu-right {
    flex: 1 1 auto;
    padding: 0;
}

.wrd-menu-left nav, .wrd-menu-right nav {
    width: 100%;
}

.wrd-menu-right {
    text-align: right;
    display: flex;
}

.wrd-center-title {
    flex: 1 1 auto;
    padding: 5px 3px;
    font-weight: bold;
    text-align: center;
    color: #000;
    font-size: 1.0rem;
    line-height: 1.2;
}

/* Responsive: Center 25% bei schmalen Bildschirmen */
/* @media (max-width: 768px) {
    .wrd-center-title {
        flex: 0 0 25%;
        font-size: 0.9em;
    }
    .wrd-menu-band nav > ul > li > a {
        padding: 5px 10px;
    }
} */


/* --- Navigation Styles --- */
.wrd-menu-band ul{
    list-style: none;
    margin: 0;
    padding: 0;
    /* display: flex; */
    width: 100% !important;
}

/* Untermenü-Struktur Korrektur für schwebende Ebenen */
.wrd-menu-band ul.sub-menu li {
    position: relative; /* Ankerpunkt für die absolute Positionierung der nächsten Ebene */
}

.wrd-menu-band ul.sub-menu li > ul.sub-menu {
    position: absolute;
    top: 0;
    left: 95%; /* Öffnet sich standardmäßig nach rechts */
    min-width: 200px;
    max-width: none !important;
    z-index: 1001;
    box-shadow: 5px 0 15px rgba(0,0,0,0.1);
    width: auto !important;
}

.wrd-menu-band ul li a {
    color: var(--wrd-menu-text);
    text-decoration: none;
    padding: 10px 10px;
    display: flex; /* Umgestellt auf Flex für perfekte Zentrierung */
    align-items: center;
    justify-content: center;
    /* height: 100%; */
    text-align: center;
    /* width: 100% !important; */
}

/* Top Level Menu Items Border */
.wrd-menu-band nav > ul > li > a {
    border: none;
    margin: 0 2px;
    white-space: nowrap;
    border-radius: 0;
    padding: 10px 10px;
    text-align: center;
}

/* Linkes Menü: Rand unten und rechts */
.wrd-menu-left nav > ul > li > a {
    border-bottom: 3px solid rgba(0,0,128,0.3);
    border-right: 3px solid rgba(0,0,128,0.3);
    border-top: 1px solid transparent; /* Platzhalter für Layout-Stabilität */
    border-left: 1px solid transparent;
    border-radius: 0 0 15px 0;
}

/* Rechtes Menü: Rand unten und links */
.wrd-menu-right nav > ul > li > a {
    border-bottom: 3px solid rgba(0,0,128,0.3);
    border-left: 3px solid rgba(0,0,128,0.3);
    border-top: 1px solid transparent;
    border-right: 1px solid transparent;
    border-radius: 0 0 0 15px;
}

/* Dropdown Arrow (Dreieck) */
.wrd-menu-band .sub-menu li.menu-item-has-children > a {
    padding-right: 25px; /* Platz für Pfeil */
}
.wrd-menu-band li.menu-item-has-children > a::after {
    content: '';
    display: inline-block;
    margin-left: 8px;
    vertical-align: middle;
    width: 6px;
    height: 6px;
    border: solid currentColor;
    border-width: 0 1px 1px 0;
    transform: rotate(45deg);
    margin-bottom: 3px;
}

.wrd-menu-right ul {
    justify-content: flex-end;
}

.wrd-menu-band ul li:hover > a {
    background-color: rgba(0,0,128,0.1);
}

/* Submenus */
.wrd-menu-band ul ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    color: #fff;
    flex-direction: column;
    /* min-width: 200px; */
    max-width: 100%;
    overflow: visible;
    /* Hintergrundfarben werden jetzt zentral in der header.php gesteuert */
}

.wrd-menu-band ul li.toggled-open > ul {
    display: block;
}

/* Submenu Item Styles (Customizer) */
.wrd-menu-band ul ul li a {
    display: flex;
    align-items: center;
    justify-content: center; 
    min-height: var(--wrd-sub-height);
    font-family: var(--wrd-sub-font);
    font-size: var(--wrd-sub-size);
    color: #fff;
    font-weight: var(--wrd-sub-weight);
    text-decoration: var(--wrd-sub-dec);
    font-style: var(--wrd-sub-style);
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.wrd-menu-band ul ul li a:hover {
    background-color: orange;
}

/* Fallback Hover für Desktop */
.wrd-menu-band ul li:hover > ul {
    display: block;
}

/* Ausrichtung für rechtes Menü: Untermenüs rechtsbündig */
.wrd-menu-right ul ul {
    left: auto;
    right: 0;
}

/* Unter-Untermenüs im rechten Menü nach links schweben lassen */
.wrd-menu-right ul.sub-menu li > ul.sub-menu {
    left: auto;
    right: 95% !important;
}

/* Separator Style */
.menu-item-separator {
    border-top: 1px solid rgba(255,255,255,0.3);
    margin: 5px 0;
    height: 1px;
    padding: 0 !important;
}

.menu-item-separator hr {
    display: none;
}

/* Active Page Highlight */
.wrd-menu-band ul ul li.current-menu-item > a,
.wrd-menu-band ul ul li.current-menu-ancestor > a,
.wrd-menu-band ul ul li.current_page_item > a {
    background-color: #ffcc00 !important;
    color: #000080 !important;
}

/* Neu-Flag Style für Menüpunkte (Ebene 1 und 2) */
.menu-item-new > a::before {
    content: "Neu" !important;
    flex-shrink: 0; /* Verhindert, dass das Flag gequetscht wird */
            display: inline-block;
            padding: 0.1em 0.4em;
            font-size: 0.7em;
            font-weight: bold;
            line-height: 1;
            color: #fff;
            background-color: #dc3545; /* Bootstrap danger red */
            border-radius: 0.25rem;
            vertical-align: super;
            margin-right: 4px;    
}

/* --- Main Content --- */
.wrd-main-container {
    background-color: var(--wrd-bg-color);
    padding: 20px;
    min-height: 50vh;
}

/* Boxed Design Logic (wird via JS/PHP Klassen gesteuert oder CSS Vars) */
.wrd-layout-boxed {
    max-width: var(--wrd-content-width);
    margin: 1px auto var(--wrd-content-margin);
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.wrd-layout-full {
    width: 100%;
    margin: 0;
}

/* --- Footer --- */
.wrd-footer {
    background-color: var(--wrd-footer-bg);
    padding: 40px 20px;
    margin-top: 40px;
    border-top: 5px solid #ccc; /* Optische Abhebung */
}

.wrd-footer-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    max-width: var(--wrd-content-width);
    margin: 0 auto;
}

.widget {
    margin-bottom: 20px;
}

.widget h2 {
    font-size: 1.2em;
    margin-bottom: 10px;
    border-bottom: 2px solid #ddd;
    padding-bottom: 5px;
}

/* Utility */
.hidden {
    display: none !important;
}