/* ============================================================
   RITTER WEBSERVICE — technik.css
   Nur fuer technik.html. Laedt NACH werkstatt.css und nutzt
   dessen Bausteine (st-kopf, st-liste, st-schritte, st-cta).
   Neu sind drei Teile, alle mit Praefix tk-:
   1. Werkzeugkasten: vier Faecher im Look eines Code-Fensters
   2. Projektkarten mit Technik-Etiketten
   3. Filter (Art und Technik), erst sichtbar, wenn technik.js
      laeuft. Ohne Skript stehen alle Projekte untereinander.
   ============================================================ */

.tk-abschnitt {
  padding-bottom: clamp(64px, 8vw, 110px);
}

/* ══ 1. WERKZEUGKASTEN ══════════════════════════════════════ */

.tk-kasten {
  padding-bottom: clamp(64px, 8vw, 110px);
  background: #fff;
  border-block: 1px solid var(--line);
}

.tk-kasten-raster {
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 78px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(18px, 2.4vw, 30px);
}

.tk-fach {
  min-width: 0;
  border-radius: 14px;
  overflow: hidden;
  background: var(--navy);
  border: 1px solid rgba(7, 27, 58, .9);
  box-shadow: 0 24px 60px rgba(7, 27, 58, .16);
  color: #fff;
}

.tk-fach-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 16px;
  background: #061832;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.tk-fach-bar i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .22);
}

.tk-fach-bar span {
  margin-left: 10px;
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .04em;
  color: var(--blue2);
}

.tk-fach h3 {
  margin: 0;
  padding: 22px clamp(18px, 2.4vw, 28px) 6px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.4rem, 2vw, 1.75rem);
  line-height: 1.2;
  color: #fff;
}

.tk-fach dl {
  margin: 0;
  padding: 8px clamp(18px, 2.4vw, 28px) 24px;
  counter-reset: zeile;
}

.tk-fach dl > div {
  display: grid;
  grid-template-columns: 26px minmax(0, .95fr) minmax(0, 1.05fr);
  gap: 4px 14px;
  align-items: baseline;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

/* Zeilennummern wie im Editor der Werkbank */
.tk-fach dl > div::before {
  counter-increment: zeile;
  content: counter(zeile, decimal-leading-zero);
  font-family: var(--mono);
  font-size: .66rem;
  color: rgba(255, 255, 255, .28);
}

.tk-fach dt {
  font-family: var(--mono);
  font-size: .8rem;
  font-weight: 500;
  color: #DCE9FF;
}

.tk-fach dd {
  margin: 0;
  font-size: .86rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, .62);
}

.tk-fach:nth-child(3) .tk-fach-bar span,
.tk-fach:nth-child(4) .tk-fach-bar span {
  color: var(--hand);
}

/* ══ 2. PROJEKTKARTEN ══════════════════════════════════════ */

.tk-projekte {
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 78px);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
  gap: clamp(16px, 2vw, 24px);
}

.tk-projekt {
  --tk-farbe: var(--blue);
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(22px, 2.4vw, 30px);
  background: #fff;
  border: 1px solid var(--line);
  border-top: 3px solid var(--tk-farbe);
}

.tk-projekt[data-art~="software"] { --tk-farbe: var(--navy2); }
.tk-projekt[data-art~="app"]      { --tk-farbe: var(--hand); }
.tk-projekt[data-art="intern"]    { --tk-farbe: #94A3B8; }

/* CraftClock vereint App, Weboberflaeche und API: doppelt breit */
.tk-projekt--gross {
  grid-column: span 2;
}

.tk-projekt-kopf {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin: 0 0 14px;
}

.tk-art {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

.tk-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 700;
  line-height: 1.5;
  color: var(--navy);
  background: var(--bg);
  border: 1px solid var(--line);
}

.tk-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.tk-status--live        { color: #087a55; background: #e6f6f0; border-color: #bfe6d6; }
.tk-status--arbeit      { color: #8a5300; background: var(--hand-weich); border-color: #f4dcae; }
.tk-status--entwicklung { color: #0d5fc4; background: #e9f3ff; border-color: #cfe3fb; }
.tk-status--test        { color: #0d5fc4; background: #fff; border-color: #cfe3fb; }
.tk-status--intern      { color: #475569; background: #f1f5f9; border-color: #e2e8f0; }

.tk-projekt h3 {
  margin: 0 0 8px;
  font-size: 1.16rem;
  line-height: 1.3;
  letter-spacing: -.01em;
  color: var(--navy);
}

.tk-projekt h3 a {
  color: inherit;
  text-decoration: none;
  background-image: linear-gradient(var(--tk-farbe), var(--tk-farbe));
  background-size: 0 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size .35s ease, color .2s ease;
}

.tk-projekt h3 a::after {
  content: " →";
  color: var(--blue);
}

.tk-projekt h3 a:hover,
.tk-projekt h3 a:focus-visible {
  color: var(--blue);
  background-size: 100% 1px;
}

.tk-projekt > p:not([class]) {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.65;
}

.tk-projekt ul {
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.tk-projekt li {
  position: relative;
  margin: 0;
  padding: 9px 0 9px 18px;
  border-bottom: 1px solid var(--line);
  font-size: .86rem;
  line-height: 1.6;
  color: var(--text);
}

.tk-projekt li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 1.05em;
  width: 7px;
  height: 1px;
  background: var(--tk-farbe);
}

.tk-projekt--gross ul {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 22px;
  border-top: 0;
}

.tk-projekt--gross li {
  border-top: 1px solid var(--line);
}

/* Etiketten: ohne Skript reiner Text, mit Skript Knoepfe */
.tk-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: auto 0 0;
}

.tk-tags span,
.tk-tags button {
  font-family: var(--mono);
  font-size: .68rem;
  line-height: 1.5;
  color: var(--navy2);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 9px;
}

.tk-tags button {
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}

.tk-tags button:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.tk-tags button[aria-pressed="true"] {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.tk-tags button:focus-visible,
.tk-chip:focus-visible,
.tk-zuruecksetzen:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* ══ 3. FILTER ═════════════════════════════════════════════ */

.tk-filter {
  max-width: 1240px;
  margin: 0 auto clamp(22px, 3vw, 34px);
  padding-inline: clamp(20px, 5vw, 78px);
  scroll-margin-top: calc(var(--header-h, 84px) + 18px);
}

.tk-filter-zeile {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tk-filter-zeile--technik {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.tk-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--navy);
  font: 600 .82rem var(--sans);
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}

.tk-chip:hover {
  border-color: var(--blue);
}

.tk-chip[aria-pressed="true"] {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.tk-chip small {
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 500;
  color: var(--muted);
}

.tk-chip[aria-pressed="true"] small {
  color: var(--blue2);
}

.tk-filter-zeile--technik .tk-chip {
  min-height: 32px;
  padding: 4px 11px;
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 500;
}

.tk-filter-zeile--technik .tk-chip--mehr {
  border-style: dashed;
  color: var(--blue);
  font-family: var(--sans);
  font-weight: 600;
}

.tk-filter-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin: 16px 0 0;
  font-family: var(--mono);
  font-size: .74rem;
  color: var(--muted);
}

.tk-zuruecksetzen {
  padding: 0;
  border: 0;
  background: none;
  color: var(--blue);
  font: 600 .78rem var(--sans);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.tk-leer {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px clamp(20px, 5vw, 78px) 0;
  color: var(--muted);
}

/* ══ 4. WEGGELASSEN — Band auf Navy, nutzt st-werkbank ═════ */

.tk-weg .st-datei {
  margin-bottom: 0;
}

.tk-weg .st-schluss {
  padding-top: clamp(30px, 4vw, 54px);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  row-gap: clamp(28px, 3.4vw, 44px);
}

/* ══ Responsive ════════════════════════════════════════════ */

@media (max-width: 1000px) {
  .tk-kasten-raster {
    grid-template-columns: minmax(0, 1fr);
  }

  .tk-projekt--gross ul {
    grid-template-columns: minmax(0, 1fr);
    border-top: 1px solid var(--line);
  }

  .tk-projekt--gross li {
    border-top: 0;
  }

  .tk-weg .st-schluss {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .tk-projekt--gross {
    grid-column: auto;
  }
}

@media (max-width: 620px) {
  .tk-weg .st-schluss {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .tk-fach dl > div {
    grid-template-columns: 22px minmax(0, 1fr);
  }

  .tk-fach dd {
    grid-column: 2;
  }

  .tk-filter-zeile--technik {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: thin;
  }

  .tk-filter-zeile--technik .tk-chip {
    flex-shrink: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tk-projekt h3 a,
  .tk-chip,
  .tk-tags button {
    transition: none;
  }
}
