/* Sprachzauber – Motivwahl nach Anlass (zu assets/js/sz-motivwahl.js).
   Nutzt die Seiten-Tokens --brand, --brand2, --line, --card, --solid, --shadow2, --focus, --soft, --muted, --text;
   --mpFade = Farbe der weichen Chip-Kanten (Standard: --bg). */
.mp { min-width: 0; }

/* ---------- Anlass-Chips ---------- */
.mpChipsWrap { position: relative; min-width: 0; }
.mpChips {
  display: flex; gap: 8px; overflow-x: auto; overflow-y: hidden;
  padding: 4px 2px 10px; scroll-snap-type: x proximity; scrollbar-width: none;
  -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
}
.mpChips::-webkit-scrollbar { display: none; }
/* Weiche Kante = „hier geht's weiter" */
.mpChipsWrap::before, .mpChipsWrap::after {
  content: ""; position: absolute; top: 0; bottom: 10px; width: 34px; pointer-events: none;
  opacity: 0; transition: opacity .2s ease; z-index: 1;
}
.mpChipsWrap::before { left: 0; background: linear-gradient(90deg, var(--mpFade, var(--bg, #fff8f4)), transparent); }
.mpChipsWrap::after { right: 0; background: linear-gradient(270deg, var(--mpFade, var(--bg, #fff8f4)), transparent); }
.mpChipsWrap.canPrev::before, .mpChipsWrap.canNext::after { opacity: 1; }

.mpChip {
  position: relative; flex: 0 0 auto; scroll-snap-align: start;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 13px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--card); color: var(--text); font: inherit; font-size: 14px; font-weight: 800;
  cursor: pointer; white-space: nowrap; box-shadow: 0 4px 12px rgba(0, 0, 0, .04);
  transition: border-color .15s ease, background .15s ease, color .15s ease, transform .1s ease;
}
.mpChip:hover { border-color: var(--brand2); transform: translateY(-1px); }
.mpChip:focus-visible { outline: 0; box-shadow: var(--focus); }
.mpChipEmoji { font-size: 16px; line-height: 1; }
.mpChipCount {
  min-width: 22px; padding: 2px 7px; border-radius: 999px; text-align: center;
  background: rgba(233, 75, 125, .10); color: var(--brand); font-size: 12px; font-weight: 900;
}
.mpChip[aria-pressed="true"] {
  background: var(--brand); border-color: var(--brand); color: #fff;
  box-shadow: 0 8px 18px rgba(233, 75, 125, .28);
}
.mpChip[aria-pressed="true"] .mpChipCount { background: rgba(255, 255, 255, .25); color: #fff; }
.mpChipNow {
  position: absolute; top: -8px; right: 8px; padding: 1px 7px; border-radius: 999px;
  background: var(--yellow, #ffd84d); color: #4a3a00; font-size: 10px; font-weight: 900; letter-spacing: .02em;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .12);
}
.mpChips:has(.mpChipNow) { padding-top: 12px; }
/* Gewähltes Motiv liegt in dieser (gerade nicht offenen) Kategorie */
.mpChip.hasSelection::after {
  content: "✓"; position: absolute; left: -3px; top: -5px; width: 17px; height: 17px; border-radius: 50%;
  background: var(--brand); color: #fff; font-size: 10px; font-weight: 900; display: grid; place-items: center;
  box-shadow: 0 2px 6px rgba(233, 75, 125, .4);
}

.mpChipsNav {
  display: none; position: absolute; top: calc(50% - 5px); transform: translateY(-50%); z-index: 2;
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--solid, var(--bg, #fff)); color: var(--brand); font-size: 20px; font-weight: 900; line-height: 1;
  cursor: pointer; box-shadow: 0 6px 14px rgba(0, 0, 0, .12);
}
.mpChipsNav.prev { left: -6px; }
.mpChipsNav.next { right: -6px; }
@media (hover: hover) and (pointer: fine) {
  .mpChipsWrap.canPrev .mpChipsNav.prev, .mpChipsWrap.canNext .mpChipsNav.next { display: grid; place-items: center; }
}

.mpStatus { margin: 2px 2px 10px; color: var(--soft); font-size: 12.5px; font-weight: 700; }

/* ---------- Motiv-Kacheln ---------- */
.mpTile {
  position: relative; display: flex; flex-direction: column; align-self: start; min-width: 0; padding: 5px; border: 2px solid var(--line); border-radius: 15px;
  background: var(--card); cursor: pointer; text-align: left; font: inherit; color: inherit;
  box-shadow: var(--shadow2); transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
}
.mpTile:hover { transform: translateY(-2px); border-color: var(--brand2); }
.mpTile:focus-visible { outline: 0; box-shadow: var(--focus); }
.mpTile[aria-pressed="true"] { border-color: var(--brand); box-shadow: 0 10px 22px rgba(233, 75, 125, .22); }
.mpTile[aria-pressed="true"]::after {
  content: "✓"; position: absolute; top: 10px; right: 10px; width: 21px; height: 21px; border-radius: 50%;
  background: var(--brand); color: #fff; font-size: 12px; font-weight: 900; display: grid; place-items: center;
  box-shadow: 0 4px 10px rgba(233, 75, 125, .4);
}
.mpTileImg {
  position: relative; display: block; width: 100%; aspect-ratio: 1507 / 1044; border-radius: 10px; overflow: hidden;
  background: linear-gradient(100deg, rgba(233, 75, 125, .07) 30%, rgba(233, 75, 125, .16) 50%, rgba(233, 75, 125, .07) 70%);
  background-size: 300% 100%; animation: mpShimmer 1.2s ease-in-out infinite;
}
.mpTileImg.loaded, .mpTileImg.failed { animation: none; }
.mpSquare .mpTileImg { aspect-ratio: 1 / 1; }   /* Einzelkarte: quadratisches Fenster */
/* absolut, damit die width/height-Attribute die Kachelhöhe nicht aufblähen */
.mpTileImg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .25s ease; }
.mpTileImg.loaded img { opacity: 1; }
@keyframes mpShimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .mpTileImg { animation: none; } .mpTileImg img { transition: none; } }
.mpTileName {
  display: block; padding: 6px 3px 1px; color: var(--muted); font-size: 11.5px; font-weight: 800; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mpTile[aria-pressed="true"] .mpTileName { color: var(--brand); }

/* Variante A: Leiste (wie bisher, aber nur die Motive EINER Kategorie) */
.isStrip .mpTiles {
  display: flex; gap: 10px; overflow-x: auto; overflow-y: hidden; padding: 4px 2px 10px;
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
}
/* Handy: gut 1½ Kacheln sichtbar – die angeschnittene zeigt „hier geht's weiter" */
.isStrip .mpTile { flex: 0 0 clamp(140px, 58%, 190px); width: clamp(140px, 58%, 190px); scroll-snap-align: start; }
.isStrip .mpTiles::-webkit-scrollbar { height: 7px; }
.isStrip .mpTiles::-webkit-scrollbar-track { background: rgba(0, 0, 0, .05); border-radius: 999px; }
.isStrip .mpTiles::-webkit-scrollbar-thumb { background: rgba(233, 75, 125, .45); border-radius: 999px; }
.mpSwipe { margin: 0; text-align: center; color: var(--soft); font-size: 12px; }
@media (hover: hover) and (pointer: fine) { .mpSwipe { display: none; } }

/* Variante B: Raster mit „Alle anzeigen" */
.isGrid .mpTiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
@media (max-width: 420px) { .isGrid .mpTiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mpMore {
  display: block; width: 100%; margin-top: 10px; padding: 11px 14px; border-radius: 14px;
  border: 1.5px dashed rgba(233, 75, 125, .45); background: transparent; color: var(--brand);
  font: inherit; font-size: 14px; font-weight: 900; cursor: pointer;
}
.mpMore:hover { background: rgba(233, 75, 125, .06); }
.mpMore:focus-visible { outline: 0; box-shadow: var(--focus); }

.mpError .mpStatus { color: #c0392b; }
