/* Polizeischützen Parsberg - Farbschema basierend auf Vereinswappen */

:root {
    /* Primär - Vereinsgrün */
    --color-primary: #2D5A27;
    --color-primary-dark: #1E3D1A;
    --color-primary-light: #3A7A32;
    
    /* Sekundär - Bayerisch Blau */
    --color-secondary: #4A86B8;
    --color-secondary-light: #6BA3D0;
    
    /* Akzente */
    --color-accent-gold: #C5A033;
    --color-accent-red: #C8102E;
    
    /* Neutrale */
    --color-bg: #F5F5F0;
    --color-bg-alt: #E8EDE7;
    --color-text: #1A1A1A;
    --color-text-secondary: #4A4A4A;
    --color-border: #A8A9AD;
    
    /* Footer */
    --color-footer-bg: #1E3D1A;
    --color-footer-text: #E8EDE7;
}

/* Body Hintergrund */
body {
    background-color: var(--color-bg);
    color: var(--color-text);
}

/* Header - Kompakt und Sticky */
#header {
    background-color: var(--color-primary);
    position: sticky !important;
    top: 0 !important;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    min-height: 210px;
}

/* Logo kompakter */
#header #logo {
    margin: 0;
    padding: 0;
}

#header #logo a {
    display: block;
}

#header #logo .logo-img {
    height: 170px;
    width: auto;
    max-width: 550px;
    display: block;
    transition: opacity 0.3s ease;
}

#header #logo .logo-img:hover {
    opacity: 0.8;
}

/* Navbar inline mit Logo */
#header #navbar {
    margin: 0;
    padding: 0;
}

#header #navbar .navigation {
    display: flex;
    gap: 25px;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Navigation Links */
#header #navbar nav ul li a,
#header .navigation li a,
.navigation li a {
    color: white !important;
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.95em;
}

#header #navbar nav ul li a:hover,
#header .navigation li a:hover,
.navigation li a:hover {
    color: var(--color-accent-gold) !important;
}

#header #navbar nav ul li.active a,
#header .navigation li.active a,
.navigation li.active a {
    color: var(--color-accent-gold) !important;
    font-weight: bold;
}

/* Links */
a {
    color: var(--color-secondary);
    transition: color 0.3s ease;
}

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

/* Buttons */
.button, button, .btn {
    background-color: var(--color-primary);
    color: white;
    border: none;
    transition: background-color 0.3s ease;
}

.button:hover, button:hover, .btn:hover {
    background-color: var(--color-primary-light);
}

.button.primary, .btn-primary {
    background-color: var(--color-accent-gold);
    color: var(--color-text);
}

.button.primary:hover, .btn-primary:hover {
    background-color: #D4B143;
}

/* Content Sections */
#body {
    background-color: white;
    padding: 40px 20px;
}

/* Footer */
#footer {
    background-color: var(--color-footer-bg);
    color: var(--color-footer-text);
    padding: 40px 20px;
    position: relative;
}

#footer a {
    color: var(--color-footer-text);
}

#footer a:hover {
    color: var(--color-accent-gold);
}

/* Return to Top Button - nicht über Pagination */
#footer .totop {
    position: absolute;
    top: -50px;
    right: 20px;
    z-index: 100;
}

#footer .totop a {
    display: block;
    width: 50px;
    height: 50px;
    background-color: var(--color-primary);
    color: white;
    text-align: center;
    line-height: 50px;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: background-color 0.3s ease;
}

#footer .totop a:hover {
    background-color: var(--color-primary-light);
}

/* Blog List Item - Datum links neben Content */
.list-item .list-blog-header {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 30px;
}

.list-item .list-blog-date {
    flex-shrink: 0;
    order: -1;
    min-width: 100px;
    text-align: center;
    margin: 0 !important;
}

.list-item .list-blog-date time {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--color-primary);
    color: white;
    padding: 15px 10px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.list-item:hover .list-blog-date time {
    background: var(--color-primary-light);
}

.list-item .list-blog-date time span {
    font-size: 2.5em;
    font-weight: bold;
    line-height: 1;
}

.list-item .list-blog-date time em {
    font-size: 1em;
    text-transform: uppercase;
    font-style: normal;
    margin-top: 5px;
}

.list-item .list-blog-header > div {
    flex-grow: 1;
}

.list-item h4 a {
    color: var(--color-text);
}

.list-item h4 a:hover {
    color: var(--color-primary);
}

/* Home/Aktuelles - Keine Sidebar, zentriert */
body.fullwidth #body {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    float: none;
}

body.fullwidth #sidebar {
    display: none;
}

body.fullwidth .content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Pagination - nicht blockiert durch Return-to-Top */
.pagination {
    margin: 40px 0;
    text-align: center;
    position: relative;
    z-index: 200;
}

/* Responsive */
@media (max-width: 768px) {
    #header {
        flex-direction: column;
        padding: 10px 20px;
    }
    
    #header #logo .logo-img {
        height: 90px;
    }
    
    #header #navbar {
        margin-top: 10px;
    }
    
    #header #navbar .navigation {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }
    
    .list-item .list-blog-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .list-item .list-blog-date {
        width: 100%;
    }
}

/* Logo komplett im Header - keine Überlappung */
body {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

#header #logo {
    position: relative;
    z-index: auto;
}

#header #logo .logo-img {
    position: relative;
    z-index: auto;
    margin: 0;
}

/* Content startet direkt nach Header */
#body {
    margin-top: 0 !important;
    padding-top: 40px;
}

/* Header padding konsistent für alle Seiten */
#header {
    padding-left: 20px !important;
    padding-right: 20px !important;
}

body.fullwidth #header,
body #header {
    padding-left: 20px !important;
    padding-right: 20px !important;
}

/* Tabellen zentriert */
table {
    margin: 30px auto;
    border-collapse: collapse;
    width: auto !important;
    min-width: 600px;
    max-width: 900px;
}

table th, table td {
    padding: 15px 30px;
    text-align: left;
    border: 1px solid var(--color-border);
}

table thead {
    background-color: var(--color-primary);
    color: var(--color-text);
}

table th {
    font-weight: bold;
    color: var(--color-text) !important;
}

table tbody tr:nth-child(even) {
    background-color: var(--color-bg-alt);
}

table tbody tr:hover {
    background-color: var(--color-bg);
}

/* Alle Seiten: Content zentriert, Text linksbündig */
#body {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    text-align: left;
}

#body h1, #body h2, #body h3, #body h4, #body h5, #body h6 {
    text-align: left;
}

#body p, #body ul, #body ol {
    text-align: left;
}

/* Sidebar verstecken auf allen Seiten */
#sidebar {
    display: none !important;
}

.blog-content-item {
    max-width: 100%;
}

#item {
    max-width: 900px;
    margin: 0 auto;
}

/* Header mit Hintergrundbild */
#header {
    background-image: linear-gradient(rgba(45, 90, 39, 0.35), rgba(45, 90, 39, 0.35)), url('../images/header-bg.png');
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
}

/* Galerie-Bilder als Grid */
.gallery-content p,
article p {
    display: inline;
}

/* Bilder-Grid für Galerien */
article a[href*=".jpg"] img,
article a[href*=".jpeg"] img,
article a[href*=".png"] img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

article a[href*=".jpg"],
article a[href*=".jpeg"],
article a[href*=".png"] {
    display: inline-block;
    width: calc(25% - 20px);
    margin: 10px;
    text-decoration: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

article a[href*=".jpg"]:hover img,
article a[href*=".jpeg"]:hover img,
article a[href*=".png"]:hover img {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* Responsive Grid */
@media (max-width: 1200px) {
    article a[href*=".jpg"],
    article a[href*=".jpeg"],
    article a[href*=".png"] {
        width: calc(33.333% - 20px);
    }
}

@media (max-width: 768px) {
    article a[href*=".jpg"],
    article a[href*=".jpeg"],
    article a[href*=".png"] {
        width: calc(50% - 20px);
    }
}

@media (max-width: 480px) {
    article a[href*=".jpg"],
    article a[href*=".jpeg"],
    article a[href*=".png"] {
        width: calc(100% - 20px);
    }
}

/* Galerie Grid Override */
.gallery-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: flex-start;
}

.gallery-grid p {
    display: contents;
}

.gallery-grid a {
    width: calc(25% - 12px);
    display: block;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.gallery-grid a:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.gallery-grid img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

/* Responsive Galerie */
@media (max-width: 1200px) {
    .gallery-grid a {
        width: calc(33.333% - 10px);
    }
}

@media (max-width: 768px) {
    .gallery-grid a {
        width: calc(50% - 8px);
    }
}

@media (max-width: 480px) {
    .gallery-grid a {
        width: 100%;
    }
}

/* SVG Placeholder verstecken */
.gallery-grid img[src*="data:image/svg"] {
    display: none !important;
}

/* Jahres-Überschriften in Galerie */
.gallery-grid h2 {
    width: 100%;
    margin: 40px 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-primary);
    color: var(--color-primary);
    font-size: 1.8em;
}

.gallery-grid h2:first-child {
    margin-top: 0;
}

/* Nur echte Bilder anzeigen */
.gallery-content a img[src*="polizeischuetzen-parsberg.com"] {
    display: block !important;
}

/* Links mit SVG-Bildern verstecken */
.gallery-grid a:has(img[src*="data:image/svg"]) {
    display: none !important;
}

/* Dropdown-Menü Styling */
.navigation li.has-children ul {
    background: #f0f4f0 !important; /* Helles Grüngrau */
    border: 1px solid var(--verein-gruen);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.navigation li.has-children ul li a {
    color: #333 !important;
    padding: 12px 20px;
    background: #f0f4f0 !important;
}

.navigation li.has-children ul li a:hover {
    background: var(--verein-gruen) !important;
    color: white !important;
}


/* Dropdown-Menü - Verstärkte Regeln */
ul.navigation li.has-children > ul,
ul.navigation li.has-children ul {
    background-color: #e8ede8 !important; /* Grüngrau */
}

ul.navigation li.has-children ul li {
    background-color: #e8ede8 !important;
}

ul.navigation li.has-children ul li a {
    background-color: #e8ede8 !important;
    color: #2d5a27 !important;
}

ul.navigation li.has-children ul li:hover,
ul.navigation li.has-children ul li a:hover {
    background-color: var(--verein-gruen) !important;
    color: white !important;
}

/* Dropdown-Menü - Dunkleres Graugrün */
ul.navigation li.has-children > ul,
ul.navigation li.has-children ul {
    background-color: #b8c5b8 !important; /* Mittleres Graugrün */
}

ul.navigation li.has-children ul li {
    background-color: #b8c5b8 !important;
}

ul.navigation li.has-children ul li a {
    background-color: #b8c5b8 !important;
    color: #1a3d1a !important; /* Dunkleres Grün für Text */
}

ul.navigation li.has-children ul li:hover,
ul.navigation li.has-children ul li a:hover {
    background-color: #2d5a27 !important; /* Vereinsgrün */
    color: white !important;
}

/* Dropdown-Menü - Dunkles Grün + Gold */
ul.navigation li.has-children > ul,
ul.navigation li.has-children ul {
    background-color: #2d5a27 !important; /* Dunkles Vereinsgrün */
    border: 1px solid var(--verein-gold);
}

ul.navigation li.has-children ul li {
    background-color: #2d5a27 !important;
}

ul.navigation li.has-children ul li a {
    background-color: #2d5a27 !important;
    color: #c5a033 !important; /* Gold */
    font-weight: 500;
}

ul.navigation li.has-children ul li:hover,
ul.navigation li.has-children ul li a:hover {
    background-color: #3d7037 !important; /* Helleres Grün beim Hover */
    color: white !important;
}

/* Hauptmenüpunkt bei geöffnetem Dropdown */
ul.navigation li.has-children:hover > a,
ul.navigation li.has-children.active > a {
    background-color: #3d7037 !important; /* Helleres Grün */
    color: white !important;
}

/* Pfeil/Span bei Dropdown */
ul.navigation li.has-children > a span {
    border-color: white transparent transparent transparent !important;
}

/* Haupttitel auf Blog-Seite (Aktuelles) */
.blog-header h1,
#body .blog-header h1,
.blog-listing h1:first-of-type {
    text-align: center !important;
    white-space: nowrap;
}

/* Mobile: Mehrzeilig erlaubt */
@media (max-width: 768px) {
    .blog-header h1,
    #body .blog-header h1,
    .blog-listing h1:first-of-type {
        white-space: normal;
        line-height: 1.3;
    }
}

/* Willkommen-Titel zentrieren */
.blog-header h1 {
    text-align: center !important;
    white-space: nowrap !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.blog-header p {
    text-align: center !important;
}

/* Mobile: Mehrzeilig erlaubt */
@media (max-width: 1024px) {
    .blog-header h1 {
        white-space: normal !important;
        line-height: 1.3 !important;
    }
}

/* Blog-Header über volle Breite zentrieren */
.blog-header {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.blog-header h1 {
    width: 100% !important;
    text-align: center !important;
    padding-left: 20px;
    padding-right: 20px;
}

.blog-header p {
    width: 100% !important;
    text-align: center !important;
}

/* Abstand zwischen Formular-Button und Back-to-Top */
form button[type="submit"],
form .button.primary {
    margin-bottom: 60px !important;
}

/* Kontaktformular Styling */
form .checkbox label {
    line-height: 1.6;
}

/* Verein-Übersichtsseite Links */
.verein-links h3 a {
    color: var(--verein-gruen);
    text-decoration: none;
}

.verein-links h3 a:hover {
    color: var(--verein-blau);
}

.verein-links p a {
    color: var(--verein-blau);
    font-weight: 500;
}

.verein-links p a:hover {
    color: var(--verein-gold);
}

/* Mitgliederbereich-Übersichtsseite Links */
.mitglieder-links h3 a {
    color: var(--verein-gruen);
    text-decoration: none;
}

.mitglieder-links h3 a:hover {
    color: var(--verein-blau);
}

.mitglieder-links p a {
    color: var(--verein-blau);
    font-weight: 500;
}

.mitglieder-links p a:hover {
    color: var(--verein-gold);
}
