/* =================================================================
   qteach – Anleitungen für Lehrkräfte
   -----------------------------------------------------------------
   Gebaut fürs Papier: A4, schwarz auf weiss, keine Farbflächen ausser
   den paar Feldern der Farblegende. Am Bildschirm liest es sich
   genauso; der Knopf "Drucken" verschwindet beim Drucken selbst.

   Bewusst OHNE die Programm-Stylesheets: eine Anleitung soll auch dann
   noch lesbar sein, wenn am Aussehen der Programme geschraubt wird.
   ================================================================= */

:root {
  --ink:      #1a1d23;
  --ink-soft: #5b6472;
  --line:     #d9d5cd;
  --paper:    #ffffff;
  --gruen:    #166534;
  --blau:     #1e3a5f;
  --tuerkis:  #16705f;
  --amber:    #b4690e;
  --graphit:  #3b4252;
  --rot:      #c0453a;
}

* { box-sizing: border-box; }

body {
  margin: 0 auto;
  max-width: 46rem;
  padding: 2rem 1.4rem 4rem;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  hyphens: auto;
}

h1 {
  font-size: 1.9rem; line-height: 1.15; margin: 0 0 .2em;
  letter-spacing: -.015em;
}
h1 .sub { display: block; font-size: 1rem; font-weight: 400; color: var(--ink-soft); margin-top: .3em; }
h2 {
  font-size: 1.2rem; margin: 2.2rem 0 .6rem;
  padding-bottom: .25rem; border-bottom: 2px solid var(--ink);
}
h3 { font-size: 1rem; margin: 1.4rem 0 .3rem; }
p, li { margin: 0 0 .7rem; }
ul, ol { padding-left: 1.3rem; }
li > ul, li > ol { margin-top: .3rem; }
strong { font-weight: 700; }
code, kbd {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: .92em; background: #f2f1ee; border: 1px solid var(--line);
  border-radius: 4px; padding: .05em .3em;
}
kbd { font-weight: 700; }
a { color: var(--blau); }

/* ----- Programmsymbole (bilder/symbole/*.svg), z. B. in index.html ---- */
.sym {
  display: inline-block; height: 1.15em; width: auto; vertical-align: -.22em;
  margin-right: .3em; border-radius: .24em;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}

/* ----- Kopf und Fuss ---------------------------------------------- */
.marke {
  display: flex; align-items: baseline; gap: .6rem;
  font-weight: 800; letter-spacing: -.01em; margin-bottom: 1.6rem;
}
.marke .prog { font-size: 1.05rem; }
.marke .art  { font-weight: 400; color: var(--ink-soft); font-size: .9rem; }

.werkzeug { display: flex; gap: .6rem; align-items: center; margin-bottom: 1.6rem; flex-wrap: wrap; }
.werkzeug a, .werkzeug button {
  font: inherit; font-size: .9rem; font-weight: 600;
  padding: .35rem .8rem; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; color: var(--blau);
  text-decoration: none; cursor: pointer;
}
.werkzeug button { border-color: var(--blau); background: var(--blau); color: #fff; }

.fuss {
  margin-top: 3rem; padding-top: .8rem; border-top: 1px solid var(--line);
  font-size: .85rem; color: var(--ink-soft);
}

/* ----- Schritte ---------------------------------------------------- */
.schritt {
  border: 1px solid var(--line); border-left: 4px solid var(--ink);
  border-radius: 6px; padding: .9rem 1.1rem; margin: 0 0 1rem;
  break-inside: avoid; page-break-inside: avoid;
}
.schritt h3 { margin-top: 0; display: flex; align-items: baseline; gap: .5rem; }
.schritt h3 .nr {
  font-size: .78rem; font-weight: 800; color: #fff; background: var(--ink);
  border-radius: 999px; padding: .1em .55em; flex: none;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.schritt > :last-child { margin-bottom: 0; }

/* ----- Tabellen ---------------------------------------------------- */
table { width: 100%; border-collapse: collapse; margin: 0 0 1rem; font-size: .95rem; }
th, td { text-align: left; vertical-align: top; padding: .35rem .5rem; border-bottom: 1px solid var(--line); }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
td code { white-space: nowrap; }

/* ----- Hinweiskasten ----------------------------------------------- */
.merke {
  border: 1px solid var(--line); border-radius: 6px;
  background: #f7f6f3; padding: .7rem .9rem; margin: 0 0 1rem;
  break-inside: avoid;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.merke p:last-child { margin-bottom: 0; }
.merke .titel { font-weight: 700; }

/* ----- Farblegende -------------------------------------------------- */
.farben td:first-child { width: 9.5rem; }
.feld {
  display: inline-block; width: 1.1em; height: 1.1em; border-radius: 3px;
  vertical-align: -.2em; margin-right: .4em; border: 1px solid rgba(0,0,0,.2);
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.f-gruen   { background: var(--gruen); }
.f-blau    { background: var(--blau); }
.f-tuerkis { background: var(--tuerkis); }
.f-amber   { background: var(--amber); }
.f-graphit { background: var(--graphit); }
.f-rot     { background: #fff; border-color: var(--rot); }

/* ----- 1234-Anleitung: eine Seite, Ziel und Ergebnis oben ------------ */
.zielbox {
  display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin: 0 0 1.4rem;
}
.zielbox > div {
  border: 2px solid var(--ink); border-radius: 6px; padding: .55rem .8rem;
  break-inside: avoid;
}
.zielbox .label {
  display: block; font-size: .72rem; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-soft); margin-bottom: .15rem;
}
.zielbox p { margin: 0; }

.stufen { list-style: none; padding: 0; margin: 0; }
.stufe {
  display: grid; grid-template-columns: 2.6rem 1fr; gap: .9rem;
  padding: .7rem 0; border-top: 1px solid var(--line);
  break-inside: avoid; page-break-inside: avoid;
}
.stufe:first-child { border-top: 2px solid var(--ink); }
.stufe .gross {
  width: 2.4rem; height: 2.4rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--ink); color: #fff; font-size: 1.35rem; font-weight: 800;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.stufe h3 { margin: .1rem 0 .2rem; font-size: 1.08rem; }
.stufe p { margin: 0 0 .25rem; }
.stufe p:last-child { margin-bottom: 0; }
.stufe .klasse { color: var(--ink-soft); font-size: .92em; }
/* Adressen nicht am Bindestrich umbrechen (punkte-noten.qteach.de) */
.stufe code { white-space: nowrap; }
.stufe .klasse strong { color: var(--ink); }

@media (max-width: 30rem) {
  .zielbox { grid-template-columns: 1fr; }
}

/* ----- Quick-Anleitung: Schritt mit Bild daneben -------------------- */
.vorspann { color: var(--ink-soft); margin: 0 0 1.1rem; }

.stufe.mitbild > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 30%);
  gap: 1rem;
  align-items: start;
}

/* Breitere Bildspalte, wo die Seite Platz hat (helle Bilder wirken sonst zu klein). */
.stufen.bild-breit .stufe.mitbild > div { grid-template-columns: minmax(0, 1fr) minmax(0, 40%); }

/* Schmalere Bildspalte fuer hohe Bilder - sonst wird aus einer Seite eine zweite. */
.stufen.bild-schmal .stufe.mitbild > div { grid-template-columns: minmax(0, 1fr) minmax(0, 24%); }

/* Zwischenstufe: fünf Schritte mit eher hohen Bildern, die bei 30 % gerade nicht mehr passen. */
.stufen.bild-mittel .stufe.mitbild > div { grid-template-columns: minmax(0, 1fr) minmax(0, 27%); }

/* Einzelner Schritt mit hochformatigem Bild (Handy-Ansicht) in einer sonst breiten Liste. */
.stufen .stufe.mitbild.bild-hoch > div { grid-template-columns: minmax(0, 1fr) minmax(0, 22%); }

.bild { margin: 0; }
.bild img {
  display: block; width: 100%; height: auto;
  border-radius: 6px; border: 1px solid var(--line);
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}

@media (max-width: 36rem) {
  .stufe.mitbild > div { grid-template-columns: 1fr; }
  .bild { max-width: 22rem; }
}

/* ----- Druck -------------------------------------------------------- */
@page { size: A4; margin: 18mm 16mm; }

@media print {
  body { max-width: none; padding: 0; font-size: 11.5pt; }
  .werkzeug { display: none !important; }
  h1 { font-size: 20pt; }
  h2 { font-size: 13pt; margin-top: 1.4rem; }
  h2, h3 { break-after: avoid; page-break-after: avoid; }
  a { color: var(--ink); text-decoration: none; }
  /* Adressen ausschreiben - auf Papier hilft ein Link sonst niemandem. */
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .85em; color: var(--ink-soft); }
  .neueseite { break-before: page; page-break-before: always; }

  /* 1234-Anleitung: muss auf ein Blatt passen */
  body.einseiter { font-size: 10.5pt; line-height: 1.45; }
  body.einseiter .marke { margin-bottom: .8rem; }
  body.einseiter h1 { font-size: 18pt; }
  body.einseiter .zielbox { margin-bottom: .9rem; }
  body.einseiter .stufe { padding: .45rem 0; }
  body.einseiter .fuss { margin-top: 1rem; }
}
