/* Color Palette & Base Variables */
:root {
    --primary: #1483BB;   /* Light Blue */
    --secondary: #2CDB98; /* Teal/Green */
    --dark: #05456A;      /* Dark Blue */
    --bg-color: #f9f9f9;
    --text-main: #333333;
    --text-muted: #666666;
}

/* Base Setup & Smooth Scrolling */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px; /* Adjust based on your header height */
}

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-main);
    background-color: var(--bg-color);
    line-height: 1.6;
}

h1, h2, h3 {
    color: var(--dark);
    margin-bottom: 0.5rem;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--secondary);
}

/* Main Layout Structure */
.page-wrapper {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    background: #ffffff;
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
}

.main-content {
    flex: 1; /* Takes up all available space */
    min-width: 0; /* Prevents overflow issues */
}

/* Sticky Right Sidebar */
.sticky-sidebar {
    width: 380px; /* Widened to fit official Instagram embeds (min 326px) */
    background: #ffffff; 
    color: var(--text-main);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    padding: 30px 20px;
    box-sizing: border-box;
    border-left: 1px solid #eeeeee;
    box-shadow: -4px 0 20px rgba(0,0,0,0.02);
}

/* Sidebar Header & Integration */
.sidebar-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0; /* Matches the subtle borders of the main site */
}

.sidebar-header h3 {
    color: var(--dark);
    font-size: 1.6rem; /* Scaled up slightly to match the visual weight of main H2s */
    font-weight: bold;
    margin-bottom: 12px;
}

.sidebar-header .ig-handle {
    margin-bottom: 25px;
    display: block;
}

.sidebar-header .ig-handle a {
    color: var(--primary); /* Blue handle for better contrast */
    font-size: 0.95rem;
    font-weight: 600;
}

.sidebar-header .ig-handle a:hover {
    color: #1483BB;
}

/* Modern Pill Button for Instagram Handle */
.ig-badge {
    display: inline-flex;
    align-items: center;
    background-color: rgba(20, 131, 187, 0.1); /* A soft wash of your primary blue */
    color: var(--primary);
    padding: 6px 14px;
    border-radius: 20px; /* Gives it the pill shape */
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
}

.ig-badge:hover {
    background-color: var(--primary);
    color: #ffffff;
    transform: translateY(-1px); /* Slight lift effect */
    box-shadow: 0 4px 8px rgba(20, 131, 187, 0.2);
}

/* Navigation Bar */
.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px; /* Reduced side padding to give the menu more room */
    background: white;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 3px solid var(--primary);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* ... keep the .logo img block as it is ... */

.top-nav ul {
    list-style: none;
    display: flex;
    gap: 12px;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.top-nav a {
    color: var(--dark);
    font-weight: 600;
    font-size: 0.9rem; /* Slightly reduced font size (was 0.95rem) */
}

.top-nav a:hover {
    color: var(--primary);
}

.logo img {
    height: 60px; /* Increased for a larger logo */
    width: auto;
}

/* Sections Styling */
section {
    padding: 60px 40px;
    border-bottom: 1px solid #eeeeee;
}

/* Fade-In Animation Logic */
.fade-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Slider CSS - Fading Logic */
.slider-container {
    position: relative;
    max-width: 100%;
    height: auto; 
    aspect-ratio: 16 / 9;
    margin: auto;
    overflow: hidden;
    border-radius: 12px; /* Rounder, modern corners */
    box-shadow: 0 10px 30px rgba(0,0,0,0.1); /* Deeper shadow */
    background-color: #111111; /* Dark background hides letterboxing */
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0; /* Invisible by default */
    transition: opacity 1.2s ease-in-out; /* The fade duration */
    z-index: 1;
}

/* When the 'active' class is added via JS, the slide fades in */
.slide.active {
    opacity: 1;
    z-index: 2; /* Sits on top of the others */
}

.slide img {
    width: 100%;
    height: 100%;
    /* Change 'cover' to 'contain' to show the whole image */
    object-fit: contain; 
    display: block;
}

.prev, .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -22px;
    color: white;
    font-weight: bold;
    font-size: 20px;
    transition: 0.3s;
    border-radius: 50%; /* Perfect circles */
    background-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px); /* Modern frosted glass effect */
    z-index: 10;
    user-select: none;
    border: 1px solid rgba(255,255,255,0.4);
}

.prev { left: 15px; }

.next { right: 15px; }

.prev:hover, .next:hover { 
    background-color: rgba(255, 255, 255, 0.4); 
    transform: scale(1.1); /* Slight pop effect on hover */
}

.dots {
    text-align: center;
    position: absolute;
    bottom: 15px;
    width: 100%;
    z-index: 10; /* Ensure dots stay above images */
}

.dot {
    cursor: pointer;
    height: 12px;
    width: 12px;
    margin: 0 5px;
    background-color: rgba(255,255,255,0.5);
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.3s ease;
}

/* Combined class for active dot and hover state */
.dot.active, .dot:hover { 
    background-color: var(--secondary); 
}

/* Standard Sections Layout */
.standard-section {
    display: flex;
    align-items: center; /* Centers image and text vertically */
    gap: 50px;
    background: transparent; /* Ensures PNGs blend perfectly */
}

.standard-section--reverse {
    flex-direction: row-reverse;
}

.image-placeholder {
    flex: 0 0 350px; /* Adjust width as needed */
    display: flex;
    justify-content: center;
    background: transparent;
}

.image-placeholder:not(:empty) {
    width: 300px;
    height: 200px;
    background: #eee;
    border-radius: 4px;
}

.image-placeholder img {
    max-width: 100%;
    height: auto;
    display: block; /* Removes tiny bottom gap */
}

.standard-section .text-content {
    flex-grow: 1;
}

/* Kontakt Section Layout */
.kontakt-section {
    display: flex;
    gap: 40px;
}

.map-container {
    flex: 1;
    border: 2px solid var(--primary);
    border-radius: 8px;
    overflow: hidden;
}

.kontakt-section .text-content {
    flex: 1;
}

/* Footer Layout */
.site-footer {
    background: var(--bg-color);
    padding: 30px 40px;
    border-top: 1px solid #ddd;
    color: var(--text-muted);
}

/* Flexbox puts the text and logo side-by-side */
.footer-content {
    display: flex;
    flex-direction: row;     /* Side-by-side */
    justify-content: center; /* Centers the combined unit on the page */
    align-items: center;     /* Centers logo and text vertically relative to each other */
    gap: 50px;               /* Space between text and logo */
}

/* Center the text within its own group */
.footer-text-group {
    text-align: center;      /* This will center the copyright over the links */
}

.footer-text-group p {
    margin-top: 0;
    margin-bottom: 10px;
}

.footer-links a {
    color: var(--text-muted);
    /* Removed margin-right to ensure actual centering */
    margin: 0 5px; 
}

/* Footer Logo Sizing */
.footer-logo {
    height: 100px; 
    width: auto;
    margin: 0;
}

.text-content ul {
    padding-left: 20px;
    margin-bottom: 20px;
}

.text-content li {
    margin-bottom: 8px;
    color: var(--text-main);
}

/* Full Width Centered Section */
.full-width-section {
    padding: 60px 20px; /* Space on top and bottom */
    background: transparent;
}

.full-width-section .text-content {
    /* Use a smaller max-width (e.g., 700px - 800px) to take up less horizontal space */
    max-width: 750px; 
    
    /* This centers the narrower text block in the middle of the screen */
    margin: 0 auto;   
    
    text-align: center;
}

/* Center the container of the lists and make sure they align to the text width */
.full-width-section .text-content ul {
    list-style-position: inside;
    padding: 0;
    margin: 1.5rem auto;
    display: inline-block; /* Helps with centering bullet-text units */
    text-align: center;
}

.full-width-section .text-content li {
    margin-bottom: 10px;
    list-style-type: "• ";
}

/* Centering the bullet points while keeping the text left-aligned inside them */
.centered-list {
    display: inline-block;
    text-align: left;
    margin: 0 auto 1.5rem auto;
}

/* Ensure headings and paragraphs in this section are also centered */
.full-width-section h2, 
.full-width-section p, 
.full-width-section strong {
    display: block;
    text-align: center;
}

/* Mobile Navigation Toggle Button */
.menu-toggle {
    display: none; /* Hidden on desktop */
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

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

/* --- Dropdown Menus (Desktop) --- */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropbtn {
    cursor: pointer;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #ffffff;
    min-width: 180px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    z-index: 1001;
    border-radius: 8px;
    overflow: hidden;
    top: 150%; /* Starts slightly lower for a slide-up animation */
    left: 50%;
    transform: translateX(-50%); /* Centers the box under the parent word */
    border: 1px solid #eeeeee;
    opacity: 0;
    transition: opacity 0.2s ease, top 0.2s ease;
}

/* Hover activates the dropdown */
.dropdown:hover .dropdown-content {
    display: block;
    opacity: 1;
    top: 100%; /* Slides up to snap directly under the menu */
}

.dropdown-content a {
    color: var(--text-main);
    padding: 12px 20px;
    text-decoration: none;
    display: block;
    font-weight: 500;
    border-bottom: 1px solid #f9f9f9;
    text-align: center;
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown-content a:hover {
    background-color: var(--bg-color);
    color: var(--primary);
}

/* RESPONSIVE MEDIA QUERIES */
@media (max-width: 1024px) {

    /* Fix Dropdowns for Mobile */
    .dropdown {
        width: 100%;
        text-align: center;
    }
    
    .dropdown-content {
        position: static;
        display: none; 
        box-shadow: none;
        border: none;
        background-color: transparent;
        width: 100%;
        transform: none;
        opacity: 1;
        margin-top: 10px;
    }

    /* Hover etkisini mobilde tamamen öldür */
    .dropdown:hover .dropdown-content {
        display: none; 
    }

    /* Opens securely via JavaScript class on mobile */
    .dropdown.mobile-open .dropdown-content {
        display: flex !important;
        flex-direction: column;
    }

    .dropdown-content a {
        padding: 10px;
        font-size: 0.9rem;
        color: var(--text-muted);
    }

    /* Stack the Page Wrapper (Main Content & Sidebar) */
    .page-wrapper {
        display: grid; /* Switch to Grid for precise ordering */
        grid-template-columns: 100%;
    }

    .main-content {
        display: contents; /* Allows children (sections) to be part of the grid */
    }

    /* Target specific sections to set the order */
    #wilkommen { order: 1; }
    
    .sticky-sidebar {
        order: 2; /* Keeps it right below the Start/Willkommen section */
        width: 100%; /* Fills the screen horizontally */
        position: relative; /* REMOVES the sticky behavior */
        top: auto; 
        height: auto; /* REMOVES the 100vh scroll trap */
        overflow-y: visible; /* REMOVES the double scrollbars */
        padding: 40px 20px;
        box-sizing: border-box;
        border-left: none;
        border-top: 4px solid var(--secondary); /* Nice separator lines for mobile */
        border-bottom: 4px solid var(--secondary);
        box-shadow: none;
        background: #ffffff;
    }

    #dialog { order: 3; }
    #jugendarbeit { order: 4; }
    #migration { order: 5; }
    #ueber-uns { order: 6; }
    #veranstaltungen { order: 7; }
    #archiv { order: 8; }
    #kontakt { order: 9; }
    #impressum { order: 10; }
    .site-footer { order: 11; }

    /* Fix image stacking on mobile */
    .standard-section, 
    .standard-section--reverse,
    .kontakt-section {
        flex-direction: column !important;
        text-align: center;
    }

    /* Top Nav: Show Hamburger */
    .menu-toggle {
        display: flex;
    }

    .top-nav nav {
        display: none; /* Hide menu by default on mobile */
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: white;
        border-bottom: 3px solid var(--primary);
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
    }

    .top-nav nav.active {
        display: block;
    }

    .top-nav ul {
        flex-direction: column;
        align-items: center;
        padding: 20px 0;
        gap: 20px;
    }

    /* Fix Standard Sections: Stack images and text */
    .standard-section, 
    .standard-section--reverse,
    .kontakt-section {
        flex-direction: column;
        padding: 40px 20px;
        gap: 30px;
        text-align: center;
    }

    .image-placeholder {
        flex: 0 0 auto;
        width: 100%;
    }

    /* Adjust Footer */
    .footer-content {
        flex-direction: column;
        gap: 20px;
    }
}

@media (max-width: 600px) {
    /* Smaller padding for very small screens */
    section {
        padding: 40px 15px;
    }
    
    .logo img {
        height: 50px;
    }
}

.kontakt-section {
    display: flex;
    flex-direction: column; /* Stack Title over Content */
    align-items: center;
}

.kontakt-content-wrapper {
    display: flex;
    width: 100%;
    gap: 40px;
}

/* Mobile fix for Kontakt */
@media (max-width: 1024px) {
    .kontakt-content-wrapper {
        flex-direction: column;
        text-align: center;
    }
    
    .map-container {
        order: 2; /* Keeps map below the text info on mobile if preferred */
    }
}
