/* Vokabeln 2go – Lernempfehlungen v1.0 (2026-11-21)
   Gestalterische Referenz: Overlay von schulspanisch.de, übertragen auf die
   Apple-Palette von Vokabeln 2go (hell #f5f5f7 / dunkel #1c1c1e, Akzent #e34b43).
   Keine Fremdbibliothek. Overlay ist ein natives <dialog> (Top-Layer),
   deshalb braucht es keinen z-index. Nur der Floating Button hat einen:
   900 – unter Cookie-Banner (9999) und Navigation (100000). */

.slr-dialog{
  --slr-bg:#fff; --slr-soft:#f5f5f7; --slr-text:#1d1d1f; --slr-muted:#6e6e73;
  --slr-line:#e5e5ea; --slr-accent:#e34b43; --slr-ink:#45454a;
  width:min(100% - 24px,860px); max-height:calc(100dvh - 24px); padding:0;
  border:0; border-radius:clamp(20px,2vw,28px); overflow:hidden;
  background:var(--slr-bg); color:var(--slr-text);
  box-shadow:0 18px 60px rgb(16 24 40 / .18);
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Display","Segoe UI",sans-serif;
}
.slr-dialog::backdrop{background:rgb(18 20 24 / .42);backdrop-filter:blur(4px)}
.slr-panel{display:flex;flex-direction:column;gap:18px;padding:clamp(18px,2.4vw,30px);max-height:calc(100dvh - 24px);overflow:hidden}

/* Kopf */
.slr-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}
.slr-overline{margin:0 0 6px;color:var(--slr-accent);font-size:.76rem;font-weight:700;letter-spacing:.14em;text-transform:uppercase}
.slr-head h2{margin:0;font-size:clamp(1.35rem,2.4vw,1.9rem);font-weight:700;letter-spacing:-.03em;line-height:1.1}
.slr-head p#slr-subtitle{margin:6px 0 0;color:var(--slr-muted);font-size:.94rem;line-height:1.4}
.slr-close{
  flex:0 0 36px;display:grid;place-items:center;width:36px;height:36px;padding:0;
  border:1px solid var(--slr-line);border-radius:999px;background:var(--slr-soft);
  color:var(--slr-ink);font:inherit;font-size:1.3rem;line-height:1;cursor:pointer;
  transition:background-color .18s ease,color .18s ease;
}
.slr-close:hover{background:#ebebf0;color:#111}
/* Innenkontur statt Outline: Safari/iOS zeigt den beim Schließen programmatisch
   gesetzten Fokus auch nach Touch als :focus-visible. */
.slr-close:focus-visible{outline:0;border-color:#b9b9c0;box-shadow:inset 0 0 0 2px #fff,0 0 0 2px #b9b9c0}

/* Empfehlungskarten */
.slr-carousel{position:relative;min-height:0}
.slr-track{display:flex;gap:18px;overflow-x:auto;overscroll-behavior-inline:contain;scroll-snap-type:x mandatory;scrollbar-width:none;scroll-behavior:smooth;padding-bottom:2px}
.slr-track::-webkit-scrollbar{display:none}
.slr-card{flex:0 0 100%;scroll-snap-align:start;display:grid;overflow:hidden;border-radius:clamp(16px,1.6vw,22px);background:var(--slr-soft);border:1px solid var(--slr-line)}
.slr-card>img{display:block;width:100%;height:clamp(140px,19vh,220px);object-fit:cover}
.slr-card-body{padding:clamp(14px,1.6vw,20px)}
.slr-category{margin:0 0 6px;color:var(--slr-muted);font-size:.74rem;font-weight:700;letter-spacing:.1em;text-transform:uppercase}
.slr-card-body h3{margin:0 0 7px;font-size:clamp(1.1rem,1.8vw,1.4rem);font-weight:700;letter-spacing:-.02em;line-height:1.15}
.slr-card-body p{margin:0 0 14px;color:var(--slr-muted);font-size:.93rem;line-height:1.45;max-width:52ch}
.slr-card-body a{
  display:inline-flex;align-items:center;gap:9px;min-height:40px;padding:0 17px;
  border:1px solid var(--slr-text);border-radius:999px;background:var(--slr-text);
  color:#fff;text-decoration:none;font-size:.9rem;font-weight:650;
  transition:transform .18s ease,background-color .18s ease;
}
.slr-card-body a:hover{background:#000;transform:translateY(-1px)}
.slr-card-body a span{opacity:.6}
/* Kapitel ohne eigenes Bild (Kapitel 14): Typografie statt Platzhalterbild. */
.slr-typo{display:grid;place-items:center;height:clamp(140px,19vh,220px);background:linear-gradient(145deg,#2b2d33,#15171b)}
.slr-typo span{color:#fff;font-size:clamp(1.8rem,5vw,2.9rem);font-weight:700;letter-spacing:-.04em}

/* Blätter-Steuerung: nur bei mehr als einer Karte sichtbar */
.slr-controls{display:flex;align-items:center;justify-content:flex-end;gap:10px}
.slr-controls[hidden]{display:none}
.slr-controls button{width:38px;height:38px;padding:0;border:1px solid var(--slr-line);border-radius:999px;background:var(--slr-bg);color:var(--slr-ink);font:inherit;font-size:1.1rem;line-height:1;cursor:pointer}
.slr-controls button:disabled{opacity:.35;cursor:default}
.slr-position{color:var(--slr-muted);font-size:.84rem;font-variant-numeric:tabular-nums}

/* Satzbau-Trainer: dezent, als Pill */
.slr-trainer{display:flex;flex-wrap:wrap;align-items:center;gap:10px;padding-top:2px;border-top:1px solid var(--slr-line)}
.slr-subhead{margin:14px 0 0;color:var(--slr-muted);font-size:.82rem;font-weight:650}
.slr-chip{
  display:inline-flex;align-items:center;gap:8px;min-height:38px;padding:0 15px;
  border:1px solid var(--slr-line);border-radius:999px;background:var(--slr-soft);
  color:var(--slr-text);text-decoration:none;font-size:.87rem;font-weight:600;
  transition:background-color .18s ease,border-color .18s ease;
}
.slr-chip:hover{background:#ebebf0;border-color:#d5d5dc}
.slr-chip span{color:var(--slr-muted)}

/* Zusatzkarte „Weitere Sprachen entdecken“ – klein, dezent, optional */
.slr-cross{display:flex;align-items:center;gap:12px;padding:12px 14px;border:1px solid var(--slr-line);border-radius:16px;background:var(--slr-soft)}
/* Muss nach .slr-cross stehen: sonst gewinnt display:flex gegen das
   hidden-Attribut und die Karte waere von Anfang an sichtbar. */
.slr-cross[hidden]{display:none}
.slr-cross img{flex:0 0 36px;width:36px;height:36px;border-radius:9px;object-fit:cover}
.slr-cross-body{min-width:0;flex:1}
.slr-cross-body p{margin:0;color:var(--slr-muted);font-size:.86rem;line-height:1.4}
.slr-cross-body a{display:inline-block;color:var(--slr-text);font-size:.88rem;font-weight:650;text-decoration:none;white-space:nowrap}
.slr-cross-body a:hover{text-decoration:underline}
.slr-cross-close{flex:0 0 28px;width:28px;height:28px;padding:0;border:0;border-radius:999px;background:transparent;color:var(--slr-muted);font:inherit;font-size:1.05rem;line-height:1;cursor:pointer}
.slr-cross-close:hover{background:#e4e4e9;color:var(--slr-text)}

/* Floating Button */
.slr-fab{
  position:fixed;z-index:900;right:16px;bottom:calc(20px + env(safe-area-inset-bottom,0px));
  display:grid;place-items:center;width:46px;height:46px;padding:0;
  border:0;border-radius:999px;background:var(--v2g-fab,#e34b43);color:#fff;cursor:pointer;
  box-shadow:0 2px 6px rgb(16 24 40 / .08),0 8px 20px rgb(227 75 67 / .22);
  opacity:0;visibility:hidden;transition:opacity .25s ease,visibility .25s ease;
}
.slr-fab[hidden]{display:none}
.slr-fab--enter{opacity:1;visibility:visible}
.slr-fab--away{opacity:0;visibility:hidden}
.slr-fab:hover{background:#d4423a}
.slr-fab:focus-visible{outline:0;box-shadow:inset 0 0 0 2px rgb(255 255 255 / .9),0 2px 6px rgb(16 24 40 / .08),0 8px 20px rgb(227 75 67 / .28)}
.slr-fab__icon{width:22px;height:22px;fill:currentColor;pointer-events:none}
.slr-fab__icon path:last-child{opacity:.55}
@media(min-width:768px){
  .slr-fab{width:55px;height:55px;right:clamp(40px,3.2vw,48px);bottom:clamp(40px,3.2vw,48px)}
  .slr-fab__icon{width:26px;height:26px}
}

/* Platz sparen auf kleinen und niedrigen Viewports */
@media(min-width:768px){
  .slr-card{grid-template-columns:1.05fr 1fr}
  .slr-card>img,.slr-typo{height:100%;min-height:210px}
  .slr-card-body{align-self:center}
}
@media(max-width:767px){
  .slr-panel{gap:14px}
  .slr-head h2{font-size:1.3rem}
  .slr-head p#slr-subtitle{font-size:.88rem}
}
@media(max-width:767px) and (max-height:700px){
  .slr-panel{gap:11px;padding:15px}
  .slr-card>img,.slr-typo{height:106px}
  .slr-card-body{padding:13px}
  .slr-card-body p{margin-bottom:11px;font-size:.88rem}
  .slr-head p#slr-subtitle{display:none}
  .slr-subhead{margin-top:9px}
  /* Zu wenig Platz: Zusatzkarte nicht anzeigen, Hauptempfehlung hat Vorrang. */
  .slr-cross{display:none}
}

/* Dark Mode */
@media(prefers-color-scheme:dark){
  .slr-dialog{
    --slr-bg:#1c1c1e; --slr-soft:#2a2a2e; --slr-text:#f5f5f7; --slr-muted:#a1a1a6;
    --slr-line:#3a3a40; --slr-accent:#ff6b60; --slr-ink:#dedee2;
    color-scheme:dark; box-shadow:0 18px 60px rgb(0 0 0 / .5);
  }
  .slr-dialog::backdrop{background:rgb(0 0 0 / .58)}
  .slr-close:hover{background:#35353a;color:#fff}
  .slr-close:focus-visible{border-color:#7d8799;box-shadow:inset 0 0 0 2px #1c1c1e,0 0 0 2px #7d8799}
  .slr-card-body a{border-color:#f5f5f7;background:#f5f5f7;color:#1d1d1f}
  .slr-card-body a:hover{background:#fff}
  .slr-chip:hover{background:#35353a;border-color:#4a4a52}
  .slr-cross-close:hover{background:#3a3a40}
  .slr-fab{background:#e05449;box-shadow:0 2px 6px rgb(0 0 0 / .3),0 8px 20px rgb(0 0 0 / .34)}
  .slr-fab:hover{background:#ef6055}
}

/* Weiches Öffnen, nur wo unterstützt */
@supports (transition-behavior:allow-discrete){
  .slr-dialog{opacity:0;transition:opacity .22s ease,overlay .22s allow-discrete,display .22s allow-discrete}
  .slr-dialog[open]{opacity:1}
  @starting-style{.slr-dialog[open]{opacity:0}}
  .slr-dialog::backdrop{opacity:0;transition:opacity .22s ease,overlay .22s allow-discrete,display .22s allow-discrete}
  .slr-dialog[open]::backdrop{opacity:1}
  @starting-style{.slr-dialog[open]::backdrop{opacity:0}}
}
@media(prefers-reduced-motion:reduce){
  .slr-track{scroll-behavior:auto}
  .slr-card-body a:hover{transform:none}
  .slr-fab{transition:none}
  .slr-dialog,.slr-dialog::backdrop{transition-duration:.01ms}
}
