/* fermentations-ratgeber.de – warmes Küchen-/Handwerk-Design
   Keine externen Fonts, kein Tracking, kein JS-Framework. */

:root {
  --paper:        #fbf7f0;
  --paper-warm:   #f4ece0;
  --card:         #ffffff;
  --ink:          #2b2420;
  --ink-soft:     #5d5148;
  --text-muted:   #7a6d62;
  --line:         #e6dccb;
  --line-strong:  #d6c8b0;

  --terracotta:      #b4552f;
  --terracotta-dark: #8d3f1e;
  --terracotta-tint: #f6e7de;
  --olive:           #5b6b47;
  --olive-tint:      #eaeee0;
  --amber:           #c2872f;
  --amber-tint:      #f9f0dd;

  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(43,36,32,.04), 0 8px 24px -12px rgba(43,36,32,.14);
  --maxw: 1120px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }

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

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.22;
  color: var(--ink);
  margin: 0 0 .6em;
  letter-spacing: -.01em;
}
h1 { font-size: clamp(1.95rem, 4.4vw, 2.85rem); }
h2 { font-size: clamp(1.45rem, 2.8vw, 1.85rem); margin-top: 2.2em; }
h3 { font-size: 1.2rem; margin-top: 1.8em; }
h4 { font-size: 1.05rem; }
p { margin: 0 0 1.1em; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

/* ---------- Icons ---------- */
.ico {
  width: 1.35em; height: 1.35em;
  flex: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  vertical-align: -.28em;
}
.ico-lg { width: 2rem; height: 2rem; }

/* ---------- Header ---------- */
.site-header {
  background: rgba(251,247,240,.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.header-inner { display: flex; align-items: center; gap: 20px; min-height: 66px; }
.site-logo {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--serif); font-size: 1.16rem; font-weight: 600;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.site-logo .ico { color: var(--terracotta); }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0 0 0 auto; padding: 0; }
.site-nav a {
  display: block; padding: 7px 11px; border-radius: 7px;
  font-size: .93rem; color: var(--ink-soft); text-decoration: none;
}
.site-nav a:hover { background: var(--paper-warm); color: var(--ink); }
.site-nav a.is-active { color: var(--terracotta-dark); font-weight: 600; }
.site-nav a.nav-cta {
  background: var(--terracotta); color: #fff; font-weight: 600;
}
.site-nav a.nav-cta:hover { background: var(--terracotta-dark); color: #fff; }

/* Untermenü – Desktop: Dropdown bei Hover UND Tastaturfokus (kein JS nötig) */
.site-nav .has-sub { position: relative; }
.site-nav .sub-toggle { display: inline-flex; align-items: center; gap: 5px; }
.sub-arrow { display: inline-flex; }
.sub-arrow .ico { width: .95em; height: .95em; transition: transform .15s ease; }
.site-nav .sub-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 232px;
  list-style: none;
  margin: 0;
  padding: 7px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 16px 34px -18px rgba(43, 36, 32, .42);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .14s ease, transform .14s ease, visibility .14s;
  z-index: 70;
}
/* is-open-sub wird von assets/js/main.js gesetzt – deckt Tastatur und
   Touch-Geräte ohne Hover ab (Tablet im Querformat) */
.site-nav .has-sub:hover > .sub-menu,
.site-nav .has-sub:focus-within > .sub-menu,
.site-nav .has-sub.is-open-sub > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.site-nav .has-sub:hover > .sub-toggle .ico,
.site-nav .has-sub:focus-within > .sub-toggle .ico,
.site-nav .has-sub.is-open-sub > .sub-toggle .ico { transform: rotate(180deg); }
.site-nav .sub-menu a {
  display: block;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: .92rem;
  white-space: nowrap;
}
/* Unsichtbare Brücke, damit der Zeiger das Dropdown erreicht */
.site-nav .has-sub::after {
  content: "";
  position: absolute;
  top: 100%; left: 0; right: 0;
  height: 8px;
}

/* Burger-Button – nur bei aktivem JS und schmalem Viewport sichtbar
   (siehe assets/js/main.js, Progressive Enhancement) */
.menu-toggle {
  display: none;
  margin-left: auto;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
}
.menu-toggle:hover { background: var(--paper-warm); }
.menu-toggle .ico { width: 1.4rem; height: 1.4rem; vertical-align: middle; }
.menu-toggle .menu-icon-close { display: none; }
.menu-toggle[aria-expanded="true"] .menu-icon-open { display: none; }
.menu-toggle[aria-expanded="true"] .menu-icon-close { display: inline-flex; }

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  background: var(--paper-warm);
  border-bottom: 1px solid var(--line);
  font-size: .84rem; color: var(--text-muted);
  padding: 9px 0;
}
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--terracotta-dark); text-decoration: underline; }
.breadcrumb span { margin: 0 7px; opacity: .55; }

/* ---------- Hero ---------- */
.hero {
  padding: 64px 0 52px;
  background:
    radial-gradient(1000px 380px at 12% -10%, var(--terracotta-tint), transparent 62%),
    radial-gradient(760px 320px at 92% 0%, var(--olive-tint), transparent 60%),
    var(--paper);
  border-bottom: 1px solid var(--line);
}
.hero h1 { max-width: 20ch; }
.hero p { max-width: 62ch; font-size: 1.09rem; color: var(--ink-soft); }
.hero p:last-child { margin-bottom: 0; }

/* Split-Hero: Text links, Motiv rechts */
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, .96fr);
  gap: 44px;
  align-items: center;
}
.hero-grid .hero-text h1 { max-width: 22ch; }
.hero-grid .hero-text p { max-width: 46ch; }
.hero-media { margin: 0; }
.hero-media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-strong);
  box-shadow: 0 20px 44px -24px rgba(43, 36, 32, .5);
}
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--sans); font-size: .78rem; font-weight: 600;
  letter-spacing: .09em; text-transform: uppercase;
  color: var(--terracotta-dark); background: var(--terracotta-tint);
  border-radius: 999px; padding: 5px 13px; margin-bottom: 18px;
}

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section-alt { background: var(--paper-warm); border-block: 1px solid var(--line); }
.section-head { max-width: 60ch; margin-bottom: 30px; }
.section-head p { color: var(--ink-soft); }

/* ---------- Prose ---------- */
.prose { max-width: 74ch; }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.3em; }
.prose li { margin-bottom: .5em; }
.prose li::marker { color: var(--terracotta); }
.prose strong { color: var(--ink); }
.prose > h2:first-child, .prose > h3:first-child { margin-top: 0; }

/* ---------- Cards ---------- */
.card-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 22px 22px 24px;
  box-shadow: var(--shadow);
}
a.card { display: block; text-decoration: none; color: inherit; transition: transform .15s ease, border-color .15s ease; }
a.card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.card h3 { margin: 12px 0 8px; font-size: 1.16rem; }
.card p { margin: 0; color: var(--ink-soft); font-size: .95rem; line-height: 1.66; }
.card .ico-lg { color: var(--terracotta); }
.card-meta {
  display: flex; flex-wrap: wrap; gap: 6px 14px;
  margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line);
  font-size: .82rem; color: var(--text-muted);
}
.card-meta span { display: inline-flex; align-items: center; gap: 5px; }
.card-meta .ico { width: 1.05em; height: 1.05em; }

/* ---------- Info-Boxen ---------- */
.info-box {
  background: var(--card); border: 1px solid var(--line);
  border-left: 3px solid var(--terracotta);
  border-radius: var(--radius); padding: 17px 20px;
  margin: 1.6em 0; font-size: .96rem; line-height: 1.7;
}
.info-box p:last-child { margin-bottom: 0; }
.info-box.expert { border-left-color: var(--olive); background: var(--olive-tint); }
.info-box.warn { border-left-color: var(--amber); background: var(--amber-tint); }
.info-box strong { display: inline; }
.info-box .box-title {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--serif); font-size: 1.02rem; font-weight: 600;
  margin-bottom: 6px;
}

/* ---------- Parameter-Tabelle / Vergleichstabelle ---------- */
.table-wrapper { overflow-x: auto; margin: 1.5em 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
table.compare-table, table.param-table {
  width: 100%; border-collapse: collapse; font-size: .93rem;
}
.compare-table th, .compare-table td,
.param-table th, .param-table td {
  padding: 10px 14px; text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.compare-table thead th, .param-table thead th {
  background: var(--paper-warm); font-family: var(--sans);
  font-size: .8rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--ink-soft); white-space: nowrap;
}
.compare-table tbody tr:last-child td, .param-table tbody tr:last-child td { border-bottom: 0; }
.compare-table tbody tr:hover, .param-table tbody tr:hover { background: #fdfaf5; }
.param-table th[scope="row"] { font-weight: 600; width: 34%; color: var(--ink); }
.cell-empty { color: var(--line-strong); }

/* ---------- Produktkarten (ausruestung.html) ---------- */
.product {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 22px 24px 24px;
  margin-bottom: 18px; box-shadow: var(--shadow);
}
.product-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; }
.product-head h3 { margin: 0; font-size: 1.2rem; }
.product .price {
  font-family: var(--serif); font-size: 1.3rem; font-weight: 600;
  color: var(--terracotta-dark); margin-left: auto; white-space: nowrap;
}
.product .price small { font-family: var(--sans); font-size: .72rem; font-weight: 400; color: var(--text-muted); display: block; text-align: right; letter-spacing: .02em; }
.product > p { margin: 12px 0 0; color: var(--ink-soft); font-size: .96rem; }
.spec-list {
  display: flex; flex-wrap: wrap; gap: 7px 10px;
  margin: 14px 0 0; padding: 0; list-style: none;
}
.spec-list li {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--paper-warm); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 12px;
  font-size: .82rem; color: var(--ink-soft); margin: 0;
}
.spec-list .ico { width: 1em; height: 1em; color: var(--terracotta); }
.product-cta { margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.tag {
  display: inline-block; font-size: .72rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 5px;
}
.tag-ref { background: var(--olive-tint); color: var(--olive); }
.tag-ad { color: var(--text-muted); font-weight: 400; text-transform: none; letter-spacing: 0; font-size: .8rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 8px;
  font-family: var(--sans); font-size: .95rem; font-weight: 600;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.btn-primary { background: var(--terracotta); color: #fff; }
.btn-primary:hover { background: var(--terracotta-dark); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { background: var(--paper-warm); color: var(--ink); }

/* ---------- Schrittfolge ---------- */
.steps { list-style: none; counter-reset: step; margin: 1.5em 0; padding: 0; }
.steps li {
  counter-increment: step; position: relative;
  padding: 0 0 20px 50px; margin: 0;
}
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--terracotta-tint); color: var(--terracotta-dark);
  border: 1px solid var(--line-strong);
  font-family: var(--serif); font-size: .95rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.steps li::after {
  content: ""; position: absolute; left: 15.5px; top: 34px; bottom: 4px;
  width: 1px; background: var(--line);
}
.steps li:last-child { padding-bottom: 0; }
.steps li:last-child::after { display: none; }
.steps strong { display: block; font-family: var(--serif); font-size: 1.06rem; margin-bottom: 2px; }

/* ---------- FAQ ---------- */
.faq-item {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 22px; margin-bottom: 12px;
}
.faq-item h3 { margin: 0 0 8px; font-size: 1.08rem; }
.faq-item p:last-child { margin-bottom: 0; }

/* ---------- Werbebanner (gekennzeichnet) ---------- */
.ad-banner {
  margin: 2.4em 0;
  padding: 14px 16px 16px;
  background: var(--paper-warm);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
}
.ad-banner-label {
  display: block;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.ad-banner a { display: inline-block; line-height: 0; }
.ad-banner img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  border: 1px solid var(--line-strong);
}
.ad-banner-note {
  margin: 11px 0 0;
  font-size: .78rem;
  line-height: 1.55;
  color: var(--text-muted);
}

/* ---------- Weiterlesen ---------- */
.related-articles { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 16px; }
.related-card {
  display: block; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px; text-decoration: none; color: inherit;
}
.related-card:hover { border-color: var(--line-strong); background: #fffdf9; }
.related-card h4 { margin: 0 0 6px; font-size: 1.03rem; color: var(--terracotta-dark); }
.related-card p { margin: 0; font-size: .89rem; color: var(--ink-soft); line-height: 1.6; }

.changelog-list { list-style: none; padding: 0; margin: 1em 0; }
.changelog-list li {
  padding: 9px 0 9px 0; border-bottom: 1px solid var(--line);
  font-size: .93rem; color: var(--ink-soft);
}
.changelog-list strong { display: inline-block; min-width: 105px; color: var(--ink); font-family: var(--serif); }

/* ---------- Footer ---------- */
.site-footer {
  background: #2b2420; color: #d9cfc2;
  margin-top: 64px; padding: 46px 0 0;
  font-size: .93rem;
}
.site-footer a { color: #e8dccb; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid { display: grid; gap: 30px; grid-template-columns: 1.5fr 1fr 1fr 1fr; }
.footer-about .footer-logo {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--serif); font-size: 1.1rem; color: #fff; margin-bottom: 12px;
}
.footer-about .footer-logo .ico { color: #d98a5f; }
.footer-about p { color: #a89b8d; font-size: .87rem; line-height: 1.65; max-width: 42ch; }
.footer-nav h4 { color: #fff; font-size: .82rem; letter-spacing: .07em; text-transform: uppercase; font-family: var(--sans); margin-bottom: 12px; }
.footer-nav ul { list-style: none; margin: 0; padding: 0; }
.footer-nav li { margin-bottom: 7px; font-size: .9rem; }
.footer-bottom {
  margin-top: 36px; padding: 18px 0; border-top: 1px solid #423931;
  display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center;
  font-size: .85rem; color: #a89b8d;
}
.footer-bottom .footer-legal { margin-left: auto; display: flex; gap: 18px; }
.footer-affiliate { background: #221c19; padding: 14px 0; }
.footer-affiliate p { margin: 0; font-size: .8rem; color: #8f8477; line-height: 1.6; }

/* ---------- Utility ---------- */
.lead { font-size: 1.09rem; color: var(--ink-soft); }
.muted { color: var(--text-muted); }
.center { text-align: center; }
.stack-sm > * + * { margin-top: 10px; }

@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero { padding: 44px 0 38px; }
  .section { padding: 42px 0; }
  .hero-grid { grid-template-columns: 1fr; gap: 26px; }
  .hero-grid .hero-text h1, .hero-grid .hero-text p { max-width: none; }
  .hero-media img { aspect-ratio: 16 / 9; }
}
/* ---------- Mobilmenü ---------- */
@media (max-width: 800px) {
  /* Ohne JS bleibt die Liste sichtbar und umbricht – nichts ist unerreichbar. */
  .site-nav { margin: 0; width: 100%; }
  .site-nav a { padding: 7px 10px; font-size: .9rem; }

  /* Mit JS: Burger + aufklappbares Panel unter dem Header */
  .js .menu-toggle { display: inline-flex; }
  .js .site-header .header-inner { flex-wrap: nowrap; }
  .js #hauptmenue { display: none; }
  .js #hauptmenue.is-open {
    display: block;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 34px -20px rgba(43, 36, 32, .38);
    padding: 10px 22px 18px;
    max-height: calc(100vh - 66px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 60;
  }
  .js #hauptmenue.is-open .site-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
  }
  .js #hauptmenue.is-open .site-nav > li > a {
    padding: 13px 4px;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    font-size: 1rem;
  }
  .js #hauptmenue.is-open .site-nav > li:last-child > a {
    border-bottom: 0;
    margin-top: 12px;
    border-radius: 8px;
    padding: 13px 16px;
    text-align: center;
  }

  /* Untermenü mobil: dauerhaft aufgeklappt statt zweitem Tap */
  .site-nav .has-sub { position: static; }
  .site-nav .has-sub::after { display: none; }
  .site-nav .sub-arrow { display: none; }
  .js #hauptmenue.is-open .sub-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: none;
    min-width: 0;
    margin: 0;
    padding: 0 0 0 14px;
    background: transparent;
    border: 0;
    border-left: 2px solid var(--line-strong);
    border-radius: 0;
    box-shadow: none;
  }
  .js #hauptmenue.is-open .sub-menu a {
    padding: 11px 4px;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    font-size: .94rem;
    color: var(--ink-soft);
    white-space: normal;
  }
  .js #hauptmenue.is-open .sub-menu li:last-child a { border-bottom: 0; }
}

/* Ohne JS (Fallback) bleibt auch das Untermenü auf schmalen Viewports lesbar */
@media (max-width: 800px) {
  html:not(.js) .site-nav .sub-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    min-width: 0;
    padding: 0 0 0 12px;
    background: transparent;
    border: 0;
    box-shadow: none;
  }
  html:not(.js) .site-nav .sub-menu a { padding: 6px 8px; font-size: .85rem; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .header-inner { padding: 10px 0; min-height: 56px; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom .footer-legal { margin-left: 0; }
  .product .price { margin-left: 0; }
}
