/* ==========================================================================
   teilqualifikationen.css – Teilqualifikationen TQ 1–6
   Enthält Szene C: Lernlandschaft TQ 1–6 (räumliche SVG-Illustration)
   Steuerung: assets/js/szenen.js ([data-illu="tq"])
   ========================================================================== */

/* ---------- Seitenkopf ---------- */
.tq-hero__intro {
  max-width: 820px;
  margin-bottom: clamp(1.5rem, 1rem + 2vw, 2.5rem);
}

/* ==========================================================================
   SZENE C: Lernlandschaft TQ 1–6
   Zwei SVG-Fassungen im HTML (breit ab 1024 px, hoch darunter),
   Steuerung: assets/js/szenen.js (data-illu="tq").
   Ablauf: Wegabschnitt i ab 0,3 s + i × 0,95 s → Station leuchtet auf →
   Motiv bewegt sich; Ziel ab 6,0 s; danach Ruhe.
   ========================================================================== */
.tq-illu .illu {
  margin-inline: calc(var(--gutter) * -0.5);
}

.tq-svg--tall {
  display: none !important;
  max-width: 460px;
  margin-inline: auto;
}

@media (max-width: 1023px) {
  .tq-svg--wide {
    display: none !important;
  }

  .tq-svg--tall {
    display: block !important;
  }
}

/* Legende = Liste der Teilqualifikationen (Links zu den Beschreibungen) */
.tq-pfad {
  display: grid;
  gap: 0.5rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 760px) {
  .tq-pfad {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .tq-pfad {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.tq-pfad a {
  display: grid;
  grid-template-columns: 3.6rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.8rem;
  height: 100%;
  min-height: 56px;
  padding: 0.6rem 1rem;
  border: 1px solid var(--line-dark);
  border-radius: 12px;
  color: #eef0f3;
  font-weight: 650;
  line-height: 1.3;
  text-decoration: none;
  transition: border-color var(--dur-2), background-color var(--dur-2);
}

.tq-pfad a:hover,
.tq-pfad a:focus-visible {
  border-color: var(--gold);
  background: rgba(214, 178, 94, 0.1);
}

.tq-pfad a > span:nth-child(2) {
  min-width: 0;
  overflow-wrap: anywhere;
}

.tq-pfad__nr {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gold);
}

.tq-pfad__dauer {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--mist-soft);
  white-space: nowrap;
}

@media (max-width: 480px) {
  .tq-pfad a {
    grid-template-columns: 3.2rem minmax(0, 1fr);
  }

  .tq-pfad__dauer {
    grid-column: 2;
  }
}

.tq-hero__hinweis {
  margin: 1rem 0 0;
  font-size: 0.9rem;
  color: var(--mist);
}

/* Hervorhebung über die Legende (Zeiger oder Tastaturfokus) */
.tq-station .tq-ring ellipse {
  transition: stroke-width var(--dur-2), stroke var(--dur-2);
}

.tq-station.is-focus .tq-ring ellipse {
  stroke: #fff2c4;
  stroke-width: 4.5;
}

.tq-label.is-focus > rect:first-child,
.tq-label.is-focus > circle {
  stroke: #fff2c4;
  stroke-width: 2.5;
}

/* Endzustand */
.tq-seg { stroke-dasharray: 1; stroke-dashoffset: 0; }
.tq-mark,
.tq-org { stroke-dasharray: 1; stroke-dashoffset: 0; }
.tq-alert { opacity: 0; }

/* Ausgangszustand */
.is-waiting .tq-seg { stroke-dashoffset: 1; }
.is-waiting .tq-seg-mid { opacity: 0; }
.is-waiting .tq-station,
.is-waiting .tq-label,
.is-waiting .tq-bench,
.is-waiting .tq-pause,
.is-waiting .tq-goal,
.is-waiting .tq-goal-label { opacity: 0.35; }
.is-waiting .tq-bus { opacity: 0; transform: translate(var(--tx), var(--ty)); }
.is-waiting .tq-beam { opacity: 0; }
.is-waiting .tq-alert { opacity: 1; }
.is-waiting .tq-alert-ok { opacity: 0; }
.is-waiting .tq-mark,
.is-waiting .tq-org { stroke-dashoffset: 1; }
.is-waiting .tq-lens { transform: translate(var(--tx), var(--ty)); }
.is-waiting .tq-org-box,
.is-waiting .tq-pin { opacity: 0; }
.is-waiting .tq-flag { opacity: 0; transform: translateY(46px); }

@keyframes tq-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes tq-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes tq-wake { from { opacity: 0.35; } to { opacity: 1; } }
@keyframes tq-ring {
  0% { stroke-width: 2.2; stroke: #d6b25e; }
  40% { stroke-width: 6; stroke: #fff2c4; }
  100% { stroke-width: 2.2; stroke: #d6b25e; }
}
@keyframes tq-bus { from { opacity: 0; transform: translate(var(--tx), var(--ty)); } 30% { opacity: 1; } to { opacity: 1; transform: none; } }
@keyframes tq-alert { 0%, 40%, 80% { opacity: 1; } 20%, 60% { opacity: 0.25; } 100% { opacity: 0; } }
@keyframes tq-lens { 0% { transform: translate(var(--tx), var(--ty)); } 50% { transform: translate(calc(var(--tx) * -0.4), calc(var(--ty) * 0.2)); } 100% { transform: none; } }
@keyframes tq-pin { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes tq-flag { from { opacity: 0; transform: translateY(46px); } 20% { opacity: 1; } to { opacity: 1; transform: none; } }

.is-played .tq-seg { animation: tq-draw 600ms var(--ease-soft) both; animation-delay: calc(0.3s + var(--i) * 0.95s); }
.is-played .tq-seg-mid { animation: tq-fade 400ms linear both; animation-delay: calc(0.6s + var(--i) * 0.95s); }
.is-played .tq-station,
.is-played .tq-label { animation: tq-wake 400ms var(--ease-soft) both; animation-delay: calc(0.8s + var(--i) * 0.95s); }
.is-played .tq-station .tq-ring ellipse { animation: tq-ring 900ms var(--ease-soft) both; animation-delay: calc(0.8s + var(--i) * 0.95s); }
.is-played .tq-bench,
.is-played .tq-pause { animation: tq-wake 500ms var(--ease-soft) 3.1s both; }
.is-played .tq-bus { animation: tq-bus 900ms var(--ease) 1.65s both; }
.is-played .tq-beam { animation: tq-fade 500ms var(--ease-soft) both; animation-delay: calc(2.7s + var(--k) * 0.25s); }
.is-played .tq-alert { animation: tq-alert 1.1s linear 3.7s both; }
.is-played .tq-alert-ok { animation: tq-fade 300ms linear 4.75s both; }
.is-played .tq-lens { animation: tq-lens 1.2s ease-in-out 4.6s both; }
.is-played .tq-mark { animation: tq-draw 450ms var(--ease) 5.6s both; }
.is-played .tq-org-box { animation: tq-fade 250ms linear both; animation-delay: calc(5.55s + var(--k) * 0.15s); }
.is-played .tq-org { animation: tq-draw 400ms linear 5.7s both; }
.is-played .tq-pin { animation: tq-pin 450ms var(--ease) both; animation-delay: calc(6.1s + var(--k) * 0.2s); }
.is-played .tq-goal,
.is-played .tq-goal-label { animation: tq-wake 500ms var(--ease-soft) 6.4s both; }
.is-played .tq-flag { animation: tq-flag 1s var(--ease) 6.6s both; }

/* ---------- Überblick & Zeitleiste ---------- */
.tq-intro {
  max-width: 760px;
  margin-bottom: clamp(2.5rem, 2rem + 2vw, 4rem);
}

.tq-intro p:not(.note) {
  font-size: var(--step-1);
  color: var(--ink-soft);
}

.tq-liste {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tq-liste::before {
  content: "";
  position: absolute;
  left: 27px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: linear-gradient(180deg, var(--gold-deep), rgba(122, 90, 18, 0.15));
}

.tq {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 1.2rem;
  scroll-margin-top: calc(var(--header-h) + 20px);
}

.tq + .tq {
  margin-top: 1.5rem;
}

.tq__marke span {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--night);
  box-shadow: 0 0 0 6px var(--ivory);
  color: var(--gold-light);
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
}

.tq__inhalt {
  padding: clamp(1.3rem, 1rem + 1.5vw, 2.2rem);
  border: 1px solid var(--line-light);
  border-radius: var(--radius-lg);
  background: var(--paper);
  transition: border-color var(--dur-2), box-shadow var(--dur-2);
}

.tq:target .tq__inhalt {
  border-color: var(--gold-deep);
  box-shadow: 0 0 0 3px rgba(214, 178, 94, 0.35);
}

.tq__label {
  margin-bottom: 0.3rem;
  font-family: var(--font-mark);
  font-size: 0.76rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.tq__inhalt h3 {
  margin-bottom: 0.8rem;
}

.tq__inhalt > p:not(.tq__label):not(.tq__dauer) {
  max-width: 75ch;
  color: var(--ink-soft);
}

.tq__inhalt .check-list {
  margin-bottom: 1rem;
}

.tq__dauer {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.4rem 0 0;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: var(--night);
  color: #fff;
  font-weight: 700;
  font-size: 0.92rem;
}

.tq__dauer svg {
  width: 18px;
  height: 18px;
  color: var(--gold);
}

@media (min-width: 900px) {
  .tq-liste::before {
    left: 39px;
  }

  .tq {
    grid-template-columns: 80px minmax(0, 1fr);
  }

  .tq__marke span {
    width: 80px;
    height: 80px;
    font-size: 2rem;
  }
}

.tq-abschluss {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-top: 3rem;
  padding: 1.6rem 2rem;
  border-radius: var(--radius-lg);
  background: var(--sand);
}

.tq-abschluss p {
  margin: 0;
  max-width: 60ch;
}
