/* =========================================================
   Energiepass Skala Frontend 017
   Frontend-only, keine Abhängigkeit von Breakdance-Codeblock
   ========================================================= */

.va-scale-wrap,
.va-scale-wrap * {
  box-sizing: border-box;
}

.va-scale-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 18px 0 24px;
}

.va-scale {
  --top-x: 0%;
  width: 520px;
  max-width: 100%;
  margin: 0 auto;
  font-family: Arial, Helvetica, sans-serif;
  color: #111;
  position: relative;
  padding-top: 58px;
}

.va-top-arrow {
  position: absolute;
  top: 0;
  left: clamp(10px, var(--top-x), calc(100% - 10px));
  transform: translateX(-50%);
  width: 0;
  height: 0;
  z-index: 20;
}

.va-top-arrow::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: 9px;
  height: 28px;
  background: #666;
  border-radius: 2px;
}

.va-top-arrow::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 25px;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-top: 20px solid #666;
}

.va-top-info {
  position: absolute;
  top: 4px;
  left: clamp(150px, calc(var(--top-x) + 34px), calc(100% - 150px));
  display: flex;
  flex-direction: column;
  gap: 2px;
  white-space: nowrap;
  line-height: 1.15;
  z-index: 10;
}

.va-top-title,
.va-top-value {
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.va-top-bar {
  display: grid;
  grid-template-columns: 30fr 20fr 25fr 25fr 30fr 30fr 40fr 50fr 25fr;
  width: 100%;
  height: 28px;
  overflow: hidden;
  border: 2px solid #222;
  border-bottom: 0;
  border-radius: 13px 13px 0 0;
  background: #fff;
}

.va-seg {
  min-width: 0;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 2px solid #222;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.va-seg:last-child {
  border-right: 0;
}

.va-seg.is-active {
  box-shadow: inset 0 0 0 3px #111;
  font-size: 14px;
  font-weight: 900;
}

.va-aplus { background: #2fe332; }
.va-a     { background: #79ea3d; }
.va-b     { background: #b8e132; }
.va-c     { background: #ece232; }
.va-d     { background: #dfd445; }
.va-e     { background: #dcc83b; }
.va-f     { background: #d9ab2d; }
.va-g     { background: #d27a1c; }
.va-h     { background: #d31111; }

.va-axis {
  position: relative;
  width: 100%;
  height: 26px;
  margin: 5px 0 5px;
}

.va-axis span {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.va-t0   { left: 0%; transform: translate(0, -50%); }
.va-t25  { left: 9.0909%; }
.va-t50  { left: 18.1818%; }
.va-t75  { left: 27.2727%; }
.va-t100 { left: 36.3636%; }
.va-t125 { left: 45.4545%; }
.va-t150 { left: 54.5455%; }
.va-t175 { left: 63.6364%; }
.va-t200 { left: 72.7273%; }
.va-t225 { left: 81.8182%; }
.va-t250 { left: 90.9091%; transform: translate(0, -50%); }

.va-bottom-bar {
  width: 100%;
  height: 28px;
  border: 2px solid #222;
  border-top: 0;
  border-radius: 0 0 13px 13px;
  background: linear-gradient(
    90deg,
    #2fe332 0%,
    #79ea3d 14%,
    #b8e132 28%,
    #ece232 42%,
    #e7c22f 64%,
    #d97e1a 82%,
    #e20f0f 100%
  );
}

.va-bottom-area {
  display: none !important;
}

@media (max-width: 768px) {
  .va-scale {
    width: 100%;
    padding-top: 68px;
  }

  .va-top-info {
    position: static;
    margin-bottom: 8px;
    text-align: center;
    align-items: center;
    white-space: normal;
  }

  .va-top-title,
  .va-top-value {
    font-size: 12px;
  }

  .va-top-bar,
  .va-bottom-bar {
    height: 24px;
  }

  .va-seg {
    height: 24px;
    font-size: 9px;
    border-right-width: 1px;
  }

  .va-seg.is-active {
    font-size: 10px;
    box-shadow: inset 0 0 0 2px #111;
  }

  .va-axis {
    height: 20px;
    margin: 4px 0;
  }

  .va-axis span {
    font-size: 9px;
  }

  .va-top-arrow::before {
    width: 7px;
    height: 22px;
  }

  .va-top-arrow::after {
    top: 20px;
    border-left: 11px solid transparent;
    border-right: 11px solid transparent;
    border-top: 16px solid #666;
  }
}












/* =========================================================
   Shortcode [energie_skala] – v0.22 kompakt, kleine Pfeile, fließende Farben
   ========================================================= */

.va-scale-shortcode-wrap {
  width: 100% !important;
  display: flex !important;
  justify-content: center !important;
  margin: 6px auto 8px !important;
}

.va-scale.va-scale-shortcode {
  --top-x: 50%;
  --bottom-x: 50%;
  width: 520px !important;
  max-width: 100% !important;
  padding: 42px 0 46px !important;
  margin: 0 auto !important;
  overflow: visible !important;
  color: #111 !important;
  font-family: Arial, Helvetica, sans-serif !important;
}

/* Textblöcke sitzen direkt am oberen bzw. unteren Rand des Grafikbereichs */
.va-scale.va-scale-shortcode .va-top-info,
.va-scale.va-scale-shortcode .va-bottom-info {
  position: absolute !important;
  width: max-content !important;
  max-width: 285px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
  z-index: 35 !important;
  white-space: nowrap !important;
  pointer-events: none !important;
  color: #111 !important;
}

.va-scale.va-scale-shortcode .va-top-info {
  top: 0 !important;
}

.va-scale.va-scale-shortcode .va-bottom-info {
  bottom: 0 !important;
}

.va-scale.va-scale-shortcode .va-top-title,
.va-scale.va-scale-shortcode .va-bottom-title {
  font-size: 10px !important;
  font-weight: 800 !important;
  line-height: 1.05 !important;
  color: #111 !important;
  white-space: nowrap !important;
}

.va-scale.va-scale-shortcode .va-top-measure,
.va-scale.va-scale-shortcode .va-bottom-measure {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

.va-scale.va-scale-shortcode .va-value-box {
  display: inline-block !important;
  min-width: 64px !important;
  padding: 3px 6px !important;
  background: #d7d7d7 !important;
  color: #111 !important;
  border: 1px solid #a3a3a3 !important;
  border-radius: 0 !important;
  text-align: center !important;
  font-weight: 800 !important;
}

.va-scale.va-scale-shortcode .va-unit {
  display: inline-block !important;
  color: #111 !important;
  font-weight: 800 !important;
}

/* Pfeile ca. 50% kleiner als zuvor */
.va-scale.va-scale-shortcode .va-top-arrow {
  top: 9px !important;
  left: clamp(10px, var(--top-x), calc(100% - 10px)) !important;
  z-index: 25 !important;
}

.va-scale.va-scale-shortcode .va-top-arrow::before {
  width: 8px !important;
  height: 19px !important;
  top: 0 !important;
  background: #7f7f7f !important;
  border-radius: 0 !important;
}

.va-scale.va-scale-shortcode .va-top-arrow::after {
  top: 15px !important;
  border-left: 12px solid transparent !important;
  border-right: 12px solid transparent !important;
  border-top: 18px solid #7f7f7f !important;
}

.va-scale.va-scale-shortcode .va-bottom-arrow {
  position: absolute !important;
  left: clamp(10px, var(--bottom-x), calc(100% - 10px)) !important;
  bottom: 45px !important;
  transform: translateX(-50%) !important;
  width: 0 !important;
  height: 0 !important;
  z-index: 25 !important;
}

.va-scale.va-scale-shortcode .va-bottom-arrow::before {
  content: "" !important;
  position: absolute !important;
  left: 50% !important;
  top: 15px !important;
  transform: translateX(-50%) !important;
  width: 8px !important;
  height: 19px !important;
  background: #7f7f7f !important;
  border-radius: 0 !important;
}

.va-scale.va-scale-shortcode .va-bottom-arrow::after {
  content: "" !important;
  position: absolute !important;
  left: 50% !important;
  top: 0 !important;
  transform: translateX(-50%) !important;
  border-left: 12px solid transparent !important;
  border-right: 12px solid transparent !important;
  border-bottom: 18px solid #7f7f7f !important;
}

/* Oberer Balken segmentiert, aber farblich fließend und leuchtend */
.va-scale.va-scale-shortcode .va-top-bar {
  width: 100% !important;
  height: 30px !important;
  border: 2px solid #222 !important;
  border-bottom: 0 !important;
  border-radius: 14px 14px 0 0 !important;
  overflow: hidden !important;
}

.va-scale.va-scale-shortcode .va-bottom-bar {
  width: 100% !important;
  height: 30px !important;
  margin-top: 2px !important;
  border: 2px solid #222 !important;
  border-top: 0 !important;
  border-radius: 0 0 14px 14px !important;
  background: linear-gradient(90deg,
    #24ff1f 0%,
    #62ff1e 14%,
    #a8ff1b 28%,
    #f1f21a 48%,
    #ffd21a 64%,
    #ff9a18 78%,
    #ff5c14 90%,
    #f11b12 100%) !important;
}

.va-scale.va-scale-shortcode .va-seg {
  height: 30px !important;
  min-height: 30px !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  color: #111 !important;
  border-color: #222 !important;
}

.va-scale.va-scale-shortcode .va-aplus { background: #24ff1f !important; }
.va-scale.va-scale-shortcode .va-a     { background: #62ff1e !important; }
.va-scale.va-scale-shortcode .va-b     { background: #a8ff1b !important; }
.va-scale.va-scale-shortcode .va-c     { background: #eaf61a !important; }
.va-scale.va-scale-shortcode .va-d     { background: #f0e13b !important; }
.va-scale.va-scale-shortcode .va-e     { background: #e7bf34 !important; }
.va-scale.va-scale-shortcode .va-f     { background: #dfa42c !important; }
.va-scale.va-scale-shortcode .va-g     { background: #d27b23 !important; }
.va-scale.va-scale-shortcode .va-h     { background: #ef2418 !important; }

.va-scale.va-scale-shortcode .va-seg.is-active {
  box-shadow: none !important;
  font-size: 20px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
}

.va-scale.va-scale-shortcode .va-axis {
  height: 22px !important;
  margin: 3px 0 4px !important;
}

.va-scale.va-scale-shortcode .va-axis span {
  font-size: 10px !important;
  font-weight: 800 !important;
}

@media (max-width: 768px) {
  .va-scale.va-scale-shortcode {
    width: 100% !important;
    padding-top: 48px !important;
    padding-bottom: 52px !important;
  }

  .va-scale.va-scale-shortcode .va-top-title,
  .va-scale.va-scale-shortcode .va-bottom-title,
  .va-scale.va-scale-shortcode .va-top-measure,
  .va-scale.va-scale-shortcode .va-bottom-measure,
  .va-scale.va-scale-shortcode .va-axis span,
  .va-scale.va-scale-shortcode .va-seg {
    font-size: 9px !important;
  }

  .va-scale.va-scale-shortcode .va-seg.is-active {
    font-size: 15px !important;
  }

  .va-scale.va-scale-shortcode .va-value-box {
    min-width: 54px !important;
    padding: 2px 5px !important;
  }
}
