/*
Theme Name: K&E Hausverwaltung Theme
Author: Ihr persönlicher Web Developer
Description: Ein maßgeschneidertes, performantes Theme für die K&E Hausverwaltung, erstellt nach Ihren Vorgaben. 
Version: 1.5
*/

:root {
    --primary-color: #00A99D; /* A shade of green/turquoise */
    --secondary-color: #007A72; /* A darker shade for hover */
    --dark-grey: #333333;
    --light-grey: #f4f4f4;
    --white-color: #ffffff;
    --text-color: #555555;
    --border-radius: 8px;
    --box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--white-color);
    font-size: 16px;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3 {
    color: var(--dark-grey);
    font-weight: 600;
    line-height: 1.3;
}

h1 {
    font-size: 2.8rem;
}

h2 {
    font-size: 2.2rem;
    text-align: center;
    margin-bottom: 50px;
}

h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
}

p {
    margin-bottom: 15px;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

section {
    padding: 80px 0;
}

.section-bg {
    background-color: var(--light-grey);
}

.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-align: center;
    border: 2px solid transparent;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: var(--white-color);
}

/* Header */
#main-header {
    background-color: var(--white-color);
    padding: 15px 0;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: padding 0.3s ease, top 0.3s ease;
}

#main-header.scrolled {
    padding: 10px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

#main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    height: 50px;
    transition: height 0.3s ease;
}
#main-header.scrolled .logo {
    height: 40px;
}


/* --- Dropdown Menu Styles (CORRECTED & FINAL) --- */
#main-nav ul {
    list-style: none;
    display: flex;
    align-items: center; /* Vertikal zentrieren */
}

#main-nav li {
    margin-left: 35px; /* Etwas mehr Abstand */
    position: relative;
}

#main-nav a {
    color: var(--dark-grey);
    font-weight: 500;
    position: relative;
    display: block;
    font-size: 17px; /* Schrift vergrößert */
    padding: 5px 0; /* Gibt dem Link etwas mehr Klickfläche */
    transition: color 0.3s ease; /* Sanfter Farbwechsel beim Hover */
}

#main-nav a:hover {
    color: var(--primary-color);
}

/* Unterstrich-Effekt nur für Menüpunkte OHNE Submenü */
#main-nav > ul > li:not(.menu-item-has-children) > a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

/* Hover-Effekt für Unterstrich nur für Menüpunkte OHNE Submenü */
#main-nav > ul > li:not(.menu-item-has-children):hover > a::after {
    width: 100%;
}

/* Eleganter Dropdown-Pfeil nur für Menüpunkte MIT Submenü */
#main-nav .menu-item-has-children > a {
    padding-right: 20px; /* Mehr Platz für den Pfeil */
}

#main-nav .menu-item-has-children > a::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    margin-top: -4px; /* Feinjustierung für vertikale Mitte */
    width: 7px;
    height: 7px;
    border-style: solid;
    border-width: 0 2px 2px 0;
    border-color: var(--dark-grey);
    transform: rotate(45deg);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

/* Pfeil dreht sich und ändert Farbe beim Hovern */
#main-nav .menu-item:hover > a::after {
    border-color: var(--primary-color);
    transform: rotate(225deg);
    margin-top: -2px;
}

/* Das Submenü selbst */
#main-nav .sub-menu {
    display: none;
    position: absolute;
    top: 110%;
    left: -20px;
    background-color: var(--white-color);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border-radius: var(--border-radius);
    min-width: 240px; /* Etwas breiter für lange Titel */
    z-index: 100;
    padding: 10px 0;
    list-style: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

/* Submenü beim Hover auf Desktop anzeigen */
#main-nav .menu-item:hover > .sub-menu {
    display: block;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

#main-nav .sub-menu li {
    margin-left: 0;
    width: 100%;
}

#main-nav .sub-menu a {
    padding: 12px 20px;
    white-space: nowrap;
    font-size: 16px;
}

#main-nav .sub-menu a:hover {
    background-color: var(--light-grey);
    color: var(--primary-color);
}

/* Kein Unterstrich-Effekt im Submenü */
#main-nav .sub-menu a::after {
    display: none; 
}

#mobile-menu-toggle { display: none; }


/* Hero Section */
#hero {
    padding: 180px 0 120px;
    position: relative;
    text-align: left;
}

#hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 650px;
    color: var(--white-color);
    text-shadow: 0 2px 10px rgba(0,0,0,0.6);
}

#hero h1 {
    color: var(--white-color);
}

.hero-content .subhead {
    font-size: 1.2rem;
    margin: 20px 0 30px;
    color: rgba(255,255,255,0.95);
    text-shadow: 0 2px 10px rgba(0,0,0,0.55);
}

.mini-trust {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255,255,255,0.08);
    padding: 10px 14px;
    border-radius: 10px;
    max-width: 520px;
    color: rgba(255,255,255,0.95);
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
    margin-bottom: 20px;
}
.mini-trust img { height: 28px; filter: brightness(0) invert(1) drop-shadow(0 2px 4px rgba(0,0,0,0.4)); }
.mini-trust p { margin: 0; font-size: 0.98rem; color: inherit; }

.hero-cta {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

/* Spezifische Hero-Button-Styles für den Desktop (und Fallback) */
.hero-cta .btn-secondary {
    color: var(--white-color);
    border-color: var(--white-color);
}
.hero-cta .btn-secondary:hover {
    background-color: var(--white-color);
    color: var(--primary-color);
}

.trust-badges {
    display: flex;
    gap: 25px;
    margin-top: 40px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #ffffff;
    text-shadow: 0 1px 6px rgba(0,0,0,0.6);
}
.trust-badges span {
    display: flex;
    align-items: center;
    gap: 8px;
}
.trust-badges img {
    height: 16px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
}

/* Trust Section */
.trust-points {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
    text-align: center;
}
.trust-point img { height: 50px; margin-bottom: 15px; }

.association-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 50px;
    margin-top: 60px;
    filter: grayscale(100%);
    opacity: 0.6;
}
.association-logos img {
    height: 40px;
}

/* Services Section */
.service-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.card {
    background: var(--white-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 30px; /* Padding bleibt gleich */
    /* min-height wird entfernt, die Höhe ergibt sich jetzt automatisch */
}
}
.service-card-media { margin-bottom: 14px; border-radius: 8px; overflow: hidden; }
.service-card-media img { width: 100%; height: 160px; object-fit: cover; display: block; }
/* Der Button-Container */
.card-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px; /* Fügt einen festen Abstand zum Inhalt darüber hinzu */
}
.card-list {
    margin: 12px 0 18px;
    padding-left: 18px;
    color: var(--text-color);
}
.card-more {
    display: none;
    margin-bottom: 12px;
}
.card .btn { margin-top: 10px; }

/* Process Section */
.process-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    text-align: center;
    position: relative;
}
.step-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 20px;
    border: 3px solid var(--white-color);
    box-shadow: 0 0 0 3px var(--primary-color);
}

/* Testimonials Section */
.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}
.testimonial {
    background: var(--white-color);
    padding: 30px;
    border-radius: var(--border-radius);
    border-left: 5px solid var(--primary-color);
}
.testimonial p {
    font-style: italic;
    margin-bottom: 15px;
}
.testimonial cite {
    font-weight: 600;
    color: var(--dark-grey);
}

.testimonial-slider {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 22px;
}
.testimonial-slider .slides {
    overflow: hidden;
    width: 100%;
}
.testimonial-slider .slides .slide {
    min-height: 140px;
    padding: 24px;
    background: var(--white-color);
    border-radius: var(--border-radius);
    border-left: 5px solid var(--primary-color);
    margin: 0 10px;
}
.testimonial-slider .slides {
    display: flex;
    transition: transform 0.45s ease;
    gap: 20px;
}
.slider-btn {
    background: transparent;
    border: 1px solid rgba(0,0,0,0.08);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Lead Magnet Section */
#lead-magnet { padding: 40px 0; }
.lead-magnet-box {
    background-color: var(--primary-color);
    color: var(--white-color);
    padding: 36px;
    border-radius: var(--border-radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
}
.lead-magnet-text p { max-width: 620px; }
.lead-magnet-box h3 { color: var(--white-color); }
.lead-magnet-box .btn-primary {
    background-color: var(--white-color);
    color: var(--primary-color);
}
.lead-magnet-box .btn-primary:hover {
    background-color: var(--light-grey);
}

/* Local Section */
.local-content {
    display: flex;
    align-items: flex-start;
    gap: 40px;
}
.local-text { flex: 1.3; }
.local-image { flex: 0.9; }
.local-list { margin: 12px 0 18px; padding-left: 18px; }
.local-image img { width: 100%; height: auto; border-radius: 8px; display: block; }

/* FAQ Section */
.faq-accordion {
    max-width: 800px;
    margin: 0 auto;
}
.faq-accordion details {
    background: var(--white-color);
    border-radius: var(--border-radius);
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
}
.faq-accordion summary {
    padding: 20px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    position: relative;
    color: var(--dark-grey);
}
.faq-accordion summary::-webkit-details-marker { display: none; }
.faq-accordion summary::after {
    content: '+';
    position: absolute;
    right: 20px;
    font-size: 1.5rem;
    font-weight: 400;
    transition: transform 0.3s;
}
.faq-accordion details[open] summary::after {
    transform: rotate(45deg);
}
.faq-accordion p {
    padding: 0 20px 20px;
    margin: 0;
}

/* Contact Section */
#contact { text-align: center; }
#contact h2 { max-width: 700px; margin-left: auto; margin-right: auto; }
#contact p { max-width: 600px; margin-left: auto; margin-right: auto; margin-bottom: 40px; }
#contact-form {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}
.form-group {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}
#contact-form input, #contact-form textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: var(--border-radius);
    font-family: 'Poppins', sans-serif;
}
#contact-form textarea {
    height: 120px;
    margin-bottom: 20px;
    resize: vertical;
}
#contact-form button {
    width: auto;
    cursor: pointer;
}

/* Footer */
#main-footer {
    background-color: var(--dark-grey);
    color: #ccc;
    padding: 60px 0 20px;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}
.footer-col h3 {
    color: var(--white-color);
    margin-bottom: 20px;
}
.footer-col p, .footer-col a {
    color: #ccc;
    line-height: 1.8;
}
.footer-col a:hover { color: var(--primary-color); }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }
.footer-map iframe { border-radius: var(--border-radius); }

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid #444;
    font-size: 0.9rem;
}
.footer-bottom p {
    margin: 0;
    margin-bottom: 5px;
}

/* Rating Badge */
.rating-badge {
    display: flex;
    align-items: center;
    gap: 14px;
    justify-content: center;
    margin-bottom: 16px;
    font-weight: 600;
    color: var(--dark-grey);
    flex-wrap: wrap;
}
.rating-badge .rating-text { font-size: 0.98rem; color: var(--dark-grey); font-weight: 600; }
.rating-badge a { color: var(--primary-color); text-decoration: underline; font-weight:700; }

.rating-badge .stars {
    position: relative;
    font-size: 1.15rem;
    line-height: 1;
    color: #e0e0e0;
    width: 110px;
    overflow: hidden;
    display: inline-block;
    height: 1.1rem;
}
.rating-badge .stars::before {
    content: '★★★★★';
    letter-spacing: 2px;
    display: block;
}
.rating-badge .stars .stars-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    overflow: hidden;
}
.rating-badge .stars .stars-fill::before {
    content: '★★★★★';
    color: var(--primary-color);
    display: block;
    letter-spacing: 2px;
}

/* ------------------------------------------- */
/* --- RESPONSIVE STYLES --- */
/* ------------------------------------------- */

/* Medium screens (Tablets) */
@media (max-width: 992px) {
    h1 { font-size: 2.4rem; }
    h2 { font-size: 2rem; }

    /* Mobile Navigation */
    #main-nav { display: none; }
    .cta-desktop { display: none; }

    #mobile-menu-toggle {
        display: block;
        background: none;
        border: none;
        cursor: pointer;
        z-index: 1001;
    }
    #mobile-menu-toggle .bar {
        display: block;
        width: 25px;
        height: 3px;
        background-color: var(--dark-grey);
        margin: 5px 0;
        transition: 0.4s;
    }
    #main-header.nav-open #main-nav {
        display: flex;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--white-color);
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 10px 10px -10px rgba(0,0,0,0.1);
        border-top: 1px solid var(--light-grey);
    }
    #main-header.nav-open #main-nav ul {
        flex-direction: column;
        width: 100%;
    }
    #main-header.nav-open #main-nav li {
        margin: 10px 0;
        text-align: center;
    }
    
    /* --- Mobile Dropdown Specifics --- */
    #main-nav .sub-menu {
        position: static;
        box-shadow: none;
        border-radius: 0;
        min-width: 100%;
        background-color: #f9f9f9;
        padding: 5px 0 10px 0;
        margin-top: 10px;
        border-top: 1px solid #eee;
        transform: none;
        opacity: 1;
        pointer-events: auto;
    }
    
    #main-nav .menu-item:not(.submenu-open) > .sub-menu {
        display: none;
    }

    #main-nav .sub-menu a {
        padding: 10px 30px;
    }
    
    /* Pfeil drehen, wenn das Submenü offen ist */
    #main-nav .menu-item.submenu-open > a::after {
         transform: rotate(225deg);
    }

    .local-content { flex-direction: column; }
}

/* Small screens (Mobiles) */
@media (max-width: 768px) {
    /* Allgemeine Regel für alle Sections AUSSER dem Hero-Bereich */
    section:not(#hero) { 
        padding: 60px 0 !important; 
    }

    /* Spezifische und einzige Regel für den Hero-Bereich */
    #hero { 
        padding: 100px 0 60px !important;
        text-align: center !important; 
    }

    /* OPTIMIERT: Schriftgröße der Hauptüberschrift angepasst */
    #hero h1 {
        font-size: 1.8rem !important;
        line-height: 1.4 !important;
    }
    .hero-content { 
        margin: 0 auto !important; 
    }
    
    /* OPTIMIERT: Hero-Buttons nicht mehr verstecken, sondern umstylen */
    .hero-cta {
        display: flex !important;
        flex-direction: column; /* Buttons untereinander stapeln */
        align-items: center;    /* Buttons zentrieren */
        gap: 15px;              /* Abstand zwischen den Buttons */
    }

    .trust-badges { 
        justify-content: center !important; 
        flex-wrap: wrap !important; 
    }

    /* General Layouts Mobile */
    .process-steps, .footer-grid { 
        grid-template-columns: 1fr; 
    }
    .process-steps .step:not(:last-child) { 
        margin-bottom: 30px; 
    }
    .lead-magnet-box { 
        flex-direction: column; 
        text-align: center; 
    }
    .form-group { 
        flex-direction: column; 
    }
    
    .leistungen-grid {
        flex-direction: column;
    }

    /* Sticky Footer & Call Button */
    .mobile-call-button { display: none; }
    .sticky-footer {
        display: flex;
        position: fixed;
        left: 0; right: 0; bottom: 0;
        background: var(--white-color);
        border-top: 1px solid #e6e6e6;
        padding: 10px;
        gap: 10px;
        z-index: 1200;
        box-shadow: 0 -6px 20px rgba(0,0,0,0.06);
    }
    .sticky-footer a {
        flex: 1;
        text-align: center;
        padding: 12px 14px;
        border-radius: 10px;
        font-weight: 700;
        text-decoration: none;
    }
    .sticky-footer .sticky-call {
        background: transparent;
        color: var(--dark-grey);
        border: 1px solid #e0e0e0;
    }
    .sticky-footer .sticky-offer {
        background: var(--primary-color);
        color: var(--white-color);
        border: 1px solid var(--primary-color);
    }
    main { padding-bottom: 84px; }
}

/* Extra small screens */
@media (max-width: 480px) {
    /* Die `#hero h1`-Regel wurde nach oben verschoben, um Konflikte zu vermeiden */
    .rating-badge { 
        gap: 8px; 
        font-size: 0.95rem; 
    }
    .rating-badge .stars { 
        width: 96px; 
        font-size: 1rem; 
    }
}

/* --- WordPress Admin Bar Fix --- */
body.admin-bar #main-header {
    top: 32px;
}
@media screen and (max-width: 782px) {
    body.admin-bar #main-header {
        top: 46px;
    }
}


/* --- Custom Block Styles für Leistungsseite --- */

/* Das Grid für die 3 Leistungsblöcke */
.leistungen-grid {
    display: flex;
    gap: 40px; /* Abstand zwischen den Blöcken */
    align-items: stretch; /* Zwingt alle Spalten, die gleiche Höhe anzunehmen */
}

.leistung-item {
    flex: 1; /* Sorgt dafür, dass jeder Block gleich viel Platz einnimmt */
    display: flex;
    flex-direction: column;
}

/* Stellt sicher, dass die Buttons wie deine Theme-Buttons aussehen */
.wp-block-button__link {
    background-color: var(--primary-color);
    color: var(--white-color);
    border-radius: 50px;
    padding: 12px 28px;
    font-weight: 600;
    font-size: 16px;
    text-decoration: none;
    border: 2px solid var(--primary-color);
    transition: all 0.3s ease;
    display: inline-block; /* Wichtig für korrekte Darstellung */
}

.wp-block-button__link:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

/* --- Feintuning für die Leistungsseite --- */

.leistung-item .wp-block-buttons {
    margin-top: auto; /* Magischer Trick: Schiebt den Button-Block nach ganz unten */
    padding-top: 20px; /* Fügt etwas Luft über dem Button hinzu */
}

/* Gestaltet die Aufzählungslisten schöner */
.leistung-item ul {
    list-style: none; /* Entfernt die Standard-Punkte */
    padding-left: 0;
}

.leistung-item ul li {
    padding-left: 1.5em; /* Schafft Platz für den Haken */
    position: relative;
    margin-bottom: 10px; /* Mehr Abstand zwischen den Punkten */
}

.leistung-item ul li::before {
    content: '✓'; /* Setzt einen Haken als neuen "Punkt" */
    position: absolute;
    left: 0;
    color: var(--primary-color); /* Nutzt deine Hauptfarbe */
    font-weight: bold;
}


