/* FoodMind — parchment × terracotta palette */
:root {
  --parchment:    #f5f0e8;
  --parchment-dk: #e4dccc;
  --cream:        #faf7f0;
  --terracotta:   #c4623a;
  --terra-light:  #d4794e;
  --terra-dark:   #a04e2e;
  --deep-brown:   #3d2b1f;
  --brown-mid:    #6b4c38;
  --sage:         #7a9e7e;
  --sage-light:   #e8f0e8;
  --sage-dark:    #4a6b4e;
  --warm-gray:    #8a7e72;
  --text:         #2c1f14;
  --text-muted:   #7a6a5a;
  --border:       #d8cfc2;
  --radius:       6px;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  background: var(--parchment);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Navigation ─────────────────────────────────────────────────────────── */
.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem 2rem;
  background: var(--deep-brown);
  border-bottom: 2px solid var(--terra-dark);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--parchment);
  text-decoration: none;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
.brand:hover { color: #fff; }

.nav-links { display: flex; gap: 1rem; }

.nav-link {
  color: var(--parchment-dk);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  transition: color 0.15s;
}
.nav-link:hover, .nav-link.active { color: #fff; }

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--terracotta);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 500;
  min-width: 1.2rem;
  height: 1.2rem;
  border-radius: 999px;
  padding: 0 0.3rem;
  margin-left: 0.25rem;
}

.nav-search {
  margin-left: auto;
  display: flex;
}
.nav-search input {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--brown-mid);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.1);
  color: var(--parchment);
  font-size: 0.875rem;
  width: 280px;
  outline: none;
}
.nav-search input::placeholder { color: var(--warm-gray); }
.nav-search input:focus { border-color: var(--sage); background: rgba(255,255,255,0.15); }

/* ── Main layout ────────────────────────────────────────────────────────── */
.site-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 2rem 4rem;
}

/* ── Typography helpers ─────────────────────────────────────────────────── */
h1 { font-family: 'Lora', Georgia, serif; font-size: 2rem; font-weight: 600; line-height: 1.2; }
h2 { font-family: 'Lora', Georgia, serif; font-size: 1.4rem; font-weight: 600; }
h3 { font-family: 'Lora', Georgia, serif; font-size: 1.15rem; font-weight: 600; }

.page-header { margin-bottom: 2rem; }
.page-sub { color: var(--text-muted); margin-top: 0.5rem; }

.back-link {
  display: inline-block;
  color: var(--terracotta);
  text-decoration: none;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}
.back-link:hover { color: var(--terra-dark); }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background 0.15s, transform 0.1s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--terracotta); color: #fff; }
.btn--primary:hover { background: var(--terra-dark); }
.btn--secondary { background: var(--parchment-dk); color: var(--deep-brown); border: 1px solid var(--border); }
.btn--secondary:hover { background: var(--border); }
.btn--small { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn--approve { background: var(--sage); color: #fff; padding: 0.6rem 1.4rem; }
.btn--approve:hover { background: var(--sage-dark); }
.btn--reject { background: transparent; color: var(--terra-dark); border: 1px solid var(--terra-dark); padding: 0.6rem 1.4rem; }
.btn--reject:hover { background: #fdf0ec; }

kbd {
  display: inline-block;
  font-size: 0.7em;
  font-family: inherit;
  background: rgba(0,0,0,0.1);
  border: 1px solid rgba(0,0,0,0.2);
  border-radius: 3px;
  padding: 0 4px;
  vertical-align: middle;
}

/* ── Home ───────────────────────────────────────────────────────────────── */
.home-hero {
  margin-bottom: 1rem;
}
.home-hero h1 { font-size: 1.75rem; color: var(--deep-brown); }

.stats-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 1rem;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}
.stats-bar strong { color: var(--deep-brown); font-weight: 600; }
.stats-sep { color: var(--border); }
.stats-alert strong { color: var(--terracotta); }
.stats-action {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--terracotta);
  text-decoration: none;
  font-weight: 500;
}
.stats-action:hover { color: var(--terra-dark); }

.home-body {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 2.5rem;
  align-items: start;
}
@media (max-width: 860px) {
  .home-body { grid-template-columns: 1fr; }
}

.home-section-heading { font-size: 1rem; color: var(--text-muted); font-family: inherit; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.75rem; }

.filing-list { list-style: none; display: flex; flex-direction: column; }
.filing-item {
  display: grid;
  grid-template-columns: 150px auto 1fr auto;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.32rem 0;
  border-bottom: 1px solid var(--parchment-dk);
  font-size: 0.875rem;
}
.filing-item:last-child { border-bottom: none; }
.filing-concept { font-weight: 500; color: var(--terracotta); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.filing-concept:hover { color: var(--terra-dark); }
.filing-count { font-size: 0.72rem; font-weight: 500; background: var(--sage-light); color: var(--sage-dark); border-radius: 999px; padding: 0.1rem 0.4rem; white-space: nowrap; }
.filing-body { color: var(--text-muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.filing-time { font-size: 0.75rem; color: var(--warm-gray); white-space: nowrap; }

/* Right rail */
.home-rail { display: flex; flex-direction: column; gap: 1.5rem; }
.rail-block {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.rail-heading {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.55rem 0.9rem;
  background: var(--parchment-dk);
  border-bottom: 1px solid var(--border);
  font-family: inherit;
}
.rail-list { list-style: none; padding: 0.3rem 0; }
.rail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem 0.9rem;
  border-bottom: 1px solid var(--parchment-dk);
}
.rail-item:last-child { border-bottom: none; }
.rail-concept { font-size: 0.85rem; color: var(--deep-brown); text-decoration: none; font-weight: 500; }
.rail-concept:hover { color: var(--terracotta); }
.rail-count { font-size: 0.75rem; color: var(--text-muted); }
.rail-links { list-style: none; padding: 0.4rem 0; }
.rail-links li { padding: 0.3rem 0.9rem; font-size: 0.85rem; }
.rail-links a { color: var(--terracotta); text-decoration: none; }
.rail-links a:hover { color: var(--terra-dark); }
.rail-alert { color: var(--terracotta) !important; font-weight: 500; }

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

/* ── Wiki list ──────────────────────────────────────────────────────────── */
.wiki-body {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  align-items: start;
}

.wiki-category {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.wiki-category-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--parchment-dk);
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  font-family: inherit;
  font-weight: 500;
}

.wiki-category-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 400;
}

.wiki-concept-list {
  list-style: none;
  padding: 0.4rem 0;
}

.wiki-concept-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  border-bottom: 1px solid var(--parchment-dk);
}
.wiki-concept-row:last-child { border-bottom: none; }
.wiki-concept-row:hover { background: var(--parchment); }

.wiki-concept-name {
  font-size: 0.9rem;
  color: var(--deep-brown);
  text-decoration: none;
  font-weight: 500;
}
.wiki-concept-name:hover { color: var(--terracotta); }

.wiki-concept-examples {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Wiki page ──────────────────────────────────────────────────────────── */
.concept-header { margin-bottom: 2rem; }
.concept-meta { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.concept-title { font-size: 2rem; }
.concept-aliases { font-size: 0.85rem; color: var(--text-muted); }

.category-badge {
  display: inline-block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--parchment-dk);
  color: var(--text-muted);
}
.category-badge--technique { background: #e8f0e8; color: var(--sage-dark); }
.category-badge--principle { background: #f0eae0; color: var(--brown-mid); }
.category-badge--ingredient { background: #fef3ec; color: var(--terra-dark); }
.category-badge--equipment { background: #eff0f5; color: #4a5070; }
.category-badge--dish { background: #f5eef8; color: #6a4080; }

/* ── Prose (markdown content) ───────────────────────────────────────────── */
.prose { max-width: 680px; }
.prose h1, .prose h2, .prose h3 { margin-top: 1.5rem; margin-bottom: 0.5rem; }
.prose p { margin-bottom: 0.9rem; }
.prose ul { margin: 0.75rem 0 0.75rem 1.5rem; }
.prose li { margin-bottom: 0.3rem; }
.prose blockquote {
  border-left: 3px solid var(--sage);
  padding-left: 1rem;
  margin: 1rem 0;
  color: var(--text-muted);
}
.prose code {
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  font-size: 0.875em;
  background: var(--parchment-dk);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}
.prose pre {
  background: var(--deep-brown);
  color: var(--parchment);
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1rem 0;
}
.prose pre code { background: none; color: inherit; padding: 0; font-size: 0.85em; }
.prose strong { font-weight: 600; }
.prose ol { margin: 0.75rem 0 0.75rem 1.5rem; }

/* ── Concept-page tables ────────────────────────────────────────────────── */
/* Renders the GFM-style tables in the Obsidian-imported wiki content
   (wood species, protein temperatures, etc.). Horizontal scroll wrapper
   so wide tables don't blow out narrow viewports. */
.concept-table {
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
  width: 100%;
  display: block;
  overflow-x: auto;
  white-space: normal;
}
.concept-table thead tr {
  background: var(--parchment-dk);
  border-bottom: 2px solid var(--border);
}
.concept-table th {
  text-align: left;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 0.55rem 0.75rem;
}
.concept-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.concept-table tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.015);
}
.concept-table tbody tr:last-child td { border-bottom: none; }

/* ── Examples ───────────────────────────────────────────────────────────── */
.examples-section { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.examples-section h2 { margin-bottom: 1rem; }
.example-list { list-style: none; display: flex; flex-direction: column; gap: 1rem; }
.example-item {
  background: var(--cream);
  border: 1px solid var(--border);
  border-left: 3px solid var(--terracotta);
  border-radius: var(--radius);
  padding: 0.85rem 1.1rem;
}
.example-body { font-size: 0.9rem; color: var(--text); margin-bottom: 0.35rem; }
.example-time { font-size: 0.78rem; color: var(--text-muted); }

/* ── Search ─────────────────────────────────────────────────────────────── */
.search-form { display: flex; gap: 0.75rem; margin-bottom: 2rem; }
.search-input {
  flex: 1;
  padding: 0.65rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--cream);
  font-size: 1rem;
  outline: none;
  font-family: inherit;
}
.search-input:focus { border-color: var(--terracotta); }
.results-count { margin-bottom: 1rem; color: var(--text-muted); font-size: 0.9rem; }
.result-list { list-style: none; display: flex; flex-direction: column; gap: 1rem; }
.result-item {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}
.result-title { font-weight: 600; color: var(--terracotta); text-decoration: none; display: block; margin-bottom: 0.4rem; }
.result-title:hover { color: var(--terra-dark); }
.result-snippet { font-size: 0.875rem; color: var(--text-muted); line-height: 1.5; }
.result-snippet mark { background: #fef3e2; color: inherit; font-weight: 600; }

/* ── Cook log ───────────────────────────────────────────────────────────── */
.cook-list { list-style: none; display: flex; flex-direction: column; }

.cook-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1rem;
  align-items: baseline;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--parchment-dk);
}
.cook-row:last-child { border-bottom: none; }

.cook-row-meta { display: flex; flex-direction: column; gap: 0.3rem; }

.cook-date {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

.cook-kind-badge {
  display: inline-block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: var(--parchment-dk);
  color: var(--text-muted);
}
.cook-kind-badge--cook     { background: #e8f0e8; color: var(--sage-dark); }
.cook-kind-badge--reheat   { background: #f0eae0; color: var(--brown-mid); }
.cook-kind-badge--drink    { background: #eff0f5; color: #4a5070; }
.cook-kind-badge--approved { background: #e8f0e8; color: var(--sage-dark); }
.cook-kind-badge--pending  { background: #fef3ec; color: var(--terra-dark); }
.cook-kind-badge--rejected { background: #f5eaec; color: #8a3040; }

.cook-text {
  font-size: 0.9rem;
  color: var(--text);
  text-decoration: none;
  line-height: 1.5;
  display: block;
}
.cook-text:hover { color: var(--terracotta); }

.cook-body { margin-bottom: 2.5rem; }
.cook-full-text {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  max-width: 680px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-left: 3px solid var(--terracotta);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}

.cook-outcomes { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.cook-outcomes h2 { margin-bottom: 1rem; }

.cook-filed-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.cook-filed-item {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--parchment-dk);
  flex-wrap: wrap;
}
.cook-filed-item:last-child { border-bottom: none; }
.cook-filed-concept { font-weight: 500; color: var(--terracotta); text-decoration: none; flex-shrink: 0; }
.cook-filed-concept:hover { color: var(--terra-dark); }
.cook-filed-body { font-size: 0.85rem; color: var(--text-muted); }

/* ── Review list ────────────────────────────────────────────────────────── */
.review-queue { list-style: none; display: flex; flex-direction: column; gap: 0.75rem; }
.review-item {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}
.review-item-meta { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.review-action {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--parchment-dk);
  color: var(--text-muted);
}
.review-action--add_note { background: #e8f0e8; color: var(--sage-dark); }
.review-action--propose_edit { background: #fef3ec; color: var(--terra-dark); }
.review-action--create_page { background: #eff0f5; color: #4a5070; }
.review-concept { font-weight: 600; color: var(--deep-brown); text-decoration: none; }
.review-concept:hover { color: var(--terracotta); }
.review-confidence { font-size: 0.8rem; color: var(--text-muted); }
.review-time { font-size: 0.78rem; color: var(--warm-gray); margin-left: auto; }
.review-preview { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.review-item-actions { display: flex; gap: 0.5rem; }

.empty-queue { text-align: center; padding: 4rem 0; color: var(--text-muted); }
.empty-queue p { font-size: 1.1rem; margin-bottom: 1rem; }

/* ── Review detail ──────────────────────────────────────────────────────── */
.review-detail-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.queue-pos { font-size: 0.85rem; color: var(--text-muted); }
.nav-arrows { display: flex; gap: 0.25rem; }
.nav-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius);
  background: var(--parchment-dk);
  color: var(--deep-brown);
  text-decoration: none;
  font-size: 1.25rem;
  line-height: 1;
}
.nav-arrow:hover { background: var(--border); }

.review-detail-body {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 2rem;
  align-items: start;
}
@media (max-width: 900px) {
  .review-detail-body { grid-template-columns: 1fr; }
}

.review-concept-pane {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.review-concept-title { margin-bottom: 1rem; }
.review-concept-title a { color: var(--deep-brown); text-decoration: none; }
.review-concept-title a:hover { color: var(--terracotta); }
.review-concept-body { font-size: 0.9rem; }

.review-proposal-pane {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: sticky;
  top: 5rem;
}
.proposal-meta { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.proposal-content {
  background: var(--cream);
  border: 1px solid var(--border);
  border-left: 3px solid var(--terracotta);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  font-size: 0.9rem;
  white-space: pre-wrap;
}

.review-form { display: flex; flex-direction: column; gap: 0.75rem; }
.edit-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }
.edit-textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--cream);
  font-family: inherit;
  font-size: 0.875rem;
  resize: vertical;
  outline: none;
}
.edit-textarea:focus { border-color: var(--sage); }

.review-buttons { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.keyboard-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.5rem; }
