/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --green: #78A273;
    --green-dark: #60825C;
    --purple: #6D2250;
    --purple-light: #8a3a6a;
    --text: #444;
    --text-light: #666;
    --bg: #f8f8f6;
    --white: #fff;
    --border: #e0e0e0;
    --radius: 8px;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --transition: 0.25s ease;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Source Sans 3', 'Segoe UI', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-wrapper { flex: 1; }

a { color: var(--green); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--purple); }

img { max-width: 100%; height: auto; }

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

/* === Header === */
.site-header {
    background: transparent;
    position: relative;
    z-index: 10;
}

.header-inner {
    display: flex;
    align-items: stretch;
    gap: 0;
    height: 100px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 220px;
    padding: 16px 0;
    background: var(--white);
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.logo img { width: 100%; height: auto; max-height: 100px; object-fit: contain; }

/* Foto modal */
#foto-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s, visibility 0.2s;
}
#foto-modal.active { visibility: visible; opacity: 1; }

#fm-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.88);
}

#fm-img {
    position: relative;
    z-index: 1;
    max-width: 94vw;
    max-height: 86vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

#fm-close {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 2;
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    font-size: 30px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
#fm-close:hover { background: rgba(255,255,255,0.3); }

/* Hamburger */
.menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 200;
}

.menu-toggle span {
    display: block;
    width: 26px;
    height: 3px;
    background: var(--purple);
    border-radius: 2px;
    transition: var(--transition);
}

.menu-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }

/* === Page wrapper (for hero positioning) === */
.page-wrapper {
    position: relative;
}

/* === Hero background (right/content column only) === */
.hero-bg {
    position: absolute;
    top: 0;
    /* start after nav (220px) + gap (40px) + container padding (20px) = offset from left edge of viewport */
    left: calc(50% - 550px + 220px + 40px);
    right: calc(50% - 550px);
    height: 400px;
    background-size: cover;
    background-position: center top;
    z-index: 0;
    border-radius: 0 0 var(--radius) var(--radius);
    overflow: hidden;
}

.hero-bg-fade {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0) 20%,
        rgba(248,248,246,0.6) 45%,
        rgba(248,248,246,1) 60%
    );
}

/* === Main Layout === */
.main-layout {
    display: flex;
    gap: 40px;
    padding-top: 40px;
    padding-bottom: 60px;
    min-height: 60vh;
    position: relative;
    z-index: 10;
}

/* === Sidebar Navigation === */
.sidebar-nav {
    width: 220px;
    flex-shrink: 0;
}

.sidebar-nav ul {
    list-style: none;
    position: sticky;
    top: 110px;
}

.sidebar-nav ul li { margin-bottom: 4px; }

.sidebar-nav ul li > a {
    display: block;
    padding: 10px 16px;
    background: var(--green);
    color: var(--white);
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 15px;
    transition: background var(--transition);
}

.sidebar-nav ul li > a:hover,
.sidebar-nav ul li > a.active {
    background: var(--purple);
    color: var(--white);
}

.subnav {
    padding: 4px 0 4px 12px;
}

.subnav.hidden { display: none; }

.subnav a {
    display: block;
    padding: 5px 12px;
    font-size: 14px;
    color: var(--text-light);
    border-left: 3px solid transparent;
    transition: all var(--transition);
}

.subnav a:hover { color: var(--purple); border-left-color: var(--green); }
.subnav a.active { color: var(--purple); font-weight: 600; border-left-color: var(--purple); }

/* === Content === */
.content {
    flex: 1;
    min-width: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(2px);
    padding: 36px 40px;
}

h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--purple);
    margin-bottom: 24px;
    line-height: 1.3;
}

h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--purple);
    margin-top: 28px;
    margin-bottom: 12px;
}

.page-content p { margin-bottom: 16px; }
.page-content ul { margin: 0 0 20px 20px; }
.page-content ul li { margin-bottom: 6px; }

.page-content .important {
    border: 2px solid var(--border);
    border-left: 4px solid var(--purple);
    padding: 16px 20px;
    display: block;
    border-radius: var(--radius);
    background: #faf7f9;
    margin: 20px 0;
}

/* Team photos */
.page-content img.foto {
    float: left;
    margin: 0 24px 16px 0;
    width: 180px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* Gallery */
.page-content img.gallery {
    width: 160px;
    margin: 0 12px 12px 0;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
}

.page-content img.gallery:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

/* Tables (Sprechstunden) */
.page-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.page-content table td,
.page-content table th {
    padding: 8px 12px;
    vertical-align: top;
    font-size: 15px;
}

.page-content table tr.odd td { background: #f4f4f2; }

/* Maps */
.page-content iframe.map {
    width: 100%;
    height: 400px;
    border: none;
    border-radius: var(--radius);
    margin: 16px 0;
}

/* Sprechstunden table: day column styling */
.page-content table td:first-child:not(:empty) {
    color: var(--purple);
    font-weight: 700;
}

/* Sprechstunden mobile cards */
.stunden-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.stunden-card {
    background: var(--white);
    border-radius: var(--radius);
    border-left: 4px solid var(--green);
    padding: 12px 14px;
    box-shadow: var(--shadow);
}

.stunden-day {
    font-weight: 700;
    font-size: 15px;
    color: var(--purple);
    margin-bottom: 6px;
}

.stunden-slot {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    padding: 3px 0;
    border-bottom: 1px solid #f0f0f0;
}
.stunden-slot:last-of-type { border-bottom: none; }

.stunden-time {
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    margin-right: 12px;
}

.stunden-who { color: var(--text-light); text-align: right; }

.stunden-closed {
    font-size: 14px;
    color: #999;
    font-style: italic;
}

.stunden-note {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 6px;
    font-style: italic;
}

/* External links */
a.extern { padding-right: 20px; background: url('/images/link-ext.gif') no-repeat right center; }

/* === Contact Form === */
.contact-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.contact-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #f4f8f3;
    border: 1px solid rgba(120,162,115,0.25);
    border-radius: var(--radius);
    padding: 18px 20px;
    text-decoration: none;
    color: var(--text);
    transition: box-shadow var(--transition), border-color var(--transition);
}

.contact-card:hover {
    box-shadow: 0 4px 16px rgba(120,162,115,0.18);
    border-color: var(--green);
    color: var(--text);
}

.contact-card-icon {
    font-size: 26px;
    color: var(--green);
    flex-shrink: 0;
    line-height: 1;
}

.contact-card-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 14px;
    line-height: 1.4;
}

.contact-card-text strong {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--green-dark);
}

.form-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 36px;
}

.form-card-title {
    margin: 0 0 8px;
    font-size: 20px;
    color: var(--purple);
}

.form-card-intro {
    margin: 0 0 28px;
    font-size: 14px;
    color: #777;
}

.betreff-cards {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.betreff-card {
    flex: 1;
    min-width: 140px;
    position: relative;
    cursor: pointer;
}

.betreff-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.betreff-card span {
    display: block;
    padding: 10px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    transition: border-color var(--transition), background var(--transition), color var(--transition);
    background: var(--white);
}

.betreff-card input[type="radio"]:checked + span {
    border-color: var(--green);
    background: #f4f8f3;
    color: var(--green-dark);
}

.betreff-card:hover span {
    border-color: var(--green);
}

.form-group { margin-bottom: 20px; }

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--text);
}

.form-group label.error,
label.error { color: #c0392b; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
    width: 100%;
    padding: 11px 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 16px;
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
    background: var(--white);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(120,162,115,0.15);
}

input::placeholder,
textarea::placeholder { color: #aaa; }

.btn {
    display: inline-block;
    padding: 12px 32px;
    background: var(--purple);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
}

.btn:hover { background: var(--purple-light); }

.btn-submit {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 32px;
    background: var(--green);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
    margin-top: 8px;
}

.btn-submit:hover {
    background: var(--green-dark);
    transform: translateX(3px);
}

/* === Footer === */
.site-footer {
    background: var(--green-dark);
    color: rgba(255,255,255,0.9);
    padding: 40px 0 24px;
    font-size: 14px;
    line-height: 1.8;
}

.site-footer a { color: rgba(255,255,255,0.85); }
.site-footer a:hover { color: var(--white); }

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.footer-bottom {
    padding-top: 16px;
    text-align: center;
    font-size: 13px;
    opacity: 0.8;
}

/* === Mobile First Responsive === */

/* Tablet */
@media (max-width: 900px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .content { padding: 28px 24px; }
    .page-content img.gallery { width: 140px; }
}

/* Mobile */
@media (max-width: 768px) {
    .menu-toggle { display: flex; }

    .site-header { position: sticky; top: 0; z-index: 100; background: var(--white); box-shadow: 0 1px 6px rgba(0,0,0,0.06); }
    .header-inner { height: 70px; justify-content: center; position: relative; }
    .logo { padding: 8px 0; background: transparent; box-shadow: none; border-radius: 0; }
    .logo img { height: 54px; }
    .menu-toggle { position: absolute; right: 0; top: 50%; transform: translateY(-50%); }
    .hero-bg { display: none; }

    .page-content img.foto {
        float: left;
        width: 100px !important;
        margin: 0 16px 12px 0;
        cursor: zoom-in;
    }

    .main-layout {
        flex-direction: column;
        gap: 0;
        padding-top: 0;
    }

    .sidebar-nav {
        width: 100%;
        position: fixed;
        top: 90px;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--white);
        z-index: 90;
        padding: 20px;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform var(--transition);
        box-shadow: 2px 0 12px rgba(0,0,0,0.1);
    }

    .sidebar-nav.open { transform: translateX(0); }

    .sidebar-nav ul { position: static; }

    .sidebar-nav ul li > a {
        font-size: 16px;
        padding: 12px 18px;
    }

    .subnav.hidden { display: block; }

    .content {
        border-radius: 0;
        box-shadow: none;
        padding: 24px 16px;
    }

    h1 { font-size: 1.5rem; }

    .form-row { grid-template-columns: 1fr; gap: 0; }

    .contact-cards { grid-template-columns: 1fr; gap: 10px; }
    .form-card { padding: 22px 18px; }
    .betreff-cards { flex-direction: column; gap: 8px; }
    .betreff-card { min-width: 0; }

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

    .page-content img.foto { width: 50%; }
    .page-content img.gallery { width: 45%; margin: 0 8px 8px 0; }
    .page-content iframe.map { height: 280px; }

    .page-content table td { padding: 6px 6px; font-size: 13px; }
}

@media (max-width: 480px) {
    .page-content img.gallery { width: 100%; margin: 0 0 12px 0; }
}

/* Desktop: hide hamburger */
@media (min-width: 769px) {
    .menu-toggle { display: none; }
    .sidebar-nav { display: block !important; transform: none !important; }
}
