/* Rheinwerkstatt – Stylesheet
   Palette: Hintergrund #f6f1e7, Text #2b2118, Akzent #b5542d, Sekundär #6b7d5c */

:root {
  --bg: #f6f1e7;
  --bg-deep: #ede5d5;
  --ink: #2b2118;
  --ink-soft: #5a4b3f;
  --line: #d8cdb8;
  --accent: #b5542d;
  --accent-dark: #8f3f20;
  --moss: #6b7d5c;
  --moss-dark: #4f5f43;
  --paper: #fffaf1;
  --max: 1160px;
  --radius: 4px;
  --font-head: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", "Segoe UI", Helvetica, Arial, sans-serif;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
}

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

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-dark); }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 .6em;
  color: var(--ink);
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); font-variation-settings: "opsz" 144; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.25rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1.1em; }
ul, ol { padding-left: 1.3em; }
li { margin-bottom: .35em; }
strong { font-weight: 600; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: #fff; padding: .5rem 1rem; z-index: 100;
}
.skip-link:focus { left: 1rem; top: 1rem; }

.wrap { width: min(var(--max), 100% - 2rem); margin-inline: auto; }

/* ---------- Header / Navigation ---------- */
.site-header {
  background: var(--bg);
  border-bottom: 2px solid var(--ink);
  position: sticky; top: 0; z-index: 50;
}
.nav-bar {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 72px; gap: 1rem;
}
.brand {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.55rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.015em;
  display: inline-flex; align-items: center; gap: .55rem;
}
.brand svg { width: 30px; height: 30px; flex: none; }
.brand .dot { color: var(--accent); }

.nav-toggle {
  display: inline-flex; align-items: center; gap: .5rem;
  background: none; border: 2px solid var(--ink); border-radius: var(--radius);
  padding: .45rem .75rem; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer;
}
.nav-toggle .bars { display: inline-block; width: 18px; height: 2px; background: currentColor; position: relative; }
.nav-toggle .bars::before, .nav-toggle .bars::after {
  content: ""; position: absolute; left: 0; width: 18px; height: 2px; background: currentColor;
}
.nav-toggle .bars::before { top: -6px; }
.nav-toggle .bars::after { top: 6px; }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: .25rem; }
.site-nav a {
  display: block; padding: .5rem .8rem; color: var(--ink); text-decoration: none;
  font-weight: 600; border-radius: var(--radius); border: 2px solid transparent;
}
.site-nav a:hover { border-color: var(--line); }
.site-nav a[aria-current="page"] { border-color: var(--accent); color: var(--accent-dark); }

@media (max-width: 820px) {
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--bg); border-bottom: 2px solid var(--ink); padding: .75rem 1rem 1rem;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; gap: .15rem; }
  .site-nav a { padding: .7rem .8rem; border-bottom: 1px solid var(--line); border-radius: 0; }
}
@media (min-width: 821px) { .nav-toggle { display: none; } }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: clamp(2.5rem, 6vw, 5rem) 0;
  background-color: var(--bg);
  background-image:
    linear-gradient(to right, rgba(43,33,24,.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(43,33,24,.07) 1px, transparent 1px);
  background-size: 48px 48px;
  border-bottom: 2px solid var(--ink);
}
.hero-grid {
  display: grid; gap: 2rem; align-items: center;
}
@media (min-width: 821px) {
  .hero-grid { grid-template-columns: 1.1fr 1fr; gap: 3.5rem; }
}
.hero figure { margin: 0; }
.hero img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  border: 2px solid var(--ink); border-radius: var(--radius);
  box-shadow: 10px 10px 0 var(--moss);
}
.hero figcaption, figcaption {
  font-size: .85rem; color: var(--ink-soft); margin-top: .6rem;
}
.hero .eyebrow, .eyebrow {
  display: inline-block; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  font-size: .78rem; color: var(--moss-dark); margin-bottom: .9rem;
}
.hero .lead, .lead { font-size: 1.22rem; color: var(--ink-soft); }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.4rem; }
.btn {
  display: inline-block; padding: .7rem 1.25rem; font-weight: 600; text-decoration: none;
  border: 2px solid var(--ink); border-radius: var(--radius); color: var(--ink); background: var(--paper);
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.btn-accent:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }

/* Page hero (Unterseiten) */
.page-hero { padding: clamp(2rem, 5vw, 4rem) 0 0; }
.page-hero .hero-grid { align-items: start; }

/* ---------- Sections ---------- */
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section + .section { border-top: 2px solid var(--line); }
.section-head { max-width: 760px; margin-bottom: 2.25rem; }
.section-head h2 { margin-bottom: .4em; }
.section-alt { background: var(--bg-deep); }
.prose { max-width: 760px; }
.prose h2 { margin-top: 2.2rem; }
.prose h3 { margin-top: 1.6rem; }

.two-col { display: grid; gap: 2.5rem; }
@media (min-width: 821px) { .two-col { grid-template-columns: 1fr 1fr; } }

/* ---------- Cards ---------- */
.cards { display: grid; gap: 1.25rem; }
@media (min-width: 600px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .cards.cols-4 { grid-template-columns: repeat(4, 1fr); } .cards.cols-3 { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex; flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translate(-3px, -3px); box-shadow: 5px 5px 0 var(--accent); }
.card h3 { margin-top: .5rem; }
.card p { color: var(--ink-soft); flex: 1; }
.card .card-link { font-weight: 700; text-decoration: none; }
.card .card-link::after { content: " →"; }
.card .num {
  font-family: var(--font-head); font-size: 2rem; color: var(--moss); font-weight: 700; line-height: 1;
}

.card-img { padding: 0; overflow: hidden; }
.card-img img { aspect-ratio: 3 / 2; object-fit: cover; border-bottom: 2px solid var(--ink); }
.card-img .card-body { padding: 1.5rem; display: flex; flex-direction: column; flex: 1; }

/* ---------- Fakten ---------- */
.facts { display: grid; gap: 1.25rem; }
@media (min-width: 821px) { .facts { grid-template-columns: repeat(3, 1fr); } }
.fact {
  border: 2px solid var(--moss); border-radius: var(--radius); padding: 1.5rem; background: var(--paper);
}
.fact .big {
  font-family: var(--font-head); font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 700; color: var(--accent); line-height: 1; margin-bottom: .4rem;
}
.fact p { margin: 0; color: var(--ink-soft); }
.fact .src { font-size: .85rem; display: block; margin-top: .6rem; }

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; border: 2px solid var(--ink); border-radius: var(--radius); background: var(--paper); }
table { border-collapse: collapse; width: 100%; min-width: 640px; font-size: .98rem; }
th, td { text-align: left; padding: .75rem .9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--bg-deep); font-weight: 700; font-family: var(--font-head); font-size: 1rem; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fbf6ea; }
td.num, th.num { text-align: right; white-space: nowrap; }
.table-note { font-size: .9rem; color: var(--ink-soft); margin-top: .75rem; }

/* ---------- Zeitleiste ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 11px; top: 0; bottom: 0; width: 2px; background: var(--ink);
}
.timeline li { position: relative; padding-left: 3rem; margin-bottom: 2rem; }
.timeline li::before {
  content: ""; position: absolute; left: 3px; top: .35rem; width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--ink); box-sizing: content-box;
}
.timeline time, .timeline .when {
  display: inline-block; font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; color: var(--moss-dark); margin-bottom: .25rem;
}
.timeline h3 { margin: 0 0 .35rem; font-size: 1.2rem; }
.timeline p { margin: 0; color: var(--ink-soft); }
@media (min-width: 821px) {
  .timeline { padding-left: 1rem; }
  .timeline::before { left: 27px; }
  .timeline li { padding-left: 4rem; }
  .timeline li::before { left: 19px; }
}

/* ---------- Boxen ---------- */
.callout {
  border: 2px solid var(--accent); border-left-width: 10px; border-radius: var(--radius);
  background: var(--paper); padding: 1.25rem 1.5rem; margin: 1.8rem 0;
}
.callout h3 { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }

.tool-list { display: grid; gap: 1.25rem; }
@media (min-width: 821px) { .tool-list { grid-template-columns: repeat(2, 1fr); } }
.tool {
  border: 2px solid var(--ink); border-radius: var(--radius); padding: 1.4rem 1.5rem; background: var(--paper);
}
.tool h3 { margin-top: 0; }
.tool h3 small { display: block; font-family: var(--font-body); font-weight: 600; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--moss-dark); margin-bottom: .3rem; }
.tool p:last-child { margin-bottom: 0; }

figure.photo { margin: 2rem 0; }
figure.photo img { border: 2px solid var(--ink); border-radius: var(--radius); width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

dl.meta { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.25rem; margin: 0 0 1.2rem; }
dl.meta dt { font-weight: 700; }
dl.meta dd { margin: 0; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink); color: #e9dfcf; padding: 3.5rem 0 2rem; margin-top: 2rem;
}
.site-footer a { color: #f3e7cf; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; gap: 2rem; }
@media (min-width: 700px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer .brand { color: #fff; margin-bottom: .75rem; }
.site-footer .brand .dot { color: #e08a63; }
.site-footer h4 { color: #fff; font-size: 1.05rem; margin-bottom: .75rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .4rem; }
.site-footer p { color: #d2c5b0; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.18); margin-top: 2.5rem; padding-top: 1.25rem;
  font-size: .9rem; color: #c3b59e; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between;
}

/* ---------- Legal / Text pages ---------- */
.legal h2 { font-size: 1.45rem; margin-top: 2rem; }
.legal h3 { font-size: 1.15rem; }
.placeholder { background: #fff2cf; padding: 0 .25em; border-radius: 2px; }

/* ---------- 404 ---------- */
.notfound { text-align: center; padding: clamp(4rem, 12vw, 8rem) 0; }
.notfound .code { font-family: var(--font-head); font-size: clamp(5rem, 15vw, 9rem); font-weight: 700; color: var(--accent); line-height: 1; }

/* ---------- Utilities ---------- */
.muted { color: var(--ink-soft); }
.small { font-size: .9rem; }
.mt-2 { margin-top: 2rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card { transition: none; }
}
