/* widget.css: Gestaltung des Veranstaltungs-Widgets (widget.php), statischer
   Teil (W1: vorher inline im Template). Die Einstellungen der Instanz - Thema-
   farbe --primary, Hintergrund, Ecken, Schrift - setzt das Widget als dynamische
   Variablen dazu (partials/_stil_widget.php im <head> der StandaloneLayout). */
#scp-wrap { padding: 4px 2px 14px; }
.w-search {
  display: flex; align-items: center; gap: 9px;
  background: #f5f5f5; border: 1px solid #e6e6e6; border-radius: var(--w-r-pill);
  padding: 10px 16px; margin-bottom: 22px;
}
.w-search svg { flex: 0 0 auto; color: var(--primary); }
.w-search input {
  flex: 1; border: 0; background: transparent; font: inherit; color: #222; outline: none;
}

/* Kategorien-Filter-Reiter (aktivierbar per ?tabs=1). Horizontal scrollbar,
   damit bei vielen Kategorien nichts umbricht. Aktiver Tab in Vereinsfarbe. */
.w-tabs {
  display: flex; gap: 8px; overflow-x: auto;
  margin: 0 0 18px; padding-bottom: 4px;
  scrollbar-width: thin;
}
.w-tabs::-webkit-scrollbar { height: 6px; }
.w-tabs::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15); border-radius: var(--w-r-sm); }
.w-tab {
  flex: 0 0 auto;
  padding: 8px 16px;
  border-radius: var(--w-r-pill);
  background: #f2f2f2;
  color: #333; text-decoration: none;
  font-size: 14px; font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background .15s, color .15s, transform .1s;
}
.w-tab:hover { background: #e6e6e6; transform: translateY(-1px); }
.w-tab.is-active {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.w-tab.is-active:hover { background: var(--primary); transform: none; cursor: default; }
.w-month {
  margin: 26px 0 10px; padding-bottom: 6px;
  font-size: 21px; font-weight: 700; color: #1c1c1c;
  border-bottom: 2px solid #d9d9d9;
}
.w-group:first-of-type .w-month { margin-top: 0; }
.w-row {
  position: relative;
  display: flex; align-items: center; gap: 16px;
  background: #fff; border: 1px solid #ececec; border-radius: var(--w-r-md);
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
  padding: 14px 16px; margin-bottom: 14px;
  text-decoration: none; color: inherit;
  transition: transform .15s ease, box-shadow .15s ease;
}
.w-row:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.10); }
.w-archived { cursor: default; }
.w-archived:hover { transform: none; box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.w-date {
  flex: 0 0 88px; text-align: center;
  color: var(--primary); font-weight: 700; font-size: 16px;
}
/* Monatsname in der Datumsspalte: volle Form, auf schmalen Raendern die Kurzform */
.w-m-abbr { display: none; }
@media (max-width: 700px) {
  .w-m-full { display: none; }
  .w-m-abbr { display: inline; }
}
.w-thumb {
  flex: 0 0 150px; height: 96px; overflow: hidden; border-radius: var(--w-r-sm); background: #f2f2f2;
}
.w-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Platzhalter bei fehlendem Bild: gleiche Groesse wie .w-thumb, dezentes Grau mit Symbol */
.w-thumb-empty { display: flex; align-items: center; justify-content: center; color: #c9c9cd; }
.w-thumb-empty svg { width: 34px; height: 34px; }
.w-main { flex: 1; min-width: 0; padding-right: 120px; }
.w-title { font-weight: 700; font-size: 16.5px; margin-bottom: 2px; }
.w-when { color: #333; font-size: 14px; }
.w-loc { display: flex; align-items: center; gap: 5px; color: #444; font-size: 14px; margin-top: 1px; }
.w-loc svg { flex: 0 0 auto; color: #666; }
.w-deadline { color: var(--primary); font-size: 13.5px; margin-top: 3px; }
.w-pill {
  position: absolute; top: 12px; right: 14px;
  font-size: 12.5px; font-weight: 700; padding: 4px 12px; border-radius: var(--w-r-md); white-space: nowrap;
}
.p-red      { background: #d21f2c; color: #fff; }
.p-primary  { background: var(--primary); color: #fff; }
.p-yellow { background: #ffd23f; color: #4a3a00; }
.p-green  { background: #2e9e46; color: #fff; }
.p-gray   { background: #e8e8e8; color: #555; }
.w-price {
  position: absolute; right: 16px; bottom: 14px;
  color: var(--primary); font-weight: 800; font-size: 16px; white-space: nowrap;
}
.w-empty { text-align: center; color: #777; padding: 34px 0; }
@media (max-width: 620px) {
  .w-row { display: block; padding: 44px 14px 14px; }
  .w-date { display: none; } /* Datum steht bereits in der Zeitzeile */
  .w-thumb { width: 100%; height: 150px; margin-bottom: 10px; }
  .w-main { padding-right: 0; }
  .w-title { font-size: 16px; }
  .w-price {
    position: static; display: block;
    text-align: right; margin-top: 10px; font-size: 17px;
  }
  .w-pill { top: 10px; right: 10px; }
}

/* ===== Darstellungsformen ===== */

/* Terminliste: kompakte graue Zeilen, kein Bild, kein Datum links, Preis rechts */
.view-terminliste .w-thumb { display: none; }
.view-terminliste .w-date { display: none; }
.view-terminliste .w-row {
  padding: 14px 16px; margin-bottom: 10px; gap: 12px;
  background: #d9d9d9; border: none; box-shadow: none; border-radius: var(--w-r-md);
}
.view-terminliste .w-row:hover { transform: none; box-shadow: none; background: #d0d0d0; }
.view-terminliste .w-main { padding-right: 90px; }
.view-terminliste .w-title { font-size: 16px; font-weight: 700; }
.view-terminliste .w-when { font-size: 13px; color: #333; }
.view-terminliste .w-loc,
.view-terminliste .w-deadline { display: none; }
.view-terminliste .w-price { color: var(--primary); font-weight: 800; }
.view-terminliste .w-month { font-size: 18px; margin: 18px 0 8px; }

/* Kalenderliste: chronologisch, etwas dichter als Standard, Bild kleiner */
.view-kalenderliste .w-thumb { flex: 0 0 100px; height: 68px; }
.view-kalenderliste .w-row { padding: 12px 14px; margin-bottom: 10px; }

/* Wochenplan (Paket 88): Tage als Spalten, Zeitfenster als Zeilen, parallele Kurse nebeneinander,
   Kategorie-Filter oben, Popup beim Klick. Farben je Kategorie (categories.farbe), sonst Vereinsfarbe. */
.wp-root { }
.wp-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.wp-chip { --chip: var(--primary); border: 1.5px solid var(--chip); background: transparent; color: var(--chip);
  border-radius: 999px; padding: 6px 14px; font-size: 12.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; cursor: pointer; }
.wp-chip.is-on { background: var(--chip); color: #fff; }
.wp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.wp-day { border: 1px solid #e5e5ea; border-radius: var(--w-r-md); overflow: hidden; background: #fff; }
.wp-day.wp-empty { display: none; }
.wp-dayhead { background: var(--primary); color: #fff; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; padding: 12px 14px; font-size: 14px; }
.wp-slot { padding: 10px 12px; border-top: 1px solid #f0f0f2; }
.wp-slot.wp-hide { display: none; }
.wp-time { font-size: 11.5px; letter-spacing: .1em; color: #6b6b70; margin-bottom: 6px; font-weight: 600; }
/* Kacheln: mindestens 150 px breit - bei drei parallelen Kursen in einer 250-px-Spalte
   also zwei nebeneinander und eine darunter, statt drei zerquetschter mit
   abgeschnittenen Titeln (Paket 88, Korrektur). */
.wp-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.wp-item { --cat: var(--primary); text-align: left; border: 1px solid rgba(0,0,0,.06); border-left: 4px solid var(--cat); border-radius: var(--w-r-sm, 6px);
  background: color-mix(in srgb, var(--cat) 12%, #fff); padding: 8px 10px; cursor: pointer; font: inherit; width: 100%; min-width: 0; overflow: hidden; }
@supports not (background: color-mix(in srgb, red 10%, white)) { .wp-item { background: #f7f7f9; } }
.wp-item:hover { box-shadow: 0 3px 10px rgba(0,0,0,.12); }
.wp-item.wp-hide { display: none; }
.wp-title { font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .01em; color: #1d1d1f; line-height: 1.2;
  overflow-wrap: anywhere; hyphens: auto; }
/* "MasterClass" als kleines Etikett statt im Titel - der Kursname bleibt kurz */
.wp-title .wp-mc { display: block; font-size: 9.5px; letter-spacing: .12em; opacity: .7; margin-bottom: 2px; }
.wp-trainer { font-size: 12px; color: #6b6b70; margin-top: 3px; }
.wp-once-head { margin: 22px 0 8px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: 13px; color: #1d1d1f; }
.wp-once { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
/* Popup */
.wp-ov { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; z-index: 9999; padding: 16px; }
.wp-ov[hidden] { display: none; }
.wp-dlg { position: relative; background: #fff; color: #1d1d1f; border-radius: var(--w-r-lg, 12px); max-width: 520px; width: 100%; max-height: 90vh; overflow: auto; padding: 24px 26px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.wp-x { position: absolute; top: 10px; right: 12px; border: 0; background: transparent; font-size: 26px; line-height: 1; cursor: pointer; color: #6b6b70; }
.wp-h { margin: 0 24px 6px 0; font-size: 22px; font-weight: 800; text-transform: uppercase; letter-spacing: .02em; }
.wp-sub { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: #6b6b70; margin-bottom: 14px; }
.wp-desc { font-size: 14.5px; line-height: 1.5; white-space: pre-line; margin: 0 0 14px; }
.wp-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 0 0 18px; padding-top: 14px; border-top: 1px solid #eee; }
.wp-meta dt { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #6b6b70; }
.wp-meta dd { margin: 2px 0 0; font-size: 14px; }
.wp-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.wp-btn { display: inline-block; padding: 12px 18px; font-size: 12.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; border-radius: var(--w-r-sm, 6px); text-decoration: none; cursor: pointer; font-family: inherit; }
.wp-btn-p { background: var(--primary); color: #fff; border: 2px solid var(--primary); }
.wp-btn-o { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.wp-preise { margin: 12px 0 0; padding: 12px; background: #f7f7f9; border-radius: var(--w-r-sm, 6px); font: 13.5px/1.5 inherit; white-space: pre-line; }
body.wp-lock { overflow: hidden; }
@media (max-width: 640px) {
  .wp-grid { grid-template-columns: 1fr; }
  /* Am Handy hoechstens zwei Kacheln nebeneinander - drei zerquetschen die Titel */
  .wp-items { grid-template-columns: 1fr 1fr; }
  .wp-title { font-size: 12.5px; }
  .wp-dlg { padding: 20px 18px; }
}
@media (max-width: 380px) { .wp-items { grid-template-columns: 1fr; } }

/* (alt) Wochenplan: 7-Spalten-Raster – bleibt fuer Archiv/Fallback */
#scp-wrap.view-wochenplan { }
.view-wochenplan .w-weekgrid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 0;
  border: 1px solid #e5e5ea; border-radius: var(--w-r-md); overflow: hidden;
}
.view-wochenplan .w-daycol { border-left: 1px solid #eee; min-height: 150px; }
.view-wochenplan .w-daycol:first-child { border-left: none; }
.view-wochenplan .w-dayhead {
  text-align: center; font-size: 14px; font-weight: 600; color: #333;
  padding: 12px 4px; border-bottom: 1px solid #eee;
}
.view-wochenplan .w-daybody { padding: 8px 6px; }
.view-wochenplan .w-month {
  font-size: 19px; color: var(--primary); border-bottom-color: var(--primary);
}
/* Termin-Block in der Tagesspalte */
.view-wochenplan .w-row {
  display: block; padding: 8px 10px; margin: 0 0 8px; gap: 0;
  background: var(--primary); border: none; border-radius: var(--w-r-sm);
  box-shadow: none; color: #fff;
}
.view-wochenplan .w-row:hover { transform: none; box-shadow: 0 3px 8px rgba(0,0,0,.2); }
.view-wochenplan .w-thumb,
.view-wochenplan .w-date,
.view-wochenplan .w-loc,
.view-wochenplan .w-deadline,
.view-wochenplan .w-price { display: none; }
.view-wochenplan .w-main { padding: 0; }
.view-wochenplan .w-title { font-size: 14px; font-weight: 700; color: #fff; margin-bottom: 3px; }
.view-wochenplan .w-when { font-size: 12px; color: rgba(255,255,255,.9); }
.view-wochenplan .w-pill {
  position: static; display: inline-block; margin-top: 4px;
  background: rgba(255,255,255,.25); color: #fff; font-size: 11px; padding: 2px 8px;
}
@media (max-width: 700px) {
  .view-wochenplan .w-weekgrid { grid-template-columns: 1fr; }
  .view-wochenplan .w-daycol { border-left: none; border-top: 1px solid #eee; min-height: 0; }
  .view-wochenplan .w-daycol:first-child { border-top: none; }
}

/* ===== Kachel-Ansichten (Terminübersicht & Angebotsübersicht) ===== */
/* Saubere, gleichmäßige Karten: Bild oben (oder farbiger Kopf), darunter Titel + Details. */
.view-terminuebersicht .w-group,
.view-angebotsuebersicht .w-group {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.view-terminuebersicht .w-group {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}
/* Karte: vertikaler Aufbau, gleiche Struktur mit/ohne Bild */
.view-terminuebersicht .w-row,
.view-angebotsuebersicht .w-row {
  display: flex; flex-direction: column; padding: 0; margin: 0; gap: 0;
  overflow: hidden; border: 1px solid #e9e9ec; border-radius: var(--w-r-lg);
  background: #fff; position: relative;
}
.view-terminuebersicht .w-row:hover,
.view-angebotsuebersicht .w-row:hover {
  transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.10);
}
/* Bildkopf */
.view-terminuebersicht .w-thumb,
.view-angebotsuebersicht .w-thumb {
  display: block; flex: none; width: 100%; height: 140px; border-radius: 0; margin: 0;
}
.view-terminuebersicht .w-thumb img,
.view-angebotsuebersicht .w-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Kacheln OHNE Bild: farbiger Kopfbalken statt Bild, damit alle Karten gleich wirken */
.view-terminuebersicht .w-row.no-img::before,
.view-angebotsuebersicht .w-row.no-img::before {
  content: ""; display: block; height: 8px; background: var(--primary);
}
/* In den Kachel-Ansichten ersetzt die Farbbalken-Leiste den leeren Thumb-Platzhalter */
.view-terminuebersicht .w-row.no-img .w-thumb,
.view-angebotsuebersicht .w-row.no-img .w-thumb { display: none; }
/* Datum links oben ausblenden (steht in der Zeitzeile) */
.view-terminuebersicht .w-date,
.view-angebotsuebersicht .w-date { display: none; }
/* Textbereich */
.view-terminuebersicht .w-main,
.view-angebotsuebersicht .w-main {
  display: flex; flex-direction: column; gap: 4px;
  padding: 12px 14px 14px; margin: 0; flex: 1 1 auto;
}
/* Titel immer als normaler Text über den Details (kein Overlay – ruhiger & lesbarer) */
.view-terminuebersicht .w-title,
.view-angebotsuebersicht .w-title {
  position: static; order: -1; margin: 0 0 2px; padding: 0;
  color: var(--ink, #1d1d1f); font-size: 16px; font-weight: 700; line-height: 1.25;
  background: none; text-shadow: none;
}
.view-angebotsuebersicht .w-title { font-size: 15px; }
.view-terminuebersicht .w-when,
.view-angebotsuebersicht .w-when { font-size: 13.5px; color: #444; }
.view-terminuebersicht .w-loc,
.view-angebotsuebersicht .w-loc { font-size: 12.5px; color: #666; margin: 0; }
.view-terminuebersicht .w-deadline,
.view-angebotsuebersicht .w-deadline { display: none; }
/* Status-Pille oben rechts auf dem Bildkopf */
.view-terminuebersicht .w-pill,
.view-angebotsuebersicht .w-pill {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
/* Preis unten, klar abgesetzt */
.view-terminuebersicht .w-price,
.view-angebotsuebersicht .w-price {
  position: static; display: block; text-align: right;
  margin-top: auto; padding-top: 8px; font-size: 16px; font-weight: 800; color: var(--primary);
}
.view-angebotsuebersicht .w-thumb { height: 130px; }
