/* guide.css – Leitfaden (Issue #50): Inhalt im Rahmen der Website (Kopf, Fuß, Schriften und Grundfarben aus
   /site/site.css, scripts/site-shell.mjs); hier nur Inhaltsverzeichnis, Text, Kästen, Tabellen. Am Handy einspaltig. */

:root {
  --ink: #2b1d14;
  --wood: #5b3a22;
  --wood-dark: #3f2716;
  --parchment: #f4e4c1;
  --parchment-dim: #c9b38a;
  --gold: #f2c14e;
  --grass: #2c4220;
  --red: #e05a4f;
  --cyan: #3fc1c9;
  --pixel: 'Pixelify Sans', ui-monospace, monospace;
  color-scheme: dark;
}

.layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 16px;
}

.toc {
  position: sticky;
  top: 16px;
  align-self: start;
  padding: 12px;
  background: var(--wood);
  border: 4px solid var(--ink);
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc a {
  display: block;
  padding: 4px 6px;
  color: var(--parchment);
  font-size: 0.92rem;
  text-decoration: none;
}

.toc a:hover,
.toc a[aria-current='page'] {
  background: var(--wood-dark);
  color: var(--gold);
}

/* Text des Kapitels (früher <main>; <main> gehört jetzt dem Rahmen) */
.guide-text {
  padding: 24px clamp(16px, 4vw, 40px);
  background: var(--wood);
  border: 4px solid var(--ink);
  box-shadow: 4px 4px 0 rgb(0 0 0 / 0.35);
}

h1,
h2,
h3 {
  font-family: var(--pixel);
  color: var(--gold);
  line-height: 1.25;
}

.guide-text h1 {
  margin-top: 0;
  font-size: 2rem;
  /* Lange deutsche Wörter in der Pixelschrift passen sonst nicht aufs Handy */
  hyphens: auto;
  overflow-wrap: break-word;
}

/* site.css zentriert h2 mit Schatten (Startseite) – im Text links und schlicht */
.guide-text h2 {
  margin: 2em 0 0.6em;
  padding-bottom: 4px;
  font-size: 1.5rem;
  text-align: left;
  text-shadow: none;
  border-bottom: 3px dashed var(--wood-dark);
  hyphens: auto;
  overflow-wrap: break-word;
}

img {
  max-width: 100%;
  image-rendering: pixelated;
}

/* Spielbrett-Bilder: Rahmen wie im Spiel, Unterschrift aus dem Alt-Text darunter (figure) */
.guide-text p > img:only-child {
  display: block;
  margin: 8px auto;
  border: 4px solid var(--ink);
}

figure {
  margin: 16px 0;
  text-align: center;
}

figure img {
  border: 4px solid var(--ink);
}

figcaption {
  margin-top: 4px;
  color: var(--parchment-dim);
  font-size: 0.9rem;
}

.pair {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.pair figure {
  flex: 1 1 260px;
  max-width: 360px;
}

/* Kleine Figuren-Sprites im Text */
img.sprite {
  width: 28px;
  height: 28px;
  /* site.css: img { max-width: 100% } drückt Bildchen in schmalen Tabellenspalten (Handy) sonst auf null */
  max-width: none;
  vertical-align: middle;
  border: none;
  margin: 0;
  display: inline;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 0.95rem;
}

th,
td {
  padding: 6px 8px;
  border: 2px solid var(--wood-dark);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--wood-dark);
  color: var(--gold);
  font-family: var(--pixel);
}

.table-scroll {
  max-width: 100%;
  overflow-x: auto;
}

code {
  padding: 1px 4px;
  background: var(--wood-dark);
  border-radius: 3px;
}

kbd {
  padding: 1px 6px;
  border: 2px solid var(--ink);
  background: var(--parchment);
  color: var(--ink);
  font: 700 0.85rem var(--pixel);
}

/* Kästen: Designer's note (Pergament), Tipp (grün), Strategie (gold) */
.note {
  margin: 20px 0;
  padding: 12px 16px;
  border: 3px solid var(--ink);
  box-shadow: 3px 3px 0 rgb(0 0 0 / 0.35);
}

.note > :last-child {
  margin-bottom: 0;
}

.note-title {
  margin: 0 0 4px;
  font: 700 1rem var(--pixel);
}

.note-designer {
  background: var(--parchment);
  color: var(--ink);
}

.note-designer .note-title {
  color: #8a4b12;
}

.note-designer a {
  color: #8a4b12;
}

.note-tip {
  background: #2f4a24;
}

.note-tip .note-title {
  color: #9be15d;
}

.note-strategy {
  background: var(--wood-dark);
  border-color: var(--gold);
}

.note-strategy .note-title {
  color: var(--gold);
}

.contents {
  columns: 2 260px;
  font-size: 1.05rem;
}

.contents li {
  margin-bottom: 6px;
  break-inside: avoid;
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 32px;
  padding-top: 12px;
  border-top: 3px dashed var(--wood-dark);
  font-family: var(--pixel);
}

/* Handy: Inhaltsverzeichnis über dem Text, kompakt */
@media (max-width: 820px) {
  .layout {
    /* minmax(0, …): breite Tabellen dürfen die Spalte nicht aufdehnen (Issue #62) */
    grid-template-columns: minmax(0, 1fr);
    padding: 12px 8px;
  }

  .toc {
    position: static;
  }

  .toc ol {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 4px;
  }

  .toc a {
    padding: 2px 6px;
    font-size: 0.85rem;
  }

  .guide-text {
    padding: 16px 12px;
  }

  .guide-text h1 {
    font-size: 1.6rem;
  }

  .page-guide {
    font-size: 16px;
  }
}
