/* ===========================
   Layout für galerie.php
   =========================== */

html{ scrollbar-gutter: stable; }   /* kein Sprung, aber Gutter nur rechts */

   main.container.galerie {
    max-width: 1040px;
    margin: 0 auto;
    padding-left: 1.1rem;
    padding-right: 1.1rem;
  }
  
  .galerie-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-top: 2rem;
    margin-bottom: 1rem;
  }
  
  .galerie-header h1 {
    font-size: 2rem;
    margin: 0;
  }
  
  .galerie-aktionen {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.3rem;
  }
  
  .galerie-info {
    font-size: 0.95rem;
    margin: 0;
    color: #aaa;
  }
  
  .galerie-dropdown {
    padding: 0.4rem 0.8rem;
    font-size: 0.95rem;
    border-radius: 6px;
    border: 1px solid #ccc;
    background-color: #fff;
    color: #000;
  }

  .galerie-kopfzeile {
    margin-top: 2rem;
    margin-bottom: 2rem;
  }
  
  .galerie-kopfzeile h1 {
    font-size: 2rem;
    margin-bottom: 0.3rem;
  }
  
  .titelblock-mit-dropdown {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 1rem;
  }
  
  .titelblock-mit-dropdown .unterzeile {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 400;
    color: #ccc;
    flex: 1;
  }
  
  .dropdownblock {
    flex-shrink: 0;
  }

  .galerie-kopfzeile {
    margin-top: 2rem;
    margin-bottom: 2rem;
  }
  
  .galerie-kopfzeile h1 {
    font-size: 2rem;
    margin-bottom: 0.3rem;
  }
  
  main.galerie .titelblock-mit-dropdown {
    display: flex !important;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.5rem;
  }
  
  .titelblock-mit-dropdown .unterzeile {
    margin: 0;
    font-size: 1.25rem;
    color: #ccc;
    flex: 1;
  }
  
  .dropdownblock {
    flex-shrink: 0;
  }

  .dropdownblock select {
    background-color: #333;
    color: #fff;
    border: 1px solid #666;
    border-radius: 6px;
    padding: 0.4rem 0.8rem;
    font-size: 0.95rem;
  }

  .grid img {
  width: 100%;
  aspect-ratio: 1 / 1;           /* Erzwingt quadratisches Verhältnis */
  object-fit: cover;             /* Bild wird zugeschnitten statt verzerrt */
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

/* Mouse-Over-Effekt für den Button 'mehr anzeigen' */
.galerie-mehr-button {
  color: #f9f2e8;; /* chamois-farbene Schrift */
  text-decoration: none; /* entfernt Unterstreichung bei <a> */
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

.galerie-mehr-button:hover {
  background-color: #3f5779;    /* farbiger Balken bei Hover */
  color: #f9f2e8;; /* chamois-farbene Schrift */
  cursor: pointer;
} 

.galerie-button-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  max-width: 1040px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 0;
  padding-right: 0.2rem;
}

.galerie-nach-oben {
  text-decoration: none;
}

/* Abstand unter dem Grid */
.grid {
  margin-bottom: 1rem;
}

.galerie-hinweis {
  background-color: #94bdf4;    /* identisch oder sehr nah an index.php */
  color: #111;
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin: 3rem auto 2rem auto;
  max-width: 1040px;
  font-size: 1.5rem;               /* wie auf index.php */
  font-family: 'Quicksand', sans-serif;
  line-height: 1.6;                /* angenehme Lesbarkeit */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.galerie-hinweis h3 {
  margin-top: 0;
  margin-bottom: 0.8rem;
  font-size: 1.2rem;
  font-weight: 600;
}

main.container.galerie h1 {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.3;
}

/* ===================================================
   Statistik unter dem Grid – dunkel, mit feiner Linie
   ================================================ */

.views-summary {
  text-align: center;
  margin: 1.9rem auto 0 auto;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.70);          /* dezentes Grau für Fließtext */
  font-family: 'Quicksand', sans-serif;
  line-height: 1.6;
  max-width: 1040px;
  letter-spacing: 0.01em;
}

.views-summary::before {
  content: "";
  display: block;
  width: 46%;                       /* zentrierte Trennlinie */
  height: 1.5px;                     /* etwas kräftigerer Strich */
  background-color: rgba(255, 255, 255, 0.14);
  margin: 0 auto 0.7rem auto;        /* kleine Distanz zum Text */
  border-radius: 1px;
}

.views-summary b {
  color: #f4f0e6;                    /* leicht warmes Weiß – harmoniert mit deinem chamois */
  font-weight: 600;
}

/* ===== Button „zeitlicher Verlauf“: optisch wie Text in der Summary ===== */
.cc-zeit-btn{
  appearance: none;
  background: rgba(255,255,255,0.08);        /* etwas hellerer Untergrund */
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 10px;
  color: inherit;                             /* Textfarbe wie Summary */
  font: inherit;                              /* gleiche Schrift */
  line-height: 1.25;
  padding: .08rem .75rem;                     /* kompakt, aber fühlbar */
  display: inline-flex;
  position: relative;                         /* für Tooltip-Positionierung */
  align-items: center;
  gap: .55rem;
  cursor: pointer;
  opacity: .98;
  margin-top: .25rem;
  }

/* Schöner Tooltip „in Entwicklung“ – erscheint bei Hover/Focus */
.cc-zeit-btn::after{
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);          /* oberhalb des Buttons */
  transform: translateX(-50%) translateY(4px);
  background: rgba(243, 201, 72, 0.96); /* warmes Amber, passt zum Chamois */
  color: #2a2a2a;
  font-weight: 600;
  font-size: 0.92em;
  letter-spacing: .01em;
  padding: .35rem .55rem;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.25);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 10;
}
.cc-zeit-btn[data-tip]::before{
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  border: 6px solid transparent;      /* Pfeilspitze */
  border-top-color: rgba(243, 201, 72, 0.96);
  opacity: 0;
  transition: opacity .18s ease;
  z-index: 10;
}
.cc-zeit-btn[data-tip]:hover::after,
.cc-zeit-btn[data-tip]:focus-visible::after{
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.cc-zeit-btn[data-tip]:hover::before,
.cc-zeit-btn[data-tip]:focus-visible::before{
  opacity: 1;
}

.cc-zeit-btn:hover{
  background: rgba(255,255,255,0.14);         /* etwas heller beim Hover */
  text-decoration: none;                      /* kein Unterstreichen nötig */
}
.cc-zeit-btn:focus-visible{
  outline: 2px solid rgba(255,255,255,.35);
  outline-offset: 2px;
}
.cc-zeit-icon{
  width: 18px; height: 18px;
  transform: translateY(-1px);                /* optische Ausrichtung */
  stroke: #e74c3c;                            /* rote Verlaufskurve */
  stroke-width: 2;
}

/* ===== Dezent umrahmter Kasten für die eingeblendete Statistik ===== */
.cc-zeit-embed{
  max-width: 1040px;                 /* gleiche Breite wie .views-summary */
  margin: .4rem auto 0 auto;         /* zentriert, kleiner Abstand darunter */
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: .5rem;
}
.cc-zeit-embed iframe{
  display: block;
  width: 100%;
  height: 340px;
  border: 0;
  border-radius: 8px;
}

/* ====== Statistik-Overlay ====== */
#cc-stats-backdrop[hidden], #cc-stats-modal[hidden]{ display:none }

#cc-stats-backdrop{
  position:fixed; inset:0;
  background:rgba(0,0,0,.55);           /* Grid abdunkeln */
  z-index:1000;
}

#cc-stats-modal{
  position:fixed;
  top:6vh; bottom:6vh;                    /* oben & unten Luft */
  left:50%;                               /* mittig am Viewport ausrichten */
  transform:translateX(-50%);             /* perfekte Zentrierung */
  z-index:1001;
  display:flex; justify-content:center; align-items:flex-start;
  pointer-events:none;                    /* nur Inhalt klickbar */
}

#cc-stats-modal .cc-stats-modal__scroll{
  width:min(970px, calc(100vw - 2rem));   /* Breite inkl. Padding sicher im Viewport */
  max-height:calc(100vh - 8vh);           /* Höhe so angepasst, dass kein Scrollbar erscheint */
  margin:0 auto;
  background:#121212;
  color:#f4f0e6;
  border:1px solid rgba(255,255,255,.08);
  border-radius:12px;
  box-shadow:0 20px 60px rgba(0,0,0,.45);
  overflow:auto;
  pointer-events:auto;
  padding:1.2rem 1rem 1.8rem;
  box-sizing:border-box;                  /* Padding in Gesamtbreite einrechnen */
}

/* Footer im Galerie-Kontext stets über Abdunklung halten */
body.galerie footer{ position:relative; z-index:1002; }

/* Styles, leicht gekapselt */
.cc-stats-modal .head{ margin:.2rem 0 .6rem; text-align:center }          
.cc-stats-modal .head h1{ margin:0 0 .15rem; font-size:1.4rem; font-weight:700 } 
.cc-stats-modal .head .sub{ margin:.05rem 0 0; font-size:.95rem; color:rgba(255,255,255,.6) }

/* Desktop: Versions-Badge neben dem Titel ausblenden */
.cc-stats-modal .head h1::after{ content:none !important; }
.cc-stats-modal .head h1 .version,
.cc-stats-modal .head h1 .ver,
.cc-stats-modal .head h1 small{ display:none !important; }
.cc-stats-modal .panel{
  background:#1c1c1c;
  border:1px solid rgba(255,255,255,.08);
  border-radius:10px;
  padding:.9rem;             
  margin:.8rem 0 1rem;      
}

.cc-stats-modal .panel.warn{
  border-color:rgba(255,180,0,.25);
  background:linear-gradient(180deg,#1c1c1c 0%,#181818 100%);
}

.cc-stats-modal .kpi{ display:grid; grid-template-columns:repeat(3,1fr); gap:.7rem } /* ↓ */
.cc-stats-modal .kpi-item{
  background:linear-gradient(180deg,#1d1d1d 0%,#171717 100%);
  border:1px solid rgba(255,255,255,.08);
  border-radius:10px;
  padding:.7rem .8rem;       
  text-align:center;
}

.cc-stats-modal .kpi-label{
  color:rgba(255,255,255,.6);
  font-size:.85rem;          
  margin-bottom:.2rem;       
}

.cc-stats-modal .kpi-value{
  font-size:1.45rem;         
  font-weight:700;
  color:#f9f2e8;
}

.cc-stats-modal .chart{
  display:flex; align-items:flex-end; gap:.8rem;
  height:312px; /* +30% */
  padding:.7rem 1rem 1rem;          /* ↓ etwas weniger Innenabstand */
  border:1px dashed rgba(255,255,255,.08);
  border-radius:10px;
  overflow-x:auto;
  box-sizing:border-box;            /* verhindert, dass das Padding nach rechts übersteht */
  width:100%;                       /* Chart immer maximal so breit wie der Inhalt */
  max-width:100%;
}

.cc-stats-modal .bar{
  --bar-label-space: 1.4rem;        /* Platz für X-Achsen-Label */
  flex:0 0 60px;                    /* Balkenbreite, muss bis auf Weiteres monatlich reduziert werden */
  position:relative;
  text-align:center;
  height:100%;
  display:flex;
  align-items:flex-end;
  padding-bottom: var(--bar-label-space);
  overflow: visible;
}
.cc-stats-modal .bar .bar-area{
  position:absolute; left:0; right:0; top:0;
  bottom: var(--bar-label-space);   /* clippt exakt bis zur X-Achse */
  overflow:hidden;
}
.cc-stats-modal .bar-inner{
  width:100%;
  min-height:4px;
  /* wichtig: volle Plot-Höhe erlauben */
  max-height:100%;
  background:linear-gradient(180deg,#94bdf4 0%,#3f5779 100%);
  border-radius:6px 6px 0 0;
  transition:height .4s ease;
  /* wichtig: Balkenfuß an die Achse setzen */
  position:absolute;
  left:0; right:0; bottom:0;
}

.cc-stats-modal .bar-value{ position:absolute; top:-1.2rem; left:50%; transform:translateX(-50%); font-size:.75rem; color:rgba(255,255,255,.75) }
.cc-stats-modal .bar-label{ position:absolute; bottom:0; left:50%; transform:translateX(-50%); font-size:.85rem; color:rgba(255,255,255,.6); white-space:nowrap }
.cc-stats-modal .chart-legend{ margin-top:.6rem; color:rgba(255,255,255,.75) }

/* Desktop: X-Achse – Labels kommen vollständig (YYYY-MM) aus dem Markup */
.cc-stats-modal .chart-year{ display:none; }             /* Jahr-Zeile ausblenden */
/* Kein Präfix mehr, verhindert „2025-2025-10“ */
.cc-stats-modal .bar-label::before{ content:none; }

.cc-stats-modal .foot{ margin-top:1.0rem; text-align:center }
.cc-stats-modal .btn{ display:inline-block; padding:.6rem .9rem; background:#2a2a2a; color:#f4f0e6; border:1px solid rgba(255,255,255,.08); border-radius:8px; text-decoration:none }
.cc-stats-modal .btn:hover{ background:#333 }

/* Responsiv */
@media (max-width:900px){
  .cc-stats-modal .kpi{ grid-template-columns:1fr }
  .cc-stats-modal .bar{ flex-basis:70px }
  .cc-stats-modal .bar-label{
    font-size:.78rem;
    left: 0;                 /* volle Breite nutzen */
    right: 0;
    transform: none;         /* Desktop-Translate überstimmen */
    text-align: center;      /* Text sauber zentrieren */
    white-space: nowrap;
  }
}

/* Desktop: weniger Luft über der Überschrift im Stats-Overlay */
@media (min-width: 768px){
  #cc-stats-modal .cc-stats-modal__scroll{ padding-top: 0; }
  .cc-stats-modal .head{ margin-top: 0; }                       
}

/* ===================================
   Optimierung für Smartphones
   =================================== */

@media (max-width: 767px) {
  main.container.galerie {
    max-width: 100% !important;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }

    main.container.galerie h1 {
    font-size: 1.7rem;
    font-weight: 600;   
    margin-top: -1.5rem;
    margin-bottom: 0.6rem;
    line-height: 1.2;
  }

  .galerie-kopfzeile .titelblock-mit-dropdown {
    width: 100%;
  }

  .galerie-kopfzeile .dropdownblock {
    width: 100%;
  }

  .galerie-kopfzeile .galerie-dropdown {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    font-size: 0.8rem !important; /* ← NEU: Schrift verkleinern */
  }

  body.galerie main.container.galerie {
    padding-top: 0.8rem !important;
  }

  .galerie .grid {
    gap: 0.3rem !important;
  }

  .galerie-hinweis h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
  }

  .galerie-hinweis {
    font-size: 0.8rem;
    line-height: 1.4;
    padding: 0.8rem 1rem;
    margin-top: 1.2rem;
    margin-bottom: 1.2rem;
  }

  .galerie-mehr-button {
    font-size: 0.85rem; /* oder z.B. 0.8rem – je nach gewünschter Wirkung */
  }
}

/* ===========================
   Benutzerdefiniertes Dropdown-Menü
   =========================== */
   .dropdown-wrapper {
  position: relative;
  max-width: 100%;
  font-family: 'Quicksand', sans-serif;
  font-size: 0.9rem;
}

.dropdown-trigger {
  background-color: #333;
  color: #fff;
  padding: 0.6rem 0.9rem;
  border-radius: 6px;
  border: 1px solid #666;
  cursor: pointer;
}

.dropdown-options {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: #444;
  color: #fff;
  border: 1px solid #666;
  border-radius: 6px;
  margin: 0.3rem 0 0;
  padding: 0;
  list-style: none;
  max-height: 50vh;
  overflow-y: auto;
  z-index: 1000;
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); /* Platz für die URL-Leiste */
}

/* Unsichtbarer Scroll-Puffer am Listenende (kein HTML nötig) */
.dropdown-options::after{
  content: "";
  display: block;
  height: 2.2rem;   /* Desktop-Puffer */
}

.dropdown-options.open {
  display: block;
}

.dropdown-options li {
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid #555;
  cursor: pointer;
  white-space: normal;
  word-break: break-word;
}

.dropdown-options li:last-child {
  border-bottom: none;
}

/* Scroll-Puffer am Listenende, verbessert Scrollbarkeit auf Mobil */
.dropdown-options .scroll-spacer{
  height: 2.2rem;        /* dezenter Puffer am Desktop */
  border-bottom: none;
  pointer-events: none;  /* sicher unklickbar */
}

.dropdown-options li:hover {
  background-color: #555;
}

/* ===========================
   Zusatz: NEU-Badge für neue Bilder
   =========================== */

.bildkachel {
  position: relative;      /* ← nötig, damit NEU-Badge und View-Zähler relativ dazu positioniert werden */
  width: 100%;             /* ← passt sich dem Grid-Raster an */
  aspect-ratio: 1 / 1;     /* ← optional: sorgt für quadratische Kachel, auch ohne Bildinhalt */
  overflow: hidden;        /* ← schützt vor überstehenden Elementen */
}

.neu-badge {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;                          /* ← links oben positioniert */
  background-color: rgb(255, 0, 0);    /* ← kräftiges Rot für hohe Sichtbarkeit */
  color: white;
  font-weight: bold;
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 0.3rem;
  z-index: 10;                           /* ← liegt über dem Bild */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  pointer-events: none;                  /* ← verhindert Klicks auf das Badge */
  width: auto;                           /* ← Breite richtet sich nach Inhalt */
  max-width: 90%;                        /* ← schützt vor zu langen Inhalten */
  white-space: nowrap;                   /* ← keine Zeilenumbrüche im Badge */
}

/* ===========================
   Zusatz: View-Counter für Bilder
   =========================== */

.view-overlay {
  position: absolute;
  bottom: 0.4rem;
  right: 0.4rem;                         /* ← unten rechts positioniert */
  display: inline-flex;                  /* ← Icon + Zahl nebeneinander */
  align-items: center;
  gap: 0.3rem;
  background: rgba(0, 0, 0, 0.5);      /* ← halbtransparentes Schwarz */
  color: #fff;                         /* ← weiße Schrift für Kontrast */
  font-size: 0.75rem;                    /* ← dezent, aber lesbar */
  padding: 0.2rem 0.5rem;
  border-radius: 0.3rem;
  pointer-events: none;                  /* ← verhindert versehentliche Klicks */
}

/* Optional: Auge als Pseudo-Element vor der Zahl */
.view-overlay::before {
  content: "👁";                         /* ← Emoji als Symbol */
  font-size: 0.85rem;
}

/* ===========================
   Badges auf dem Smartphone klein darstellen
   =========================== */

@media (max-width: 767px) {
  .view-overlay {
    font-family: 'Inter', sans-serif;   /* nur auf dem Smartphone */
    font-size: 0.4rem;
    padding: 0.1rem 0.3rem;
    bottom: 0.2rem;                     /* näher an die Ecke */
    right: 0.2rem;
  }

  .view-overlay::before {
    font-size: 0.4rem;
  }

  .neu-badge {
    font-size: 0.4rem;           
    padding: 0.1rem 0.3rem;     /* etwas kompakter */
    border-radius: 0.25rem;      /* runder, kleiner */
    top: 0.2rem;                      /* näher an die Ecke */
    left: 0.2rem;
  }
}

/* Debugging leere Monatsthemen-Galerie */
  main.container.galerie {
    width: 100%;
    max-width: 1040px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.1rem;
    padding-right: 1.1rem;
    box-sizing: border-box;
  }

/* Mobile Darstellung Statistik */
  @media (max-width: 767px) {
  .views-summary {
    font-size: 0.85rem;
    margin: 1.4rem auto 0.5rem auto; /* etwas kompakter, damit der Button näher rückt */
  }
  .views-summary::before {
    width: 55%;
    margin-bottom: 0.5rem;
  }
}

/* ===== Smartphone-Optimierung Statistik (Lightbox-Views) ===== */
 /* 1) Überschrift "Lightbox-Views" zentrieren (failsafe) */
 .cc-stats-modal .head h1{
   text-align:center;
 }

 /* 2) KPIs am Smartphone ausblenden */
 @media (max-width: 767px){
   /* Versteckt nur das KPI-Grid */
   .cc-stats-modal .kpi{ display:none !important; }
   /* Falls die KPIs in einem eigenen Panel liegen: Panel ebenfalls ausblenden (moderne Browser) */
   .cc-stats-modal .panel:has(.kpi){ display:none !important; }
 }

 /* 3) Grafik so schmal, dass sie ohne Horizontalscrollen aufs Display passt (Höhe bleibt) */
 @media (max-width: 767px){
  .cc-stats-modal .chart{
    gap:.4rem;                 /* engeres Spacing zwischen Balken */
    padding:.5rem .5rem .9rem; /* weniger seitliches Padding */
    overflow-x:hidden;         /* kein horizontales Scrollen */
    height: 240px;              /* Höhe unverändert wie definiert */
  }
  .cc-stats-modal .bar{
    flex-basis:36px;
    --bar-label-space: 1.1rem;   /* mobiler Abstand zur X-Achse */
    border-radius: 3px 3px 0 0;
  }
  .cc-stats-modal .bar .bar-area{ border-radius: 3px 3px 0 0; } /* gleiche Rundung */
  .cc-stats-modal .bar-inner,
  .cc-stats-modal .cc-prog-cap { border-radius: 3px 3px 0 0 !important; } /* HR weniger rund */
  .cc-stats-modal .bar-label{
    font-size:.72rem;          /* kompaktere Achsenbeschriftung */
    white-space:nowrap;
  }
  .cc-stats-modal .bar-value{
    font-size:.68rem;          /* kleinere Werte über den Balken */
    top:-1.0rem;
  }
}

/* ===== Smartphone-Optimierung: Kopf & X-Achse ===== */

/* Mehr Raum oberhalb der Überschrift */
.cc-stats-modal .head{ margin-top: 1.0rem; }              /* Desktop & Mobil */
@media (max-width:767px){ .cc-stats-modal .head{ margin-top: 1.1rem; } }

/* ===== Zweizeilige X-Achse (Monate über Jahr) ===== */
@media (max-width:767px){
  .cc-stats-modal .chart{
    position:relative;
    padding-bottom: 2.2rem;   /* Platz für die Jahreszeile */
  }

  .cc-stats-modal .bar{
    --bar-label-space: 1.4rem;      /* Platz für Monatslabel */
    flex:0 0 36px; position:relative; text-align:center; height:100%;
    display:flex; align-items:flex-end; padding-bottom: var(--bar-label-space);
    overflow: visible;               /* Label & Prognose-Text dürfen rausstehen */
  }

  .cc-stats-modal .bar .bar-area{
    position:absolute; left:0; right:0; top:0;
    bottom: var(--bar-label-space);  /* clippt exakt bis zur Achse */
    overflow:hidden;                 /* nur der Balkenbereich wird geclippt */
  }
  /* Balkenfuß fest auf die Achse setzen */
  .cc-stats-modal .bar .bar-inner{
    position: absolute;
    left: 0; right: 0;
    bottom: 0;                 /* ⬅️ immer unten andocken */
    max-height: 100%;          /* keine zusätzliche Deckelung */
  }
  .cc-stats-modal .bar-label{
    font-size:.78rem;
    transform:none;           /* keine Schrägstellung mehr */
    white-space:nowrap;
  }
  /* zentrierte Jahreszeile unter der Achse */
  .cc-stats-modal .chart-year{
    display:block !important;     /* ← wichtig: überschreibt das globale display:none; */
    position:absolute;
    left:50%;
    bottom:.35rem;
    transform:translateX(-50%);
    font-size:.82rem;
    color:rgba(255,255,255,.75);
    pointer-events:none;
  }
}

/* Smartphone: Balkenauswahl nicht mehr per CSS, sondern nach dem Laden der Statistik */
@media (max-width: 767px){
  .cc-stats-modal .chart .bar{
    display:flex !important;
  }
}

/* Smartphone: Label-Text "Prognose" -> "HR" */
@media (max-width: 767px){
  .cc-stats-modal .cc-prog-label{
    font-size: 0 !important;           /* Originaltext unsichtbar machen */
  }
  .cc-stats-modal .cc-prog-label::after{
    content: "HR";                      /* Ersatztext */
    font-size: .70rem;                  /* gewünschte Größe */
    color: inherit;                     /* gleiche Farbe wie sonst */
    transform: translateY(-25px); /* Abstand feinjustieren: -4px … -10px */
  }
}

/* Modal über Footer legen */
body.galerie #cc-stats-backdrop { z-index: 3000 !important; }
body.galerie #cc-stats-modal    { z-index: 3001 !important; }

/* Nur sehr kleine Smartphones: Bars etwas schmaler, damit alle Monate reinpassen */
@media (max-width: 480px) {
  .cc-stats-modal .chart { gap: .5rem; }
  .cc-stats-modal .chart .bar { flex: 0 0 26px; } 
  .cc-stats-modal .chart .bar-label { font-size: .82rem; }
}

/* Smartphone: HR-Label mit Abstand zum Balken */
@media (max-width: 767px){
  .cc-stats-modal .cc-prog-label{
    /* etwas höher rücken */
    transform: translateY(-5px) !important;
  }
  /* Failsafe: falls nur das ::before sichtbar ist */
  .cc-stats-modal .cc-prog-label::before{
    display: inline-block;
    transform: translateY(-8px) translateX(2px);
  }
}

/* Mobile Kurzlabels unter dem Galerie-Grid */
.galerie-button-container .gb-label-mobile {
  display: none;
}

@media (max-width: 767px) {
  .galerie-button-container {
    gap: 0.8rem;
  }

  .galerie-button-container .galerie-mehr-button {
    white-space: nowrap;
  }

  .galerie-button-container .gb-label-desktop {
    display: none;
  }

  .galerie-button-container .gb-label-mobile {
    display: inline;
  }
}

/* Mobile Kurzlabel für View-Summary */
.views-summary .vs-label-mobile {
  display: none;
}

@media (max-width: 767px) {
  .views-summary .views-line {
    white-space: nowrap;
  }

  .views-summary .vs-label-desktop {
    display: none;
  }

  .views-summary .vs-label-mobile {
    display: inline;
  }
}

/* ============================
   Monatsthemen – Kopf/Nav-Leiste
   ============================ */

/* Wrapper mit Pfeil + Scroll-Schiene */
.mt-leiste {
  display: block;          /* Button fällt weg – simple Block-Leiste */
  margin-top: .5rem;
  line-height: 1.35;
  overflow: hidden;        /* nichts außerhalb zeigen */
  margin-bottom: -8px;     /* Scrollbar-Höhe kompensieren → kein Grid-Sprung */
}

/* Horizontale, einzeilige Link-Schiene */
.mt-auswahl {
  flex: 1 1 auto;          /* darf schrumpfen */
  min-width: 0;            /* wichtig für Flex-Shrink */
  white-space: nowrap;     /* einzeilig */
  overflow-x: auto;        /* horizontal scrollen bei Bedarf */
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;   /* Basis */
  scrollbar-color: rgba(255,255,255,.282) var(--margin-bg, #2a2a2a); /* Basis */
  padding-bottom: 7px;     /* 6px Scrollbar + 1px Luft */
  padding-right: .5rem;    /* etwas Luft rechts */
  box-sizing: border-box;
  position: relative;      /* Basis für Pseudo-Element (nur FF) */
  scrollbar-gutter: stable;   /* Platz für den „Track“-Hinweis reservieren */

  /* Typografie wie Body, kompakt */
  font-family: inherit;
  font-size: 1.2rem;       /* Desktop-Größe (deine Wahl) */
  line-height: 1.35;

  /* dezente Box unter den Links – in allen Browsern sichtbar */
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 10px;
  padding-top: 3px;        /* oben minimal Polster */
}

/* Firefox: dauerhafte, dezente Track-Linie (sichtbar im Ruhezustand) */
@-moz-document url-prefix() {
  .mt-auswahl::after{
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 6px;                               /* wie Scrollbar-Höhe */
    background: var(--margin-bg, #2a2a2a);     /* wie Ränder */
    border-radius: 8px;
    opacity: .65;                               /* klar sichtbar, aber dezent */
    pointer-events: none;
  }
  .mt-auswahl:hover::after{ opacity: .80; }
}

/* Firefox spezifisch: dicker + kontrastreicher */
@supports (scrollbar-color: auto){
  .mt-auswahl{
    scrollbar-width: auto; /* statt thin → sichtbar dicker */
    /* Chamois als Daumen, dunkler Track für Kontrast */
    scrollbar-color: rgba(220,220,220,.38) #242424;  /* weniger „grell“ */
  }
}

/* WebKit: dezente, niedrige Scrollbar */
.mt-auswahl::-webkit-scrollbar { height: 6px; }
.mt-auswahl::-webkit-scrollbar-track {
  background: var(--margin-bg, #343434);
}
.mt-auswahl::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.18);
  border-radius: 8px;
}
.mt-auswahl::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,.26);
}

/* Links: Farbe Chamois, ohne Unterstrich (Standard) */
.mt-auswahl a {
  display: inline;                     /* Linie endet exakt am Text */
  margin-right: .75rem;
  color: var(--chamois, #f7f2e8);
  text-decoration: none !important;
  font: inherit;
  font-weight: 400;
  letter-spacing: inherit;
  text-transform: none;
}
.mt-auswahl a:last-child { margin-right: 0; }

/* Unterstrich exakt nur unter dem Text */
.mt-linktext {
  display: inline-block;                 /* saubere Border unter nur dem Text */
  border-bottom: 0 solid currentColor;   /* initial ohne Linie */
  padding-bottom: 2px;                   /* Abstand wie im Header */
}
.mt-auswahl a:hover .mt-linktext,
.mt-auswahl a:focus-visible .mt-linktext {
  border-bottom-width: 1px;              /* Linie einblenden */
  border-bottom-color: currentColor;     /* explizit setzen, falls global überschrieben */
}
/* Sicherheit: native Unterstreichung aus */
.mt-auswahl a:hover,
.mt-auswahl a:focus-visible {
  text-decoration: none !important;
}

/* Aktiver Link leicht betonen (ohne Unterstrich) */
.mt-auswahl a.active { opacity: .95; }

/* Globale Komma-/Separator-Pseudoelemente hier unterdrücken */
.galerie .titelblock-mit-dropdown .mt-auswahl a::after,
.galerie .titelblock-mit-dropdown .mt-auswahl a::before,
.galerie .titelblock-mit-dropdown .mt-auswahl a + a::before {
  content: "" !important;
  display: inline-block !important;
  width: 0 !important;
  margin: 0 !important;
}

/* Smartphone: etwas kleiner */
@media (max-width: 600px) {
  .mt-auswahl { font-size: .9rem; }
  .mt-prev { font-size: .85rem; }
}

/* Aktives Monatsthema visuell markieren */
.mt-auswahl a.active {
  background: #8c8982;   /* gleiche Aktiv-Farbe wie Menü */
  color: #282828;
  font-weight: 600;
  border-radius: 4px;     /* nur ganz wenig abgerundet */
  cursor: default;
  pointer-events: none;
}
/* Der frühere Inline-Layoutanker aus galerie.php. */
.galerie-layout-anker { width:100%; max-width:1040px; height:1px; background-color:#282828; margin:2rem auto; box-sizing:border-box; }
