/* ==========================================================================
   elements.css – Wärme mit System
   The custom UX Builder elements (PROJECT_PLAN §7).
   ========================================================================== */

/* --------------------------------------------------------------------------
   Wärmelinie
   -------------------------------------------------------------------------- */

.ws-wave {
  width: 100%;
  line-height: 0;
  pointer-events: none;
}

.ws-wave svg {
  display: block;
  width: 100%;
}

.ws-wave--divider { opacity: 0.9; }

/* --------------------------------------------------------------------------
   Hero headline line reveal.
   The mask is inserted by motion.js; nothing here may hide the text, so that
   the headline is readable if the script never runs (PROJECT_PLAN §6.1).
   -------------------------------------------------------------------------- */

.ws-split__mask {
  display: block;
  overflow: hidden;
}

.ws-split__line { display: block; }

/* --------------------------------------------------------------------------
   Readout
   -------------------------------------------------------------------------- */

.ws-readout__value { margin-bottom: var(--ws-space-2); }

.ws-readout__unit {
  font-size: 0.55em;
  font-weight: 600;
}

.ws-readout__label {
  margin-bottom: var(--ws-space-1);
  color: var(--ws-body);
}

.ws-readout__source { color: var(--ws-muted); }

.ws-section-navy .ws-readout__label { color: rgba(255, 255, 255, 0.86); }
.ws-section-navy .ws-readout__source { color: rgba(255, 255, 255, 0.64); }

/* --------------------------------------------------------------------------
   Steps – oversized numerals, a thin rule between them on desktop.
   -------------------------------------------------------------------------- */

.ws-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.ws-steps__item {
  display: grid;
  grid-template-columns: minmax(64px, 96px) 1fr;
  gap: var(--ws-space-5);
  padding: var(--ws-space-6) 0;
  margin-left: 0 !important;
  border-top: 1px solid var(--ws-line);
}

.ws-steps__item:first-child { border-top: 0; padding-top: 0; }

.ws-steps__number {
  font-family: var(--ws-font-display);
  font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.5rem);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--ws-ink);
  letter-spacing: -0.02em;
}

.ws-steps__title { margin-bottom: var(--ws-space-2); }

.ws-steps__body > p:last-child { margin-bottom: 0; }

@media (max-width: 549px) {
  .ws-steps__item {
    grid-template-columns: 1fr;
    gap: var(--ws-space-2);
  }
}

.ws-section-navy .ws-steps__item { border-top-color: rgba(255, 255, 255, 0.16); }
.ws-section-navy .ws-steps__number { color: #fff; }

/* --------------------------------------------------------------------------
   Signed note
   -------------------------------------------------------------------------- */

.ws-note {
  display: grid;
  grid-template-columns: minmax(96px, 140px) 1fr;
  gap: var(--ws-space-5);
  align-items: start;
  margin: 0;
  padding: var(--ws-space-6) 0;
  border-top: 1px solid var(--ws-line);
  border-bottom: 1px solid var(--ws-line);
}

.ws-note:not(:has(.ws-note__media)) { grid-template-columns: 1fr; }

.ws-note__portrait {
  width: 100%;
  height: auto;
  border-radius: var(--ws-radius-image);
}

.ws-note__quote {
  margin: 0 0 var(--ws-space-4);
  padding: 0;
  border: 0;
  font-family: var(--ws-font-display);
  font-size: clamp(1.125rem, 1rem + 0.6vw, 1.4rem);
  font-weight: 500;
  line-height: 1.4;
  color: var(--ws-ink);
}

.ws-note__quote p:last-child { margin-bottom: 0; }

.ws-note__sign {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--ws-space-2);
  font-size: 0.9375rem;
  color: var(--ws-muted);
}

.ws-note__name {
  font-weight: 600;
  color: var(--ws-ink);
}

@media (max-width: 549px) {
  .ws-note { grid-template-columns: 1fr; }
  .ws-note__media { max-width: 140px; }
}

/* --------------------------------------------------------------------------
   Price card – rules, not shadows.
   -------------------------------------------------------------------------- */

.ws-price-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: var(--ws-space-6) 0 0;
  border-top: 2px solid var(--ws-ink);
}

.ws-price-card__title { margin-bottom: var(--ws-space-1); }

.ws-price-card__subtitle {
  margin-bottom: var(--ws-space-5);
  color: var(--ws-muted);
}

.ws-price-card__price {
  margin-bottom: var(--ws-space-1);
  font-family: var(--ws-font-display);
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  color: var(--ws-ink);
  letter-spacing: -0.02em;
}

.ws-price-card__price-note {
  margin-bottom: var(--ws-space-5);
  color: var(--ws-muted);
}

.ws-price-card__heading {
  margin-bottom: var(--ws-space-2);
  font-family: var(--ws-font-display);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ws-ink);
}

.ws-price-card__list {
  margin-bottom: var(--ws-space-5);
  font-size: 1rem;
}

.ws-price-card__list li {
  position: relative;
  padding-left: 1.5em;
  margin-bottom: var(--ws-space-2);
}

.ws-price-card__list--in li::before,
.ws-price-card__list--out li::before {
  position: absolute;
  left: 0;
  font-weight: 600;
}

.ws-price-card__list--in li::before {
  content: "+";
  color: var(--ws-ink);
}

.ws-price-card__list--out li::before {
  content: "–";
  color: var(--ws-muted);
}

.ws-price-card__list--out li { color: var(--ws-muted); }

.ws-price-card__note {
  margin-bottom: var(--ws-space-5);
  color: var(--ws-muted);
}

.ws-price-card__cta { margin-top: auto; }

/* --------------------------------------------------------------------------
   Reference case
   -------------------------------------------------------------------------- */

.ws-case { margin: 0; }

.ws-case__image {
  width: 100%;
  height: auto;
  border-radius: var(--ws-radius-image);
}

.ws-case__place { margin: var(--ws-space-5) 0 var(--ws-space-4); }

.ws-case__facts {
  margin: 0 0 var(--ws-space-5);
  font-size: 1rem;
}

.ws-case__fact {
  display: grid;
  grid-template-columns: minmax(110px, 34%) 1fr;
  gap: var(--ws-space-3);
  padding: var(--ws-space-2) 0;
  border-top: 1px solid var(--ws-line);
}

.ws-case__fact dt {
  color: var(--ws-muted);
  font-weight: 500;
}

.ws-case__fact dd {
  margin: 0;
  color: var(--ws-body);
}

.ws-case__quote {
  margin: 0 0 var(--ws-space-4);
  padding-left: var(--ws-space-4);
  border-left: 2px solid var(--ws-line);
}

.ws-case__quote blockquote {
  margin: 0 0 var(--ws-space-2);
  padding: 0;
  border: 0;
  font-size: 1.0625rem;
  color: var(--ws-ink);
}

.ws-case__quote figcaption { color: var(--ws-muted); }

/* --------------------------------------------------------------------------
   FAQ – <details>, rules only.
   -------------------------------------------------------------------------- */

.ws-faq__item {
  border-bottom: 1px solid var(--ws-line);
}

.ws-faq__question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ws-space-4);
  padding: var(--ws-space-4) 0;
  cursor: pointer;
  list-style: none;
  font-family: var(--ws-font-display);
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--ws-ink);
}

.ws-faq__question::-webkit-details-marker { display: none; }

.ws-faq__question:focus-visible {
  outline: 3px solid var(--ws-focus);
  outline-offset: 2px;
}

/* A plus that becomes a minus. No icon font, no coloured circle. */
.ws-faq__marker {
  position: relative;
  flex: none;
  width: 16px;
  height: 16px;
}

.ws-faq__marker::before,
.ws-faq__marker::after {
  content: "";
  position: absolute;
  inset: 50% 0 auto 0;
  height: 2px;
  background: var(--ws-ink);
  transform: translateY(-50%);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.ws-faq__marker::after { transform: translateY(-50%) rotate(90deg); }

.ws-faq__item[open] .ws-faq__marker::after {
  transform: translateY(-50%) rotate(0deg);
  opacity: 0;
}

.ws-faq__answer {
  overflow: hidden;
  padding-bottom: var(--ws-space-5);
  max-width: 68ch;
}

.ws-faq__answer > p:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   "mit System" diagram
   -------------------------------------------------------------------------- */

.ws-diagram { position: relative; }

.ws-diagram__line {
  display: none;
}

.ws-diagram__list {
  display: grid;
  gap: var(--ws-space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.ws-diagram__node {
  position: relative;
  margin-left: 0 !important;
  padding-left: var(--ws-space-6);
}

/* The dot doubles as the step marker on mobile, where the wave is hidden. */
.ws-diagram__dot {
  position: absolute;
  top: 0.45em;
  left: 0;
  width: 12px;
  height: 12px;
  border: 2px solid var(--ws-line);
  border-radius: 50%;
  background: var(--ws-white);
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

.ws-diagram__node.is-active .ws-diagram__dot {
  border-color: var(--ws-indigo);
  background: var(--ws-indigo);
}

.ws-diagram__title {
  margin-bottom: var(--ws-space-1);
  font-size: 1.0625rem;
}

.ws-diagram__text {
  margin-bottom: 0;
  font-size: 1rem;
  color: var(--ws-body);
}

/* A vertical rule connects the dots on mobile. */
.ws-diagram__node::before {
  content: "";
  position: absolute;
  top: 1.5em;
  bottom: calc(var(--ws-space-5) * -1);
  left: 5px;
  width: 2px;
  background: var(--ws-line);
}

.ws-diagram__node:last-child::before { display: none; }

@media (min-width: 850px) {
  .ws-diagram__line {
    display: block;
    position: absolute;
    inset: 0 0 auto 0;
    height: 120px;
    line-height: 0;
    pointer-events: none;
  }

  .ws-diagram__line svg {
    display: block;
    width: 100%;
    height: 120px;
  }

  .ws-diagram__list {
    grid-template-columns: repeat(var(--ws-diagram-count, 6), 1fr);
    gap: var(--ws-space-4);
    padding-top: 132px;
  }

  .ws-diagram__node {
    padding-left: 0;
    padding-top: var(--ws-space-5);
  }

  .ws-diagram__node::before {
    top: 0;
    bottom: auto;
    left: 0;
    right: 0;
    width: auto;
    height: 1px;
  }

  .ws-diagram__dot {
    top: -6px;
    left: 0;
  }
}

/* --------------------------------------------------------------------------
   Heizkurve
   -------------------------------------------------------------------------- */

.ws-heizkurve { margin: 0; }

.ws-heizkurve__svg {
  display: block;
  width: 100%;
  height: auto;
}

.ws-heizkurve__grid line {
  stroke: var(--ws-line);
  stroke-width: 1;
}

.ws-heizkurve__tick {
  fill: var(--ws-muted);
  font-family: var(--ws-font-body);
  font-size: 13px;
}

.ws-heizkurve__curve-a {
  stroke: var(--ws-muted);
  stroke-width: 2;
  stroke-dasharray: 6 6;
  opacity: 0.8;
}

.ws-heizkurve__curve-b {
  stroke-width: 4;
  stroke-linecap: round;
}

.ws-heizkurve__annotation circle {
  fill: var(--ws-amber);
  stroke: var(--ws-white);
  stroke-width: 3;
}

.ws-heizkurve__legend {
  margin-top: var(--ws-space-4);
}

.ws-heizkurve__key {
  position: relative;
  margin-bottom: var(--ws-space-2);
  padding-left: 32px;
  color: var(--ws-body);
}

.ws-heizkurve__key::before {
  content: "";
  position: absolute;
  top: 0.6em;
  left: 0;
  width: 22px;
  height: 3px;
  border-radius: 2px;
}

.ws-heizkurve__key--a::before {
  background: repeating-linear-gradient(
    to right,
    var(--ws-muted) 0 5px,
    transparent 5px 10px
  );
}

.ws-heizkurve__key--b::before { background: var(--ws-gradient); }

.ws-heizkurve__note,
.ws-heizkurve__axes { color: var(--ws-muted); }
