/* ==========================================================================
   1. Grundlegende Einstellungen & Layout
   ========================================================================== */
html {
    scroll-behavior: smooth;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    color: #333;
    line-height: 1.6;
}

/* Offset für fixierten Header, damit Überschriften sichtbar bleiben */
section[id] {
    scroll-margin-top: 90px;
}

.container {
    max-width: 1100px;
    margin: auto;
    padding: 3rem 1rem;
}

.bg-light {
    background-color: #f4f7f4;
}

.bg-white {
    background-color: #ffffff;
}

/* Buttons */
.btn {
    display: inline-block;
    background: #588140; /* Minimal dunkleres Grün */
    color: white;
    padding: 0.8rem 1.5rem;
    text-decoration: none;
    border-radius: 5px;
    margin-top: 1rem;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn:hover {
    background: #496d34; /* Hover-Effekt */
}

/* ==========================================================================
   2. Header & Navigation
   ========================================================================== */
header {
    background: #588140; /* Minimal dunkleres Grün */
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

header .logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

header .logo-img {
    height: 50px; /* Höhe des Logos angepasst */
    width: auto;
    display: block;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li a {
    color: white;
    text-decoration: none;
    margin-left: 1.5rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

nav ul li a:hover {
    text-decoration: underline;
}

/* Hero Section (falls verwendet) */
.hero {
    background: url('bilder/Visitenkarte_fuer_homepage.jpg') no-repeat center center / contain;
    height: 60vh;
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    text-align: center;
    color: black;
    margin-left: 8rem;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

/* ==========================================================================
   3. Leistungskarten
   ========================================================================== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.service-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1.5rem;
    border-top: 5px solid #588140; /* Minimal dunkleres Grün */
}

.service-card h3 {
    margin-bottom: 0.8rem;
    color: #588140; /* Minimal dunkleres Grün */
}

/* ==========================================================================
   4. Galerie-Grid & Hover-Effekte
   ========================================================================== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.gallery-item {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    height: 220px;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.08);
}

.gallery-item .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(88, 129, 64, 0.85); /* Passende RGBA-Transparenz */
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-weight: bold;
    font-size: 1.1rem;
    padding: 1rem;
    text-align: center;
}

.gallery-item:hover .overlay {
    opacity: 1;
}

/* ==========================================================================
   5. Lightbox (Großansicht mit Pfeil-Navigation)
   ========================================================================== */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

/* Aktiv-Zustand per JavaScript Steuerung */
.lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox img {
    max-width: 90%;
    max-height: 85vh;
    border-radius: 6px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    user-select: none;
    cursor: default;
}

/* Schließen-Button (X) */
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 3rem;
    text-decoration: none;
    font-weight: bold;
    line-height: 1;
    z-index: 2010;
    cursor: pointer;
    transition: color 0.2s ease;
}

.lightbox-close:hover {
    color: #588140; /* Minimal dunkleres Grün */
}

/* Navigation Pfeile */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 2.5rem;
    text-decoration: none;
    font-weight: bold;
    padding: 1rem 1.2rem;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 6px;
    user-select: none;
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease;
    z-index: 2010;
}

.lightbox-nav:hover {
    background: rgba(88, 129, 64, 0.9); /* Passende RGBA-Transparenz */
    color: #ffffff;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

/* Zentrierter Text-Hilfe für Sections */
.text-center {
    text-align: center;
}

/* ==========================================================================
   Visitenkarten-Bild im Kontaktbereich
   ========================================================================== */
.visitenkarte-container {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
}

.visitenkarte-img {
    max-width: 100%;
    width: 600px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.visitenkarte-img:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35);
}

/* ==========================================================================
   6. Formular Styling
   ========================================================================== */
.contact-form {
    max-width: 600px;
    margin: 2rem auto 0 auto;
    background: #f9f9f9;
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.form-group {
    margin-bottom: 1.2rem;
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.4rem;
    font-weight: 600;
    color: #588140; /* Minimal dunkleres Grün */
}

.form-group input,
.form-group textarea {
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #588140; /* Minimal dunkleres Grün */
    box-shadow: 0 0 5px rgba(88, 129, 64, 0.4); /* Passende RGBA-Transparenz */
}

.checkbox-group {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-group label {
    font-weight: normal;
    font-size: 0.9rem;
    margin-bottom: 0;
}

.contact-form .btn {
    width: 100%;
    font-size: 1rem;
}

/* ==========================================================================
   7. Pop-up Modal (Datenschutz)
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #ffffff;
    width: 90%;
    max-width: 650px;
    max-height: 80vh;
    padding: 2rem;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    cursor: default;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 2rem;
    text-decoration: none;
    color: #888;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
}

.modal-close:hover {
    color: #588140; /* Minimal dunkleres Grün */
}

.modal-body {
    overflow-y: auto;
    margin-top: 1rem;
    padding-right: 0.5rem;
}

.modal-body h3 {
    color: #588140; /* Minimal dunkleres Grün */
    margin-top: 1rem;
    margin-bottom: 0.3rem;
    font-size: 1.1rem;
}

.modal-body p {
    font-size: 0.95rem;
    margin-bottom: 0.8rem;
    color: #444;
}

/* ==========================================================================
   8. Footer & Mobile Optimierung
   ========================================================================== */
footer {
    background: #3a5a29;
    color: white;
    text-align: center;
    padding: 1.5rem;
    margin-top: 2rem;
}

footer a {
    color: #d8f3dc;
}

@media (max-width: 768px) {
    section[id] {
        scroll-margin-top: 130px;
    }

    header {
        flex-direction: column;
        gap: 0.8rem;
        padding: 0.8rem 1rem;
    }

    nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }

    nav ul li a {
        margin: 0.3rem 0.5rem;
        white-space: nowrap; /* Verhindert den Umbruch von "Über mich" */
        font-size: 0.95rem;
    }

    .hero {
        margin-left: 0;
        height: 40vh;
    }

    .lightbox-nav {
        font-size: 1.8rem;
        padding: 0.5rem 0.8rem;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }
}