/* ITMAT.de – Grundgerüst: Farben, Schrift, Kopf, Startseite, Werkzeug-Seiten, Rechtliches */

@font-face {
  font-family: "Bricolage";
  src: url("../fonts/bricolage-grotesque-latin-standard-normal.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("../fonts/public-sans-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #eef1f5;
  --surface: #ffffff;
  --ink: #142038;
  --ink-2: #34405a;
  --muted: #5d687e;
  --line: #d8dee7;
  --line-2: #bfc8d5;
  --brand: #ffd23f;
  --brand-soft: #fff4c7;

  /* Kategorien */
  --seo: #2457d6;   --seo-bg: #e7eefc;
  --sec: #c43d27;   --sec-bg: #fbeae6;
  --net: #11805a;   --net-bg: #e1f2ea;
  --day: #a96f05;   --day-bg: #f8eed6;

  --ok: #11805a;
  --warn: #a96f05;
  --bad: #c43d27;

  --f-display: "Bricolage", "Arial Narrow", system-ui, sans-serif;
  --f-body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: ui-monospace, "Cascadia Mono", Consolas, monospace;

  --r: 10px;
  --r-sm: 6px;
  --wrap: 1240px;
  --gutter: clamp(16px, 3.5vw, 36px);

  /* Werte für die Werkzeug-Bausteine */
  --paper: var(--bg);
  --marker: var(--brand);
  --marker-soft: var(--brand-soft);
  --white: #ffffff;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 1rem/1.6 var(--f-body);
}
img, svg { max-width: 100%; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--brand); text-decoration-thickness: 3px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; box-shadow: 0 0 0 5px var(--ink); border-radius: 3px; }
h1, h2, h3, h4 { font-family: var(--f-display); line-height: 1.12; margin: 0; font-weight: 700; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.ico { width: 22px; height: 22px; flex: none; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip { position: absolute; left: -9999px; top: 0; background: var(--brand); color: var(--ink); padding: 10px 16px; z-index: 50; }
.skip:focus { left: 16px; top: 12px; }

/* ---------- Kopf ---------- */
.top { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--line); }
.top__in { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.brand { font: 800 1.6rem/1 var(--f-display); letter-spacing: -.02em; text-decoration: none; color: var(--ink); flex: none; }
.brand b { font-weight: inherit; background: linear-gradient(transparent 58%, var(--brand) 58%, var(--brand) 92%, transparent 92%); }
.brand:hover { text-decoration: none; }

.search { position: relative; flex: 1 1 auto; max-width: 440px; margin-left: 12px; }
.search .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; font: inherit; font-size: .95rem; color: var(--ink);
  background: var(--bg); border: 1px solid transparent; border-radius: 999px;
  padding: 9px 14px 9px 38px;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; background: var(--surface); border-color: var(--ink); box-shadow: 0 0 0 3px var(--brand); }

.top__nav { display: flex; gap: 22px; margin-left: auto; font-size: .95rem; font-weight: 500; }
.top__nav a { text-decoration: none; color: var(--ink-2); white-space: nowrap; }
.top__nav a:hover, .top__nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--brand); text-decoration-thickness: 3px; }

/* ---------- Startseite ---------- */
.intro {
  background-color: var(--bg);
  background-image: radial-gradient(rgba(20,32,56,.13) 1.3px, transparent 1.4px);
  background-size: 22px 22px;
  border-bottom: 1px solid var(--line);
  padding: clamp(36px, 6vw, 72px) 0 clamp(28px, 4vw, 44px);
}
.intro h1 { font-size: clamp(2.3rem, 5vw, 4rem); font-stretch: 84%; font-weight: 760; letter-spacing: -.028em; line-height: 1.02; max-width: 15ch; }
.intro__lead { font-size: 1.15rem; color: var(--ink-2); max-width: 36em; margin-top: 18px; }

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 28px; }
.chip {
  font: inherit; font-size: .92rem; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); border-radius: 999px; padding: 7px 14px;
}
.chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--ink)); }
.chip span { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.chip[aria-pressed="true"] span { color: #c9d1df; }
.chip[aria-pressed="true"] i { box-shadow: 0 0 0 2px var(--surface); }

.board { padding-top: clamp(28px, 4vw, 48px); padding-bottom: clamp(48px, 6vw, 80px); }
.group + .group { margin-top: 40px; }
.group__head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.group__head h2 { font-size: 1.45rem; font-stretch: 88%; display: flex; align-items: center; gap: 10px; }
.group__head h2 i { width: 12px; height: 12px; border-radius: 3px; background: var(--c); }
.group__head p { color: var(--muted); font-size: .93rem; margin: 0; }
.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.tile a {
  height: 100%; display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-content: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px 16px 18px; text-decoration: none;
}
.tile a:hover { border-color: var(--c); box-shadow: inset 0 0 0 1px var(--c); text-decoration: none; }
.tile__ic { grid-row: span 2; width: 44px; height: 44px; border-radius: 9px; display: grid; place-items: center; background: var(--cb); color: var(--c); }
.tile__ic .ico { width: 24px; height: 24px; }
.tile strong { font: 650 1.1rem/1.25 var(--f-display); align-self: end; }
.tile span.d { font-size: .9rem; line-height: 1.45; color: var(--muted); }
.board__empty { padding: 32px; background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--r); color: var(--muted); }

.c-seo { --c: var(--seo); --cb: var(--seo-bg); }
.c-sec { --c: var(--sec); --cb: var(--sec-bg); }
.c-net { --c: var(--net); --cb: var(--net-bg); }
.c-day { --c: var(--day); --cb: var(--day-bg); }

.promise { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: clamp(36px, 5vw, 56px) 0; }
.promise__grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(24px, 5vw, 64px); align-items: start; }
.promise h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-stretch: 86%; letter-spacing: -.02em; }
.promise ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.promise li { display: grid; gap: 6px; font-size: .95rem; color: var(--muted); }
.promise li .ico { width: 26px; height: 26px; color: var(--ink); }
.promise li strong { color: var(--ink); font-size: 1rem; }

.more { padding: 0 0 clamp(48px, 6vw, 72px); }
.more h2 { font-size: 1.45rem; font-stretch: 88%; margin-bottom: 14px; }
.more__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.more__list a { height: 100%; display: grid; align-content: start; grid-template-columns: auto 1fr; gap: 4px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; text-decoration: none; }
.more__list a:hover { border-color: var(--c); box-shadow: inset 0 0 0 1px var(--c); text-decoration: none; }
.more__list .tile__ic { grid-row: span 2; width: 44px; height: 44px; border-radius: 9px; display: grid; place-items: center; background: var(--cb); color: var(--c); }
.more__list .tile__ic .ico { width: 24px; height: 24px; }
.more__list strong { display: block; font: 700 1.2rem/1.2 var(--f-display); margin-bottom: 4px; }
.more__list .d { display: block; font-size: .92rem; color: var(--muted); line-height: 1.5; }
.more__list em { grid-column: 2; font-style: normal; font-weight: 600; font-size: .9rem; color: var(--c); margin-top: 6px; }

/* ---------- Werkzeug-Seiten ---------- */
.shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: clamp(24px, 3vw, 44px); padding-top: 28px; padding-bottom: clamp(48px, 6vw, 80px); align-items: start; }
.side { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; font-size: .92rem; }
.side summary { display: none; }
.side h2 { font: 700 .8rem/1 var(--f-body); color: var(--muted); display: flex; align-items: center; gap: 8px; margin: 0 0 6px; padding-left: 10px; }
.side [data-group]:first-of-type h2 { margin-top: 0; }
.side [data-group] h2 { margin-top: 18px; }
.side h2 i { width: 9px; height: 9px; border-radius: 2px; background: var(--c); }
.side ul { list-style: none; margin: 0; padding: 0; }
.side a { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: var(--r-sm); text-decoration: none; color: var(--ink-2); }
.side a .ico { width: 18px; height: 18px; color: var(--c); }
.side a:hover { background: var(--surface); color: var(--ink); text-decoration: none; }
.side a[aria-current="page"] { background: var(--surface); color: var(--ink); font-weight: 650; box-shadow: inset 3px 0 0 var(--c); }
.side__all { display: inline-block; margin-bottom: 14px; font-weight: 600; }

.page { min-width: 0; }
.crumbs { font-size: .88rem; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.page__head { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; align-items: center; }
.page__ic { grid-row: span 2; width: 60px; height: 60px; border-radius: 12px; display: grid; place-items: center; background: var(--cb); color: var(--c); }
.page__ic .ico { width: 32px; height: 32px; }
.page__head h1 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); font-stretch: 84%; font-weight: 750; letter-spacing: -.025em; line-height: 1.05; }
.page__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.page__tags span { font-size: .78rem; font-weight: 600; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
.page__tags .t-cat { color: var(--c); border-color: currentColor; }
.page__lead { font-size: 1.08rem; color: var(--ink-2); max-width: 46em; margin: 18px 0 24px; }

.related { margin-top: 36px; }
.related h2 { font-size: 1.15rem; font-stretch: 90%; margin-bottom: 12px; }
.related .tiles { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

/* ---------- Rechtliches ---------- */
.legal { padding: clamp(32px, 5vw, 64px) 0 clamp(48px, 7vw, 88px); }
.legal__in { max-width: 780px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: clamp(24px, 4vw, 48px); }
.legal h1 { font-size: clamp(2rem, 4vw, 3rem); font-stretch: 84%; letter-spacing: -.025em; margin-bottom: 14px; }
.legal h2 { font-size: 1.35rem; font-stretch: 88%; margin: 2em 0 .6em; scroll-margin-top: 84px; }
.legal__lead { font-size: 1.12rem; color: var(--ink-2); }
.legal__meta { font-size: .9rem; color: var(--muted); }
.legal ul { padding-left: 1.2em; margin: 0 0 1em; }
.legal li { margin-bottom: .25em; }
.legal__dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 24px; margin: 0; }
.legal__dl dt { color: var(--muted); }
.legal__dl dd { margin: 0; font-weight: 600; }
.legal__toc { background: var(--bg); border-left: 4px solid var(--brand); border-radius: 0 var(--r-sm) var(--r-sm) 0; padding: 16px 20px; margin: 24px 0 8px; }
.legal__toc ol { margin: 0; padding-left: 1.3em; columns: 2; column-gap: 32px; }
.legal__toc li { break-inside: avoid; }
.legal .btn-home { display: inline-block; margin-top: 8px; background: var(--ink); color: var(--surface); text-decoration: none; font-weight: 600; padding: 10px 18px; border-radius: var(--r-sm); }

/* ---------- Fuß ---------- */
.foot { border-top: 1px solid var(--line); background: var(--surface); padding: 32px 0 40px; font-size: .93rem; color: var(--muted); }
.foot__in { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.foot__about { max-width: 36em; }
.foot__about p { margin-bottom: .5em; }
.foot .brand { font-size: 1.3rem; display: inline-block; margin-bottom: 8px; }
.foot__nav { display: flex; gap: 20px; }
.foot__more { gap: 14px; }
.foot__more span { color: var(--muted); }
.foot a { color: var(--ink); }
.foot a[href^="tel:"] { white-space: nowrap; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 160%); visibility: hidden; background: var(--ink); color: #fff; padding: 10px 18px; border-radius: var(--r-sm); border-left: 5px solid var(--brand); font-size: .95rem; transition: transform .2s ease; z-index: 60; pointer-events: none; }
.toast.is-on { transform: translate(-50%, 0); visibility: visible; }

/* ---------- Responsiv ---------- */
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; padding-top: 16px; }
  .side { position: static; max-height: none; overflow: visible; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
  .side summary { display: flex; justify-content: space-between; align-items: center; cursor: pointer; padding: 12px 16px; font-weight: 650; list-style: none; }
  .side summary::-webkit-details-marker { display: none; }
  .side summary::after { content: "+"; font-size: 1.3rem; line-height: 1; color: var(--muted); }
  .side[open] summary::after { content: "–"; }
  .side__body { padding: 0 8px 12px; }
  .side__all { margin-left: 10px; }
  .promise__grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .top__in { flex-wrap: wrap; gap: 10px 16px; padding-top: 10px; padding-bottom: 10px; }
  .search { order: 3; flex-basis: 100%; max-width: none; margin-left: 0; }
  .top__nav { gap: 16px; font-size: .9rem; }
  .promise ul { grid-template-columns: 1fr; gap: 16px; }
  .more__list { grid-template-columns: 1fr; }
  .page__ic { width: 48px; height: 48px; }
  .page__ic .ico { width: 26px; height: 26px; }
  .legal__dl { grid-template-columns: 1fr; gap: 0; }
  .legal__dl dd { margin-bottom: 10px; }
  .legal__toc ol { columns: 1; }
  html { scroll-padding-top: 120px; }
}

/* Datenfluss-Kennzeichnung: lokal / Verbindung */
.tile span.tile__flow { grid-column: 2; justify-self: start; margin-top: 6px; font-size: .74rem; font-weight: 700; letter-spacing: .01em; border-radius: 999px; padding: 2px 9px 2px 20px; position: relative; }
.tile span.tile__flow::before { content: ""; position: absolute; left: 8px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: currentColor; }
.tile__flow--local { color: #0d6b4b; background: #e1f2ea; }
.tile__flow--connect { color: #8a5a00; background: #fbefd2; }
.page__tags .t-flow { display: inline-flex; align-items: center; gap: 5px; }
.page__tags .t-flow .ico { width: 13px; height: 13px; }
.page__tags .t-flow--local { color: #0d6b4b; background: #e1f2ea; border-color: #9fd4bd; }
.page__tags .t-flow--connect { color: #8a5a00; background: #fbefd2; border-color: #e8c97a; }
