/* arbeitsweise.css — „Der Weg": sechs Stationen an einer durchgehenden Linie.
   Alle Klassen hier sind seitenspezifisch und kollidieren nicht mit
   components.css oder pages.css. */

/* ─── ABSCHNITTSKOPF DES WEGES ─────────────────────────────────────────────── */
.path-head { margin-bottom: clamp(2.5rem, 6vw, 4rem); }
.path-head .label { display: block; margin-bottom: 0.9rem; }

.path-head h2 {
  font-size: clamp(1.9rem, 4.4vw, 3.4rem);
  font-weight: 300;
  line-height: 1.12;
  letter-spacing: -0.01em;
  max-width: 18ch;
}

.path-head h2 em { color: var(--accent); font-style: italic; }

.path-lead {
  margin-top: 1.5rem;
  font-size: clamp(0.9rem, 1.4vw, 1rem);
  line-height: 1.8;
  color: var(--text-secondary);
  max-width: 56ch;
}

.path-hint {
  margin-top: 1.75rem;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.path-hint::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--accent);
  flex-shrink: 0;
}

/* ─── DIE LINIE ────────────────────────────────────────────────────────────── */
.path-wrap { position: relative; --node: 2.75rem; max-width: 62rem; }

/* Läuft von der Mitte des ersten bis zur Mitte des letzten Knotens */
.path-line {
  position: absolute;
  left: calc(var(--node) / 2);
  top: calc(var(--node) / 2);
  bottom: calc(var(--node) / 2);
  width: 1px;
  background: var(--border);
  overflow: hidden;
}

.path-line-fill {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, var(--accent), var(--accent-hot));
  transform-origin: top;
  transform: scaleY(1);
}

/* Die Linie füllt sich beim Scrollen — reine CSS-Zugabe. Wo scroll-driven
   animations fehlen, steht sie schlicht durchgehend gefüllt. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .path-line-fill {
      transform: scaleY(0);
      animation: pathFill linear both;
      animation-timeline: view();
      animation-range: cover 8% cover 70%;
    }
    @keyframes pathFill { to { transform: scaleY(1); } }
  }
}

/* ─── STATIONEN ────────────────────────────────────────────────────────────── */
.path {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.path-step + .path-step { margin-top: 0.5rem; }

.step { border: 0; }

.step-summary {
  display: grid;
  grid-template-columns: var(--node) 1fr auto;
  align-items: start;
  gap: clamp(1rem, 2.5vw, 1.75rem);
  padding: 1rem 0;
  cursor: pointer;
  list-style: none;
}

/* Standard-Dreieck entfernen (WebKit und Rest) */
.step-summary::-webkit-details-marker { display: none; }
.step-summary::marker { content: ""; }

/* Der Knoten deckt die Linie ab, damit sie nicht durchscheint */
.step-node {
  width: var(--node);
  height: var(--node);
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  transition: background 0.3s var(--ease-out), color 0.3s var(--ease-out),
              border-color 0.3s var(--ease-out);
}

.step-heading { display: block; padding-top: 0.35rem; }

.step-title {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3.2vw, 2.15rem);
  font-weight: 300;
  line-height: 1.15;
  color: var(--text-primary);
  transition: color 0.3s var(--ease-out);
}

.step-lead {
  display: block;
  margin-top: 0.5rem;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-secondary);
  max-width: 54ch;
}

/* Plus, das beim Öffnen zum Minus wird */
.step-marker {
  width: 1.5rem;
  height: 1.5rem;
  margin-top: 0.75rem;
  position: relative;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color 0.3s var(--ease-out);
}

.step-marker::before,
.step-marker::after {
  content: "";
  position: absolute;
  inset: 50% 0 auto 0;
  height: 1px;
  background: currentColor;
  transition: transform 0.35s var(--ease-out), opacity 0.35s var(--ease-out);
}

.step-marker::after { transform: rotate(90deg); }
.step[open] .step-marker::after { transform: rotate(0deg); }

/* ─── ZUSTÄNDE ─────────────────────────────────────────────────────────────── */
.step-summary:hover .step-node,
.step[open] .step-node {
  border-color: var(--accent);
  color: var(--accent);
}

.step[open] .step-node {
  background: var(--accent);
  color: var(--bg);
}

.step-summary:hover .step-title,
.step[open] .step-title { color: var(--accent); }

.step-summary:hover .step-marker { color: var(--accent); }

.step-summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

/* ─── AUFGEKLAPPTER INHALT ─────────────────────────────────────────────────── */
.step-body {
  padding: 0 0 1.75rem calc(var(--node) + clamp(1rem, 2.5vw, 1.75rem));
  max-width: 62ch;
}

.step-detail {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text-secondary);
}

.step-result {
  margin-top: 1.4rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  background: var(--bg-surface);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-primary);
}

.step-result-label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

/* Sanftes Aufklappen, wo der Browser es kann; sonst öffnet es schlicht sofort */
@supports (interpolate-size: allow-keywords) {
  @media (prefers-reduced-motion: no-preference) {
    .path { interpolate-size: allow-keywords; }
    .step::details-content {
      block-size: 0;
      overflow: hidden;
      opacity: 0;
      transition: block-size 0.4s var(--ease-out), opacity 0.3s var(--ease-out),
                  content-visibility 0.4s allow-discrete;
    }
    .step[open]::details-content { block-size: auto; opacity: 1; }
  }
}

/* ─── DER ANFANG ───────────────────────────────────────────────────────────── */
.beginn { display: grid; gap: clamp(2.5rem, 6vw, 4.5rem); align-items: start; }

@media (min-width: 900px) { .beginn { grid-template-columns: 1.1fr 1fr; } }

.beginn-text .label { display: block; margin-bottom: 0.9rem; }

.beginn-text h2 {
  font-size: clamp(1.9rem, 4.4vw, 3.2rem);
  font-weight: 300;
  line-height: 1.12;
  margin-bottom: 1.5rem;
}

.beginn-text h2 em { color: var(--accent); font-style: italic; }

.beginn-text p {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text-secondary);
  margin-bottom: 1.1rem;
  max-width: 56ch;
}

.beginn-text a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.22em;
}

.beginn-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border);
}

.beginn-steps li {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 1rem;
  align-items: baseline;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.beginn-num {
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  color: var(--accent);
}

/* ─── SCHMALE DISPLAYS ─────────────────────────────────────────────────────── */
@media (max-width: 560px) {
  .path-wrap { --node: 2.25rem; }
  .step-summary { gap: 0.9rem; padding: 0.85rem 0; }
  .step-marker { width: 1.15rem; margin-top: 0.5rem; }
  .step-body { padding-left: calc(var(--node) + 0.9rem); }
}
