/* ============================================================
   HistoSwiss Werkstatt – gemeinsames Stylesheet
   Gilt für: index.html, vorlage.html und alle Anleitungen
   ============================================================ */

:root {
  --hs-dunkelblau:   #242A4A;
  --hs-dunkelblau-2: #3a4270;
  --hs-rot:          #ff6b6b;
  --hs-gruen:        #d5e3bf;
  --hs-gruen-hell:   #eef3e3;
  --hs-gruen-mittel: #a9c39b;
  --hs-gruen-dunkel: #7fa06d;
  --hs-text:         #222;
  --hs-text-2:       #666;
  --hs-weiss:        #fff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--hs-text);
  line-height: 1.6;
  background: var(--hs-gruen-hell);
  min-height: 100vh;
}

/* ---------- Kopfbereich (auf allen Seiten gleich) ---------- */
.kopf {
  background: var(--hs-dunkelblau);
  color: #fff;
  padding: 18px 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.kopf-inhalt {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: baseline;
  gap: 20px;
  flex-wrap: wrap;
}
.kopf h1 {
  margin: 0;
  font-size: 22px;
  font-weight: bold;
  letter-spacing: .2px;
}
.kopf h1 .swiss { color: var(--hs-rot); }
.kopf .heim {
  color: #cfd3e0;
  text-decoration: none;
  font-size: 14px;
  margin-left: auto;
}
.kopf .heim:hover { color: #fff; }

/* ---------- Haupt-Container für Anleitungen ---------- */
main.anleitung {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 24px 60px;
}

/* ---------- Überschriften in Anleitungen ---------- */
h1.titel {
  font-size: 30px;
  color: var(--hs-dunkelblau);
  border-bottom: 4px solid var(--hs-gruen-mittel);
  padding-bottom: 10px;
  margin: 0 0 12px;
  line-height: 1.2;
}
p.untertitel {
  color: var(--hs-text-2);
  margin: 0 0 32px;
  font-size: 15px;
}
main.anleitung h2 {
  font-size: 22px;
  color: var(--hs-dunkelblau);
  margin: 40px 0 12px;
  line-height: 1.3;
}

/* ---------- Schritt ---------- */
.schritt { margin: 36px 0; }

.schritt-kopf {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.schritt-nr {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--hs-gruen-mittel);
  color: var(--hs-dunkelblau);
  font-weight: bold;
  font-size: 16px;
  flex: 0 0 auto;
  box-shadow: 0 2px 4px rgba(0,0,0,.1);
}
.schritt-kopf h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

/* ---------- Zweispaltige Zeile (Bild + Text) ---------- */
.zeile {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  margin: 16px 0;
}
.zeile > .bild { flex: 0 0 40%; }
.zeile > .text { flex: 1 1 auto; min-width: 0; }

/* Bildbreite-Varianten */
.zeile.bild-40  > .bild { flex: 0 0 40%; }
.zeile.bild-40  > .text { flex: 1 1 auto; }
.zeile.bild-60  > .bild { flex: 0 0 60%; }
.zeile.bild-60  > .text { flex: 1 1 auto; }
.zeile.bild-100 > .bild { flex: 0 0 100%; }

/* Spalten vertauschen */
.zeile.reverse { flex-direction: row-reverse; }

/* ---------- Bilder in Anleitungen ---------- */
.zeile figure {
  margin: 0;
}
.zeile img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
  display: block;
  background: #f0f0f0;
}
.zeile figcaption {
  font-size: 12px;
  color: var(--hs-text-2);
  margin-top: 6px;
  text-align: center;
  font-style: italic;
}
/* ---------- Bildgrössen (optional per Klasse) ---------- */
.bild.bild-s img { max-height: 220px; width: auto; height: auto; display: block; margin: 0 auto; }
.bild.bild-m img { max-height: 320px; width: auto; height: auto; display: block; margin: 0 auto; }
.bild.bild-l img { max-height: 480px; width: auto; height: auto; display: block; margin: 0 auto; }
/* ---------- Text in Anleitungen ---------- */
.text p { margin: 0 0 12px; }
.text p:last-child { margin-bottom: 0; }
.text ul, .text ol { padding-left: 1.4em; margin: 8px 0; }
.text li { margin-bottom: 4px; }
.text a {
  color: #2c4f76;
  text-decoration: none;
  border-bottom: 1px solid rgba(44,79,118,.35);
}
.text a:hover { border-bottom-color: #2c4f76; }
.text strong { color: #1a1a2e; }
.text code {
  background: rgba(0,0,0,.06);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 13px;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}
.text pre {
  background: #2a2e45;
  color: #eaeaea;
  padding: 14px 18px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.5;
  margin: 12px 0;
}
.text pre code { background: transparent; padding: 0; color: inherit; }
.text blockquote {
  border-left: 4px solid var(--hs-gruen-mittel);
  background: #fff;
  padding: 10px 16px;
  margin: 12px 0;
  color: #444;
  border-radius: 0 6px 6px 0;
}

/* ---------- Hinweisboxen ---------- */
.hinweis {
  padding: 12px 16px;
  border-radius: 8px;
  margin: 16px 0;
  font-size: 14px;
  border-left: 4px solid #e0c060;
  background: #fffbe6;
  color: #6d4c00;
}
.hinweis.tipp {
  border-left-color: var(--hs-gruen-mittel);
  background: #f0f7ec;
  color: #1b3d1e;
}
.hinweis.warnung {
  border-left-color: #c62828;
  background: #fdecec;
  color: #7f1d1d;
}

/* ---------- Navigation am Ende einer Anleitung ---------- */
.schritt-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 48px;
  gap: 12px;
  flex-wrap: wrap;
}
.schritt-nav a {
  padding: 10px 22px;
  background: var(--hs-dunkelblau);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: bold;
  font-size: 14px;
  transition: background .15s;
}
.schritt-nav a:hover { background: var(--hs-dunkelblau-2); }

/* ---------- Fußbereich ---------- */
.fuss {
  text-align: center;
  padding: 24px;
  color: var(--hs-text-2);
  font-size: 13px;
  border-top: 1px solid rgba(0,0,0,.08);
  margin-top: 40px;
}
.fuss a { color: var(--hs-dunkelblau); text-decoration: none; }
.fuss a:hover { text-decoration: underline; }

/* ============================================================
   Übersicht der Werkstatt (index.html)
   ============================================================ */

main.uebersicht {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 24px 60px;
}

.ueber-leiste {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 24px;
  background: #fff;
  padding: 14px 18px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,.06);
}
.ueber-leiste input[type=search] {
  flex: 1 1 240px;
  min-width: 0;
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fafafa;
}
.ueber-leiste input[type=search]:focus {
  outline: 2px solid var(--hs-gruen-mittel);
  outline-offset: 1px;
  background: #fff;
}
.ueber-leiste .zaehler {
  font-size: 13px;
  color: var(--hs-text-2);
  margin-left: auto;
  white-space: nowrap;
}

.werkstatt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.anl-karte {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
  transition: transform .15s, box-shadow .15s;
  border: 1px solid #e8e8e8;
}
.anl-karte:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,.12);
}
.anl-karte .anl-bild {
  width: 100%;
  height: 160px;
  background: var(--hs-gruen-hell);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  color: var(--hs-gruen-dunkel);
  overflow: hidden;
}
.anl-karte .anl-bild img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.anl-karte .anl-inhalt {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 6px;
}
.anl-karte .anl-titel {
  font-size: 16px;
  font-weight: bold;
  color: var(--hs-dunkelblau);
  line-height: 1.3;
}
.anl-karte .anl-beschr {
  font-size: 13px;
  color: var(--hs-text-2);
  line-height: 1.45;
  flex: 1 1 auto;
}
.anl-karte .anl-meta {
  font-size: 11px;
  color: #999;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed #eee;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.leer {
  grid-column: 1 / -1;
  padding: 60px 20px;
  text-align: center;
  color: var(--hs-text-2);
  font-size: 15px;
}

/* ---------- Responsiv ---------- */
@media (max-width: 700px) {
  .zeile,
  .zeile.bild-40,
  .zeile.bild-60,
  .zeile.bild-100,
  .zeile.reverse {
    flex-direction: column;
    gap: 14px;
  }
  .zeile > .bild,
  .zeile.bild-40 > .bild,
  .zeile.bild-60 > .bild,
  .zeile.bild-100 > .bild {
    flex: 1 1 auto;
    width: 100%;
  }
  h1.titel { font-size: 24px; }
  .kopf h1 { font-size: 19px; }
  main.anleitung { padding: 24px 18px 40px; }
}
.anl-tags {
  margin-top: .35rem;
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
}

.tag {
  font-size: .72rem;
  padding: .1rem .45rem;
  border-radius: 999px;
  background: #eef2f6;
  color: #456;
}