/* PREWI Gebrauchsanweisung — Design-Tokens 1:1 aus den Produktdatenblaettern
   (Dokumentation Produkte/vorlage/style.css). Eine Quelle fuer Web und A4-PDF. */

@font-face { font-family: "HK Grotesk"; src: url("fonts/HKGrotesk-Regular.otf") format("opentype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "HK Grotesk"; src: url("fonts/HKGrotesk-Medium.otf") format("opentype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "HK Grotesk"; src: url("fonts/HKGrotesk-SemiBold.otf") format("opentype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "HK Grotesk"; src: url("fonts/HKGrotesk-Bold.otf") format("opentype"); font-weight: 700; font-display: swap; }

:root {
  --bg: #FBF9F6;
  --bronze: #8C6E3F;
  --ink: #23201A;
  --body: #6E665D;
  --muted: #8E877C;
  --orange: #E57D2C;
  --row-alt: #F2EFE7;
  --hairline: #E3DED0;
  --orange-soft: #FBE9D8;
  /* Produktlinien */
  --pf: #8C6E3F;
  --pr: #5E6B70;
  --px: #6F7F4E;
  --mu: #E57D2C;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 16px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "HK Grotesk", "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

/* ---------------------------------------------------------------- Typo */

.kicker {
  font-weight: 500;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--bronze);
  margin: 0 0 6px;
}

h1, h2, h3, h4 { font-weight: 600; color: var(--ink); line-height: 1.15; }
h2 { font-size: 30px; margin: 0; }
h3 { font-size: 19px; margin: 34px 0 10px; }
h4 { font-size: 15px; margin: 22px 0 6px; }

.accent-rule { width: 34px; height: 3px; background: var(--bronze); border: 0; margin: 12px 0 22px; }

p { margin: 0 0 12px; color: var(--ink); }
.lead { font-size: 18px; color: var(--body); max-width: 60ch; }
.klein { font-size: 13px; color: var(--muted); }
strong { font-weight: 600; }
ul, ol { padding-left: 1.25em; margin: 0 0 14px; }
li { margin: 0 0 5px; }
li::marker { color: var(--bronze); }

/* ------------------------------------------------------- Linien-Chips */

.l {
  display: inline-block;
  font-weight: 600;
  font-size: .72em;
  letter-spacing: .06em;
  line-height: 1;
  color: #fff;
  padding: .32em .5em .28em;
  border-radius: 3px;
  vertical-align: .12em;
  margin-right: .15em;
}
.l.pf { background: var(--pf); }
.l.pr { background: var(--pr); }
.l.px { background: var(--px); }
.l.mu { background: var(--mu); }

.gilt { margin: -8px 0 14px; font-size: 13px; color: var(--muted); }

.offen {
  display: inline-block;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #fff;
  background: var(--orange);
  padding: 2px 6px;
  border-radius: 2px;
  vertical-align: .1em;
}
.offen::before { content: "offen · "; opacity: .8; }

/* ---------------------------------------------------------------- Boxen */

.hinweis, .achtung {
  padding: 14px 18px;
  background: var(--row-alt);
  border-left: 3px solid var(--bronze);
  margin: 16px 0;
  font-size: 15px;
  break-inside: avoid;
}
.achtung { border-left-color: var(--orange); background: var(--orange-soft); }
.hinweis > :last-child, .achtung > :last-child { margin-bottom: 0; }
.box-titel { font-weight: 600; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--bronze); margin: 0 0 4px; }
.achtung .box-titel { color: var(--orange); }

/* -------------------------------------------------------------- Tabellen */

.tab-wrap { overflow-x: auto; margin: 14px 0 18px; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th {
  text-align: left;
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 10px;
  border-bottom: 1.5px solid var(--bronze);
  vertical-align: bottom;
}
td { padding: 8px 10px; vertical-align: top; border-bottom: 1px solid var(--hairline); }
tbody tr:nth-child(odd) td { background: var(--row-alt); }
td.lab { font-weight: 600; white-space: nowrap; }
.tab-linien th:not(:first-child), .tab-linien td:not(:first-child) { min-width: 130px; }

/* ----------------------------------------------------- Skizzen & Fotos */

figure { margin: 18px 0 22px; break-inside: avoid; }
figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; }
figcaption b { color: var(--bronze); font-weight: 600; }

.skizze { background: #fff; border: 1px solid var(--hairline); border-radius: 3px; padding: 14px 16px 10px; }
.sk { width: 100%; height: auto; display: block; font-family: "HK Grotesk", "Segoe UI", sans-serif; }
.sk .t { font-size: 12px; fill: var(--ink); }
.sk .t-klein { font-size: 10.5px; fill: var(--body); }
.sk .t-fett { font-size: 12.5px; font-weight: 600; fill: var(--ink); }
.sk .holz { fill: url(#p-holz); stroke: var(--bronze); stroke-width: 1; }
.sk .holz2 { fill: #D9BF8C; stroke: var(--bronze); stroke-width: 1; }
.sk .mat { fill: #F7D9BD; stroke: var(--orange); stroke-width: 1.3; stroke-linejoin: round; }
.sk .mat2 { fill: #FBEBDC; stroke: var(--orange); stroke-width: 1.1; stroke-dasharray: 4 2; }
.sk .mat-l { fill: none; stroke: var(--orange); stroke-width: 9; stroke-linecap: round; opacity: .55; }
.sk .beton { fill: url(#p-beton); stroke: var(--muted); stroke-width: 1; }
.sk .folie { fill: none; stroke: #2F8F83; stroke-width: 3; stroke-linejoin: round; }
.sk .mass { stroke: var(--muted); stroke-width: .9; fill: none; }
.sk .hilfs { stroke: var(--muted); stroke-width: .7; }
.sk .leit { stroke: var(--muted); stroke-width: .8; fill: none; }
.sk .leit-or { stroke: var(--orange); stroke-width: 1.6; fill: none; }
.sk .punkt { fill: var(--ink); }
.sk .nagel { fill: var(--ink); }
.sk .nagel-l { stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; }
.sk .klinge { fill: #D5D9DC; stroke: #5E6B70; stroke-width: 1; }
.sk .griff { fill: var(--ink); }
.sk .latte { fill: #D9C46A; stroke: #8C6E3F; stroke-width: 1; }
.sk .libelle { fill: #CFE6B0; stroke: #6F7F4E; stroke-width: .8; }
.sk .schnitt { stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 5 3; }
.sk .schlitz { stroke: var(--ink); stroke-width: 1.2; }
.sk .keil { fill: #C9A86A; stroke: var(--bronze); stroke-width: 1; }
.sk .keil2 { fill: #B48E4E; stroke: var(--bronze); stroke-width: 1; }
.sk .klammer { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; }
.sk .kleber { fill: none; stroke: #6E665D; stroke-width: 2; stroke-linejoin: round; }
.sk .spachtel { fill: #D5D9DC; stroke: #5E6B70; stroke-width: 1; }
.sk .gewicht { fill: #5E6B70; }
.sk .rohr { fill: #DCE3E6; stroke: #5E6B70; stroke-width: 1; }
.sk .konus { fill: #C0392B; opacity: .85; }
.sk .anker { stroke: #5E6B70; stroke-width: 1; stroke-dasharray: 6 3; }
.sk .stahl { fill: #5C5850; }
.sk .stahl-l { stroke: #5C5850; stroke-width: 4; }
.sk .abstand { fill: #9FA8AB; stroke: #5E6B70; stroke-width: 1; }
.sk .draht { fill: none; stroke: #8A4B2A; stroke-width: 1.4; }
.sk .stopper { fill: var(--orange); stroke: #B5601C; stroke-width: 1; }
.sk .stopper-r { stroke: #B5601C; stroke-width: 1; }
.sk .ok-bg { fill: #4E8A3E; } .sk .ok-z { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.sk .nok-bg { fill: #C0392B; } .sk .nok-z { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; }
.sk .nok-l { stroke: #C0392B; stroke-width: 1.5; }

.foto img { width: 100%; height: auto; border-radius: 3px; }
.foto-reihe { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 18px 0 22px; }
.foto-reihe figure { margin: 0; }
.foto-reihe img { aspect-ratio: 4 / 3; object-fit: cover; }

/* ---------------------------------------------------------- Bausteine */

.regeln { list-style: none; padding: 0; counter-reset: r; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 30px; }
.regeln li { counter-increment: r; position: relative; padding: 12px 0 12px 46px; border-bottom: 1px solid var(--hairline); margin: 0; break-inside: avoid; }
.regeln li::before { content: counter(r, decimal-leading-zero); position: absolute; left: 0; top: 10px; font-weight: 600; font-size: 22px; color: var(--orange); }
.regeln b { display: block; font-weight: 600; }

.linien { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin: 20px 0; }
.linie { background: #fff; border: 1px solid var(--hairline); border-top: 4px solid var(--c); border-radius: 3px; overflow: hidden; break-inside: avoid; }
.linie img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.linie .in { padding: 12px 14px 14px; }
.linie h4 { margin: 0 0 2px; font-size: 16px; }
.linie .code { font-weight: 700; color: var(--c); letter-spacing: .06em; font-size: 13px; }
.linie p { font-size: 13.5px; color: var(--body); margin: 6px 0 0; }
.linie.pf { --c: var(--pf); } .linie.pr { --c: var(--pr); } .linie.px { --c: var(--px); } .linie.mu { --c: var(--mu); }

.schritte { list-style: none; padding: 0; counter-reset: s; }
.schritte li { counter-increment: s; position: relative; padding-left: 36px; margin-bottom: 9px; }
.schritte li::before { content: counter(s); position: absolute; left: 0; top: 1px; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 12.5px; font-weight: 600; text-align: center; line-height: 24px; }

.check { list-style: none; padding: 0; }
.check li { position: relative; padding-left: 30px; margin-bottom: 7px; }
.check li::before { content: ""; position: absolute; left: 0; top: 3px; width: 16px; height: 16px; border: 1.5px solid var(--bronze); border-radius: 2px; background: #fff; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 34px; }
.check-grid h4 { margin-top: 16px; color: var(--bronze); text-transform: uppercase; font-size: 12.5px; letter-spacing: .1em; }

.zwei { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 26px; align-items: start; }
@media (max-width: 760px) { .zwei { grid-template-columns: minmax(0, 1fr); } }

/* ---------------------------------------------------------- Titelblatt */

.cover { position: relative; color: #fff; min-height: 92vh; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; background: var(--ink); }
.cover > img.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .72; }
.cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(35,32,26,.15) 0%, rgba(35,32,26,.05) 35%, rgba(35,32,26,.88) 88%, rgba(35,32,26,.92) 100%); }
.cover > * { position: relative; z-index: 1; }
.cover-top { padding: 34px 40px; display: flex; justify-content: space-between; align-items: flex-start; }
.cover-top .logo { width: 230px; background: var(--bg); padding: 12px 16px; border-radius: 2px; }
.cover-bottom { padding: 0 40px 44px; }
.cover .kicker { color: #F3C9A2; }
.cover h1 { color: #fff; font-size: clamp(38px, 6vw, 64px); margin: 0 0 8px; letter-spacing: -.01em; }
.cover .sub { font-size: 19px; color: #EDE7DC; max-width: 40ch; margin: 0 0 22px; }
.cover .chips .l { font-size: 15px; margin-right: 6px; }
.cover .meta { margin-top: 22px; font-size: 13px; color: #CFC7B9; }

/* ---------------------------------------------------------- Web-Layout */

.layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); max-width: 1240px; margin: 0 auto; }
nav.toc { position: sticky; top: 0; align-self: start; height: 100vh; overflow-y: auto; padding: 34px 18px 34px 28px; border-right: 1px solid var(--hairline); font-size: 14px; }
nav.toc .kicker { margin-bottom: 12px; }
nav.toc ol { list-style: none; padding: 0; margin: 0; }
nav.toc li { margin: 0; }
nav.toc a { display: flex; gap: 10px; padding: 5px 8px; border-radius: 3px; color: var(--body); text-decoration: none; }
nav.toc a span { color: var(--muted); min-width: 1.6em; font-variant-numeric: tabular-nums; }
nav.toc a:hover, nav.toc a.aktiv { background: var(--row-alt); color: var(--ink); }
nav.toc a.aktiv span { color: var(--orange); }
nav.toc .teil { margin: 16px 0 4px 8px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--bronze); }
nav.toc .dl { display: block; margin: 22px 8px 0; padding: 10px 12px; background: var(--ink); color: #fff; text-decoration: none; border-radius: 3px; font-weight: 500; text-align: center; }

main { padding: 0 56px 80px; min-width: 0; }
section.kap { padding: 56px 0 8px; border-bottom: 1px solid var(--hairline); }
section.kap:last-of-type { border-bottom: 0; }
.kap-nr { font-variant-numeric: tabular-nums; }

.mobil-nav { display: none; }
.print-only { display: none; }

@media (max-width: 980px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  nav.toc { display: none; }
  main { padding: 0 16px 60px; }
  .mobil-nav { display: block; position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--hairline); padding: 10px 16px; }
  .mobil-nav select { width: 100%; font: inherit; font-size: 15px; padding: 8px 10px; border: 1px solid var(--hairline); border-radius: 3px; background: #fff; color: var(--ink); }
  h2 { font-size: 25px; }
  .cover-top, .cover-bottom { padding-left: 16px; padding-right: 16px; }
  .cover-top .logo { width: 170px; }
  .skizze { padding: 8px; }
  .tab-wrap table { min-width: 560px; }
}

footer.seite { max-width: 1240px; margin: 0 auto; padding: 26px 56px 50px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--hairline); }

/* ---------------------------------------------------------------- Druck */

@page { size: A4; }
/* build.py rendert Titelblatt (randlos) und Inhalt (mit Rand) getrennt */
html.druck-cover body > :not(.cover) { display: none !important; }
html.druck-inhalt .cover { display: none !important; }

@media print {
  body { font-size: 9.6pt; line-height: 1.45; }
  .layout { display: block; max-width: none; }
  nav.toc, .mobil-nav, footer.seite, .web-only { display: none !important; }
  .print-only { display: block; }
  main { padding: 0; }
  section.kap { padding: 0 0 4mm; border: 0; }
  section.neu { break-before: page; }
  h2 { font-size: 21pt; }
  h3 { font-size: 12.5pt; margin: 6mm 0 2.5mm; break-after: avoid; }
  /* Titel nie allein am Seitenende: Kapitelkopf bleibt beim ersten Inhalt */
  .kap > .kicker, .kap > h2, .kap > .accent-rule, h4, .box-titel { break-after: avoid; }
  h4 { font-size: 10pt; break-after: avoid; }
  .kicker { font-size: 7.6pt; }
  .lead { font-size: 11pt; }
  .klein, figcaption { font-size: 7.8pt; }
  table { font-size: 8.6pt; }
  th { font-size: 6.9pt; padding: 4px 6px; }
  td { padding: 4px 6px; }
  tr, .hinweis, .achtung, .linie, .regeln li { break-inside: avoid; }
  .tab-wrap { overflow: visible; }
  .hinweis, .achtung { font-size: 9pt; padding: 3mm 4mm; }
  .skizze { padding: 3mm; }
  figure { margin: 4mm 0 5mm; }
  .foto-reihe { gap: 3mm; margin: 4mm 0; grid-template-columns: repeat(3, 1fr); }
  .foto-reihe.zwei-sp { grid-template-columns: repeat(2, 1fr); }
  .linien { grid-template-columns: repeat(4, 1fr); gap: 3mm; }
  .linie p { font-size: 8pt; }
  .regeln { grid-template-columns: 1fr 1fr; gap: 0 8mm; }
  .regeln li { padding: 2.6mm 0 2.6mm 11mm; }
  .regeln li::before { font-size: 15pt; top: 2mm; }
  .check-grid { grid-template-columns: 1fr 1fr; gap: 0 8mm; }
  .check li { margin-bottom: 1.2mm; }
  .check-grid h4 { margin-top: 4mm; }
  #kontakt { break-inside: avoid; }
  .zwei { gap: 6mm; }
  .lead { margin-bottom: 4mm; }
  a { color: inherit; text-decoration: none; }

  .cover { height: 296.5mm; min-height: 0; width: 100%; }
  .foto.breit img { height: 72mm; object-fit: cover; }
  .cover-top { padding: 16mm 16mm; }
  .cover-top .logo { width: 62mm; }
  .cover-bottom { padding: 0 16mm 18mm; }
  .cover h1 { font-size: 40pt; }
  .cover .sub { font-size: 13pt; }
  .cover .qr { display: flex; gap: 4mm; align-items: center; margin-top: 8mm; font-size: 8.5pt; color: #EDE7DC; }
  .cover .qr img { width: 22mm; height: 22mm; background: #fff; padding: 1.5mm; border-radius: 2px; }

  .toc-print { break-after: page; }
  .toc-print ol { list-style: none; padding: 0; margin: 0; columns: 1; }
  .toc-print li { display: flex; align-items: baseline; gap: 3mm; padding: .9mm 0; border-bottom: 1px solid var(--hairline); margin: 0; font-size: 9.4pt; }
  .toc-print li .n { color: var(--orange); font-weight: 600; min-width: 8mm; }
  .toc-print li .s { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
  .toc-print .teil { font-size: 7.4pt; letter-spacing: .14em; text-transform: uppercase; color: var(--bronze); margin: 3mm 0 0; border: 0; }
}
