/* ======================================
   STV Sedelsberg – Modernisierte Styles
   Beibehaltung der Originalfarben
   Mobile First + moderne UX
====================================== */

:root {
    /* Original Farbwelt (angepasst modern) */
    --primary: #0055a5;
    --primary-dark: #003d7a;
    --accent: #f4a100;
    --light: #f5f7fa;
    --dark: #1f2933;
    --text: #333;
    --radius: 10px;
    --shadow: 0 10px 25px rgba(0,0,0,0.08);
    --stv-blue-dark: #003d7a;
    --stv-gold: #f4a100;
}

/* ======================
   RESET
====================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    height: 100%;
}

body {
    font-family: "Segoe UI", Arial, sans-serif;
    color: var(--text);
    line-height: 1.6;
    background: #fff;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    margin: 0;
}

main {
    flex: 1 0 auto;
}

img {
    max-width: 100%;
    display: block;
}

/* ======================
   TYPOGRAPHY
====================== */

h1, h2, h3, h4, h5 {
    font-weight: 700;
    color: var(--dark);
}

h1 {
    letter-spacing: -0.5px;
}

h2 {
    margin-bottom: 1rem;
}

p {
    color: #555;
}

/* ======================
   HEADER
====================== */

.topbar {
    font-size: 0.8rem;
    color: #666;
}

.navbar {
    transition: all .3s ease;
}

.navbar-brand .fw-bold {
    color: var(--primary);
}

.nav-link {
    font-weight: 600;
    position: relative;
    transition: color .2s ease;
}

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

.nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: .3s;
}

.nav-link:hover::after {
    width: 100%;
}

/* Sticky modern */
.site-sticky {
    position: sticky;
    top: 0;
    z-index: 999;
    background: #fff;
}

/* Header Layout Fix */
header .container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between; /* Logo links, Nav rechts */
    align-items: center;
    padding: 10px 20px;
}

/* Hauptnavigation */
/* 1. Nur die Haupt-Liste nebeneinander anordnen */
.main-nav > ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;        /* Hauptpunkte nebeneinander */
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* 2. Die Dropdown-Liste komplett verstecken */
.main-nav .dropdown-menu {
    display: none;         /* ABSOLUT VERSTECKEN */
    position: absolute;    /* Aus dem Textfluss nehmen */
    top: 100%;             /* Direkt unter den Menüpunkt */
    left: 0;
    background-color: #ffffff;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border-top: 3px solid var(--primary);
    z-index: 1000;
    padding: 10px 0;
    list-style: none;      /* Keine Aufzählungspunkte */
}

/* 3. Dropdown-Elemente UNTEREINANDER (wichtig!) */
.main-nav .dropdown-menu li {
    display: block;        /* Erzwingt Zeilenumbruch im Dropdown */
    width: 100%;
    margin: 0;             /* Abstände der Haupt-Nav hier zurücksetzen */
}

/* 4. DIE LOGIK: Nur bei Hover auf das Elternelement anzeigen */
.main-nav li.dropdown:hover > .dropdown-menu {
    display: block;        /* Erscheint nur bei Maus-Kontakt */
}

/* 5. Styling der Links im Dropdown */
.main-nav .dropdown-menu a {
    color: var(--primary);
    padding: 10px 20px;
    display: block;        /* Link füllt die ganze Breite */
    text-decoration: none;
    font-weight: 500;
    text-transform: none;
    border-bottom: 1px solid #f0f0f0;
}

.main-nav .dropdown-menu a:hover {
    background-color: #f8f8f8;
    color: var(--primary);
}

.logo {
    display: flex;
    align-content: space-evenly;
    justify-content: space-evenly;
    align-items: center;
    gap: 1rem;
}

/* Verstecke Checkbox & Icon auf Desktop */
.menu-checkbox, .menu-icon {
    display: none;
}

/* Ab 992px (Mobile & Tablet) greifen diese Änderungen */
@media (max-width: 992px) {

    header .container {
        position: relative;
        padding: 10px 20px; /* Einheitliches Padding oben/unten */
    }

    /* Hamburger Icon anzeigen */
    .menu-icon {
        display: flex;
        flex-direction: column;
        gap: 5px;
        cursor: pointer;
        z-index: 1001;
    }

    .menu-icon span {
        display: block;
        width: 28px;
        height: 3px;
        background: var(--primary);
        transition: 0.3s;
    }

    .menu-checkbox:checked ~ .main-nav {
        display: block !important;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: 100%;       /* Startet exakt am unteren Rand des Containers */
        left: 0;
        width: 100%;
        background: #ffffff;
        z-index: 9999;   /* Sehr hoch, damit nichts drüber liegt */
        margin: 0;       /* Verhindert ungewollte Abstände */
        border-bottom: 3px solid var(--primary); /* Optischer Abschluss */
    }

    .main-nav ul {
        display: flex; /* Wir brauchen Flex, aber untereinander */
        flex-direction: column;
        width: 100%;
        padding: 0;
        margin: 0;
    }

    .main-nav > ul > li {
        width: 100%;
    }

    .nav-link {
        display: block;
        padding: 15px 20px;
        width: 100%;
        border-bottom: 1px solid #f5f5f5;
    }

    /* Dropdown für Mobile anpassen (immer offen oder eingerückt) */
    .main-nav .dropdown-menu {
        position: static; /* Nicht mehr schwebend */
        display: none;   /* Direkt unter dem Menüpunkt anzeigen */
        box-shadow: none;
        background: #f9f9f9;
        border-top: none;
        border-left: 4px solid var(--accent);
        margin-left: 20px;
        width: auto;
    }

    @media (hover: hover) {
        .main-nav li.dropdown:hover > .dropdown-menu {
            display: block;
        }
    }

    .main-nav li.dropdown.show > .dropdown-menu {
        display: block !important;
    }

    .menu-checkbox:checked ~ .main-nav {
        display: block !important;
    }

    /* X-Animation für den Hamburger */
    .menu-checkbox:checked + .menu-icon span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .menu-checkbox:checked + .menu-icon span:nth-child(2) { opacity: 0; }
    .menu-checkbox:checked + .menu-icon span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
}

/* ======================
   HERO
====================== */

.hero-original {
    background: linear-gradient(rgba(0,0,0,.45), rgba(0,0,0,.55)),
    url("../img/DJI_0259.jpg") center/cover no-repeat;
    padding: 120px 20px;
}

.hero-original h1 {
    color: #fff;
}

.hero-original p {
    color: #e5e5e5;
}

.hero-original .btn {
    border-radius: 40px;
    padding: 14px 30px;
    font-weight: 600;
}

/* ======================
   BUTTONS
====================== */

.btn-primary {
    background: var(--primary);
    border: none;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-outline-primary {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: #fff;
}

/* ======================
   CARDS
====================== */

.card {
    border-radius: var(--radius);
    transition: all .25s ease;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow);
}

.card-img-top {
    border-radius: var(--radius) var(--radius) 0 0;
}

/* ======================
   SECTIONS
====================== */

section {
    position: relative;
}

section h2 {
    position: relative;
    display: inline-block;
}

section h2::after {
    content: "";
    display: block;
    width: 40%;
    height: 4px;
    background: var(--accent);
    margin: 8px auto 0;
}

/* ======================
   NEWS
====================== */

.news img {
    object-fit: cover;
}

/* ======================
   PARTNER
====================== */

.partner-section img,
section img.img-fluid {
    filter: grayscale(100%);
    opacity: .7;
    transition: .3s;
}

.partner-section img:hover,
section img.img-fluid:hover {
    filter: grayscale(0);
    opacity: 1;
}

/* ======================
   FOOTER
====================== */

footer {
    background: var(--dark);
    margin-top: auto;
    flex-shrink: 0;
}

footer a {
    text-decoration: none;
    transition: .2s;
}

footer a:hover {
    color: var(--accent) !important;
}

footer h4 {
    color: grey;
}

/* ======================
   ANIMATIONEN
====================== */

.card,
.btn,
.navbar,
.hero-original {
    will-change: transform;
}

.fade-in {
    animation: fadeIn 1s ease both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/*
SLIDER
*/

/* Base Container */
.slider-container {
    position: relative;
    width: 60%; /* Keeping it slightly smaller than full width */
    margin: 20px auto;
    overflow: hidden;
    border-radius: 8px; /* Slightly softer corners */
    background-color: #f4f4f4; /* Optional: adds a light background for contain letterboxing */
}

.slider-wrapper {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    /* Set a standard, smaller height for the whole slider area */
    height: 200px; /* Adjust this value to make the slider overall "smaller" */
}

/* Slide Container */
.slide {
    flex: 0 0 33.333%; /* Desktop: 3 images */
    padding: 5px; /* Smaller padding */
    box-sizing: border-box;
    display: flex;
    justify-content: center; /* Center the image horizontally within its 1/3 slot */
    align-items: center; /* Center the image vertically within its 1/3 slot */
}

/* Mobile: 1 Image */
@media (max-width: 768px) {
    .slide {
        flex: 0 0 100%; /* Take up the full width */
    }

    .slider-wrapper {
        height: 180px; /* Slightly smaller height on mobile */
    }
}

/* The Image itself */
.slide img {
    max-width: 100%; /* Don't allow it to exceed the slide width */
    max-height: 100%; /* Don't allow it to exceed the slider-wrapper height */
    width: auto; /* Allow the width to scale naturally */
    height: auto; /* Allow the height to scale naturally */

    /* THE KEY FIXES: */
    object-fit: contain; /* Shows entire image, adds letterboxing if needed */
    /* object-fit: cover; /* (Alternative) Fills space, crops edges, but never stretches */

    border-radius: 4px;
    display: block; /* Removes baseline spacing issues */
}

/* Buttons */
.prev, .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    padding: 15px;
    cursor: pointer;
    z-index: 10;
}

.prev { left: 0; }
.next { right: 0; }


/* ======================
   RESPONSIVE
====================== */

@media (max-width: 991px) {

    .hero-original {
        padding: 90px 20px;
    }

}

@media (max-width: 768px) {

    h1 {
        font-size: 1.8rem;
    }

    .hero-original {
        padding: 70px 15px;
    }

}

@media (max-width: 480px) {

    .btn {
        width: 100%;
    }

}

/*COOKIES*/

.cookie-banner {
    position: fixed;
    bottom: -200px; /* Startet außerhalb des Bildschirms */
    left: 0;
    right: 0;
    background-color: var(--stv-blue-dark); /* Dein Vereinsblau */
    color: black;
    z-index: 9999;
    transition: bottom 0.5s ease-in-out;
    border-top: 3px solid var(--stv-gold); /* Dein Gold/Gelb als Akzent */
    visibility: hidden;
}

.cookie-banner.show {
    bottom: 0; !important; /* Schiebt sich ins Bild */
    visibility: visible;
}

.cookie-text {
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Responsive Anpassung für sehr kleine Bildschirme */
@media (max-width: 576px) {
    .cookie-banner {
        text-align: center;
    }
}