/* contact-overrides.css */
/* 
 * Spezielle Layout-Overrides nur für die Kontakt-Seite
 * Erstellt: 2025-01-27
 * Zweck: Vier-Kachel-Layout (Kontaktdaten, Bild, Map, Formular) ohne Änderung bestehender CSS-Dateien
 * Scope: Nur .kontakt-sektion um Konflikte zu vermeiden
 */

/* Vier-Kachel-Layout für Kontakt-Seite */
.kontakt-sektion .kontakt-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;               /* Abstand zwischen den Kacheln */
    justify-content: space-between;
    margin-top: 2rem;
    margin-bottom: 7rem;
}

.kontakt-sektion .kontakt-grid > * {
    flex: 0 1 48%;           /* Jeweils 48% Breite */
    box-sizing: border-box;
    min-height: 300px;       /* Mindesthöhe für einheitliches Aussehen */
}

/* Spezielle Anpassungen für die einzelnen Kacheln */
.kontakt-sektion .contact-details {
    display: flex;
    flex-direction: column;
}

.kontakt-sektion .contact-image {
    display: flex;
    align-items: center;
    justify-content: flex-start;  /* Bild links ausrichten */
}

.kontakt-sektion .kontakt-grid > .contact-image {
    flex: 0 0 48%;        /* 48% der Grid-Breite */
    max-width: 48%;       /* Maximale Breite 48% */
}

.kontakt-sektion .contact-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    object-fit: cover;
}

.kontakt-sektion .map-kachel {
    display: flex;
    flex-direction: column;
}

.kontakt-sektion .form-kachel {
    display: flex;
    flex-direction: column;
}

/* Info-Cards innerhalb der Kontakt-Details anpassen */
.kontakt-sektion .info-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
}

.kontakt-sektion .info-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* Map-Container Anpassungen */
.kontakt-sektion .map-container {
    height: 250px;
    flex: 1;
}

.kontakt-sektion .map-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 4px;
}

/* Formular-Anpassungen für .info-card */
.kontakt-sektion .form-kachel .info-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.kontakt-sektion .form-kachel .info-card form {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.kontakt-sektion .form-kachel .form-group:last-of-type {
    margin-top: auto;
}

/* Responsive: bei schmalen Viewports untereinander */
@media (max-width: 768px) {
    .kontakt-sektion .kontakt-grid > * {
        flex: 0 1 100%;
        min-height: auto;
    }
    
    .kontakt-sektion .kontakt-grid {
        gap: 1.5rem;
    }
    
    .kontakt-sektion .map-container {
        height: 200px;
    }
}

/* Alle Überschriften: Sekundäre Schriftart und primäre Farbe */
.kontakt-sektion h1,
.kontakt-sektion h2,
.kontakt-sektion h3,
.kontakt-sektion h4 {
    font-family: var(--font-secondary); /* Playfair Display für alle Überschriften */
    color: var(--primary-color); /* Primäre Farbe für alle Überschriften */
}

/* Map-Container iframe Styling */
.kontakt-sektion .map-container iframe {
    width: 100%;
    height: 96%;
    border: 0;
    border-radius: 4px;
    padding-top: 20px;
}



/* Spezifisches Padding für Kontaktdaten- & Öffnungszeiten-Titel */
.kontakt-sektion .contact-details h4 {
    padding-top: 30px;
    padding-bottom: 10px;
}

/* Reihenfolge der Flex-Boxen festlegen */
.kontakt-sektion .kontakt-grid > .contact-image        { order: 1; }
.kontakt-sektion .kontakt-grid > .form-kachel          { order: 2; }
.kontakt-sektion .kontakt-grid > .contact-details      { order: 3; }
.kontakt-sektion .kontakt-grid > .map-kachel           { order: 4; }

/* Formularfelder Padding */
.kontakt-sektion .form-group input,
.kontakt-sektion .form-group textarea {
    padding: 0.4rem;
}

/* Checkbox-spezifische Regeln */
.kontakt-sektion .form-group input[type="checkbox"] {
    width: auto;           /* Überschreibt width: 100% */
    display: inline-block; /* Nebeneinander mit Label */
    margin-right: 0.5rem;  /* Abstand zum Label-Text */
    vertical-align: top;   /* Ausrichtung mit Text */
}

.kontakt-sektion .form-group input[type="checkbox"] + label {
    display: inline-block; /* Überschreibt display: block */
    margin-bottom: 0;      /* Überschreibt margin-bottom: 0.5rem */
    vertical-align: top;   /* Ausrichtung mit Checkbox */
    max-width: calc(100% - 2rem); /* Platz für Checkbox lassen */
}

/* Desktop: Kontaktdaten linksbündig mit Hausbild ausrichten */
@media (min-width: 1025px) {
    .kontakt-sektion .contact-details .info-card {
        text-align: left;
    }
    
    /* Oberkanten von Bild und Kontaktformular-Text bündig ausrichten */
    .kontakt-sektion .contact-image,
    .kontakt-sektion .form-kachel {
        align-self: flex-start;
    }
    
    .kontakt-sektion .contact-image img {
        vertical-align: top;
        width: 100%;
        height: auto;
    }
    
    .kontakt-sektion .form-kachel .info-card {
        /* padding-top entfernt für bessere Überschrift-Positionierung */
    }
}

/* Tablet-Ansicht: 2x2 Grid */
@media (min-width: 769px) and (max-width: 1024px) {
    .kontakt-sektion .kontakt-grid > * {
        flex: 0 1 48%;
    }
}

/* ───────────────────────────────────────────────────────────────
   Mobile Fluid Layout für sehr schmale Viewports (z.B. Galaxy S22)
   ─────────────────────────────────────────────────────────────── */
@media (max-width: 375px) {
  /* 1. Haupt-Container flüssig und zentriert */
  .kontakt-sektion .section-container {
    max-width: none !important;    /* entfernt feste Max-Width */
    width: 98% !important;         /* 98% der Viewport-Breite */
    margin: 0 auto !important;     /* zentriert horizontal */
    padding-left: 0.25rem !important;  /* Minimales Padding */
    padding-right: 0.25rem !important; /* Minimales Padding */
  }
  /* 2. Kontakt-Kacheln einzeln als volle Breite */
  .kontakt-sektion .kontakt-grid {
    display: block !important;     /* Flex-Layout auflösen */
  }
  .kontakt-sektion .kontakt-grid > * {
    flex: none !important;         /* Flex-Eigenschaften deaktivieren */
    width: 95% !important;         /* 95% der Viewport-Breite */
    max-width: 95% !important;     /* Überschreibt alle max-width Regeln */
    margin: 0 auto 1.5rem !important; /* zentriert und Abstand unten */
    order: initial !important;     /* ursprüngliche Reihenfolge beibehalten */
  }
  /* 3. Spezielle Behandlung für contact-image */
  .kontakt-sektion .kontakt-grid > .contact-image {
    flex: none !important;
    width: 95% !important;
    max-width: 95% !important;
  }
}

/* DSGVO-konformes Karten-Overlay */
.map-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.map-overlay-content {
    text-align: center;
    padding: 2rem;
    max-width: 400px;
}

.map-overlay-icon {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.map-overlay h4 {
    margin: 0 0 1rem 0;
    color: var(--text-color);
    font-size: 1.2rem;
    font-weight: 600;
}

.map-overlay p {
    margin: 0 0 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.map-overlay-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.btn-accept-map {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.btn-accept-map:hover {
    background: var(--secondary-color);
}

.btn-decline-map {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid #ddd;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-decline-map:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.map-overlay-links {
    margin-top: 1rem;
}

.map-overlay-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s ease;
}

.map-overlay-links a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Map Container Positionierung */
.map-container {
    position: relative;
    min-height: 300px;
}

/* Verstecktes Overlay */
.map-overlay.hidden {
    display: none;
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
    .map-overlay-content {
        padding: 1.5rem;
        max-width: 100%;
    }
    
    .map-overlay-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .btn-accept-map,
    .btn-decline-map {
        width: 100%;
    }
}
