/* Lerntool Inklusivum
   Farben und Schrift wie auf test.inklusivum.de: Source Sans 3, Lila #7a3dc5 als
   Hauptfarbe, Dunkellila #2e174a für Text, Gruen und Creme fuer die Kacheln. */

:root {
    /* Farbgebung nach test.inklusivum.de: heller gelber Grund, schwarze Schrift,
       Lila für alles Hervorgehobene in Lektionen und Übungen, Dunkelgrün für
       Kopf- und Fußzeile. */
    --grund:       #fffae6;   /* hellgelber Seitenhintergrund */
    --flaeche:     #ffffff;   /* Karten und Eingabefelder heben sich davon ab */
    --schrift:     #000000;
    --schrift-leise: #4a4636;

    --lila:        #7a3dc5;
    --lila-dunkel: #5a2a95;
    --lila-hell:   #c89bff;
    --lila-blass:  #f1e8fd;

    --gruen:       #2f6b43;   /* Kopf- und Fußzeile */
    --gruen-hell:  #91e6aa;
    --gruen-blass: #e7f5ec;

    --gold:        #8a7a35;
    --gelb:        #ffed9c;
    --gelb-kraeftig: #ffe066;
    --rand:        #e6dcbe;   /* Rahmen auf gelbem Grund */
    --weiss:       #ffffff;

    --akzent:       var(--lila);
    --akzent-dunkel:var(--lila-dunkel);
    --akzent-blass: var(--lila-blass);
    --akzent-rand:  var(--lila-hell);

    --schriftart: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --radius: 10px;
    --breite: 44rem;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--schriftart);
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--schrift);
    background: var(--grund);
    /* Platz fuer die Notch bzw. die Gestensteuerung auf dem Handy */
    padding: env(safe-area-inset-top) env(safe-area-inset-right)
             env(safe-area-inset-bottom) env(safe-area-inset-left);
}

h1, h2, h3 { line-height: 1.25; color: var(--akzent); }
h1 { font-size: 1.75rem; margin: 0 0 .6rem; }
h2 { font-size: 1.3rem; margin: 1.6rem 0 .5rem; }
h3 { font-size: 1.1rem; margin: 1.2rem 0 .4rem; }

a { color: var(--lila); }

.sprungmarke {
    position: absolute;
    left: -9999px;
    background: var(--lila);
    color: var(--weiss);
    padding: .6rem 1rem;
    z-index: 10;
}
.sprungmarke:focus { left: .5rem; top: .5rem; }

/* ---------- Kopf ---------- */

.kopf {
    border-bottom: 2px solid var(--gruen);
    background: var(--grund);
    color: var(--gruen);
    position: sticky;
    top: 0;
    z-index: 5;
}
.kopf-innen {
    max-width: var(--breite);
    margin: 0 auto;
    padding: .6rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}
.marke { text-decoration: none; font-weight: 700; font-size: 1.15rem; }
.marke-wort   { color: var(--gruen); }
.marke-zusatz { color: var(--schrift); font-weight: 400; }

/* Beide Erklärweisen stehen nebeneinander, die aktive ist gefüllt. So ist
   sichtbar, was gerade gilt und was der Klick bewirkt. */
.modus-wahl {
    display: flex;
    border: 1px solid var(--gruen);
    border-radius: 999px;
    overflow: hidden;
    background: var(--weiss);
}
.modus-knopf {
    font: inherit;
    font-size: .82rem;
    border: none;
    background: var(--weiss);
    color: var(--gruen);
    padding: .32rem .7rem;
    cursor: pointer;
    white-space: nowrap;
}
.modus-knopf:hover { background: var(--gruen-blass); }
.modus-knopf.aktiv {
    background: var(--gruen);
    color: var(--weiss);
    font-weight: 600;
}

/* ---------- Grundgerüst ---------- */

main {
    max-width: var(--breite);
    margin: 0 auto;
    padding: 1.25rem 1rem 3rem;
}
main:focus { outline: none; }

.seite[hidden] { display: none; }

.vorspann { color: var(--schrift-leise); margin-top: 0; }

/* ---------- Kacheln ---------- */

.kacheln {
    display: grid;
    gap: .9rem;
    margin: 1.5rem 0;
}
.kachel {
    display: block;
    text-decoration: none;
    color: var(--lila-dunkel);
    border: 1px solid var(--rand);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    background: var(--flaeche);
    transition: transform .08s ease;
}
.kachel:hover { transform: translateY(-2px); }
.kachel h2 { margin: 0 0 .25rem; font-size: 1.2rem; }
.kachel p  { margin: 0; color: var(--schrift-leise); font-size: 1rem; }
.kachel-lernen      { background: var(--lila-blass);  border-color: var(--lila-hell); }
.kachel-wiederholen { background: var(--gruen-blass); border-color: var(--gruen-hell); }
.kachel-wiederholen h2 { color: var(--gruen); }
.kachel-nachschlagen { background: var(--gelb); border-color: var(--gelb); }
.kachel-stand { display: block; margin-top: .5rem; font-size: .9rem; color: var(--schrift-leise); }

.kasten {
    border: 1px solid var(--rand);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    margin: 1.5rem 0;
}
.kasten h2 { margin-top: 0; font-size: 1.1rem; }
.kasten p  { font-size: 1rem; color: var(--schrift-leise); }

.wahl { display: flex; flex-wrap: wrap; gap: .5rem; }
.wahl-knopf {
    font: inherit;
    font-size: 1rem;
    border: 1px solid var(--rand);
    background: var(--weiss);
    color: var(--lila-dunkel);
    border-radius: 999px;
    padding: .45rem 1rem;
    cursor: pointer;
}
.wahl-knopf[aria-checked="true"] {
    background: var(--lila);
    border-color: var(--lila);
    color: var(--weiss);
    font-weight: 600;
}

/* ---------- Lektionsliste ---------- */

.lektionsliste { list-style: none; padding: 0; margin: 1.25rem 0 0; }
.lektionsliste li { margin-bottom: .6rem; }

.lektion-knopf {
    width: 100%;
    text-align: left;
    font: inherit;
    border: 1px solid var(--rand);
    border-left: 5px solid var(--akzent);
    border-radius: var(--radius);
    background: var(--weiss);
    padding: .7rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: .75rem;
}
.lektion-knopf:hover:not([disabled]) {
    border-color: var(--akzent-rand);
    border-left-color: var(--akzent);
    background: var(--akzent-blass);
}
.lektion-knopf[disabled] { cursor: not-allowed; opacity: .55; }
.lektion-nummer {
    flex: none;
    width: 1.9rem; height: 1.9rem;
    border-radius: 50%;
    background: var(--akzent-blass);
    color: var(--akzent);
    font-size: .9rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lektion-titel  { font-weight: 600; flex: 1; }
.lektion-stand  { font-size: .85rem; color: var(--schrift-leise); white-space: nowrap; }
.lektion-stand.fertig { color: var(--gruen); font-weight: 600; }

/* ---------- Einstieg in eine Lektion ---------- */

.uebung-kopf {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: .95rem;
}
.zurueck {
    font: inherit;
    font-size: .95rem;
    background: none;
    border: none;
    color: var(--lila);
    cursor: pointer;
    padding: .25rem 0;
    text-decoration: none;
}
.uebung-fortschritt { color: var(--schrift-leise); }

.einstieg-text { font-size: 1.15rem; }

.beispielpaar {
    background: var(--akzent-blass);
    border-left: 4px solid var(--akzent);
    border-radius: var(--radius);
    padding: .9rem 1rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .6rem;
    font-size: 1.15rem;
}
.vorher  { color: var(--schrift-leise); }
.nachher { font-weight: 700; color: var(--akzent); }
.pfeil   { color: var(--akzent-rand); }

.einstieg-knoepfe, .aufgabe-knoepfe, .aufgabe-weiter {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    margin-top: 1.25rem;
}

.knopf {
    font: inherit;
    font-size: 1rem;
    border-radius: 999px;
    padding: .55rem 1.2rem;
    cursor: pointer;
    border: 1px solid var(--lila);
    text-decoration: none;
    display: inline-block;
}
.knopf { border-color: var(--akzent); }
.knopf-haupt { background: var(--akzent); color: var(--weiss); font-weight: 600; }
.knopf-haupt:hover { background: var(--akzent-dunkel); border-color: var(--akzent-dunkel); }
.knopf-leise { background: var(--weiss); color: var(--akzent); }
.knopf-leise:hover { background: var(--akzent-blass); }

/* ---------- Abspielknopf ---------- */

.ton {
    border: 1px solid var(--akzent-rand);
    background: var(--weiss);
    color: var(--akzent);
    border-radius: 50%;
    width: 2.1rem;
    height: 2.1rem;
    font-size: .8rem;
    line-height: 1;
    cursor: pointer;
    flex: none;
}
.ton:hover { background: var(--akzent-blass); }
/* Solange keine Aufnahme hinterlegt ist, bleibt der Knopf sichtbar, aber stumm. */
.ton[data-ton=""] { opacity: .4; cursor: default; }
.ton[data-ton=""]:hover { background: var(--weiss); }

/* ---------- Der Übungssatz ---------- */

.aufgabe-anleitung { color: var(--schrift-leise); font-size: 1rem; }

.kontext {
    border-left: 3px solid var(--rand);
    padding: .25rem 0 .25rem .8rem;
    margin-bottom: 1rem;
    color: var(--schrift-leise);
    font-size: 1rem;
}

.satz {
    font-size: 1.3rem;
    line-height: 2.1;
    margin: 1rem 0;
}

.wort {
    font: inherit;
    background: none;
    border: none;
    border-bottom: 2px dotted var(--akzent-rand);
    color: inherit;
    padding: 0 .1em;
    cursor: pointer;
    border-radius: 3px;
}
.wort:hover { background: var(--akzent-blass); }
.wort.offen { border-bottom-color: transparent; }
.satzzeichen { white-space: pre-wrap; }

/* Das Eingabefeld nimmt den Platz des Wortes ein, schreibt aber etwas kleiner,
   damit auch eine laengere Form wie „Kundere“ noch hineinpasst. */
.luecke {
    font-family: inherit;
    font-size: .85em;
    line-height: 1.2;
    border: none;
    border-bottom: 2px solid var(--akzent);
    background: var(--akzent-blass);
    color: var(--lila-dunkel);
    padding: .1em .2em;
    border-radius: 4px 4px 0 0;
    min-width: 3.5em;
}
.luecke:focus { outline: 3px solid var(--akzent-rand); outline-offset: 1px; }
.luecke.richtig { background: var(--gruen-blass); border-bottom-color: var(--gruen); }
.luecke.falsch  { background: var(--gelb);        border-bottom-color: var(--gold); }

/* ---------- Rückmeldung ---------- */

.rueckmeldung:empty { display: none; }
.rueckmeldung { margin-top: 1.25rem; }

.meldung {
    border: 1px solid var(--rand);
    border-left-width: 4px;
    border-radius: var(--radius);
    padding: .75rem .9rem;
    margin-bottom: .6rem;
    font-size: 1rem;
    background: var(--flaeche);
}
/* Die Kennzeichnung laeuft ueber Wort und Symbol, nicht ueber Farbe allein. */
.meldung-art { font-weight: 700; }
.meldung.gut      { border-left-color: var(--gruen); background: var(--gruen-blass); }
.meldung.gut .meldung-art { color: var(--gruen); }
.meldung.fehler   { border-left-color: var(--gold); background: var(--gelb); }
.meldung.fehler .meldung-art { color: #8a6d1f; }
.meldung.hinweis  { border-left-color: var(--lila-hell); background: var(--lila-blass); }
.meldung.hinweis .meldung-art { color: var(--lila); }

.meldung .form { font-weight: 700; }
.meldung .regel-link {
    display: inline-block;
    margin-top: .35rem;
    font-size: .95rem;
}

/* ---------- Nachschlagen ---------- */

.suche { margin: 1rem 0; }
.suche label { display: block; font-size: .95rem; color: var(--schrift-leise); margin-bottom: .25rem; }
.suche input {
    font: inherit;
    width: 100%;
    padding: .55rem .75rem;
    border: 1px solid var(--rand);
    border-radius: var(--radius);
}
.suche input:focus { outline: 3px solid var(--lila-hell); outline-offset: 1px; }

.nachschlag-eintrag {
    border: 1px solid var(--rand);
    border-left: 5px solid var(--akzent);
    border-radius: var(--radius);
    background: var(--akzent-blass);
    padding: .7rem .9rem;
    margin-bottom: .55rem;
}
.nachschlag-eintrag a { color: var(--akzent-dunkel); }
.nachschlag-eintrag a { font-weight: 600; text-decoration: none; font-size: 1.1rem; }
.nachschlag-eintrag p { margin: .2rem 0 0; color: var(--schrift-leise); font-size: 1rem; }

.marke-art {
    display: inline-block;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-radius: 999px;
    padding: .1rem .55rem;
    margin-left: .5rem;
    vertical-align: .1em;
    border: 1px solid currentColor;
}
.marke-art.regel      { color: var(--lila); }
.marke-art.empfehlung { color: var(--gruen); }
.marke-art.variante   { color: var(--gold); }

.regel-inhalt .beispiele { list-style: none; padding: 0; }
.regel-inhalt .beispiele li {
    background: var(--akzent-blass);
    border-radius: var(--radius);
    padding: .5rem .75rem;
    margin-bottom: .4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
}
.regel-quelle { font-size: .9rem; color: var(--schrift-leise); margin-top: 1.5rem; }

/* ---------- Fuß ---------- */

.fuss {
    border-top: 2px solid var(--gruen);
    margin-top: 2rem;
    color: var(--gruen);
}
.fuss p {
    max-width: var(--breite);
    margin: 0 auto;
    padding: 1rem;
    font-size: .9rem;
}
.fuss a { color: var(--gruen); font-weight: 600; }

/* ---------- Sichtbarer Fokus überall ---------- */

a:focus-visible, button:focus-visible, input:focus-visible {
    outline: 3px solid var(--akzent);
    outline-offset: 2px;
}

/* ---------- Breiter Bildschirm ---------- */

@media (min-width: 40rem) {
    .kacheln { grid-template-columns: repeat(3, 1fr); }
    h1 { font-size: 2rem; }
    .satz { font-size: 1.4rem; }
}

/* ---------- Nur für Screenreader ---------- */

.nur-vorlesen {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------- Zitierte Formen ---------- */

/* In Erklärungen und Rückmeldungen stehen zitierte Formen kursiv, damit sie
   sich vom Fließtext abheben: „Hier heißt es derm.“ */
em.form {
    font-style: italic;
    font-weight: 600;
    color: var(--akzent);
}
.meldung em.form { color: inherit; }

/* Lektionen, die im Kurs erst später kommen, sind blasser – anklickbar
   bleiben sie trotzdem, damit sich ein einzelner Bereich ansteuern lässt. */
.lektion-knopf.spaeter { opacity: .6; }
.lektion-knopf.spaeter:hover { opacity: 1; }

.regel-zurueck-unten { margin-top: 2rem; }


/* ---------- Flächen auf gelbem Grund ---------- */

/* Auf dem hellgelben Seitenhintergrund treten Karten, Satzfeld und Eingaben
   weiss hervor; das hebt den Arbeitsbereich ab, ohne eine weitere Farbe
   einzufuehren. */
.kachel, .kasten, .lektion-knopf, .meldung, .nachschlag-eintrag,
.regel-inhalt .beispiele li, .beispielpaar, .satz, .suche input {
    background-color: var(--flaeche);
}
.satz {
    border: 1px solid var(--rand);
    border-radius: var(--radius);
    padding: .9rem 1rem;
}
.beispielpaar { border: 1px solid var(--rand); border-left: 4px solid var(--lila); }
.nachschlag-eintrag { border-left: 5px solid var(--lila); }
.lektion-knopf { border-left: 5px solid var(--lila); }
.lektion-nummer { background: var(--lila-blass); color: var(--lila); }

/* Die drei Kacheln der Startseite behalten ihre eigenen Töne. */
.kachel-lernen       { background-color: var(--lila-blass);  border-color: var(--lila-hell); }
.kachel-wiederholen  { background-color: var(--gruen-blass); border-color: var(--gruen-hell); }
.kachel-wiederholen h2 { color: var(--gruen); }
.kachel-nachschlagen { background-color: var(--gelb);        border-color: var(--gelb-kraeftig); }

/* Rückmeldungen: Richtig grün, noch nicht richtig gelb, Hinweise lila. */
.meldung.gut     { background-color: var(--gruen-blass); border-left-color: var(--gruen); }
.meldung.gut .meldung-art { color: var(--gruen); }
.meldung.fehler  { background-color: var(--gelb); border-left-color: var(--gold); }
.meldung.hinweis { background-color: var(--lila-blass); border-left-color: var(--lila); }
.meldung.hinweis .meldung-art { color: var(--lila); }

.luecke.richtig { background: var(--gruen-blass); border-bottom-color: var(--gruen); }
.luecke.falsch  { background: var(--gelb-kraeftig); border-bottom-color: var(--gold); }

/* Auf schmalen Geräten bekommt die Kopfzeile sonst nicht beide Erklärweisen
   unter – sie rückt dann unter den Namen und wird etwas kleiner. */
@media screen and (max-width: 29rem) {
    .kopf-innen { flex-wrap: wrap; row-gap: .4rem; }
    .modus-wahl { width: 100%; }
    .modus-knopf { flex: 1; font-size: .78rem; padding: .3rem .4rem; }
    .marke { font-size: 1.05rem; }
}

/* Die Überschrift der Nachschlagen-Kachel stand als einzige in Gold –
   Hervorgehobenes ist im Inhaltsbereich lila. */
.kachel-nachschlagen h2 { color: var(--lila); }

/* ---------- Illustration ---------- */

/* Eine Illustration des Vereins begrüßt auf der Startseite. Sie trägt keine
   Information, steht deshalb mit leerem alt-Text da und wird von Screenreadern
   übersprungen. */
.begruessung {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.illustration {
    flex: none;
    width: auto;
    height: 7.5rem;
}
@media (min-width: 30rem) {
    .illustration { height: 10rem; }
}

/* ---------- Zusätzlicher Übungsteil ---------- */

/* Jede Lektion hat einen Pflichtteil und einen zusätzlichen Übungsteil. Der
   Pflichtteil steht in der Hauptzeile, der Zusatzteil darunter – schmaler und
   leiser, damit beim Durchlernen klar ist, was dazugehört und was nicht. */
.lektion-zusatz {
    font: inherit;
    font-size: .85rem;
    margin: .25rem 0 0 2.2rem;
    padding: .3rem .7rem;
    border: 1px dashed var(--rand);
    border-radius: var(--radius);
    background: none;
    color: var(--schrift-leise);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}
.lektion-zusatz:hover { background: var(--akzent-blass); border-color: var(--akzent-rand); }
.lektion-zusatz.empfohlen {
    border-style: solid;
    border-color: var(--lila);
    color: var(--lila-dunkel);
    background: var(--lila-blass);
}
.zusatz-wort { font-weight: 600; }
.zusatz-marke {
    background: var(--lila);
    color: var(--weiss);
    border-radius: 999px;
    padding: .05rem .5rem;
    font-size: .78rem;
    font-weight: 600;
}

/* Vorschlag, einen Zusatzteil nachzuholen – auf der Startseite und über der
   Lektionsliste. */
.empfehlung {
    border: 1px solid var(--lila-hell);
    border-left: 5px solid var(--lila);
    border-radius: var(--radius);
    background: var(--lila-blass);
    padding: .9rem 1rem;
    margin: 0 0 1.25rem;
}
.empfehlung[hidden] { display: none; }
.empfehlung p { margin: 0 0 .7rem; }
.empfehlung strong { color: var(--lila-dunkel); }

/* ---------- Übersprungene Erklärungen ---------- */

/* Wer angegeben hat, die Grundlagen zu kennen, bekommt die Kurzerklärung nicht
   zu sehen. Diese Zeile führt trotzdem dorthin zurück. */
.uebersprungen {
    font-size: .9rem;
    color: var(--schrift-leise);
    margin: 0 0 .75rem;
}
.uebersprungen[hidden] { display: none; }
.uebersprungen a { font-weight: 600; }

/* ---------- Die drei Bereiche über der Fußzeile ---------- */

.bereiche {
    max-width: var(--breite);
    margin: 2.5rem auto 0;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .6rem;
}
.bereiche[hidden] { display: none; }
.bereich {
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    font-size: .95rem;
    padding: .6rem .5rem;
    border: 1px solid var(--rand);
    border-radius: var(--radius);
    background: var(--flaeche);
    color: var(--lila-dunkel);
}
.bereich:hover { transform: translateY(-2px); }
.bereich-lernen      { background: var(--lila-blass);  border-color: var(--lila-hell); }
.bereich-wiederholen { background: var(--gruen-blass); border-color: var(--gruen-hell); color: var(--gruen); }
.bereich-nachschlagen { background: var(--gelb); border-color: var(--gelb); }

/* ---------- Illustration auf der Einstiegsseite einer Lektion ---------- */

/* Eine Illustration steht nur auf der ersten Seite einer Lektion, also bei der
   Kurzerläuterung. In den Aufgaben und in den ausführlichen Erläuterungen
   stört sie beim Lesen und fehlt deshalb dort. */
.einstieg-koerper {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}
.einstieg-koerper .einstieg-text { margin-top: 0; }
.illustration-lektion { height: 7rem; align-self: center; }
.illustration-lektion[hidden] { display: none; }
@media (min-width: 30rem) {
    .illustration-lektion { height: 9.5rem; }
}
@media screen and (max-width: 25rem) {
    .einstieg-koerper { flex-direction: column; align-items: center; }
    .illustration-lektion { height: 6.5rem; }
}

/* ---------- Weg zurück innerhalb einer Lektion ---------- */

.uebung-wege {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem 1rem;
}
.vorige[hidden] { display: none; }
