/* Design-Vorschlag: warm, ruhig, Serif-Überschriften. Hell/Dunkel per data-theme, Standard folgt dem System. */
:root {
  --bg: #fbf7f1;
  --surface: #ffffff;
  --text: #2b2622;
  --muted: #6e655c;
  --accent: #b4532a;
  --line: #ebe3d8;
  --vegan: #3f6b3a;
  --vegetarisch: #7a6a2a;
  --radius: 12px;
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #c9a227;
    --surface: #d8b23d;
    --text: #1f1a12;
    --muted: #4a3f1f;
    --accent: #7a2e12;
    --line: #a88a2a;
    --vegan: #2f5a2a;
    --vegetarisch: #6b5a12;
  }
}

:root[data-theme="dark"] {
  --bg: #c9a227;
  --surface: #d8b23d;
  --text: #1f1a12;
  --muted: #4a3f1f;
  --accent: #7a2e12;
  --line: #a88a2a;
  --vegan: #2f5a2a;
  --vegetarisch: #6b5a12;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--sans);
}

h1, h2, h3 { font-family: var(--serif); line-height: 1.25; }
a { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* Kopf */
.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 16px; padding-bottom: 16px; }
.site-title { font-family: var(--serif); font-size: 1.4rem; color: var(--text); text-decoration: none; font-weight: 700; }
.site-nav { display: flex; gap: 18px; }
.site-nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.site-nav a:hover { color: var(--accent); }
.header-tools { display: flex; gap: 8px; align-items: center; }
.tool-btn {
  font: inherit; font-size: 0.85rem; cursor: pointer;
  color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px;
}
.tool-btn:hover { border-color: var(--accent); }
.icon-light { display: none; }
:root[data-theme="dark"] .icon-light { display: inline; }
:root[data-theme="dark"] .icon-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-light { display: inline; }
  :root:not([data-theme="light"]) .icon-dark { display: none; }
}
:root[data-theme="light"] .icon-dark { display: inline; }
:root[data-theme="light"] .icon-light { display: none; }

/* Layout: Inhalt + Seitenleiste */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 40px; padding-top: 40px; padding-bottom: 60px; min-height: 60vh; }
:root[data-sidebar="hidden"] .layout { grid-template-columns: minmax(0, 1fr); }
:root[data-sidebar="hidden"] .sidebar { display: none; }

.sidebar { align-self: start; position: sticky; top: 24px; }
.widget { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.widget h2 { font-size: 1.1rem; margin: 0 0 12px; }
.latest { list-style: none; padding: 0; margin: 0; }
.latest li { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.latest li:last-child { border-bottom: 0; }
.latest a { color: var(--text); text-decoration: none; font-size: 0.95rem; }
.latest a:hover { color: var(--accent); }
.latest-date { display: block; font-size: 0.8rem; color: var(--muted); }

.cloud { display: flex; flex-wrap: wrap; gap: 2px 14px; align-items: baseline; list-style: none; padding: 0; margin: 0; }
.cloud a { display: inline-block; padding: 3px 0; line-height: 1.4; color: var(--text); text-decoration: none; }
.cloud a:hover, .cloud a[aria-current] { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.cloud small { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cloud .s1 { font-size: 14px; }
.cloud .s2 { font-size: 16px; }
.cloud .s3 { font-size: 19px; }
.cloud .s4 { font-size: 23px; font-weight: 500; }

.search-input { width: 100%; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); }
.hits-info { font-size: 0.85rem; color: var(--muted); margin: 8px 0 0; }
.hits { list-style: none; padding: 0; margin: 8px 0 0; }
.hits li { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.hits li:last-child { border-bottom: 0; }
.hits a { color: var(--text); font-weight: 600; font-size: 0.95rem; text-decoration: none; }
.hits a:hover { color: var(--accent); }
.hits p { margin: 2px 0 0; font-size: 0.85rem; color: var(--muted); }
.hits mark { background: none; color: var(--accent); font-weight: 700; }

.recipe-html { margin-top: 24px; }
.recipe-html ul, .recipe-html ol { padding-left: 1.3em; }
.recipe-html img { border-radius: var(--radius); margin: 16px 0; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.tag { font-size: 13px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); text-decoration: none; white-space: nowrap; }
.tag:hover { border-color: currentColor; }

/* Startseite */
.hero { padding: 8px 0 36px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 8px; }
.hero p { color: var(--muted); font-size: 1.15rem; margin: 0; max-width: 40ch; }

.grid-section h2 { font-size: 1.5rem; margin: 0 0 20px; }
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

.card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: var(--text);
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0, 0, 0, .12); }
.card-img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.card-body { display: flex; flex-direction: column; gap: 8px; padding: 20px; flex: 1; }
.card h3 { font-size: 1.2rem; margin: 4px 0 0; }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.card-meta { margin-top: auto; font-size: 0.85rem; color: var(--muted); }

/* Kategorie-Badges */
.kategorien { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.badge {
  font-size: 0.75rem; font-weight: 600; letter-spacing: .02em;
  padding: 3px 10px; border-radius: 999px; color: #fff; background: var(--muted);
}
.badge-vegan { background: var(--vegan); }
.badge-vegetarisch { background: var(--vegetarisch); }

/* Rezeptseite */
.recipe { max-width: 760px; }
.hero-img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); margin-bottom: 24px; }
.recipe h1 { font-size: clamp(1.9rem, 4.5vw, 2.6rem); margin: 12px 0 10px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 18px; color: var(--muted); font-size: 0.95rem; }
.lead { font-size: 1.1rem; color: var(--muted); margin: 0 0 28px; }

.recipe-body { display: grid; gap: 36px; }
.zutaten, .zubereitung { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.zutaten { border-left: 4px solid var(--accent); }
.recipe h2 { font-size: 1.4rem; margin: 0 0 14px; }

.zutaten ul { list-style: none; padding: 0; margin: 0; }
.zutaten li { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.zutaten li:last-child { border-bottom: 0; }

.zubereitung ol { padding-left: 1.3em; margin: 0; }
.zubereitung li { padding: 6px 0 10px; }
.zubereitung li::marker { color: var(--accent); font-family: var(--serif); font-weight: 700; }

.hinweis { margin: 18px 0 0; padding: 12px 16px; background: var(--bg); border-radius: 8px; font-style: italic; color: var(--muted); }
.zurueck { display: inline-block; margin-top: 32px; text-decoration: none; }

/* Rechtliche Seiten */
.legal { max-width: 720px; }
.legal h1 { font-size: clamp(1.9rem, 4.5vw, 2.4rem); margin: 0 0 20px; }
.legal h2 { font-size: 1.25rem; margin: 28px 0 8px; }

/* Fuß */
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; padding: 24px 0; }
.site-footer p { margin: 0; }

@media (min-width: 960px) {
  .recipe-body { grid-template-columns: 1fr 1.4fr; align-items: start; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; }
}
