/* TRGS 746 Wissensseite, Strandmöllen TECH */
:root {
  --navy: #0e2a47;
  --navy-2: #143a5e;
  --petrol: #1f7a8c;
  --petrol-soft: #e3f1f4;
  --amber: #e09f3e;
  --amber-soft: #fbeedb;
  --ice: #bfdbf7;
  --red: #9e2a2b;
  --red-soft: #f6e4e4;
  --slate: #5b6b7c;
  --ink: #1b2430;
  --bg: #ffffff;
  --bg-2: #eef3f8;
  --line: #d8e1ea;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(14, 42, 71, .06), 0 6px 18px rgba(14, 42, 71, .07);
  --font: "Inter", "Segoe UI", Calibri, Arial, sans-serif;
  --side: 290px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 var(--font); -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--petrol); }
h1, h2, h3, h4 { color: var(--navy); line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); letter-spacing: -.01em; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.12rem; }
p { margin: 0 0 1em; }
ul { margin: 0 0 1em; padding-left: 1.2em; }
li { margin: .25em 0; }

/* Kopfzeile */
.topbar {
  position: sticky; top: 0; z-index: 20; height: 64px;
  display: flex; align-items: center; gap: 16px; padding: 0 24px;
  background: var(--navy); color: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.15);
}
.brand { display: flex; align-items: baseline; gap: 10px; color: #fff; text-decoration: none; min-width: 0; }
.brand b { font-size: 1.15rem; letter-spacing: .02em; white-space: nowrap; }
.brand span { color: var(--ice); font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }
.search { position: relative; }
.search input {
  width: 240px; height: 38px; border-radius: 19px; border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.1); color: #fff; padding: 0 14px 0 36px; font: inherit; font-size: .9rem;
}
.search input::placeholder { color: rgba(255,255,255,.65); }
.search input:focus { outline: 2px solid var(--amber); background: rgba(255,255,255,.18); }
.search .i { position: absolute; left: 13px; top: 11px; color: var(--ice); font-size: 15px; line-height: 0; }
.results {
  position: absolute; right: 0; top: 46px; width: min(420px, 92vw); max-height: 60vh; overflow: auto;
  background: #fff; color: var(--ink); border-radius: var(--radius); box-shadow: var(--shadow); display: none;
}
.results.open { display: block; }
.results a { display: block; padding: 10px 14px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--bg-2); }
.results a:hover, .results a:focus { background: var(--petrol-soft); outline: none; }
.results small { display: block; color: var(--slate); }
.results .none { padding: 12px 14px; color: var(--slate); }
.menu-btn { display: none; background: none; border: 0; color: #fff; font-size: 22px; cursor: pointer; padding: 6px; }

/* Rahmen */
.frame { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: calc(100vh - 64px); }
.side {
  position: sticky; top: 64px; height: calc(100vh - 64px); overflow: auto;
  background: var(--bg-2); border-right: 1px solid var(--line); padding: 22px 14px 40px;
}
.side .label { font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--slate); margin: 4px 10px 10px; }
.chap { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border-radius: 9px; text-decoration: none; color: var(--ink); }
.chap:hover { background: #fff; }
.chap .n {
  flex: 0 0 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  background: var(--petrol); color: #fff; font-weight: 700; font-size: .9rem;
}
.chap.planned { color: var(--slate); }
.chap.planned .n { background: #c9d3dd; }
.chap .t { font-weight: 600; line-height: 1.3; padding-top: 3px; }
.chap .t small { display: block; font-weight: 400; color: var(--slate); font-size: .8rem; }
.chap.active { background: #fff; box-shadow: var(--shadow); }
.chap.active .n { background: var(--navy); }
.sub { list-style: none; margin: 4px 0 12px 48px; padding: 0; border-left: 2px solid var(--line); }
.sub li { margin: 0; }
.sub a { display: block; padding: 4px 10px; font-size: .86rem; color: var(--slate); text-decoration: none; border-left: 2px solid transparent; margin-left: -2px; }
.sub a:hover, .sub a.on { color: var(--navy); border-left-color: var(--amber); }

main { min-width: 0; }
.content { max-width: 940px; padding: 40px 48px 64px; }

/* Startseite Held */
.hero { position: relative; color: #fff; background: var(--navy) url("img/titel.svg") center right / cover no-repeat; }
.hero-in { max-width: 940px; padding: 64px 48px 72px; }
.hero .kick { color: var(--amber); }
.hero h1 { color: #fff; max-width: 620px; }
.hero p { color: var(--ice); max-width: 560px; font-size: 1.08rem; }
.hero .meta { font-size: .85rem; color: var(--ice); opacity: .85; margin-top: 18px; }

.kick { font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--petrol); margin-bottom: 8px; }
.lead { font-size: 1.1rem; color: #33414f; }

/* Kapitelkopf */
.chead { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 28px; align-items: center; margin-bottom: 30px; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.chead .art { background: var(--petrol); border-radius: 50%; aspect-ratio: 1; padding: 6px; }

/* Absatz-Abschnitte */
.absatz { margin: 0 0 44px; }
.absatz > h2 { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }

/* Fundstellen-Badge */
.ref {
  display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 6px;
  background: var(--ice); color: var(--navy); font-size: .76rem; font-weight: 700; white-space: nowrap;
  text-decoration: none; vertical-align: middle; letter-spacing: .01em;
}
a.ref:hover { background: var(--navy); color: #fff; }
.ref.dark { background: var(--petrol); color: #fff; }
.ref.own { background: var(--amber-soft); color: #7a4e14; }

/* Karten und Raster */
.grid { display: grid; gap: 16px; margin: 16px 0 20px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { background: var(--bg-2); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.card.dark { background: var(--navy); color: #e8eef5; }
.card.dark h3, .card.dark h4 { color: #fff; }
.card.warn { background: var(--red-soft); }
.card h3, .card h4 { margin-bottom: .35em; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.card .head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.card .head h3, .card .head h4 { margin: 0; }
.ic {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: var(--petrol); color: #fff; font-size: 19px;
}
.ic.navy { background: var(--navy); } .ic.red { background: var(--red); } .ic.amber { background: var(--amber); } .ic.slate { background: var(--slate); }
.ic svg { width: 1em; height: 1em; }

.def { border-left: 4px solid var(--petrol); background: #fff; padding: 12px 16px; border-radius: 0 10px 10px 0; box-shadow: var(--shadow); margin: 12px 0 16px; }
.note { font-size: .9rem; color: var(--slate); font-style: italic; }
.own-box { background: var(--amber-soft); border-radius: 10px; padding: 12px 16px; margin: 14px 0; }
.own-box b { color: #7a4e14; }

/* Abbildungen */
figure { margin: 18px 0 22px; }
figure.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
figure img { display: block; width: 100%; height: auto; }
figcaption { font-size: .85rem; color: var(--slate); margin-top: 8px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }

/* Phasen */
.phases { list-style: none; padding: 0; margin: 16px 0 20px; display: grid; grid-template-columns: repeat(var(--n, 7), minmax(0, 1fr)); gap: 10px; }
.phases li { margin: 0; background: var(--petrol); color: #fff; border-radius: 10px; padding: 14px 6px 10px; text-align: center; font-size: .82rem; font-weight: 700; box-shadow: var(--shadow); }
.phases li.s { background: var(--slate); } .phases li.d { background: var(--navy); } .phases li.hl { background: var(--amber); color: var(--navy); }
.phases li span { display: block; font-size: 22px; line-height: 1; margin-bottom: 8px; }
.phases li span svg { width: 1em; height: 1em; }

/* Dichteskala */
.scale { display: grid; grid-template-columns: 3.6fr 1.6fr 3.2fr; border-radius: 10px; overflow: hidden; margin: 14px 0 8px; color: #fff; text-align: center; font-size: .92rem; }
.scale div { padding: 12px 6px; }
.scale b { display: block; }
.dens { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 6px; }
.dens span { background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; font-size: .86rem; }
.dens span b { color: var(--navy); }
.dens .l { border-color: var(--petrol); } .dens .m { border-color: var(--slate); } .dens .h { border-color: var(--amber); }

/* Übersicht 23 Absätze */
.overview { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 16px 0 24px; }
.overview .col h4 { color: #fff; font-size: .84rem; padding: 9px 10px; border-radius: 8px; margin: 0 0 8px; text-align: center; }
.overview a { display: flex; gap: 8px; align-items: center; background: var(--bg-2); border-radius: 8px; padding: 7px 9px; margin-bottom: 6px; text-decoration: none; color: var(--ink); font-size: .84rem; line-height: 1.25; }
.overview a:hover { background: var(--petrol-soft); }
.overview a b { flex: 0 0 22px; font-size: 1rem; }
.overview a span, .overview a { min-width: 0; overflow-wrap: anywhere; hyphens: auto; }
.overview .col { min-width: 0; }

/* Wandschnitte, GHS */
.walls { list-style: none; padding: 0; margin: 12px 0 0; }
.walls li { display: flex; gap: 12px; align-items: center; margin: 0 0 10px; }
.walls img { width: 78px; flex: 0 0 78px; }
.ghs { display: flex; gap: 6px; margin-left: auto; }
.ghs img { width: 46px; height: 46px; }

/* Tabellen */
table { width: 100%; border-collapse: collapse; margin: 12px 0 20px; font-size: .94rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--bg-2); color: var(--navy); font-size: .84rem; }

/* Blättern, Fuß */
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); }
.pager a { flex: 1; max-width: 48%; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; text-decoration: none; color: var(--navy); }
.pager a:hover { border-color: var(--petrol); background: var(--petrol-soft); }
.pager small { display: block; color: var(--slate); }
.pager .next { text-align: right; margin-left: auto; }
.foot { padding: 22px 48px 40px; font-size: .82rem; color: var(--slate); border-top: 1px solid var(--line); max-width: 940px; }

/* Startseite Kapitelkarten */
.chapters a.card { display: block; text-decoration: none; color: var(--ink); transition: transform .12s ease; }
.chapters a.card:hover { transform: translateY(-2px); }
.chapters .num { font-size: 2rem; font-weight: 800; color: var(--petrol); line-height: 1; }
.chapters .planned { opacity: .6; box-shadow: none; border: 1px dashed #b7c3cf; background: #fff; }

/* Hervorhebung beim Anspringen */
:target > h2, :target > h3 { animation: flash 1.6s ease; }
@keyframes flash { 0% { background: var(--amber-soft); } 100% { background: transparent; } }

/* Mobil */
@media (max-width: 1000px) {
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .frame { grid-template-columns: minmax(0, 1fr); }
  .menu-btn { display: block; }
  .side { position: fixed; top: 64px; left: 0; width: min(320px, 88vw); z-index: 15; transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow); }
  body.nav-open .side { transform: none; }
  .search input { width: 150px; }
  .brand span { display: none; }
  .content, .hero-in { padding: 28px 16px 48px; }
  .foot { padding: 20px 16px 36px; }
  .g2, .g3, .split { grid-template-columns: minmax(0, 1fr); }
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; font-size: .86rem; }
  .card, .def, .own-box { overflow-wrap: break-word; hyphens: auto; }
  .chead { grid-template-columns: minmax(0, 1fr) 64px; gap: 12px; }
  h1 { font-size: 1.7rem; hyphens: auto; overflow-wrap: break-word; }
  .absatz > h2 { font-size: 1.25rem; }
  .ghs img { width: 38px; height: 38px; }
  .phases { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { background-position: 70% center; }
  .hero-in { background: linear-gradient(90deg, rgba(14,42,71,.92), rgba(14,42,71,.6)); }
  .pager { flex-direction: column; } .pager a { max-width: none; }
  .topbar { padding: 0 12px; gap: 8px; }
}
@media print {
  .topbar, .side, .pager { display: none; }
  .frame { display: block; }
  .card, figure.panel { box-shadow: none; break-inside: avoid; }
}
