/*
 * PFEOS Wissenswelt – Gestaltung
 * Alle Regeln sind auf .pfw-app begrenzt und alle Klassen tragen das Präfix "pfw-",
 * damit das bestehende Website-Design nicht beeinflusst wird.
 *
 * Layout-Idee: eine Fachbibliothek – Kopf mit Suche, acht farbige "Regalfächer"
 * (Themen), darunter der Katalog mit Karteikarten und eine Detailansicht pro Beitrag.
 */

.pfw-app {
  /* Farben */
  --pfw-papier: #ffffff;
  --pfw-tinte: #172131;          /* Text, leicht blaustichig statt reinem Schwarz */
  --pfw-grau: #566173;           /* Nebentext */
  --pfw-linie: #e2e6ee;          /* Linien, Rahmen */
  --pfw-hauch: #f4f6fa;          /* zarte Flächen */
  --pfw-akzent: #1f4e9c;         /* PFEOS-Blau */
  --pfw-akzent-hell: #e8eef8;
  /* Schrift: Systemschriften – keine externen Schriftdienste (DSGVO-freundlich) */
  --pfw-schrift: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  --pfw-schrift-titel: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  /* Maße */
  --pfw-radius: 14px;
  --pfw-radius-klein: 8px;
  --pfw-max: 1180px;

  background: var(--pfw-papier);
  color: var(--pfw-tinte);
  font-family: var(--pfw-schrift);
  font-size: 16px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

/* Kleiner, lokaler Reset – wirkt nur innerhalb der Wissenswelt.
   :where() hält die Priorität niedrig: Der Reset schlägt allgemeine Website-Stile (z. B. "button {…}"),
   die Bausteine der Wissenswelt (Klassen weiter unten) gewinnen aber immer gegen den Reset. */
.pfw-app :where(*, *::before, *::after) { box-sizing: border-box; }
.pfw-app :where(h1, h2, h3, p, ul, dl, dt, dd) { margin: 0; padding: 0; }
.pfw-app :where(ul) { list-style: none; }
.pfw-app :where(a) { color: inherit; text-decoration: none; }
.pfw-app :where(button, input, select) { font: inherit; color: inherit; margin: 0; }
.pfw-app :where(button) { cursor: pointer; background: none; border: 0; padding: 0; text-align: inherit; }
.pfw-app :where(svg) { display: block; flex: none; }
.pfw-app [hidden] { display: none !important; }
.pfw-app :focus-visible { outline: 3px solid var(--pfw-akzent); outline-offset: 2px; border-radius: 6px; }

.pfw-innen {
  max-width: var(--pfw-max);
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ---------- Kopf ---------- */
.pfw-kopf { padding-block: 40px 28px; }
.pfw-kopf .pfw-innen { display: grid; gap: 18px; }
.pfw-ueberzeile {
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--pfw-akzent);
}
.pfw-titel {
  font-family: var(--pfw-schrift-titel);
  font-size: clamp(2.1rem, 5vw, 3.4rem); line-height: 1.05; font-weight: 750; letter-spacing: -0.02em;
  text-wrap: balance;
}
.pfw-einleitung { max-width: 62ch; font-size: 1.08rem; color: var(--pfw-grau); }

.pfw-suche { position: relative; max-width: 720px; }
.pfw-suche-symbol { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--pfw-grau); pointer-events: none; }
.pfw-suchfeld {
  width: 100%; height: 58px; padding: 0 52px 0 52px;
  border: 2px solid var(--pfw-linie); border-radius: 999px; background: var(--pfw-papier);
  font-size: 1.05rem; transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
.pfw-suchfeld::placeholder { color: #7d8697; }
.pfw-suchfeld:focus { outline: none; border-color: var(--pfw-akzent); box-shadow: 0 0 0 4px var(--pfw-akzent-hell); }
.pfw-suchfeld::-webkit-search-cancel-button { display: none; }
.pfw-suche-leeren {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--pfw-grau);
}
.pfw-suche-leeren:hover { background: var(--pfw-hauch); color: var(--pfw-tinte); }

.pfw-bestand { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pfw-bestand-label { font-size: 0.85rem; color: var(--pfw-grau); margin-right: 4px; }
.pfw-bestand-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: 999px; background: var(--pfw-hauch);
  font-size: 0.9rem; font-weight: 500; transition: background .15s, color .15s;
}
.pfw-bestand-chip b { font-weight: 700; font-variant-numeric: tabular-nums; }
.pfw-bestand-chip:hover { background: var(--pfw-akzent-hell); color: var(--pfw-akzent); }

/* ---------- Abschnitte ---------- */
.pfw-abschnitt { padding-block: 20px 36px; }
.pfw-abschnitt-kopf { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 18px; }
.pfw-h2 { font-family: var(--pfw-schrift-titel); font-size: 1.5rem; font-weight: 700; letter-spacing: -0.01em; text-wrap: balance; }
.pfw-hinweis { font-size: 0.92rem; color: var(--pfw-grau); }

/* ---------- Themenkacheln ---------- */
.pfw-themen { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.pfw-kachel {
  --pfw-c: var(--pfw-akzent); --pfw-t: var(--pfw-akzent-hell);
  position: relative; display: flex; flex-direction: column; gap: 12px; min-width: 0;
  padding: 20px 20px 18px; border-radius: var(--pfw-radius);
  background: var(--pfw-t); border: 1px solid transparent;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
}
.pfw-kachel:hover { transform: translateY(-3px); box-shadow: 0 12px 28px -14px rgba(23, 33, 49, .35); border-color: var(--pfw-c); }
.pfw-kachel[aria-pressed="true"] { border-color: var(--pfw-c); box-shadow: inset 0 0 0 1px var(--pfw-c); }
.pfw-kachel-symbol {
  width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center;
  background: var(--pfw-c); color: #ffffff;
}
.pfw-kachel-name { font-family: var(--pfw-schrift-titel); font-size: 1.12rem; font-weight: 700; line-height: 1.25; text-wrap: balance; }
.pfw-kachel-text { font-size: 0.92rem; color: #3d4757; }
.pfw-kachel-fuss { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; padding-top: 4px; }
.pfw-kachel-zahl { font-size: 0.85rem; color: #3d4757; font-variant-numeric: tabular-nums; }
.pfw-kachel-zahl b { color: var(--pfw-c); font-size: 1.25rem; font-weight: 750; margin-right: 3px; }
.pfw-kachel-mix { display: block; font-size: 0.8rem; color: #5a6476; }
.pfw-kachel-pfeil { color: var(--pfw-c); transition: transform .18s; align-self: flex-end; }
.pfw-kachel:hover .pfw-kachel-pfeil { transform: translateX(3px); }

/* ---------- Katalog: Themenkopf ---------- */
.pfw-themenkopf {
  --pfw-c: var(--pfw-akzent); --pfw-t: var(--pfw-akzent-hell);
  display: flex; gap: 16px; align-items: flex-start;
  padding: 20px; margin-bottom: 18px; border-radius: var(--pfw-radius); background: var(--pfw-t);
}
.pfw-themenkopf .pfw-kachel-symbol { width: 56px; height: 56px; }
.pfw-themenkopf-text { display: grid; gap: 6px; min-width: 0; flex: 1; }
.pfw-themenkopf-text p { color: #3d4757; max-width: 65ch; }

.pfw-zurueck {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px 8px 10px; border-radius: 999px; font-weight: 600; font-size: 0.92rem;
  color: var(--pfw-akzent); background: var(--pfw-akzent-hell);
}
.pfw-zurueck:hover { background: #d9e3f3; }

/* ---------- Filterleiste ---------- */
.pfw-filter {
  display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; justify-content: space-between;
  padding: 12px; margin-bottom: 14px; border: 1px solid var(--pfw-linie); border-radius: var(--pfw-radius);
}
.pfw-formate { display: flex; flex-wrap: wrap; gap: 6px; }
.pfw-format-knopf {
  display: inline-flex; align-items: center; gap: 7px; min-height: 40px;
  padding: 8px 14px; border-radius: 999px; font-size: 0.92rem; font-weight: 600;
  color: var(--pfw-grau); transition: background .15s, color .15s;
}
.pfw-format-knopf small { font-size: 0.8rem; font-weight: 500; font-variant-numeric: tabular-nums; opacity: .85; }
.pfw-format-knopf:hover { background: var(--pfw-hauch); color: var(--pfw-tinte); }
.pfw-format-knopf[aria-pressed="true"] { background: var(--pfw-tinte); color: #ffffff; }
.pfw-auswahl-gruppe { display: flex; flex-wrap: wrap; gap: 10px; }
.pfw-auswahl { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; font-size: 0.88rem; color: var(--pfw-grau); }
.pfw-select {
  min-height: 40px; padding: 6px 34px 6px 12px; border: 1px solid var(--pfw-linie); border-radius: var(--pfw-radius-klein);
  background: var(--pfw-papier) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23566173' stroke-width='1.8'/%3E%3C/svg%3E") no-repeat right 12px center;
  color: var(--pfw-tinte); font-size: 0.92rem; -webkit-appearance: none; appearance: none; max-width: 100%;
}

.pfw-ergebniszeile { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 16px; min-height: 32px; }
.pfw-anzahl { font-weight: 650; font-variant-numeric: tabular-nums; }
.pfw-aktiv-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px 5px 12px; border-radius: 999px;
  background: var(--pfw-akzent-hell); color: var(--pfw-akzent); font-size: 0.86rem; font-weight: 600;
}
.pfw-aktiv-chip:hover { background: #d9e3f3; }
.pfw-alles-zuruecksetzen { font-size: 0.86rem; font-weight: 600; color: var(--pfw-grau); padding: 5px 4px; }
.pfw-alles-zuruecksetzen:hover { color: var(--pfw-tinte); }

/* ---------- Karteikarten ---------- */
.pfw-karten { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.pfw-karte {
  --pfw-c: var(--pfw-akzent);
  position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0;
  padding: 18px 18px 16px; border: 1px solid var(--pfw-linie); border-radius: var(--pfw-radius);
  background: var(--pfw-papier); cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.pfw-karte:hover { border-color: #c9d0dc; box-shadow: 0 10px 24px -16px rgba(23, 33, 49, .4); transform: translateY(-2px); }
.pfw-karte-oben { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pfw-marken { display: flex; flex-wrap: wrap; gap: 6px; }
.pfw-marke {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 7px; border-radius: 6px;
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  background: var(--pfw-hauch); color: #3d4757;
}
.pfw-marke--video { background: #fde9e7; color: #a42b22; }
.pfw-marke--audio { background: #e6f4f1; color: #0b6b5d; }
.pfw-signatur { font-size: 0.74rem; color: #7d8697; font-variant-numeric: tabular-nums; letter-spacing: 0.03em; white-space: nowrap; }
.pfw-karte-titel { font-family: var(--pfw-schrift-titel); font-size: 1.06rem; font-weight: 700; line-height: 1.3; text-wrap: balance; }
.pfw-karte-titel button { text-align: left; }
.pfw-karte-titel button:hover { color: var(--pfw-akzent); }
.pfw-karte-text {
  font-size: 0.92rem; color: var(--pfw-grau);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.pfw-schlagwoerter { display: flex; flex-wrap: wrap; gap: 6px; }
.pfw-schlagwort {
  padding: 3px 10px; border-radius: 999px; border: 1px solid var(--pfw-linie);
  font-size: 0.8rem; color: #3d4757; background: var(--pfw-papier); transition: border-color .15s, color .15s;
}
.pfw-schlagwort:hover { border-color: var(--pfw-akzent); color: var(--pfw-akzent); }
.pfw-karte-fuss {
  margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-top: 12px; border-top: 1px solid var(--pfw-linie);
}
.pfw-thema-label { display: inline-flex; align-items: center; gap: 8px; min-width: 0; font-size: 0.84rem; font-weight: 600; color: #3d4757; }
.pfw-thema-label span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pfw-punkt { width: 10px; height: 10px; border-radius: 3px; background: var(--pfw-c); flex: none; }
.pfw-original {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  font-size: 0.86rem; font-weight: 650; color: var(--pfw-akzent); padding: 4px 2px;
}
.pfw-original:hover { color: var(--pfw-tinte); }

.pfw-leer { padding: 48px 20px; text-align: center; border: 1px dashed #c9d0dc; border-radius: var(--pfw-radius); display: grid; gap: 12px; justify-items: center; }
.pfw-leer p { color: var(--pfw-grau); max-width: 46ch; }

.pfw-mehr-zeile { display: flex; justify-content: center; margin-top: 22px; }
.pfw-knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px;
  padding: 11px 22px; border-radius: 999px; font-weight: 650; font-size: 0.98rem;
  background: var(--pfw-akzent); color: #ffffff; transition: background .15s;
}
.pfw-knopf:hover { background: #173d7c; }
.pfw-knopf--zweit { background: var(--pfw-akzent-hell); color: var(--pfw-akzent); }
.pfw-knopf--zweit:hover { background: #d9e3f3; }

/* ---------- Beitragsansicht ---------- */
.pfw-detail { --pfw-c: var(--pfw-akzent); --pfw-t: var(--pfw-akzent-hell); display: grid; gap: 22px; }
.pfw-detail-blatt {
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px;
  padding: 28px; border-radius: var(--pfw-radius); border: 1px solid var(--pfw-linie);
  background: linear-gradient(var(--pfw-t), var(--pfw-t)) top / 100% 8px no-repeat, var(--pfw-papier);
}
.pfw-detail-haupt { display: grid; gap: 16px; align-content: start; min-width: 0; }
.pfw-detail-thema { display: inline-flex; align-items: center; gap: 8px; font-size: 0.82rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--pfw-c); }
.pfw-detail-titel { font-family: var(--pfw-schrift-titel); font-size: clamp(1.6rem, 3.4vw, 2.3rem); line-height: 1.15; font-weight: 750; letter-spacing: -0.015em; text-wrap: balance; }
.pfw-detail-titel:focus { outline: none; }
.pfw-detail-text { font-size: 1.06rem; max-width: 65ch; color: #2a3445; }
.pfw-detail-aktionen { display: flex; flex-wrap: wrap; gap: 10px; }
.pfw-detail-aktionen .pfw-knopf { background: var(--pfw-c); }
.pfw-detail-aktionen .pfw-knopf:hover { filter: brightness(0.9); }
.pfw-detail-aktionen .pfw-knopf--zweit { background: var(--pfw-t); color: var(--pfw-c); }
.pfw-detail-meta { display: grid; gap: 12px; align-content: start; align-self: start; padding: 18px; border-radius: var(--pfw-radius-klein); background: var(--pfw-hauch); }
.pfw-detail-meta div { display: grid; gap: 2px; }
.pfw-detail-meta dt { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #6b7587; }
.pfw-detail-meta dd { font-size: 0.95rem; }
.pfw-detail-meta dd button { color: var(--pfw-akzent); font-weight: 600; text-align: left; }
.pfw-detail-meta dd button:hover { color: var(--pfw-tinte); }
.pfw-detail-unterkopf { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #6b7587; margin-bottom: 8px; }
.pfw-detail-unterkopf + .pfw-schlagwoerter { margin-top: -2px; }

/* ---------- Fuß ---------- */
.pfw-fuss { padding-block: 22px 32px; border-top: 1px solid var(--pfw-linie); font-size: 0.85rem; color: var(--pfw-grau); }
.pfw-fuss .pfw-innen { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: space-between; }

/* ---------- Responsiv ---------- */
@media (max-width: 1080px) {
  .pfw-themen { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pfw-detail-blatt { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .pfw-kopf { padding-block: 28px 18px; }
  .pfw-themen { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .pfw-kachel { display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 14px; row-gap: 4px; padding: 14px 16px; }
  .pfw-kachel-symbol { width: 44px; height: 44px; grid-row: span 2; }
  .pfw-kachel-text { display: none; }
  .pfw-kachel-fuss { grid-column: 2; padding-top: 0; }
  .pfw-themenkopf { padding: 16px; }
  .pfw-themenkopf .pfw-kachel-symbol { width: 44px; height: 44px; }
  .pfw-filter { padding: 10px; }
  .pfw-auswahl-gruppe, .pfw-auswahl { width: 100%; }
  .pfw-auswahl .pfw-select { flex: 1; min-width: 0; width: 100%; }
  .pfw-detail-blatt { padding: 20px 16px; }
  .pfw-suchfeld { height: 52px; font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .pfw-app *, .pfw-app *::before, .pfw-app *::after { transition: none !important; animation: none !important; }
}
