/*
Theme Name: dtheme
Theme URI: https://example.com/dtheme
Author: Your Name
Author URI: https://example.com
Description: Minimal-Theme mit linker Navigation und rechtem Elementor-Inhaltsbereich.
Version: 1.0.0
Text Domain: dtheme
*/

/* Grundfarben und Schriftart */
:root{
    --accent: #f0bd3f;
    --font-family: 'Roboto', sans-serif;
    --bg-primary: #fff;
    --bg-secondary: #f5f5f5;
    --text-primary: #000;
    --text-secondary: #666;
    --sidebar-bg: #111;
    --sidebar-text: #fff;
}

/* Dark Mode Variablen */
[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --text-primary: #fff;
    --text-secondary: #ccc;
    --sidebar-bg: #000;
    --sidebar-text: #fff;
}

/* Globale Schriftart */
*{
    font-family: var(--font-family);
}

/* Linkfarbe global */
a{ color: var(--accent); }
a:hover, a:focus{ color: #d9a62a; }

/* Layout: links Navigation, rechts Inhalt */
html, body{ height:100%; }
body{
    margin:0;
}

.dtheme-layout{
    display:flex;
    min-height:100vh;
}

.dtheme-sidebar{
    width:300px;
    background:#111;
    color:#fff;
    padding:24px;
    flex-shrink:0;
}

.dtheme-branding{ margin-top:1cm; margin-bottom:24px; }
.dtheme-branding .custom-logo{ max-width:100%; height:auto; }
.dtheme-branding .site-title{ color:#fff; font-weight:700; text-decoration:none; }

.dtheme-sidebar a{ color: var(--accent); text-decoration:none; }
.dtheme-sidebar a:hover{ text-decoration:underline; }

.dtheme-nav{ margin-top:1cm; }

.dtheme-content{
    flex:1;
    padding:24px;
    background:var(--bg-primary);
    color:var(--text-primary);
    min-width:0;
    overflow-x:hidden;
    max-width:none;
    display:flex;
    flex-direction:column;
    min-height:100vh;
}

/* Volle Breite im Content-Bereich */
.site-main{ max-width:none; margin:0 auto; }

/* Elementor Korrekturen im Inhaltsbereich */
.dtheme-content .elementor{ max-width:none; }

/* H1 Schriftgröße anpassen */
.dtheme-content h1{
    font-size:2em;
    font-weight:normal;
}

/* H2 Schriftgröße anpassen */
.dtheme-content h2{
    font-size:1.6em;
    font-weight:normal;
}

/* Mobile Titel - nur auf mobilen Geräten sichtbar */
.dtheme-mobile-title{
    display:none;
    text-align:left;
    font-size:2.5em;
    font-weight:bold;
    color:#000;
    margin:20px 0 30px 0;
    text-transform:uppercase;
    letter-spacing:2px;
}

/* Header Toggle Button */
.dtheme-toggle{
    display:none;
    position:fixed;
    top:20px;
    right:20px;
    z-index:1001;
    width:60px;
    height:60px;
    background:#111;
    color:#fff;
    border:0;
    border-radius:8px;
    font-size:24px;
}
.dtheme-toggle:focus{ outline:2px solid var(--accent); outline-offset:2px; }

/* Größeres Hamburger-Menü für mobile */
@media (max-width: 1024px){
    .dtheme-toggle{
        width:80px;
        height:80px;
        font-size:32px;
        top:15px;
        right:15px;
    }
}

/* Theme Toggle Button - Ausgeblendet */
.dtheme-theme-toggle{
    display:none;
}

/* Offcanvas für mobile */
@media (max-width: 1024px){
    .dtheme-layout{ position:relative; }
    .dtheme-toggle{ display:inline-flex; align-items:center; justify-content:center; }
    .dtheme-sidebar{
        position:fixed;
        left:0;
        top:0;
        bottom:0;
        width:300px;
        transform:translateX(-100%);
        transition:transform .25s ease;
        box-shadow: 0 10px 30px rgba(0,0,0,.4);
        z-index:1000;
        overflow-y:auto;
        max-height:100vh;
    }
    .dtheme-sidebar.is-open{ transform:translateX(0); }
    .dtheme-content{ padding:24px; }
    
    /* Mobile Titel anzeigen */
    .dtheme-mobile-title{
        display:block;
    }
    
    /* Untermenüs mobil: per Tap auf/zu (Klasse is-open vom JS) */
    .dtheme-nav .sub-menu{
        position:relative;   /* nicht absolut, damit es unter dem Parent fließt */
        top:auto; left:auto; right:auto; /* alle Offsets zurücksetzen */
        opacity:0;
        max-height:0;
        overflow:hidden;
        width:100%;
        background:transparent;
        margin:8px 0 0 0; /* unter dem Parent */
        box-shadow:none;
        border-radius:0;
        transition:max-height 0.25s ease, opacity 0.25s ease;
    }

    .dtheme-nav .menu > li.is-open > .sub-menu{
        opacity:1;
        max-height:600px; /* ausreichend für mehrere Items */
    }
    /* Submenu-Links mobil volle Breite */
    .dtheme-nav .sub-menu a{ 
        width:100%;
        margin:3px 0;
        padding-left:28px; /* Einzug für Hierarchie */
        background: transparent;
    }
    
    /* Slider auf mobil ausblenden */
    .dtheme-slider{
        display:none;
    }
}

@media (max-width: 640px){
    .dtheme-content{ padding:16px; }
}

/* Menü Buttons und Untermenüs */
.dtheme-nav .menu{ 
    list-style:none; 
    margin:0; 
    padding:0;
}

.dtheme-nav .menu > li{ 
    margin:0;
    padding:0;
    position:relative;
}

.dtheme-nav .menu > li + li{
    margin-top:2mm;
}

.dtheme-nav .menu a{
    display:block;
    padding:15px 20px;
    background:var(--accent);
    color:#000;
    border-radius:12px;
    text-decoration:none;
    font-weight:500;
    font-size:16px;
    transition:all 0.3s ease;
    border:none;
    position:relative;
    overflow:hidden;
}
/* Caret Button im Link rechts platzieren */
.submenu-toggle{
    position:absolute;
    right:12px;
    top:50%;
    transform:translateY(-50%);
    background:transparent;
    border:0;
    color:#000;
    font-size:16px;
    cursor:pointer;
}

.dtheme-nav .menu a:before{
    content:'';
    position:absolute;
    top:0;
    left:-100%;
    width:100%;
    height:100%;
    background:linear-gradient(90deg, transparent, rgba(240,189,63,0.3), transparent);
    transition:left 0.5s ease;
}

.dtheme-nav .menu a:hover{
    background:#1a1a1a;
    color:var(--accent);
    transform:none;
    box-shadow:none;
}

.dtheme-nav .menu a:active{
    transform:translateX(2px) scale(0.98);
}

.dtheme-nav .sub-menu{
    list-style:none;
    margin:0;
    padding:0;
    opacity:0;
    max-height:0;
    overflow:hidden;
    transition:all 0.3s ease;
    position:absolute;
    top:0;
    left:100%;
    width:160px;
    background:rgba(0,0,0,0.9);
    border-radius:8px;
    z-index:100;
    margin-left:8px;
}

.dtheme-nav .menu > li:hover .sub-menu{
    opacity:1;
    max-height:200px;
}

.dtheme-nav .sub-menu a{ 
    background:transparent;
    color:var(--accent);
    border:none;
    font-size:13px;
    padding:8px 12px;
    margin:3px 0;
    border-radius:6px;
    width:calc(100% - 20px);
    box-sizing:border-box;
}

.dtheme-nav .sub-menu a:hover{
    background:var(--accent);
    color:#000;
    transform:none;
}

/* Strich für Menü-Items mit Untermenü */
.dtheme-nav .menu > li.menu-item-has-children > a{
    border-left:4px solid #fff;
    padding-left:16px;
}

.dtheme-nav .menu > li.menu-item-has-children > a:hover{
    border-left:4px solid var(--accent);
}

/* Slider Styles */
.dtheme-slider{
    position:relative;
    width:calc(100% + 50px); /* +2px Fudge gegen dünne Ränder */
    margin:-24px -25px 2rem;     /* symmetrisch zu width-Fudge */
    overflow:hidden;
}

.dtheme-slider-container{
    position:relative;
    width:100%;
    height:400px;
    background:var(--bg-primary); /* keine grauen Ränder gegenüber Content */
    overflow:hidden;
}

.dtheme-slide{
    position:absolute;
    top:0;
    left:0;
    width:100%;
    height:100%;
    opacity:0;
    transform:translateX(100%);
    transition:all 4s ease-in-out;
}

.dtheme-slide.active{
    opacity:1;
    transform:translateX(0);
}

.dtheme-slide.prev{
    transform:translateX(-100%);
    opacity:0;
}

.dtheme-slide-image{
    width:100%;
    height:400px;
    object-fit:cover;
    display:block;
}

/* Slider Navigation */
.dtheme-slider-nav{
    position:absolute;
    top:50%;
    transform:translateY(-50%);
    background:rgba(0,0,0,0.7);
    color:#fff;
    border:none;
    width:50px;
    height:50px;
    border-radius:50%;
    font-size:24px;
    cursor:pointer;
    z-index:10;
    transition:background 0.3s ease;
}

.dtheme-slider-nav:hover{
    background:rgba(0,0,0,0.9);
}

.dtheme-slider-prev{
    left:20px;
}

.dtheme-slider-next{
    right:20px;
}

/* Animation: Blur */
.dtheme-slider[data-animation="blur"] .dtheme-slide{
    filter:blur(10px);
    transform:scale(1.1) translateX(0);
}

.dtheme-slider[data-animation="blur"] .dtheme-slide.active{
    filter:blur(0);
    transform:scale(1) translateX(0);
}

.dtheme-slider[data-animation="blur"] .dtheme-slide.prev{
    filter:blur(10px);
    transform:scale(1.1) translateX(0);
}

/* Responsive Slider */
@media (max-width: 768px){
    .dtheme-slider-container{
        height:300px;
    }
    
    .dtheme-slider-nav{
        width:40px;
        height:40px;
        font-size:20px;
    }
    
    .dtheme-slider-prev{
        left:10px;
    }
    
    .dtheme-slider-next{
        right:10px;
    }
    /* Tablet: Content-Padding bleibt 24px → horizontale Korrektur beibehalten */
    .dtheme-slider{
        width:calc(100% + 50px);
        margin:-24px -25px 1.75rem;
    }
}

@media (max-width: 480px){
    .dtheme-slider-container{
        height:250px;
    }
    
    .dtheme-slider-nav{
        width:35px;
        height:35px;
        font-size:18px;
    }
    /* Mobile: .dtheme-content hat padding:16px → auf volle Breite im rechten Bereich korrigieren */
    .dtheme-slider{
        width:calc(100% + 34px); /* +2px Fudge */
        margin:-16px -17px 1.5rem;
    }
}

/* Mobile Override am Dateiende, damit es Desktop-Regel (absolute/left:100%) sicher überschreibt */
@media (max-width: 1024px){
    .dtheme-nav .menu > li > .sub-menu{
        position: static !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        width: 100% !important;
        margin: 8px 0 0 0 !important;
        background: transparent !important;
    }
    .dtheme-nav .menu > li.is-open > .sub-menu{
        opacity: 1 !important;
        max-height: 600px !important;
    }
}

/* Kontakt Badge */
.dtheme-contact-badge{
    margin-top:3rem;
    padding:20px;
    background:linear-gradient(135deg, rgba(240,189,63,0.1), rgba(240,189,63,0.05));
    border:1px solid rgba(240,189,63,0.3);
    border-radius:12px;
    text-align:left;
}

.dtheme-contact-badge .contact-company{
    font-size:2em;
    font-weight:700;
    color:var(--accent);
    margin-bottom:12px;
    text-transform:uppercase;
    letter-spacing:1px;
}

.dtheme-contact-badge .contact-name-line{
    margin-bottom:12px;
    line-height:1.4;
}

.dtheme-contact-badge .contact-function{
    font-weight:600;
    color:#fff;
    margin-right:1px;
}

.dtheme-contact-badge .contact-name{
    font-weight:500;
    color:#fff;
    font-size:1.1em;
}

.dtheme-contact-badge .contact-address{
    color:#ccc;
    margin-bottom:8px;
    line-height:1.4;
}

.dtheme-contact-badge .contact-city{
    color:#ccc;
    margin-bottom:20px;
    font-weight:500;
}

.dtheme-contact-badge .contact-item{
    display:block;
    color:#fff;
    text-decoration:none;
    margin:8px 0;
    padding:8px 12px;
    background:rgba(255,255,255,0.05);
    border-radius:8px;
    transition:all 0.3s ease;
    font-weight:500;
}

.dtheme-contact-badge .contact-item:hover{
    text-decoration:none;
}

.dtheme-contact-badge .contact-item:hover{
    background:var(--accent);
    color:#000;
    transform:translateY(-2px);
    box-shadow:0 4px 12px rgba(240,189,63,0.3);
}

.dtheme-contact-badge .contact-icon{
    margin-right:6px;
    display:inline-block;
}

.dtheme-contact-badge .phone-icon{
    color:var(--accent) !important;
    font-size:1.2em;
    font-weight:bold;
}

.dtheme-contact-badge .email-icon{
    color:var(--accent);
    font-size:1.1em;
}

.dtheme-contact-badge .directions-icon{
    color:var(--accent);
    font-size:1.1em;
}

.dtheme-contact-badge .facebook-icon{
    background:#1877f2;
    color:#fff;
    font-size:14px;
    font-weight:bold;
    width:18px;
    height:18px;
    border-radius:2px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    font-family:Arial, sans-serif;
    margin-right:6px;
    line-height:1;
}

/* Credits im linken Bereich */
.dtheme-credits {
    margin-top: auto;
    padding: 20px 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: lowercase;
    border-top: 1px solid rgba(240,189,63,0.2);
}

[data-theme="dark"] .dtheme-credits {
    color: var(--text-secondary);
    border-top-color: rgba(240,189,63,0.3);
}

/* Dark Mode Styles */
[data-theme="dark"] body {
    background: var(--bg-primary);
    color: var(--text-primary);
}

[data-theme="dark"] .dtheme-sidebar {
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
}

[data-theme="dark"] .dtheme-content {
    background: var(--bg-primary);
    color: var(--text-primary);
}

[data-theme="dark"] .dtheme-slider-container {
    background: var(--bg-primary);
}

[data-theme="dark"] .dtheme-contact-badge {
    background: var(--bg-primary);
    border-color: rgba(240,189,63,0.4);
    color: var(--text-primary);
    margin-top: 3rem;
}

[data-theme="dark"] .dtheme-contact-badge .contact-company {
    color: var(--accent);
}

[data-theme="dark"] .dtheme-contact-badge .contact-function,
[data-theme="dark"] .dtheme-contact-badge .contact-name {
    color: var(--text-primary);
}

[data-theme="dark"] .dtheme-contact-badge .contact-address,
[data-theme="dark"] .dtheme-contact-badge .contact-city {
    color: var(--text-secondary);
}

[data-theme="dark"] .dtheme-contact-badge .contact-item {
    color: var(--text-primary);
    background: rgba(255,255,255,0.1);
}

[data-theme="dark"] .dtheme-contact-badge .contact-item:hover {
    background: var(--accent);
    color: #000;
}