/* ============================================================
   ZENTRALE STYLE.CSS - FINALE VERSION (ALLES INKLUSIVE)
   Layout: 1000px zentriert | Navigation mit Social Icons 
   Lightbox: Fix gegen Verzerrung | Galerie: 3-Spalten-Grid
   ============================================================ */

/* --- 1. GRUNDGERÜST & FARBEN --- */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    line-height: 1.6;
    background-color: #f4f7f6;
    color: #333;
}

/* --- GEMEINSAME HEADER-GRUNDLAGEN --- */
header {
    color: white;
    padding: 300px 20px;
    text-align: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

header h1 {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7); /* Bessere Lesbarkeit */
    margin: 0;
    font-size: 2.5rem;
}

/* --- INDIVIDUELLE BILDER & HELLIGKEIT --- */

/* Startseite: Einladendes Blau/Dunkel (0.5 Helligkeit) */
.header-home {
    background-image: linear-gradient(rgba(0,0,0,0.1), rgba(0,0,0,0.1)), url('headerbild.jpg');
}

/* Betancuria: Etwas dunkler (0.6), damit das Weiß der Kirche nicht blendet */
.header-unterseite {
    background-image: linear-gradient(rgba(0,0,0,0.1), rgba(0,0,0,0.1)), url('headerbild2.jpg');
}


/* --- 2. NAVIGATION (Zentriert & Social Icons) --- */
.main-navigation {
    background-color: #34495e;
    position: sticky;
    top: 0;
    z-index: 9999;
    display: flex;
    justify-content: center;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1000px; /* Gleiche Breite wie der Hauptinhalt */
    padding: 0 20px;
}

.nav-links, .nav-social {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Menü-Links */
.nav-links li a {
    color: white !important;
    text-decoration: none;
    font-weight: bold;
    padding: 15px 20px;
    display: block;
}

.nav-links li a:hover {
    background-color: #1abc9c;
}

/* Social Icons (SVG) */
.social-svg {
    fill: white;
    width: 26px;
    height: 26px;
    margin-left: 15px;
    transition: fill 0.3s, transform 0.2s;
    display: block;
}

.nav-social a {
    display: flex;
    align-items: center;
    padding: 10px 5px;
}

.nav-social a:hover .social-svg {
    transform: scale(1.15);
}

/* Markenfarben bei Mouseover */
.nav-social a[title="Facebook"]:hover .social-svg { fill: #1877F2; }
.nav-social a[title="YouTube"]:hover .social-svg { fill: #FF0000; }

/* --- 3. HAUPTINHALT & LAYOUT-BOX --- */
main {
    max-width: 1000px;
    margin: 20px auto;
    padding: 20px;
    background: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

/* Flex-Layout für Text/Bild-Kombinationen */
.flex-content {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    margin-bottom: 50px;
}

.flex-content.revers { flex-direction: row-reverse; }

.text-block { flex: 1; }

/* --- 4. BILDER-MANAGEMENT (Korrekturen gegen Verzerrung) --- */

/* Startseite Bild */
.hero-img {
    max-width: 100%;
    width: 600px; 
    height: auto;
    border-radius: 8px;
    display: block;
    margin: 10px auto;
}

/* Bilder in Textblöcken */
.flex-content figure {
    margin: 0;
    flex: 0 0 400px; /* Bildspalte fixiert auf 400px */
    max-width: 100%;
}

.flex-content figure img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* --- 5. BILDERGALERIE (Grid am Ende der Seite) --- */
.photo-gallery {
    max-width: 1000px;
    margin: 50px auto;
    padding: 0 20px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.gallery-item img {
    width: 100%;
    height: 200px; 
    object-fit: cover; /* Schneidet Vorschau passend zu */
    border-radius: 5px;
    display: block;
    transition: transform 0.3s;
}

.gallery-item img:hover { transform: scale(1.03); }

/* --- 6. UNIVERSAL LIGHTBOX FIX (Gegen Langziehen der Bilder) --- */
.lightbox {
    display: none;
    position: fixed;
    z-index: 20000;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.95);
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.lightbox:target { display: flex; }

.lightbox img {
    max-width: 90vw;   /* Maximal 90% der Fensterbreite */
    max-height: 80vh;  /* Maximal 80% der Fensterhöhe */
    width: auto !important;  /* WICHTIG: Erzwingt echtes Seitenverhältnis */
    height: auto !important; /* WICHTIG: Erzwingt echtes Seitenverhältnis */
    object-fit: contain !important;
    border: 3px solid white;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
}

.close-button {
    margin-top: 20px;
    color: white;
    background: #e74c3c;
    padding: 10px 25px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
}

/* --- 7. FOOTER --- */
footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 30px;
    margin-top: 50px;
}

.footer-nav a { color: #1abc9c; margin: 0 10px; text-decoration: none; }

/* --- 8. MOBILE ANSICHT (Smartphone) --- */
@media (max-width: 768px) {
    .nav-container { flex-direction: column; padding: 10px; }
    .nav-links { flex-direction: column; text-align: center; }
    .nav-social { margin-top: 15px; justify-content: center; }
    .flex-content { flex-direction: column !important; }
    .flex-content figure { flex: 0 0 auto; width: 100%; }
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}