/* Editorial Botany — Garten-Wiki Facade
   Refined minimal reading interface. Mobile-first. */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght,SOFT@9..144,300..900,0..100&family=Newsreader:opsz,wght,ital@6..72,300..700,0;6..72,300..700,1&display=swap');

:root {
  --paper:        #F6F1E7;
  --paper-raised: #FAF7F0;
  --ink:          #1F1A17;
  --ink-soft:     #4A4238;
  --ink-muted:    #8A8175;
  --ink-faint:    #B5AC9E;
  --rule:         #E3DAC8;
  --rule-soft:    #EDE5D5;
  --sage:         #5B6B4A;
  --sage-deep:    #3F4F34;
  --sage-light:   #8FA07A;
  --sage-wash:    #EAEFE0;

  --serif: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --display: 'Fraunces', 'Hoefler Text', Garamond, serif;

  --measure: 34rem;
  --gutter: 1.5rem;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.7;
  font-feature-settings: "kern", "liga", "onum";
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.12  0 0 0 0 0.10  0 0 0 0 0.07  0 0 0 0.035 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 220px 220px;
}

/* ——— Masthead ——————————————————————————— */

.masthead {
  border-bottom: 1px solid var(--rule);
  background: transparent;
}

.masthead-inner {
  max-width: 56rem;
  margin: 0 auto;
  padding: 1.4rem var(--gutter);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--display);
  font-variation-settings: "opsz" 36, "wght" 480, "SOFT" 30;
  font-size: 1.35rem;
  letter-spacing: -0.012em;
  color: var(--ink);
  text-decoration: none;
}

.brand .sprig {
  width: 22px;
  height: 22px;
  color: var(--sage);
  flex-shrink: 0;
}

.brand em {
  font-style: italic;
  color: var(--sage-deep);
  font-variation-settings: "opsz" 36, "wght" 420, "SOFT" 80;
}

.nav {
  display: flex;
  gap: 1.4rem;
  font-family: var(--serif);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.nav a {
  color: var(--ink-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 160ms ease, border-color 160ms ease;
}

.nav a[aria-current="page"] {
  color: var(--sage-deep);
  border-bottom-color: var(--sage);
}

.nav a:hover { color: var(--sage-deep); border-bottom-color: var(--sage); }

/* ——— Article column ———————————————————— */

.column {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 3rem var(--gutter) 5rem;
  animation: rise 700ms cubic-bezier(.2,.7,.2,1) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.kicker {
  font-family: var(--serif);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--sage-deep);
  margin: 0 0 0.9rem;
}

h1.title {
  font-family: var(--display);
  font-variation-settings: "opsz" 144, "wght" 380, "SOFT" 20;
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  line-height: 1.04;
  letter-spacing: -0.022em;
  margin: 0 0 0.75rem;
  color: var(--ink);
}

h1.title em {
  font-style: italic;
  font-variation-settings: "opsz" 144, "wght" 360, "SOFT" 100, "WONK" 1;
  color: var(--sage-deep);
}

.meta {
  font-family: var(--serif);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-muted);
  margin: 0 0 2.4rem;
}

.meta .dot { color: var(--ink-faint); margin: 0 0.55rem; }

.ornament {
  display: block;
  margin: 2.2rem auto;
  color: var(--sage-light);
  width: 60px;
  opacity: 0.85;
}

article p { margin: 0 0 1.15rem; }

article p.lede::first-letter {
  font-family: var(--display);
  font-variation-settings: "opsz" 144, "wght" 420, "SOFT" 0;
  float: left;
  font-size: 4.2rem;
  line-height: 0.88;
  padding: 0.4rem 0.55rem 0 0;
  color: var(--sage-deep);
}

article h2 {
  font-family: var(--display);
  font-variation-settings: "opsz" 60, "wght" 460, "SOFT" 30;
  font-size: 1.55rem;
  line-height: 1.2;
  letter-spacing: -0.012em;
  margin: 2.6rem 0 0.9rem;
  color: var(--ink);
}

article h3 {
  font-family: var(--display);
  font-variation-settings: "opsz" 30, "wght" 520, "SOFT" 0;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 2rem 0 0.7rem;
  color: var(--sage-deep);
}

article ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1.3rem;
}

article ul li {
  position: relative;
  padding-left: 1.4rem;
  margin: 0.35rem 0;
}

article ul li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--sage-light);
  font-weight: 300;
}

article a.wikilink {
  color: var(--sage-deep);
  text-decoration: none;
  border-bottom: 1px dotted var(--sage-light);
  padding-bottom: 1px;
  transition: background 160ms ease, border-color 160ms ease;
}

article a.wikilink:hover {
  background: var(--sage-wash);
  border-bottom-color: var(--sage-deep);
}

article a.wikilink::before {
  content: "⌘ ";
  color: var(--sage-light);
  font-size: 0.85em;
  margin-right: 0.05em;
}

blockquote {
  margin: 1.6rem 0;
  padding: 0.4rem 0 0.4rem 1.3rem;
  border-left: 2px solid var(--sage-light);
  color: var(--ink-soft);
  font-style: italic;
  font-family: var(--display);
  font-variation-settings: "opsz" 30, "wght" 360, "SOFT" 60;
}

code {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.9em;
  background: var(--paper-raised);
  padding: 0.1em 0.35em;
  border-radius: 2px;
  color: var(--ink-soft);
}

/* ——— Tabellen ——————————————————————————— */

article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.6rem 0;
  font-size: 0.94rem;
}

article th {
  text-align: left;
  font-family: var(--serif);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-muted);
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid var(--rule);
}

article td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--rule-soft);
  color: var(--ink-soft);
  vertical-align: top;
}

article tr:last-child td { border-bottom: none; }

/* ——— See also & Footer meta ————————————— */

.see-also {
  margin: 3rem 0 0;
  padding: 1.6rem 0 0;
  border-top: 1px solid var(--rule);
}

.see-also h4 {
  font-family: var(--serif);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink-muted);
  margin: 0 0 0.8rem;
  font-weight: 500;
}

.see-also ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.see-also li {
  padding: 0.35rem 0;
  border-bottom: 1px dotted var(--rule);
}

.see-also li:last-child { border-bottom: none; }

.see-also a {
  color: var(--ink);
  text-decoration: none;
  font-family: var(--display);
  font-variation-settings: "opsz" 24, "wght" 440, "SOFT" 30;
  font-size: 1.02rem;
}

.see-also a:hover { color: var(--sage-deep); }

.colophon {
  margin-top: 3.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-faint);
  text-align: center;
}

.empty-state {
  color: var(--ink-muted);
  font-style: italic;
}

/* ——— Index ———————————————————————————— */

.index-section {
  margin: 2.8rem 0;
}

.index-section h2 {
  font-family: var(--display);
  font-variation-settings: "opsz" 48, "wght" 420, "SOFT" 40;
  font-size: 1.4rem;
  letter-spacing: -0.008em;
  color: var(--sage-deep);
  margin: 0 0 0.2rem;
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
}

.index-section h2 .count {
  font-family: var(--serif);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 400;
}

.index-section .rule {
  height: 1px;
  background: var(--rule);
  margin: 0.6rem 0 1rem;
}

.index-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.index-list li {
  padding: 0.85rem 0;
  border-bottom: 1px dotted var(--rule);
}

.index-list li:last-child { border-bottom: none; }

.index-list a.entry-title {
  display: inline;
  font-family: var(--display);
  font-variation-settings: "opsz" 24, "wght" 460, "SOFT" 20;
  font-size: 1.08rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.005em;
}

.index-list a.entry-title:hover { color: var(--sage-deep); }

.index-list .entry-desc {
  display: block;
  margin-top: 0.15rem;
  color: var(--ink-soft);
  font-size: 0.94rem;
  line-height: 1.5;
}

/* ——— Ask / Fragen ————————————————————— */

.ask-form {
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1.2rem 1.2rem 1rem;
  margin: 2rem 0 0;
}

.ask-form textarea {
  width: 100%;
  min-height: 7.5rem;
  border: none;
  background: transparent;
  font-family: var(--display);
  font-variation-settings: "opsz" 24, "wght" 380, "SOFT" 30;
  font-size: 1.15rem;
  line-height: 1.5;
  color: var(--ink);
  resize: vertical;
  outline: none;
  padding: 0;
}

.ask-form textarea::placeholder {
  color: var(--ink-faint);
  font-style: italic;
}

.ask-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.9rem;
  padding-top: 0.8rem;
  border-top: 1px dotted var(--rule);
}

.ask-actions .hint {
  font-size: 0.78rem;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}

.btn {
  font-family: var(--serif);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--paper);
  background: var(--sage-deep);
  border: none;
  padding: 0.6rem 1.1rem;
  border-radius: 2px;
  cursor: pointer;
  transition: background 160ms ease;
}

.btn:hover:not(:disabled) { background: var(--ink); }

.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--sage-deep);
  border: 1px solid var(--sage-light);
  padding: 0.5rem 1rem;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--sage-wash);
  color: var(--sage-deep);
}

.question-quote {
  border-left: 2px solid var(--sage-light);
  padding: 0.5rem 0 0.5rem 1.2rem;
  margin: 0 0 2rem;
  font-family: var(--display);
  font-variation-settings: "opsz" 30, "wght" 380, "SOFT" 60;
  font-size: 1.2rem;
  font-style: italic;
  color: var(--ink-soft);
  line-height: 1.45;
}

.question-quote::before {
  content: "Frage";
  display: block;
  font-family: var(--serif);
  font-style: normal;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--ink-faint);
  margin-bottom: 0.4rem;
}

.answer h2.answer-heading {
  font-family: var(--display);
  font-variation-settings: "opsz" 60, "wght" 440, "SOFT" 40;
  font-size: 1.45rem;
  margin: 0 0 1rem;
  color: var(--ink);
}

.sources-line {
  margin-top: 1.8rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: 0.82rem;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
}

.sources-line a {
  color: var(--sage-deep);
  text-decoration: none;
  border-bottom: 1px dotted var(--sage-light);
}

.save-row {
  margin-top: 1.4rem;
  text-align: right;
}

.fragen-error {
  color: #8B3A2A;
  font-size: 0.9rem;
  margin-top: 1rem;
  padding: 0.6rem 0.9rem;
  border-left: 3px solid #C07060;
  background: #FDF3F0;
}

.fragen-hint {
  margin-top: 2rem;
  color: var(--ink-muted);
  font-size: 0.9rem;
  font-style: italic;
}

/* ——— Inbox / Eingang ——————————————————— */

.inbox-summary {
  display: flex;
  gap: 1.4rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-muted);
  margin: 0 0 2.2rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--rule);
}

.inbox-summary .num {
  font-family: var(--display);
  font-variation-settings: "opsz" 36, "wght" 460, "SOFT" 30;
  font-size: 1.6rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  display: block;
  text-transform: none;
  margin-top: 0.15rem;
  font-feature-settings: "onum", "lnum" 0;
}

.inbox-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.inbox-item {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--rule);
}

.inbox-item:last-child { border-bottom: none; }

.item-head {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  margin-bottom: 0.45rem;
  flex-wrap: wrap;
}

.type-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--serif);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  padding: 0.18rem 0.55rem;
  border-radius: 2px;
  flex-shrink: 0;
}

.type-badge.link {
  background: var(--sage-wash);
  color: var(--sage-deep);
  border: 1px solid var(--sage-light);
}

.type-badge.md {
  background: var(--paper-raised);
  color: var(--ink-soft);
  border: 1px solid var(--rule);
}

.type-badge svg { width: 10px; height: 10px; }

.item-title {
  font-family: var(--display);
  font-variation-settings: "opsz" 30, "wght" 460, "SOFT" 20;
  font-size: 1.15rem;
  line-height: 1.3;
  letter-spacing: -0.005em;
  color: var(--ink);
  text-decoration: none;
  flex: 1 1 auto;
  min-width: 0;
}

.item-title:hover { color: var(--sage-deep); }

.item-origin {
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin: 0 0 0.6rem;
  font-style: italic;
}

.item-summary {
  margin: 0 0 0.9rem;
  color: var(--ink-soft);
  font-size: 0.97rem;
  line-height: 1.55;
}

.item-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}

.item-foot .meta-line { font-variant-caps: small-caps; letter-spacing: 0.12em; }

.expiry { color: var(--ink-muted); }
.expiry.soon { color: #9a5a2a; }

.item-actions {
  display: inline-flex;
  gap: 0.45rem;
}

/* ——— Buttons / Actions ————————————————— */

.action {
  font-family: var(--serif);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  padding: 0.4rem 0.75rem;
  border-radius: 2px;
  background: transparent;
  cursor: pointer;
  border: 1px solid var(--rule);
  color: var(--ink-soft);
  transition: all 160ms ease;
}

.action:hover {
  background: var(--paper-raised);
  color: var(--ink);
}

.action.primary {
  border-color: var(--sage-deep);
  background: var(--sage-deep);
  color: var(--paper);
}

.action.primary:hover {
  background: var(--ink);
  border-color: var(--ink);
}

.action.danger:hover {
  border-color: #b25a4a;
  color: #b25a4a;
  background: transparent;
}

.action.danger-confirm {
  background: #b25a4a;
  color: var(--paper);
  border-color: #b25a4a;
}

.action.danger-confirm:hover { background: #7a3024; border-color: #7a3024; }

/* ——— Triage (Eingang-Item) ————————————— */

.triage-bar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.triage-btn {
  font-family: var(--serif);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  padding: 0.5em 1.2em;
  border: 1px solid var(--rule);
  background: var(--paper-raised);
  color: var(--ink-soft);
  cursor: pointer;
  border-radius: 2px;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.triage-btn:hover {
  background: var(--sage-wash);
  color: var(--sage-deep);
  border-color: var(--sage-light);
}

.triage-btn.primary {
  background: var(--sage-deep);
  color: var(--paper);
  border-color: var(--sage-deep);
}

.triage-btn.primary:hover {
  background: var(--ink);
  border-color: var(--ink);
}

/* ——— Review ————————————————————————— */

.interval-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--serif);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  padding: 0.18rem 0.55rem;
  border-radius: 2px;
  background: var(--paper-raised);
  color: var(--ink-soft);
  border: 1px solid var(--rule);
  flex-shrink: 0;
}

.interval-badge.fresh { color: var(--sage-deep); border-color: var(--sage-light); background: var(--sage-wash); }
.interval-badge.aging { color: #8a6a2a; border-color: #d6c08a; background: #f5edd6; }
.interval-badge.stale { color: #b25a4a; border-color: #d8a89c; background: #f5e5e0; }

.review-meta {
  font-size: 0.78rem;
  color: var(--ink-muted);
  margin: 0 0 0.7rem;
  font-variant-caps: small-caps;
  letter-spacing: 0.12em;
}

.review-meta .sep { color: var(--ink-faint); margin: 0 0.5rem; }

.review-snippet {
  margin: 0 0 0.9rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.55;
  font-style: italic;
}

.confirm-row {
  margin-top: 0.9rem;
  padding: 0.85rem 1rem;
  background: #f5e5e0;
  border: 1px solid #d8a89c;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.confirm-row .warning {
  font-size: 0.88rem;
  color: #7a3024;
  font-style: italic;
}

.confirm-row .actions {
  display: inline-flex;
  gap: 0.45rem;
}

/* ——— Delete Zone ——————————————————————— */

.delete-zone {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

/* ——— Ingest-Log ——————————————————————— */

.ingest-log {
  margin: 0.75rem 0 0;
  padding: 0.75rem 1rem;
  background: var(--ink);
  color: #d4cfca;
  border-radius: 6px;
  font-family: ui-monospace, 'Cascadia Code', 'Fira Code', monospace;
  font-size: 0.7rem;
  line-height: 1.55;
  max-height: 280px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ——— Einstellungen ————————————————————— */

.settings-saved {
  background: var(--sage-wash);
  color: var(--sage-deep);
  border: 1px solid var(--sage-light);
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-size: 0.88rem;
  margin-bottom: 1.5rem;
}

.settings-form { display: flex; flex-direction: column; gap: 0; }

.settings-section {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--rule);
}

.settings-section h2 {
  font-family: var(--serif);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-muted);
  margin: 0 0 1.2rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 1rem;
}

.field:last-child { margin-bottom: 0; }

.field label {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-soft);
}

.field input[type="text"],
.field input[type="number"],
.field select {
  border: 1px solid var(--rule);
  border-radius: 5px;
  padding: 0.4rem 0.65rem;
  font-family: var(--serif);
  font-size: 0.9rem;
  background: var(--paper-raised);
  color: var(--ink);
  max-width: 28rem;
}

.field input[type="number"] { max-width: 6rem; }

.field input:focus,
.field select:focus {
  outline: 2px solid var(--sage);
  outline-offset: 1px;
  border-color: transparent;
}

.field-hint {
  font-size: 0.78rem;
  color: var(--ink-muted);
  margin: 0;
}

.field-hint-inline {
  font-size: 0.78rem;
  color: var(--ink-muted);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 0.85rem 2rem;
}

.review-grid .field { margin-bottom: 0; }

.review-grid input[type="number"] { max-width: 5rem; }

.ri-hint {
  font-size: 0.75rem;
  color: var(--ink-faint);
}

.settings-actions {
  padding: 1.5rem 0 0;
}

.tools-section { border-bottom: none; }

.tool-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.tool-meta { flex: 1; }
.tool-meta strong { font-size: 0.9rem; }
.tool-meta .field-hint { margin-top: 0.2rem; }

/* ——— Responsive ———————————————————————— */

@media (max-width: 480px) {
  body { font-size: 17px; }
  .masthead-inner { padding: 1.1rem var(--gutter); }
  .nav { gap: 0.85rem; font-size: 0.7rem; letter-spacing: 0.1em; }
  .item-foot { align-items: flex-start; flex-direction: column; gap: 0.7rem; }
  .brand { font-size: 1.15rem; }
  .column { padding: 2rem var(--gutter) 3.5rem; }
  h1.title { font-size: 2rem; }
  article p.lede::first-letter { font-size: 3.4rem; }
}

@media (min-width: 900px) {
  .column { padding: 4.5rem var(--gutter) 6rem; }
}
