@charset "utf-8";

/* ==========================================================================
   Der Kult der Ewigen Erdnuss — Stilblatt für den Abzeichen-Bogen

   Zwei A4-Blätter als Druckvorlage: Blatt 1 acht Buttons zu 58 mm (das
   Maß der üblichen Buttonmaschine), Blatt 2 vier Aufnäher zu 80 mm.

   Hier zählen Millimeter, nicht Schönheit. Alle Kreise sind deshalb in
   mm angegeben und box-sizing: border-box gilt überall — der Außenrand
   eines Kreises ist seine Schnittlinie, und der Durchmesser gilt bis
   dorthin, Strichstärke eingerechnet.

   Die Blätter bleiben weiß: Wer Aufnäher auf Transferpapier druckt, will
   keinen Pergamentton um das Motiv herum. Pergament gibt es nur innerhalb
   der Kreise, weil die Bilder darauf stehen.

   Aufbau:
     1. Schriften
     2. Farben und Grundwerte
     3. Seitenlayout und Bögen
     4. Kopf und Fuß der Blätter
     5. Buttons, 58 mm
     6. Aufnäher, 80 mm
     7. Werkzeugleiste (nur Bildschirm)
   ========================================================================== */

/* ==========================================================================
   1. Schriften — selbst ausgeliefert (OFL, siehe assets/fonts/LIZENZ.txt)
   ========================================================================== */
@font-face { font-family: "IM Fell English"; font-style: normal; font-weight: 400; font-display: block; src: url("../assets/fonts/im-fell-english.woff2") format("woff2"); }
@font-face { font-family: "IM Fell English"; font-style: italic; font-weight: 400; font-display: block; src: url("../assets/fonts/im-fell-english-italic.woff2") format("woff2"); }
@font-face { font-family: "IM Fell English SC"; font-style: normal; font-weight: 400; font-display: block; src: url("../assets/fonts/im-fell-english-sc.woff2") format("woff2"); }
@font-face { font-family: "Pirata One"; font-style: normal; font-weight: 400; font-display: block; src: url("../assets/fonts/pirata-one.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Pirata One"; font-style: normal; font-weight: 400; font-display: block; src: url("../assets/fonts/pirata-one-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ==========================================================================
   2. Farben und Grundwerte
   ========================================================================== */
:root {
  --tinte:         #2a1f14;
  --tinte-blass:   #5c4a36;

  --roest:         #a5652c;
  --roest-dunkel:  #6b3f18;

  --linie:         rgba(107, 63, 24, .35);
  --linie-stark:   rgba(42, 31, 20, .7);
  --scheibe:       #f3e6c8;

  --font-titel:   "Pirata One", "IM Fell English SC", serif;
  --font-kapitel: "IM Fell English SC", "Pirata One", Georgia, serif;
  --font-text:    "IM Fell English", Georgia, "Times New Roman", serif;
}

/* ==========================================================================
   3. Seitenlayout und Bögen
   ------------------------------------------------------------------------
   10 mm Rand, damit die vier Reihen zu 58 mm auf ein Blatt passen. Die
   Bögen bekommen keine feste Höhe: Wächst etwas, wächst der Bogen auf eine
   dritte Seite, und das fällt beim Zählen der Seiten sofort auf.
   ========================================================================== */
@page {
  size: A4;
  margin: 10mm;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--font-text);
  font-size: 10pt;
  line-height: 1.35;
  color: var(--tinte);
  text-rendering: optimizeLegibility;
}

p { margin: 0; }
img { display: block; }

.bogen {
  background: #fff;
  color: var(--tinte);
}

@media screen {
  body {
    margin: 0;
    padding: 0 0 4rem;
    background: #4a3a28;
    background-image:
      radial-gradient(ellipse at 50% 0%, rgba(255, 248, 230, .18), rgba(255, 248, 230, 0) 60%);
  }

  .abz-blaetter {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
  }

  .bogen {
    flex: none;
    width: 210mm;
    min-height: 297mm;
    padding: 10mm;
    box-shadow: 0 14px 34px -18px rgba(0, 0, 0, .95);
  }

  /* Auf schmalen Geräten bleibt der Bogen A4 und wandert seitwärts:
     zusammengequetscht stimmten die Millimeter nicht mehr. */
  @media (max-width: 232mm) {
    .abz-blaetter {
      align-items: flex-start;
      overflow-x: auto;
      padding: 0 1rem;
    }
  }
}

@media print {
  html, body { margin: 0; background: #fff; }

  .bogen {
    width: auto;
    min-height: 0;
    padding: 0;
    margin: 0;
    box-shadow: none;
  }
  /* Genau zwei Seiten: die Aufnäher fangen auf einem neuen Blatt an */
  .bogen + .bogen { break-before: page; }
}

/* ==========================================================================
   4. Kopf und Fuß der Blätter
   ========================================================================== */
.bogen-kopf {
  text-align: center;
  padding-bottom: 1.4mm;
  margin-bottom: 3.5mm;
  border-bottom: 1pt double var(--roest-dunkel);
}
.bogen-kopf .ober {
  font-family: var(--font-kapitel);
  font-size: 7.5pt;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--tinte-blass);
}
.bogen-kopf h1 {
  margin: .6mm 0 0;
  font-family: var(--font-titel);
  font-weight: 400;
  font-size: 16pt;
  line-height: 1.05;
  color: var(--roest-dunkel);
}
.kopf-unter {
  margin-top: 1mm;
  font-family: var(--font-kapitel);
  font-size: 8pt;
  line-height: 1.25;
  color: var(--tinte-blass);
}

.bogen-fuss {
  margin-top: 3.5mm;
  padding-top: 1.2mm;
  border-top: .5pt solid var(--linie);
  text-align: center;
  font-size: 7.5pt;
  font-style: italic;
  color: var(--tinte-blass);
}

/* ==========================================================================
   5. Buttons, 58 mm
   ------------------------------------------------------------------------
   Vier Reihen zu zwei Kreisen: die vier Stufen als 2×2-Raster, darunter
   dasselbe Raster noch einmal. Acht Kreise, jede Stufe zweimal.

   Der Kreis misst 58 mm bis zur gestrichelten Schnittlinie (Strichstärke
   eingerechnet). Die dünne Linie bei 50 mm zeigt, was auf dem Rohling
   vorn zu sehen bleibt; die 4 mm dazwischen schlagen nach hinten um.
   ========================================================================== */
.knopf-raster {
  display: grid;
  grid-template-columns: repeat(2, 58mm);
  justify-content: center;
  column-gap: 22mm;
  row-gap: 4mm;
}

.knopf {
  position: relative;
  width: 58mm;
  height: 58mm;
  border: .3mm dashed var(--linie-stark);
  border-radius: 50%;
  overflow: hidden;
  background: var(--scheibe);
  break-inside: avoid;
}

/* Das Bild füllt den ganzen Kreis bis zur Schnittlinie — was umschlägt,
   ist dann Bild und kein weißer Rand. */
.knopf-bild {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Sichtlinie bei 50 mm: außen gemessen, Strichstärke eingerechnet. */
.knopf-sicht {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 50mm;
  height: 50mm;
  margin: -25mm 0 0 -25mm;
  border: .2mm solid rgba(42, 31, 20, .6);
  border-radius: 50%;
}

/* Der Name steht innerhalb der Sichtlinie: hoch genug, dass die Zeile im
   inneren Feld der Zeichnung liegt und nicht auf deren Ring, und schmal
   genug, dass sie die 50-mm-Linie nicht schneidet. */
.knopf-name {
  position: absolute;
  left: 13mm;
  right: 13mm;
  bottom: 12.5mm;
  padding: .7mm 1.2mm;
  text-align: center;
  font-family: var(--font-kapitel);
  font-size: 8.5pt;
  line-height: 1.15;
  letter-spacing: .05em;
  color: var(--roest-dunkel);
  background: rgba(251, 246, 234, .88);
  border-radius: 1mm;
}

/* ==========================================================================
   6. Aufnäher, 80 mm
   ------------------------------------------------------------------------
   Außen 80 mm bis zur Schnittlinie, davon 5 mm weißer Saum als Nähzugabe
   (.3 mm Strich + 4.7 mm Weiß), innen 70 mm Motiv. Unter jedem Kreis,
   außerhalb, die Kurzbeschreibung der Stufe aus dem Bordbuch.
   ========================================================================== */
.naeher-raster {
  display: grid;
  grid-template-columns: repeat(2, 88mm);
  justify-content: center;
  column-gap: 12mm;
  row-gap: 9mm;
}

.naeher { break-inside: avoid; }

.naeher-kreis {
  width: 80mm;
  height: 80mm;
  margin: 0 auto;
  padding: 4.7mm;
  background: #fff;
  border: .3mm dashed var(--linie-stark);
  border-radius: 50%;
}

.naeher-motiv {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--scheibe);
  border: .2mm solid rgba(42, 31, 20, .45);
  border-radius: 50%;
}

.naeher-bild {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.naeher-name {
  position: absolute;
  left: 14mm;
  right: 14mm;
  bottom: 11mm;
  padding: .8mm 1.4mm;
  text-align: center;
  font-family: var(--font-kapitel);
  font-size: 10.5pt;
  line-height: 1.15;
  letter-spacing: .05em;
  color: var(--roest-dunkel);
  background: rgba(251, 246, 234, .88);
  border-radius: 1mm;
}

/* Die Kurzbeschreibung steht außerhalb des Kreises: sie wird nicht
   mitgeschnitten, sie sagt nur, wofür die Stufe steht. */
.naeher-satz {
  max-width: 84mm;
  margin: 2.5mm auto 0;
  text-align: center;
  font-size: 8.5pt;
  line-height: 1.3;
  color: var(--tinte-blass);
  hyphens: auto;
}
.naeher-satz:empty { margin-top: 0; }

/* ==========================================================================
   7. Werkzeugleiste — nur am Bildschirm, im Druck weg
   ========================================================================== */
@media print {
  .werkzeugleiste, .abz-fehler { display: none !important; }
}

@media screen {
  .werkzeugleiste {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .9rem 1.4rem;
    position: sticky;
    top: 0;
    z-index: 10;
    margin: 0 0 2rem;
    padding: .9rem 1.2rem;
    background: #2a1f14;
    color: #f3e6c8;
    box-shadow: 0 6px 20px -10px rgba(0, 0, 0, .9);
  }
  .werkzeugleiste a,
  .werkzeugleiste p,
  .werkzeugleiste button {
    font-family: var(--font-kapitel);
    margin: 0;
  }
  .wz-zurueck { color: #e6d3ac; text-decoration: none; font-size: 1.05rem; }
  .wz-zurueck:hover, .wz-zurueck:focus-visible { color: #fff; text-decoration: underline; }
  .wz-status { flex: 1 1 12rem; color: #f3e6c8; font-size: 1.05rem; letter-spacing: .04em; }
  .wz-knopf {
    min-height: 44px;
    padding: .5em 1.3em;
    font-size: 1.05rem;
    letter-spacing: .06em;
    color: #fbfaf4;
    background: linear-gradient(180deg, #a5652c, #6b3f18);
    border: 2px solid #c98a4b;
    border-radius: 4px;
    cursor: pointer;
  }
  .wz-knopf:hover, .wz-knopf:focus-visible { background: #a5652c; }
  .wz-hinweis { flex: 1 1 100%; font-size: .9rem; line-height: 1.4; color: #c9b894; }

  .abz-fehler:not([hidden]) {
    display: block;
    max-width: 46rem;
    margin: 0 auto 2rem;
    padding: 1rem 1.2rem;
    font-size: 1.05rem;
    line-height: 1.5;
    color: #fbe9e3;
    background: #8c3b24;
    border: 2px solid #c07a63;
    border-radius: 4px;
  }

  :focus-visible { outline: 3px solid #c98a4b; outline-offset: 3px; }
}
