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

/* Base */
:root {
  --bg: #fafaf5;
  --bg-card: #ffffff;
  --text: #2d2a24;
  --text-muted: #5c5445;
  --accent: #e8e0d0;
  --accent-dark: #c4b9a5;
  --border: #e0ddd4;
  --verified: #4a7c59;
  --unverified: #a08b6e;
  --category-supermat: #8b4a8b;
  --category-frokost: #6b8e6b;
  --category-middag: #8b6b4a;
  --category-mellom: #6b7a8b;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}

h1, h2, h3, h4 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: normal;
  line-height: 1.3;
}

a {
  color: var(--text);
  text-decoration-color: var(--accent-dark);
}

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

/* Layout */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
  margin-bottom: 40px;
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  text-decoration: none;
  color: var(--text);
}

.site-nav a {
  margin-left: 24px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 15px;
}

.site-nav a.active,
.site-nav a:hover {
  color: var(--text);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  margin-top: 60px;
  color: var(--text-muted);
  font-size: 14px;
}

/* Category badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
}

.badge-supermat {
  background: #f0e8f0;
  color: var(--category-supermat);
}

.badge-frokost-lunsj {
  background: #e8f0e8;
  color: var(--category-frokost);
}

.badge-middag {
  background: #f0e8e0;
  color: var(--category-middag);
}

.badge-mellommaaltid {
  background: #e8ecf0;
  color: var(--category-mellom);
}

.badge-verified {
  background: #e8f0e8;
  color: var(--verified);
}

.badge-unverified {
  background: var(--accent);
  color: var(--unverified);
}

/* Recipe cards */
.recipe-group {
  margin-bottom: 48px;
}

.recipe-group h2 {
  margin-bottom: 20px;
  font-size: 24px;
}

.recipe-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.recipe-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  text-decoration: none;
  transition: border-color 0.15s;
}

.recipe-card:hover {
  border-color: var(--accent-dark);
}

.recipe-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.recipe-card .meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.recipe-card .kcal {
  color: var(--text-muted);
  font-size: 14px;
}

/* Recipe detail page */
.recipe-header {
  margin-bottom: 32px;
}

.recipe-header h1 {
  font-size: 32px;
  margin-bottom: 12px;
}

.recipe-header .meta {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

/* Portion selector */
.portion-selector {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.portion-selector label {
  font-weight: 500;
}

.portion-selector input[type="number"] {
  width: 70px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 16px;
  text-align: center;
  background: var(--bg);
}

.portion-selector .hint {
  color: var(--text-muted);
  font-size: 14px;
}

/* Ingredients table */
.ingredients-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 32px;
}

.ingredients-table th {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 2px solid var(--border);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ingredients-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

.ingredients-table tr:last-child td {
  border-bottom: none;
}

.ingredients-table .amount {
  font-variant-numeric: tabular-nums;
}

/* Nutrition summary */
.nutrition-summary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 32px;
}

.nutrition-summary h3 {
  margin-bottom: 12px;
  font-size: 18px;
}

.nutrition-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.nutrition-item {
  text-align: center;
}

.nutrition-item .value {
  font-size: 24px;
  font-family: Georgia, serif;
  display: block;
}

.nutrition-item .label {
  font-size: 13px;
  color: var(--text-muted);
}

.nutrition-unavailable {
  color: var(--text-muted);
  font-style: italic;
}

.nutrition-per-portion {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-muted);
}

/* Instructions */
.instructions {
  margin-top: 32px;
}

.instructions h2 {
  font-size: 22px;
  margin-bottom: 16px;
}

.instructions ol {
  padding-left: 24px;
}

.instructions li {
  margin-bottom: 8px;
}

/* Section list pages */
.section-list {
  list-style: none;
}

.section-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

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

.section-list a {
  font-family: Georgia, serif;
  font-size: 18px;
}

.section-list .description {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 4px;
}

/* Article pages */
.article h1 {
  font-size: 32px;
  margin-bottom: 24px;
}

.article h2 {
  font-size: 22px;
  margin-top: 32px;
  margin-bottom: 12px;
}

.article h3 {
  font-size: 18px;
  margin-top: 24px;
  margin-bottom: 8px;
}

.article p {
  margin-bottom: 16px;
}

.article ul, .article ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

.article li {
  margin-bottom: 4px;
}

.article table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
}

.article th, .article td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.article th {
  font-weight: 600;
}

/* Produkter table */
.produkter-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 24px;
}

.produkter-table th {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 2px solid var(--border);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.produkter-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

.produkter-table tr:last-child td {
  border-bottom: none;
}

/* Responsive */
@media (max-width: 600px) {
  .site-header .container {
    flex-direction: column;
    gap: 12px;
  }

  .site-nav a {
    margin-left: 0;
    margin-right: 16px;
  }

  .nutrition-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .recipe-cards {
    grid-template-columns: 1fr;
  }
}
