:root {
    /* Hier ändern wir die Rundung für ALLES auf einmal */
    --zag-radius: 15px; 
}
html {
    scroll-behavior: smooth; /* Sanftes Scrollen statt hartem Sprung */
}

/* Jedes Element, das per ID angesprungen wird (:target),
   hält 100px Abstand zum oberen Rand */
:target {
    scroll-margin-top: 120px; 
}

/* --- WAHL BADGE --- */
.wahl-badge {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background-color: #009fe3;
  color: white;
  border: 3px solid white;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  text-decoration: none;
  line-height: 1.1;
  transition: transform 0.3s ease, opacity 0.5s ease, visibility 0.5s;
  opacity: 1;
  visibility: visible;}

.wahl-badge:hover {
  transform: scale(1.1);
  background-color: #007bb5;
  text-decoration: none;
  color: white;
}
.badge-hidden {
  opacity: 0;           /* Unsichtbar */
  visibility: hidden;   /* Nicht klickbar */
  pointer-events: none; /* Maus ignoriert es */
}
.badge-top {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
}


.badge-date {
  font-size: 13px;
  font-weight: bold;
  display: block;
  border-top: 1px solid rgba(255,255,255,0.5);
  padding-top: 2px;
  margin-top: 2px;
  width: 80%;
}

@media (max-width: 768px) {
  .wahl-badge {
    width: 90px;
    height: 90px;
    bottom: 15px;
    right: 15px;
  }
  .badge-top { font-size: 8px; }
  .badge-mid { font-size: 14px; }
  .badge-date { font-size: 11px; }
}

/* --- MENÜ DESIGN (Desktop) --- */
@media only screen and (min-width: 1000px) {
  #sidebar ul li a {
    font-size: 22px !important;       /* Upgrade auf 22px für maximale Lesbarkeit */
    font-weight: 700 !important;      /* Noch etwas fetter (700 statt 600) */
    color: #1a1a1a !important;        /* NEU: Viel dunklerer Kontrast zum Beige */
    padding-top: 15px !important;
    padding-bottom: 15px !important;
    letter-spacing: 0.5px;
  }

  /* Hover-Effekt (Maus drüber) */
  #sidebar ul li a:hover {
    color: #cc0000 !important;        /* Die ZAG-Signalfarbe bleibt */
    background-color: #e5e2db;        /* Hintergrund beim Hover etwas dunkler als das Beige */
    border-right: 5px solid #cc0000;
    text-decoration: none;
    padding-left: 30px !important;
    transition: all 0.3s ease;
  }
}

/* Den allerletzten Beitrag (egal wie er heißt) groß machen */
.badge-hidden {
  opacity: 0 !important;        /* !important erzwingt das Ausblenden */
  visibility: hidden !important;
  pointer-events: none;
  transition: all 0.5s ease;    /* Macht den Übergang weich */
}


/* --- ÜBERSCHRIFTEN DESIGN (Update) --- */

.post-title, 
.section-title {
    display: inline-block;
    padding: 12px 30px;           /* Etwas mehr Polsterung wirkt edler */
    
    /* HIER IST DIE ÄNDERUNG: */
    border-radius: var(--zag-radius); 
    
    box-shadow: 0 5px 15px rgba(0,0,0,0.08); /* Schatten etwas weicher gemacht */
    color: #333;
    border-bottom: 3px solid #6c9a33; /* #009fe3;*/
    margin-bottom: 40px;
}

@media (max-width: 768px) {
    .post-title, .section-title {
        display: block;
        text-align: center;
        /* Auf Handy etwas weniger rund, spart Platz */
        border-radius: calc(var(--zag-radius) / 1.5); 
    }
}


/* --- VARIANTE: WEICHER SCHATTEN --- */
@media only screen and (min-width: 800px) {
  #sidebar {
    border-right: none !important; /* Keine harte Linie */
    
    /* Ein Schatten, der nach rechts wirft */
    box-shadow: 5px 0 15px -5px rgba(0,0,0,0.15); 
    
    z-index: 1000;
  }
}
/* --- GALERIE (Funktionierend & Enger) --- */

.gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;             
    
    /* Das hier ist dein "unsichtbarer Platz":
       Es schiebt den freien Raum gleichmäßig nach links und rechts */
    justify-content: center; 
    
    margin-bottom: 40px;
}

.gallery .box {
    /* 0 = NICHT wachsen (verhindert riesige Bilder in der letzten Zeile)
       1 = Schrumpfen erlaubt (wichtig für kleine Handys)
       220px = Die feste Wunschbreite (genauso breit wie die oberen Zeilen)
    */
    flex: 0 1 220px;       
    
    margin: 0;
    background: transparent;
}

.gallery figure {
    background-color: transparent;
    padding: 0;
    box-shadow: none;
    border: none;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

/* WICHTIG: Der Link muss sich verhalten wie ein Block, sonst ist er 0px hoch */
.gallery figure a {
    display: block;
    width: 100%;
    text-decoration: none; /* Kein Unterstrich */
}

/* Das Bild selbst */
.gallery .img {
    position: relative;
    height: 240px;
    width: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center bottom;
    border-radius: var(--zag-radius, 15px);
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.15));
    transition: transform 0.3s ease;
}


/* --- Icon: Unten Links & Kompakt --- */
.gallery .img::after {
    content: '⤢'; 
    
    /* POSITIONIERUNG: Unten Links */
    position: absolute;
    bottom: 10px;
    left: 10px;
    
    /* Alte Positionierung sicherheitshalber resetten */
    top: auto;
    right: auto;
    
    /* Start-Status: Kleiner zoomen */
    transform: scale(0.5); 

    /* GRÖSSE: Kompakt (36px) und Pfeil füllt es aus */
    width: 36px;                 
    height: 36px;
    
    /* Damit der Pfeil vertikal mittig sitzt, muss line-height = height sein */
    line-height: 34px; /* Ein Tick weniger als 36px hilft oft optisch bei Symbolen */
    
    /* Pfeil größer machen, damit er den Kreis füllt */
    font-size: 1.4rem;           
    text-align: center;
    
    /* ZAG Grün */
    background-color: rgba(108, 154, 51, 0.9); 
    color: #ffffff;              
    
    border-radius: 50%;
    /* Dezentere Schatten für unten links */
    box-shadow: 0 2px 5px rgba(0,0,0, 0.2);

    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none; 
}

/* --- Hover-Effekte --- */

.gallery figure:hover .img {
    transform: scale(1.02);
}

/* Icon erscheint */
.gallery figure:hover .img::after {
    opacity: 1;
    transform: scale(1); 
}
/* --- Hover-Effekte --- */

/* Wenn man über die Box fährt, wächst das Bild leicht */
.gallery figure:hover .img {
    transform: scale(1.02);
}

/* ...und das Icon erscheint (Ohne Verschiebung, nur Zoom) */
.gallery figure:hover .img::after {
    opacity: 1;
    transform: scale(1); /* Auf Originalgröße (40px) zoomen */
}

/* Hover-Effekte */
.gallery figure:hover .img {
    transform: scale(1.02);
}

.gallery figure:hover .img::after {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Das unsichtbare Original-Img für Photoswipe */
.gallery .img img {
    opacity: 0;
    width: 100%;
    height: 100%;
}

/* Bildunterschrift */
.gallery figcaption {
    margin-top: 15px;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 800;
    color: #333;
    line-height: 1.1;
}

/* --- SILBENTRENNUNG AUSSCHALTEN --- */
html, body, p, h1, h2, h3, h4, h5, h6, li, a, div, span {
    -webkit-hyphens: manual !important;
    -ms-hyphens: manual !important;
    hyphens: manual !important;
}
