/* Bilder innerhalb der drei Startseiten-Teaserkarten */
.teaser-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.teaser-grid > * {
    min-width: 0;
}

.teaser-grid img,
.teaser-card img,
.teaser-image {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    box-sizing: border-box;
}
/* ==========================================================
   PULLDOWN-NAVIGATION / 2. EBENE
   ========================================================== */

.nav-list > li {
    position: relative;
}

/* Untermenü zunächst verstecken */
.nav-list .submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    margin: 0;
    padding: 0;
    list-style: none;
    background-color: var(--primary-color);
    z-index: 2000;
    box-shadow: 0 5px 12px rgba(0,0,0,0.18);
}

/* Wird durch JavaScript geöffnet */
.nav-list li.submenu-open > .submenu {
    display: block;
}

.nav-list .submenu li {
    width: 100%;
    text-align: left;
}

.nav-list .submenu a {
    display: block;
    padding: 12px 18px;
    white-space: nowrap;
}

.submenu-arrow {
    display: inline-block;
    margin-left: 6px;
    font-size: 0.7em;
    transition: transform 0.2s ease;
}

.submenu-open > a .submenu-arrow {
    transform: rotate(180deg);
}


/* Smartphone */
@media (max-width: 768px) {

    .nav-list .submenu {
        position: static;
        width: 100%;
        min-width: 0;
        box-shadow: none;
    }

    .nav-list .submenu a {
        padding-left: 40px;
    }
}

/* ==========================================================================
   1. GLOBAL STYLES & VARIABLES (Modern & Clean CSS Reset)
   ========================================================================== */
:root {
    --primary-color: #1a365d;
    --secondary-color: #2b6cb0;
    --accent-color: #3182ce;
    --light-bg: #f7fafc;
    --dark-text: #2d3748;
    --white: #ffffff;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--dark-text);
    line-height: 1.6;
    background-color: #f0f4f8;
}

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

/* ==========================================================================
   2. TYPOGRAPHY & HEADINGS
   ========================================================================== */
h1, h2, h3 {
    margin-block: 1.5em 0.8em; 
}

h1 { font-size: 2.5rem; margin-block: 1.8em 0.8em; color: var(--primary-color); }
h2 { font-size: 2rem;   margin-block: 1.6em 0.7em; }
h3 { font-size: 1.5rem; margin-block: 1.4em 0.6em; }

/* ==========================================================================
   3. ISOLATED LISTS (Speziell nur für die Inhaltsübersicht .toc-box)
   ========================================================================== */
.toc-box ul {
    list-style-type: square; 
    margin-left: 25px;       
}

.toc-box ul li {
    color: green;            
    font-size: 1.5em;        
}

.toc-box ul li a {
    font-size: 0.66em;       
    vertical-align: 0.15em;  
    display: inline-block;   
}

.toc-box ul li a:link { color: lightgrey; text-decoration: none; }
.toc-box ul li a:visited { color: darkgrey; }
.toc-box ul li a:focus { color: red; outline: 2px solid red; }
toc-box ul li a:hover { color: red; }
.toc-box ul li a:active { color: orange; }

/* ==========================================================================
   4. HEADER & NAVIGATION (Desktop First)
   ========================================================================== */
header {
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('/bilder/header.png') center/cover no-repeat;
    padding: 80px 0; 
    color: var(--white);
}

.header-grid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.header-btn {
    display: inline-block;
    background-color: var(--secondary-color);
    color: var(--white);
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    transition: background-color 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
    min-width: 220px;
}

.header-btn:hover {
    background-color: var(--accent-color);
}

.logo-container {
    text-align: center;
    flex: 1;
}

.logo {
    max-height: 180px; 
    width: auto;
    display: inline-block;
    vertical-align: middle;
}

nav {
    background-color: var(--primary-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.menu-toggle {
    display: none; 
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 6px;       
    padding: 15px;  
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--white); 
    transition: 0.3s ease;
}

.nav-list {
    display: flex;
    list-style: none;
    justify-content: center;
    margin: 0;
    padding: 0;
}

.nav-list li {
    flex: 1;
    text-align: center;
}

.nav-list a {
    display: block;
    color: var(--white);
    padding: 15px 20px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.nav-list a:hover {
    background-color: var(--accent-color);
    color: var(--white);
}

/* ==========================================================================
   5. MAIN CONTENT LAYOUT & TEASERS
   ========================================================================== */
main {
    background-color: var(--white);
    padding: 40px 0;
    margin: 20px auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.main-teaser {
    font-size: 1.25rem;
    color: #4a5568;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.teaser-image {
    width: 100%;          
    aspect-ratio: 1 / 1;  
    object-fit: cover;    
    border-radius: 8px;   
    margin-bottom: 15px;  
}

.teaser-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.teaser-card {
    background-color: var(--light-bg);
    padding: 25px;
    border-radius: 6px;
    border-top: 4px solid var(--secondary-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.teaser-card h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

/* ==========================================================================
   6. FOOTER & CONTACT FORMS
   ========================================================================== */
footer {
    background-color: #1a202c;
    color: #e2e8f0;
    padding: 50px 0 20px 0;
    margin-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    padding-bottom: 30px;
    border-bottom: 1px solid #4a5568;
}

.footer-col h3 {
    color: var(--white);
    margin-bottom: 20px;
    font-size: 1.25rem;
}

/* Formspree Form Styles */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group input, .form-group textarea {
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #4a5568;
    background-color: #2d3748;
    color: var(--white);
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

.submit-btn {
    background-color: var(--secondary-color);
    color: var(--white);
    padding: 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

.submit-btn:hover {
    background-color: var(--accent-color);
}

/* Copyright & Legal Row */
.copyright-bar {
    text-align: center;
    padding-top: 20px;
    font-size: 0.9rem;
    color: #a0aec0;
}

.copyright-bar a {
    color: #a0aec0;
    text-decoration: none;
    margin-left: 15px;
}

.copyright-bar a:hover {
    color: var(--white);
    text-decoration: underline;
}

/* ==========================================================================
   7. RESPONSIVE DESIGN (Media Queries)
   ========================================================================== */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex; 
    }

    .nav-list {
        display: none; 
        flex-direction: column;
        background-color: var(--primary-color); 
        position: absolute;
        top: 100%; 
        left: 0;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .nav-list li {
        width: 100%;
        text-align: left;
    }

    .nav-list.active {
        display: flex;
    }
  
    .menu-toggle.active span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
    .menu-toggle.active span:nth-child(2) { opacity: 0; }
    .menu-toggle.active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .header-grid {
        flex-direction: column;
        text-align: center;
    }

    .logo-container {
        order: -1;
    }
}

/* ==========================================================================
   8. KANZLEI-INFOBOX
   ========================================================================== */

.kanzlei-infobox {
    display: flex;
    align-items: center;
    gap: 40px;
    max-width: 1100px;
    margin: 40px auto;
    padding: 30px;
    background: var(--light-bg);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.kanzlei-infobox .infobox-text {
    flex: 1;
    min-width: 0;
}

.kanzlei-infobox .infobox-text h3 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 20px;
}

.kanzlei-infobox .infobox-text p {
    margin-bottom: 15px;
}

/* Liste in der Kanzlei-Infobox:
   - sichtbare runde Aufzählungspunkte
   - Aufzählungspunkte grün
   - Linktext behält seine eigene Farbe */
.kanzlei-infobox .infobox-text ul {
    margin: 20px 0 0 0;
    padding-left: 0;
    list-style: none;
}

.kanzlei-infobox .infobox-text ul li {
    position: relative;
    margin-bottom: 8px;
    padding-left: 20px;
}

.kanzlei-infobox .infobox-text ul li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 0.62em;
    width: 7px;
    height: 7px;
    background-color: green;
    transform: translateY(-50%);
}

.kanzlei-infobox .infobox-image-wrapper {
    flex: 0 0 300px;
}

.kanzlei-infobox .infobox-image-wrapper img {
    display: block;
    width: 100%;
    max-width: 300px;
    height: auto;
    border-radius: 8px;
}

.kanzlei-infobox a {
    color: var(--secondary-color);
}

.kanzlei-infobox a:hover {
    color: var(--accent-color);
}

/* Mobil */
@media (max-width: 768px) {
    .kanzlei-infobox {
        flex-direction: column;
        align-items: stretch;
        gap: 25px;
        margin: 30px 20px;
        padding: 20px;
    }

    .kanzlei-infobox .infobox-image-wrapper {
        flex: none;
        text-align: center;
    }

    .kanzlei-infobox .infobox-image-wrapper img {
        margin: 0 auto;
    }
}


/* ==========================================================
   CMS-NAVIGATION: Hauptpunkt mit Untermenü als Button
   ========================================================== */
.nav-list .submenu-toggle,
.nav-list .nav-label {
    display: block;
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--white);
    padding: 15px 20px;
    font: inherit;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
}

.nav-list .submenu-toggle:hover,
.nav-list .submenu-toggle:focus-visible {
    background-color: var(--accent-color);
    color: var(--white);
}

.submenu-open > .submenu-toggle .submenu-arrow {
    transform: rotate(180deg);
}

@media (max-width: 768px) {
    .nav-list .submenu-toggle,
    .nav-list .nav-label {
        text-align: left;
    }
}

/* Startseite: Hauptteaser und Teaserkarten sauber voneinander trennen */
.startseite-hauptteaser { display: flow-root; width: 100%; margin-bottom: 32px; }
.startseite-teaserblock { display: flow-root; clear: both; width: 100%; }
.startseite-teaserblock .teaser-grid { margin-top: 0; }

/* Version 11: Kein doppelter oberer Abstand der Block-Ueberschrift. */
.startseite-zusatzbloecke .cms-inhaltsblock > h2 { margin-top: 0; }

/* Version 13: sichtbare Leerzeile zwischen Absätzen in CMS-Inhaltsblöcken.
   Nur Textabsätze, nicht Überschriften oder Bilder, werden beeinflusst. */
.cms-inhaltsblock > div > p { margin: 0 0 1.15em; }
.cms-inhaltsblock > div > p:last-child { margin-bottom: 0; }

/* Version 14: Teaserbilder zuverlässig auf die Karten begrenzen */
.startseite-teaserblock .teaser-grid,
.teaser-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.teaser-grid > .teaser-card { min-width: 0; }
.teaser-grid .teaser-card > img.teaser-image {
  display: block;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  object-fit: cover;
  margin: 0 0 15px;
  border-radius: 8px;
}
.teaser-grid .teaser-card > h3 { margin-top: 0; }
@media (max-width: 900px) {
  .startseite-teaserblock .teaser-grid,
  .teaser-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .startseite-teaserblock .teaser-grid,
  .teaser-grid { grid-template-columns: minmax(0, 1fr); }
}


/* Mobile Header-Anpassung: KI-Layout – Desktop bleibt unverändert */
@media (max-width: 768px) {
    header {
        padding: 28px 0;
    }
    header .header-grid {
        flex-direction: column;
        align-items: center;
        gap: 14px;
    }
    header .logo-container {
        order: -1;
        flex: 0 0 auto;
        width: 100%;
        text-align: center;
    }
    header .logo {
        display: block;
        width: auto;
        height: auto;
        max-width: min(160px, 65vw);
        max-height: 75px;
        object-fit: contain;
        margin: 0 auto;
    }
    header .header-btn {
        width: min(100%, 300px);
        min-width: 0;
    }
}
