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

:root {
  --bg: #fafaf8;
  --surface: #ffffff;
  --text: #1a1a1a;
  --text-muted: #6b6b6b;
  --accent: #2d6a4f;
  --accent-light: #d8f3dc;
  --border: #e0e0e0;
  --radius: 8px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: 1.8rem; margin-bottom: 0.5rem; }
h2 { font-size: 1.3rem; margin: 1.5rem 0 0.5rem; color: var(--accent); }
h3 { font-size: 1.1rem; margin: 1rem 0 0.3rem; }

/* Header / Nav */
.site-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.site-header h1 a { color: var(--text); }

.nav-controls {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 1rem;
}

select, input[type="text"] {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  background: var(--surface);
  color: var(--text);
}

select { min-width: 180px; }

input[type="text"] {
  flex: 1;
  min-width: 200px;
}

/* Recipe cards on index */
.recipe-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

.recipe-list li a {
  display: block;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s;
}

.recipe-list li a:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.recipe-list .recipe-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Search results */
.search-results {
  list-style: none;
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.search-results li a {
  display: block;
  padding: 0.6rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.search-results li a:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.search-results .result-week {
  font-size: 0.8rem;
  color: var(--text-muted);
}

#search-results-container { display: none; }
#browse-container { display: block; }

/* Recipe detail page */
.recipe-image {
  width: 100%;
  max-width: 500px;
  border-radius: var(--radius);
  margin: 1rem 0;
}

.recipe-meta-detail {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.recipe-summary {
  margin-bottom: 1.5rem;
  color: var(--text-muted);
  font-style: italic;
}

.ingredients ul {
  list-style: disc;
  padding-left: 1.5rem;
}

.ingredients li {
  margin-bottom: 0.3rem;
}

.instructions p {
  margin-bottom: 0.8rem;
}

.nutrition-table {
  border-collapse: collapse;
  margin: 0.5rem 0;
}

.nutrition-table td {
  padding: 0.3rem 1rem 0.3rem 0;
  border-bottom: 1px solid var(--border);
}

.nutrition-table td:last-child {
  font-weight: 600;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.source-link {
  display: inline-block;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

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