/* ============================================
   OGV Vereinswebseite – Hauptstylesheet
   Natur-inspiriertes, warmes Design
   ============================================ */

/* Lokale Fonts – datenschutzkonform (kein Google-Server-Kontakt) */
@import url('../fonts/fonts.css');

:root {
    --gruen-dunkel:  #2d5016;
    --gruen-mittel:  #4a7c2f;
    --gruen-hell:    #7ab648;
    --gruen-zart:    #e8f5d8;
    --braun:         #7a5230;
    --braun-hell:    #c8a97a;
    --apricot:       #f5e6c8;
    --creme:         #faf7f0;
    --text-dunkel:   #2c2c2c;
    --text-mittel:   #555;
    --text-hell:     #888;
    --weiss:         #ffffff;
    --schatten:      rgba(45, 80, 22, 0.12);
    --border-radius: 12px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Lato', sans-serif;
    background-color: var(--creme);
    color: var(--text-dunkel);
    line-height: 1.7;
}

/* ---- TYPOGRAPHIE ---- */
h1, h2, h3, h4 {
    font-family: 'Playfair Display', serif;
    color: var(--gruen-dunkel);
    line-height: 1.3;
}

a { color: var(--gruen-mittel); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--gruen-hell); }

/* ---- HEADER ---- */
header {
    background: linear-gradient(135deg, var(--gruen-dunkel) 0%, var(--gruen-mittel) 100%);
    color: var(--weiss);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 16px rgba(0,0,0,0.2);
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-icon {
    font-size: 1.8rem;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

.logo-text {
    font-family: 'Playfair Display', serif;
    color: var(--weiss);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.2;
}

.logo-sub {
    display: block;
    font-family: 'Lato', sans-serif;
    font-size: 0.65rem;
    font-weight: 300;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.75);
    text-transform: uppercase;
}

/* ---- NAVIGATION (Desktop) ---- */
#main-nav {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    flex-wrap: nowrap;
}

#main-nav a {
    color: rgba(255,255,255,0.88);
    padding: 0.4rem 0.65rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 400;
    transition: all 0.2s;
    white-space: nowrap;
    text-decoration: none;
}

#main-nav a:hover, #main-nav a.active {
    background: rgba(255,255,255,0.18);
    color: var(--weiss);
}

.nav-btn {
    background: var(--gruen-hell) !important;
    color: var(--weiss) !important;
    padding: 0.4rem 0.9rem !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.nav-btn:hover { background: var(--braun-hell) !important; transform: translateY(-1px); }

/* ---- HAMBURGER ---- */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    gap: 5px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 8px;
    padding: 8px 10px;
    flex-shrink: 0;
    min-width: 44px;
    min-height: 44px;
}
.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--weiss);
    border-radius: 2px;
    transition: all 0.3s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---- HERO ---- */
.hero {
    background: var(--hero-bg, linear-gradient(160deg, var(--gruen-dunkel) 0%, var(--gruen-mittel) 50%, var(--gruen-hell) 100%));
    background-size: cover;
    background-position: center;
    background-attachment: scroll; /* kein parallax – verhindert Ruckeln */
    will-change: auto;
    color: var(--weiss);
    padding: 7rem 1.5rem 6rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 480px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: translateZ(0); /* GPU-Layer erzwingen */
}

/* Overlay bei Bild: weicher grüner Schleier wie im Mockup */
.hero.has-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(30, 60, 20, 0.35) 0%,
        rgba(20, 50, 15, 0.55) 100%
    );
    z-index: 0;
}
.hero.has-image > * { position: relative; z-index: 1; }

/* Emoji-Deko nur ohne Bild */
.hero:not(.has-image)::before {
    content: '🌿🍎🌳🌸🍃';
    position: absolute;
    font-size: 8rem;
    opacity: 0.06;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    letter-spacing: 1rem;
    pointer-events: none;
}

.hero h1 {
    color: var(--weiss);
    font-size: clamp(2rem, 5vw, 3.4rem);
    margin-bottom: 1rem;
    text-shadow: 0 2px 16px rgba(0,0,0,0.4);
    line-height: 1.25;
}

.hero p {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.9);
    max-width: 560px;
    margin: 0 auto 2.5rem;
    text-shadow: 0 1px 6px rgba(0,0,0,0.3);
}

.hero-buttons { display: flex; gap: 1.25rem; justify-content: center; flex-wrap: wrap; }

/* Buttons genau wie im Mockup */
.btn-primary {
    background: var(--weiss);
    color: var(--gruen-dunkel) !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    border: none;
}
.btn-primary:hover {
    background: var(--gruen-zart);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    color: var(--gruen-dunkel) !important;
}

.btn-secondary {
    background: rgba(45, 80, 22, 0.55);
    color: var(--weiss) !important;
    border: 2px solid rgba(255,255,255,0.5);
    backdrop-filter: blur(4px);
}
.btn-secondary:hover {
    background: rgba(74,124,47,0.7);
    border-color: rgba(255,255,255,0.8);
    color: var(--weiss) !important;
    transform: translateY(-2px);
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.8rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: all 0.25s;
    text-decoration: none;
    font-family: 'Lato', sans-serif;
}

.btn-primary {
    background: var(--weiss);
    color: var(--gruen-dunkel);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.btn-primary:hover {
    background: var(--gruen-zart);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    color: var(--gruen-dunkel);
}

.btn-secondary {
    background: transparent;
    color: var(--weiss);
    border: 2px solid rgba(255,255,255,0.7);
}
.btn-secondary:hover {
    background: rgba(255,255,255,0.15);
    border-color: var(--weiss);
    color: var(--weiss);
}

.btn-gruen {
    background: var(--gruen-mittel);
    color: var(--weiss);
    box-shadow: 0 3px 12px rgba(74,124,47,0.35);
}
.btn-gruen:hover {
    background: var(--gruen-dunkel);
    transform: translateY(-1px);
    color: var(--weiss);
}

.btn-sm { padding: 0.45rem 1.1rem; font-size: 0.85rem; }

/* ---- MAIN CONTENT ---- */
main {
    max-width: 1100px;
    margin: 3rem auto;
    padding: 0 1.5rem;
}

/* ---- KARTEN ---- */
.card {
    background: var(--weiss);
    border-radius: var(--border-radius);
    box-shadow: 0 2px 16px var(--schatten);
    overflow: hidden;
    transition: transform 0.25s, box-shadow 0.25s;
    display: flex;
    flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 28px var(--schatten); }

.card-body { padding: 1.5rem; display: flex; flex-direction: column; flex: 1; }
.card-body .btn { margin-top: auto; align-self: flex-start; }

.card-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    color: var(--gruen-dunkel);
    margin-bottom: 0.5rem;
}

.card-meta {
    font-size: 0.82rem;
    color: var(--text-hell);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ---- GRID LAYOUTS ---- */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 1.5rem; }

/* ---- SECTION HEADER ---- */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.75rem;
    border-bottom: 2px solid var(--gruen-zart);
    padding-bottom: 0.75rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.section-header h2 { font-size: 1.8rem; margin: 0; }
.section-header a:not(.btn) { font-size: 0.9rem; color: var(--gruen-mittel); }
.section-header .btn { font-size: 0.85rem; }

/* Admin-Aktionsleiste – erscheint unter dem Section-Header für Eingeloggte */
.admin-bar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    background: var(--gruen-zart);
    border-radius: 8px;
    padding: 0.6rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.88rem;
    color: var(--gruen-dunkel);
}
.admin-bar a, .admin-bar button {
    background: var(--weiss);
    color: var(--gruen-dunkel);
    border: 1.5px solid var(--gruen-hell);
    border-radius: 6px;
    padding: 0.3rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    transition: background 0.2s, color 0.2s;
    display: inline-block;
}
.admin-bar a:hover, .admin-bar button:hover {
    background: var(--gruen-mittel);
    color: var(--weiss);
    border-color: var(--gruen-mittel);
}

/* ---- FORMULAR ---- */
.form-group { margin-bottom: 1.2rem; }

.form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
    color: var(--text-dunkel);
}

.form-control {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1.5px solid #dde8cc;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: 'Lato', sans-serif;
    background: var(--creme);
    color: var(--text-dunkel);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--gruen-hell);
    box-shadow: 0 0 0 3px rgba(122, 182, 72, 0.2);
    background: var(--weiss);
}

textarea.form-control { resize: vertical; min-height: 130px; }

/* ---- ALERTS ---- */
.alert {
    padding: 0.9rem 1.2rem;
    border-radius: 8px;
    margin-bottom: 1.2rem;
    font-size: 0.93rem;
    border-left: 4px solid;
}
.alert-success { background: #edfcd8; border-color: var(--gruen-hell); color: var(--gruen-dunkel); }
.alert-error   { background: #fde8e8; border-color: #c0392b; color: #922b21; }
.alert-info    { background: var(--apricot); border-color: var(--braun-hell); color: var(--braun); }

/* ---- BADGE ---- */
.badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.badge-gruen { background: var(--gruen-zart); color: var(--gruen-dunkel); }
.badge-braun { background: var(--apricot); color: var(--braun); }

/* ---- EVENT KARTE ---- */
.event-datum {
    background: var(--gruen-dunkel);
    color: var(--weiss);
    text-align: center;
    padding: 0.75rem;
    min-width: 64px;
    border-radius: 8px;
    flex-shrink: 0;
}
.event-datum .tag { font-size: 1.6rem; font-weight: 700; font-family: 'Playfair Display', serif; display: block; }
.event-datum .mon { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; }

.event-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.2rem;
    border-radius: var(--border-radius);
    background: var(--weiss);
    box-shadow: 0 2px 10px var(--schatten);
    transition: transform 0.2s;
}
.event-item:hover { transform: translateX(4px); }

/* ---- GALERIE ---- */
.galerie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}
.galerie-bild {
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    width: 100%;
    transition: transform 0.25s, box-shadow 0.25s;
    cursor: zoom-in;
}
.galerie-bild:hover { transform: scale(1.04); box-shadow: 0 8px 24px rgba(0,0,0,0.2); }

/* ---- LOGIN/REGISTER SEITE ---- */
.auth-container {
    max-width: 440px;
    margin: 3rem auto;
}
.auth-card {
    background: var(--weiss);
    border-radius: var(--border-radius);
    padding: 2.5rem;
    box-shadow: 0 4px 24px var(--schatten);
}
.auth-card h2 { text-align: center; margin-bottom: 0.25rem; }
.auth-card .subtitle { text-align: center; color: var(--text-hell); font-size: 0.9rem; margin-bottom: 2rem; }

/* ---- FOOTER ---- */
footer {
    background: var(--gruen-dunkel);
    color: rgba(255,255,255,0.8);
    padding: 3rem 1.5rem 1.5rem;
    margin-top: 5rem;
}
.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}
.footer-col h4 {
    color: var(--gruen-hell);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}
.footer-col a { color: rgba(255,255,255,0.7); display: block; margin-bottom: 0.4rem; font-size: 0.9rem; }
.footer-col a:hover { color: var(--weiss); }
.footer-bottom {
    max-width: 1100px;
    margin: 0 auto;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1rem;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.5);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Mobiles Suchfeld nur auf Mobil sichtbar */
.nav-mobile-search { display: none; }

/* ---- RESPONSIVE ---- */
/* ============================================
   RESPONSIVE – Mobile First
   ============================================ */

/* Tablet: Nav beginnt zu stauchen */
@media (max-width: 1100px) {
    #main-nav a { padding: 0.35rem 0.4rem; font-size: 0.78rem; }
    #main-nav form input { width: 80px !important; }
}

/* Hamburger ab 900px sichtbar – zu viele Nav-Einträge für schmale Desktops */
@media (max-width: 900px) {
    .hamburger { display: flex; }
    .nav-mobile-search { display: block; }

    /* Nav-Overlay: öffnet sich unter dem Header */
    #main-nav {
        display: none;
        position: fixed;           /* fixed statt absolute: scrollt nicht mit */
        top: 68px;                 /* Höhe des Headers */
        left: 0;
        right: 0;
        bottom: 0;                 /* füllt den ganzen Rest des Bildschirms */
        background: var(--gruen-dunkel);
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        gap: 0.2rem;
        overflow-y: auto;          /* scrollbar bei sehr kleinen Geräten */
        z-index: 1000;
        border-top: 2px solid rgba(255,255,255,0.15);
        /* Slide-in Animation */
        transform: translateY(-8px);
        opacity: 0;
        transition: transform 0.25s ease, opacity 0.25s ease;
        pointer-events: none;
    }

    #main-nav.open {
        display: flex;
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    #main-nav a {
        padding: 0.9rem 1.1rem;
        border-radius: 10px;
        font-size: 1rem;
        display: block;
        width: 100%;
        color: rgba(255,255,255,0.92);
        border-bottom: none;
    }

    #main-nav a:hover, #main-nav a.active {
        background: rgba(255,255,255,0.15);
        color: var(--weiss);
    }

    /* Suche als erstes Element im mobilen Menü */
    .nav-mobile-search {
        padding: 0.5rem 0 0.75rem;
        border-bottom: 1px solid rgba(255,255,255,0.15);
        margin-bottom: 0.25rem;
    }
    .nav-mobile-search form {
        display: flex; align-items: center;
        background: rgba(255,255,255,0.12);
        border: 1px solid rgba(255,255,255,0.25);
        border-radius: 12px;
        padding: 0.1rem 0.5rem;
    }
    .nav-mobile-search input[type="text"] {
        flex: 1;
        background: none !important;
        border: none !important;
        color: white !important;
        font-size: 1rem !important;
        padding: 0.75rem 0.5rem !important;
        outline: none;
        border-radius: 0 !important;
        width: 100% !important;
    }
    .nav-mobile-search input::placeholder { color: rgba(255,255,255,0.55) !important; }

    /* Desktop-Suchleiste auf Mobil ausblenden */
    #search-bar { display: none !important; }
    #search-toggle { display: none !important; }

    /* Trennlinie vor Login-Button */
    .nav-btn {
        text-align: center;
        margin-top: 0.5rem;
        padding: 0.9rem 1.1rem !important;
        font-size: 1rem !important;
        border-top: 1px solid rgba(255,255,255,0.15);
    }

    /* Suchfeld nimmt volle Breite ein */
    #main-nav form {
        margin-top: 0.5rem;
        padding-top: 0.75rem;
        border-top: 1px solid rgba(255,255,255,0.15);
    }
    #main-nav form input {
        width: 100% !important;
        background: rgba(255,255,255,0.12) !important;
        color: white !important;
        border-radius: 10px !important;
        padding: 0.8rem 1.1rem !important;
        font-size: 1rem !important;
        border: 1px solid rgba(255,255,255,0.25) !important;
        transition: none !important; /* kein width-Transition auf mobil */
    }
    #main-nav form input::placeholder { color: rgba(255,255,255,0.55) !important; }

    /* Header braucht position:relative für top-Berechnung nicht mehr (wir nutzen fixed) */
    .header-inner { position: static; }

    /* Layout-Anpassungen */
    .grid-3, .grid-2 { grid-template-columns: 1fr; }
    .hero { padding: 4rem 1rem 3.5rem; min-height: 360px; }
    .hero h1 { font-size: 1.9rem; }
    .hero p { font-size: 0.97rem; }
    .hero-buttons { flex-direction: column; align-items: center; }

    main { margin: 1.5rem auto; }

    /* Admin */
    .admin-layout { flex-direction: column; }
    .admin-sidebar { width: 100%; position: static; display: flex; flex-wrap: wrap; padding: 0.5rem; gap: 0.25rem; }
    .admin-sidebar a { padding: 0.45rem 0.75rem; font-size: 0.82rem; border-radius: 6px; }

    /* Tabellen scrollen */
    .admin-table { font-size: 0.8rem; }
    .admin-table th, .admin-table td { padding: 0.5rem 0.6rem; }

    /* Event-Items */
    .event-item { flex-direction: column; gap: 0.5rem; }
}

/* Sehr kleine Bildschirme */
@media (max-width: 380px) {
    .logo-text { font-size: 0.95rem; }
    .logo-icon { font-size: 1.5rem; }
    .header-inner { padding: 0 0.75rem; }
    main { padding: 0 0.75rem; }
}

/* ---- UTILS ---- */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-3 { margin-bottom: 1.5rem; }
.text-center { text-align: center; }
.text-muted { color: var(--text-hell); font-size: 0.9rem; }
.divider { border: none; border-top: 1px solid #eee; margin: 2rem 0; }

/* ---- ADMIN ---- */
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.admin-table th { background: var(--gruen-zart); color: var(--gruen-dunkel); padding: 0.75rem 1rem; text-align: left; font-weight: 700; }
.admin-table td { padding: 0.65rem 1rem; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.admin-table tr:hover td { background: #fafff5; }

.admin-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: var(--weiss);
    border-radius: var(--border-radius);
    box-shadow: 0 2px 16px var(--schatten);
    padding: 1.5rem 0;
    align-self: flex-start;
    position: sticky;
    top: 80px;
}
.admin-sidebar a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 1.5rem;
    color: var(--text-mittel);
    font-size: 0.92rem;
    transition: all 0.2s;
}
.admin-sidebar a:hover, .admin-sidebar a.active {
    background: var(--gruen-zart);
    color: var(--gruen-dunkel);
    font-weight: 700;
}
.admin-layout { display: flex; gap: 2rem; align-items: flex-start; }
.admin-content { flex: 1; min-width: 0; }

/* ---- ADMIN SUBPAGE LAYOUT (Galerie, Baumkataster, Newsletter) ---- */
.admin-subpage-wrap {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}
.admin-sidebar-fixed {
    width: 200px;
    flex-shrink: 0;
    background: var(--weiss);
    border-radius: var(--border-radius);
    box-shadow: 0 2px 16px var(--schatten);
    padding: 1rem 0.5rem;
    position: sticky;
    top: 80px;
}
.admin-sidebar-fixed a {
    display: block;
    padding: 0.55rem 1rem;
    color: var(--text-mittel);
    text-decoration: none;
    font-size: 0.88rem;
    border-radius: 6px;
    transition: all 0.15s;
}
.admin-sidebar-fixed a:hover,
.admin-sidebar-fixed a.active {
    background: var(--gruen-zart);
    color: var(--gruen-dunkel);
    font-weight: 700;
}
.admin-subpage-content {
    flex: 1;
    min-width: 0;
}
@media (max-width: 800px) {
    .admin-subpage-wrap { flex-direction: column; }
    .admin-sidebar-fixed { width: 100%; position: static; display: flex; flex-wrap: wrap; gap: 4px; padding: 0.5rem; }
    .admin-sidebar-fixed a { padding: 0.4rem 0.75rem; font-size: 0.82rem; }
    .admin-sidebar-fixed div { display: none; }
}