/* === Sektionen === */
.kanaldeckel-section {
  margin-bottom: 2rem;
}

/* === Bezirks-Grid: genaue Spalten pro Breakpoint === */
.kanaldeckel-grid {
  display: grid;
  gap: 1rem;
  justify-items: center;
}

/* 5 Spalten (Desktop) */
@media (min-width: 1201px) {
  .kanaldeckel-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* 4 Spalten */
@media (max-width: 1200px) and (min-width: 1025px) {
  .kanaldeckel-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* 3 Spalten */
@media (max-width: 1024px) and (min-width: 881px) {
  .kanaldeckel-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* 2 Spalten */
@media (max-width: 880px) and (min-width: 768px) {
  .kanaldeckel-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 2 Spalten (Mobil) */
@media (max-width: 767px) {
  .kanaldeckel-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* === Bezirks-Kacheln === */
.kanaldeckel-box {
  aspect-ratio: 1 / 1;
  width: 100%;
  background: #f5f5f5;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Kachel-Inhalt */
.kanaldeckel-box-inner {
  text-align: center;
  padding: 1rem;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  overflow: hidden;
}

/* Bezirksname */
.bezirk-name {
  font-weight: 700 !important;
  font-size: 1.4rem !important;
  text-decoration: none;
  color: inherit;
  word-break: break-word;
  line-height: 2.2rem;
  margin-bottom: 0.2em;
  display: block;
  text-align: center;
}

/* Stückzahl */
.bezirk-anzahl {
  font-size: 1rem;
  color: #333;
  line-height: 1.2rem;
  text-align: center;
  display: block;
}

/* Wappen-Kachel */
.wappen-kachel {
  background-image: url('/wp-content/uploads/wien-wappen.png'); /* Pfad ggf. anpassen */
  background-repeat: no-repeat;
  background-position: center center;
  background-size: 60%;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
}

/* === Balkenstatistiken === */
.kanaldeckel-bar-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
}

.kanaldeckel-bar-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 0.3rem;
  font-size: 0.9rem;
  font-weight: 500;
}

/* Balken-Container */
.bar-container {
  position: relative;
  width: 100%;
  height: 20px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: visible;
}

/* Balken-Füllung */
.bar {
  height: 100%;
  background-color: var(--e-global-color-accent, #444);
  border-radius: 4px 0 0 4px;
  width: var(--bar-width);
  transition: width 0.6s ease;
  position: relative;
  z-index: 1;
}

/* Prozentbeschriftung */
.percent-label {
  position: absolute;
  top: 50%;
  left: calc(var(--bar-width) + 6px);
  transform: translateY(-50%);
  white-space: nowrap;
  font-weight: 600;
  font-size: 0.85rem;
  user-select: none;
  pointer-events: none;
  color: #333;
  z-index: 2;
  text-align: left;
  max-width: calc(100% - var(--bar-width) - 12px);
  overflow: visible;
  transition: color 0.3s ease, left 0.3s ease, right 0.3s ease, text-align 0.3s ease;
}

/* Beschriftung bei vollem oder geringem Balken */
.bar-container.inside .percent-label,
.bar-container.full .percent-label {
  left: auto !important;
  right: 50px !important;
  color: white !important;
  text-align: right !important;
  pointer-events: none;
}

/* Mobile Balken-Anpassung */
@media (max-width: 767px) {
  .kanaldeckel-bar-meta {
    flex-direction: row;
    gap: 1rem;
  }
}