/* finder.css — Pulse. Ein Layout für Games Finder, Lessons Finder und die Sphären-Hubs (Klassen .sf-*).
   Aufbau: Kopf (.sf-head) · Werkzeugleiste, klebt beim Scrollen (.sf-tools: Umschalter, Suche, aktive Filter, Zähler, Sortierung)
   · zweispaltig: Filter-Spalte (.sf-filters, Gruppen auf- und zuklappbar) und Karten (.sf-main). Unter 1024px wird die Filter-Spalte
   zum Panel unter der Werkzeugleiste (Knopf »Filter«). Farben: Violett #380348, Creme #FDFCED, Gelb #FFBC21, Karte var(--color-two).
   Brand-Regel: auf hellen Farben nur violette Schrift (nie Schwarz). Kontrast (WCAG): Violett auf Gelb 9,8:1, Blau 10,1:1, Pink 8,5:1, Türkis 6,3:1 (Creme auf Türkis wären 2,5:1), Zähler mindestens 4,5:1, Rahmen von Bedienelementen rund 3:1. */
.sf { --sf-violet: var(--ghost-accent-color, #380348); --sf-yellow: #FFBC21; --sf-cream: #FDFCED; --sf-line: rgba(56,3,72,.14); --sf-line-strong: rgba(56,3,72,.45); --sf-tools-h: 118px;
  /* Bereichsfarben der Marke (Code Injection setzt sie site-weit, hier nur Fallbacks). Eine Regel: Farbe = Bereich, Violett = deine Auswahl. */
  --sf-articles: var(--ghost-accent-articles, #FFBC21); --sf-lessons: var(--ghost-accent-lessons, #90D2FF); --sf-games: var(--ghost-accent-games, #EAA6C7); --sf-resources: var(--ghost-accent-resources, #00B3C1);
  margin-top: 0; }
.sf-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Kopf: Titel, Lead, Einstieg, Zeile »Aktuell«. Kein Hero-Bild. */
.sf-head { padding: 0 0 4px; max-width: 46em; }
.sf-h1 { font-size: clamp(2.2rem, 4.2vw, 3.4rem); line-height: 1.02; letter-spacing: -.01em; margin: 0 0 .45em; }
.sf-lead { font-size: clamp(1.1rem, 1.5vw, 1.3rem); line-height: 1.45; margin: 0 0 .8em; }
.sf-intro { font-size: 1rem; line-height: 1.55; }
.sf-intro p { margin: 0 0 .7em; opacity: .85; }
.sf-intro p:last-child { margin-bottom: 0; }
.sf-intro ul { list-style: none; margin: .9em 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25em .6em; align-items: baseline; font-size: .95rem; }
.sf-intro ul::before { content: var(--sf-now, "Aktuell:"); font-weight: var(--font-weight-bold); }
.sf-intro li { margin: 0; padding: 0; }
.sf-intro li + li::before { content: "·"; margin-right: .6em; opacity: .5; }
.sf-intro li a { color: var(--color-font-one); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.sf-intro li a:hover { color: var(--sf-violet); }
.sf-intro li strong { font-weight: inherit; }

/* ---------- Werkzeugleiste: zwei Umschalter (Für wen? Was?), dann Suche, Pillen, Zähler, Sortierung */
.sf-tools { position: sticky; top: 0; z-index: 20; background: var(--color-body, #FDFCED); border-bottom: 1px solid var(--sf-line);
  margin: 16px 0 0; padding: 10px 0; display: flex; flex-direction: column; gap: 10px; }
.sf-switches { display: flex; flex-wrap: wrap; gap: 8px 28px; align-items: flex-end; }
.sf-switch-wrap { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sf-switch-label { font-size: .68rem; letter-spacing: .09em; text-transform: uppercase; font-weight: var(--font-weight-bold); opacity: .6; padding-left: 4px; }
.sf-switch button { display: inline-flex; align-items: center; gap: 6px; }
.sf-ico { width: 1.25rem; height: 1.05rem; flex: 0 0 auto; margin-right: 2px; }
.sf-loading, .sf-failed { margin: 12px 0; font-size: .95rem; opacity: .8; }
.sf-loading[hidden], .sf-failed[hidden] { display: none; }
.sf-failed a { color: var(--color-font-one); text-decoration: underline; text-underline-offset: 3px; }
.sf-switch { display: inline-flex; align-self: flex-start; margin: 0; padding: 3px; border-radius: var(--radius-full); background: rgba(56,3,72,.07); max-width: 100%; }
.sf-switch a, .sf-switch button { font: inherit; font-size: .92rem; font-weight: var(--font-weight-bold); line-height: 1.2; padding: .45em 1.15em; border: 0;
  border-radius: var(--radius-full); background: transparent; color: var(--color-font-one); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .15s, color .15s; }
.sf-switch a:hover, .sf-switch button:hover { color: var(--sf-violet); }
.sf-switch a.on, .sf-switch button.on { background: var(--sf-violet); color: var(--sf-cream); }
.sf-switch .on[data-bereich="articles"] { background: var(--sf-articles); color: #380348; }
.sf-switch .on[data-bereich="lessons"] { background: var(--sf-lessons); color: #380348; }
.sf-switch .on[data-bereich="games"] { background: var(--sf-games); color: #380348; }
.sf-switch .on[data-bereich="resources"] { background: var(--sf-resources); color: #380348; }
.sf-tools-row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
#sf-q { flex: 1 1 260px; max-width: 420px; margin: 0; padding: .6em 1.1em; font: inherit; font-size: 1rem; color: var(--color-font-one);
  background: var(--color-two, #F5F3E0); border: 1.5px solid var(--color-font-one); border-radius: var(--radius-full); }
#sf-q:focus { outline: 3px solid rgba(56,3,72,.22); }
.sf-active { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 auto; }
.sf-active button { font: inherit; font-size: .8rem; line-height: 1.2; padding: .3em .75em .3em .85em; border: 0; border-radius: var(--radius-full);
  background: var(--sf-violet); color: var(--sf-cream); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.sf-active button b { font-weight: 400; opacity: .7; }
.sf-active button:hover b { opacity: 1; }
.sf-status { display: flex; gap: 12px; align-items: center; font-size: .92rem; flex: 0 0 auto; white-space: nowrap; }
#sf-reset { font: inherit; font-size: .85rem; background: none; border: none; cursor: pointer; color: var(--color-font-one); text-decoration: underline; text-underline-offset: 3px; padding: 0; }
.sf-sort-wrap { margin: 0; }
.sf-sort { font: inherit; font-size: .88rem; padding: .45em 2em .45em .9em; cursor: pointer; border: 1.5px solid var(--sf-line-strong); border-radius: var(--radius-full);
  background: transparent; color: var(--color-font-one); appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23380348' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .7em center; background-size: .8em; }
.sf-sort:focus { outline: 3px solid rgba(56,3,72,.22); }
.sf-filter-toggle { display: none; }
.sf-n[hidden] { display: none; }
.sf-n { display: inline-block; font-size: .7rem; line-height: 1.4; background: var(--sf-yellow); color: #380348; border-radius: var(--radius-full); padding: .1em .55em; letter-spacing: 0; }

/* ---------- Zwei Spalten: Filter links, Karten rechts */
.sf-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 36px; align-items: start; padding: 22px 0 0; }
.sf-filters { position: sticky; top: calc(var(--sf-tools-h) + 14px); max-height: calc(100vh - var(--sf-tools-h) - 30px); overflow: auto; padding-right: 6px; scrollbar-width: thin; }
.sf-filters .sf-group { padding: 10px 0 12px; border-bottom: 1px solid var(--sf-line); }
.sf-group[hidden] { display: none; }
.sf-filters .sf-group:last-child { border-bottom: 0; }
.sf-label { display: flex; align-items: center; gap: 8px; width: 100%; padding: 4px 0; margin: 0; cursor: pointer; text-align: left;
  font: inherit; font-size: .74rem; letter-spacing: .09em; text-transform: uppercase; font-weight: var(--font-weight-bold); opacity: .85;
  background: none; border: 0; color: var(--color-font-one); }
.sf-label .sf-n { margin-left: auto; }
.sf-label::after { content: ""; width: 8px; height: 8px; margin-left: 4px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); opacity: .6; transition: transform .15s; }
.sf-label .sf-n[hidden] { display: none; }
.sf-group.is-closed .sf-label::after { transform: rotate(-45deg); }
.sf-group.is-closed .sf-chips { display: none; }
.sf-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sf-chips button { font: inherit; font-size: .8rem; padding: .3em .8em; cursor: pointer; border: 1px solid var(--sf-line-strong); border-radius: var(--radius-full);
  background: transparent; color: var(--color-font-one); transition: background .15s, color .15s, border-color .15s; }
.sf-chips button:hover { border-color: var(--color-font-one); }
.sf-chips button.on { background: var(--sf-violet); border-color: var(--sf-violet); color: var(--sf-cream); }
.sf-chips button[title] { cursor: help; }
.sf-c { font-size: .78em; opacity: .75; margin-left: .4em; font-variant-numeric: tabular-nums; } /* Deckkraft .75: Zähler bleiben über 4,5:1, auch auf Gelb, Pink und Türkis */
.sf-c[hidden] { display: none; }
.sf-chips button.on .sf-c { opacity: .85; }
.sf-chips button.is-empty, .sf-switch button.is-empty { opacity: .45; cursor: default; } /* gesperrt, aber noch lesbar (rund 3:1) */
.sf-chips button.is-empty:hover { border-color: var(--sf-line-strong); }
.sf-switch button .sf-c { opacity: .7; }
.sf-switch button.on .sf-c { opacity: .85; }
.sf-select { width: 100%; margin-top: 8px; font: inherit; font-size: .82rem; padding: .35em 2.2em .35em .95em; cursor: pointer; max-width: 100%;
  border: 1px solid var(--sf-line-strong); border-radius: var(--radius-full); background: transparent; color: var(--color-font-one); appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23380348' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .7em center; background-size: .9em; }
.sf-select.on { background-color: var(--sf-violet); color: var(--sf-cream); border-color: var(--sf-violet); }
.sf-select:focus { outline: 3px solid rgba(56,3,72,.22); }

/* ---------- Merkliste: Beschriftung wie die Filter-Gruppen, Einträge als Pillen mit rundem Bild */
.sf-pinned { margin: 0 0 20px; padding: 12px 16px 14px; background: var(--color-two, #F5F3E0); border-radius: var(--radius-medium); }
.sf-pinned-label { display: flex; align-items: center; gap: 8px; margin: 0; font-size: .74rem; letter-spacing: .09em; text-transform: uppercase; font-weight: var(--font-weight-bold); opacity: .85; }
.sf-pinned-label svg { width: 1rem; height: 1rem; flex: 0 0 auto; }
.sf-pinned-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.sf-pinned-item { display: inline-flex; align-items: center; gap: .55rem; padding: .25rem .35rem .25rem .25rem; background: var(--color-body, #FDFCED); border-radius: var(--radius-full);
  text-decoration: none; color: var(--color-font-one); font-size: .88rem; font-weight: var(--font-weight-bold); line-height: 1.25; max-width: 100%; }
.sf-pinned-item span { padding: .1rem 0; }
.sf-pinned-item img { width: 1.9rem; height: 1.9rem; border-radius: var(--radius-full); object-fit: cover; margin: 0; flex: 0 0 auto; }
.sf-pinned-item:hover span { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.sf-unpin { width: 1.6rem; height: 1.6rem; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; border: none; border-radius: var(--radius-full); background: none; cursor: pointer;
  color: var(--color-font-one); font-size: .8rem; line-height: 1; padding: 0; opacity: .55; }
.sf-unpin:hover { opacity: 1; background: rgba(56,3,72,.1); }

/* ---------- Karten: ruhig, Bild und Titel tragen, erstes Badge gelb. Raster erst sichtbar, wenn finder.js sortiert hat (kein Springen); ohne JS zeigt noscript im Template */
.sf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; visibility: hidden; }
.sf.is-ready .sf-grid { visibility: visible; }
.sf-empty { margin: 0 0 18px; padding: 28px 20px; text-align: center; background: var(--color-two, #F5F3E0); border-radius: var(--radius-medium); font-size: 1rem; }
.sf-empty button { font: inherit; font-size: .95rem; margin-left: .6em; padding: .45em 1.1em; cursor: pointer; border: 1.5px solid var(--color-font-one); border-radius: var(--radius-full); background: transparent; color: var(--color-font-one); }
.sf-empty button:hover { background: var(--sf-violet); border-color: var(--sf-violet); color: var(--sf-cream); }
.sf-empty[hidden] { display: none; }
.sf-empty-sub { display: block; margin-top: 12px; font-size: .92rem; opacity: .8; }
.sf-empty-sub[hidden] { display: none; }
.sf-card { position: relative; display: flex; flex-direction: column; padding: 0; text-decoration: none; color: var(--color-font-one); border-radius: var(--radius-medium); }
.sf-card.off { display: none; }
.sf-card:hover .sf-title { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.sf-imgwrap { display: block; width: 100%; aspect-ratio: 16/9; overflow: hidden; border-radius: var(--radius-medium); background: var(--color-two, #F5F3E0); }
.sf-img { display: block; width: 100%; height: 100%; object-fit: cover; margin: 0; }
.sf-body { display: flex; flex-direction: column; gap: 6px; padding: 12px 4px 4px; flex: 1 1 auto; }
.sf-title { font-weight: var(--font-weight-bold); font-size: 1.02rem; line-height: 1.25; }
.sf-excerpt { font-size: .88rem; opacity: .7; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sf-badges { order: -1; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.sf-badges:empty { display: none; }
.sf-badges em { font-style: normal; font-size: .7rem; letter-spacing: .02em; padding: .2em .6em; border-radius: var(--radius-full); background: rgba(56,3,72,.08); }
.sf-badges em:first-child { font-weight: var(--font-weight-bold); }
.sf-badges em.sf-b-articles { background: var(--sf-articles); color: #380348; }
.sf-badges em.sf-b-lessons { background: var(--sf-lessons); color: #380348; }
.sf-badges em.sf-b-games { background: var(--sf-games); color: #380348; }
.sf-badges em.sf-b-resources { background: var(--sf-resources); color: #380348; }
.sf-pin { position: absolute; top: .6rem; right: .6rem; width: 2.25rem; height: 2.25rem; padding: 0; display: flex; align-items: center; justify-content: center; cursor: pointer;
  border: none; border-radius: var(--radius-full); background: rgba(253,252,237,.92); color: var(--color-font-one); transition: background .15s, color .15s; }
.sf-pin svg { width: 1.125rem; height: 1.125rem; display: block; }
.sf-pin[aria-pressed="true"] { background: var(--sf-violet); color: var(--sf-yellow); }
.sf-pin[aria-pressed="true"] svg path { fill: currentColor; }
.sf-pin:hover { background: var(--sf-yellow); color: #380348; }
.sf-pin[aria-pressed="true"]:hover { background: rgba(253,252,237,.92); color: var(--color-font-one); }
.sf-pin[aria-pressed="true"]:hover svg path { fill: none; }
.sf-more-wrap { text-align: center; margin-top: 28px; }
#sf-more { font: inherit; font-size: 1rem; padding: .6em 1.6em; cursor: pointer; border: 2px solid var(--color-font-one); border-radius: var(--radius-full);
  background: transparent; color: var(--color-font-one); transition: background .15s, color .15s; }
#sf-more:hover { background: var(--sf-violet); border-color: var(--sf-violet); color: var(--sf-cream); }
.sf-toast { position: fixed; left: 50%; bottom: 2rem; transform: translateX(-50%); z-index: 90; background: var(--sf-violet); color: var(--sf-cream); font-size: .95rem;
  padding: .7em 1.4em; border-radius: var(--radius-full); box-shadow: 0 6px 24px rgba(56,3,72,.25); }
.sf-toast a { color: var(--sf-yellow); text-decoration: underline; }

/* ---------- Handy und Tablet: Filter als Panel unter der Werkzeugleiste, Einstieg eingeklappt */
@media (max-width: 1024px) {
  .sf-intro p { display: none; }
  .sf-intro ul { margin-top: 0; }
  .sf-layout { grid-template-columns: 1fr; gap: 16px; padding-top: 14px; }
  .sf-filters { position: static; max-height: none; display: none; padding: 4px 0 0; }
  .sf-filters.is-open { display: block; }
  .sf-filter-toggle { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: .9rem; font-weight: var(--font-weight-bold); padding: .55em 1em;
    border: 1.5px solid var(--color-font-one); border-radius: var(--radius-full); background: transparent; color: var(--color-font-one); cursor: pointer; }
  .sf-filter-toggle[aria-expanded="true"] { background: var(--color-font-one); color: var(--color-body, #FDFCED); }
  .sf-tools { position: static; }
  .sf-switches { flex-direction: column; align-items: stretch; gap: 8px; }
  .sf-switch { align-self: stretch; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
  .sf-switch .sf-c { display: none; } /* Zähler stehen am Handy an den Chips, nicht in den Umschaltern (Platz) */
  .sf-switch a, .sf-switch button { flex: 1 0 auto; text-align: center; font-size: .84rem; padding: .45em .8em; }
  #sf-q { max-width: none; flex-basis: 100%; }
  .sf-status { flex: 1 1 auto; white-space: normal; gap: 10px; font-size: .88rem; }
  .sf-sort { font-size: .84rem; padding-left: .8em; }
  .sf-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
  .sf-title { font-size: .95rem; }
  .sf-excerpt { display: none; }
}
@media (max-width: 480px) { .sf-grid { grid-template-columns: 1fr 1fr; } }
