:root {
  --bg: #fdfaf6;
  --surface: #ffffff;
  --text: #3a2e2a;
  --text-muted: #7a6c63;
  --accent: #c0623a;
  --accent-dark: #9e4a2a;
  --border: #e8ddd5;
  --green: #5a8a4f;
  --yellow: #d4a837;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,.07);
}

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

body {
  font-family: 'Lato', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

h1, h2, h3, h4 { font-family: 'Playfair Display', Georgia, serif; line-height: 1.25; }
a { color: inherit; text-decoration: none; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* ---- Header ---- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  position: sticky; top: 0; z-index: 10;
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; }
.logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.75rem; font-weight: 700; color: var(--text);
}
.logo span { color: var(--accent); }
.main-nav { display: flex; gap: 24px; }
.nav-link {
  font-size: .95rem; font-weight: 500; color: var(--text-muted);
  transition: color .15s;
}
.nav-link:hover, .nav-link.active { color: var(--accent); }

/* ---- Hero ---- */
.hero {
  text-align: center;
  padding: 60px 0 48px;
}
.hero h1 { font-size: 2.6rem; margin-bottom: 8px; }
.subtitle { color: var(--text-muted); font-size: 1.15rem; margin-bottom: 28px; }
.hero-search { display: flex; gap: 0; max-width: 500px; margin: 0 auto; }
.hero-search input {
  flex: 1; padding: 12px 18px; font-size: 1rem; border: 2px solid var(--border);
  border-right: none; border-radius: var(--radius) 0 0 var(--radius); outline: none;
  background: var(--surface);
}
.hero-search input:focus { border-color: var(--accent); }
.hero-search button {
  padding: 12px 24px; background: var(--accent); color: #fff; border: none;
  border-radius: 0 var(--radius) var(--radius) 0; font-size: 1rem; cursor: pointer;
  transition: background .15s;
}
.hero-search button:hover { background: var(--accent-dark); }

/* ---- Recipe grid ---- */
.region-section { padding: 40px 0; }
.section-header {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 24px; padding-bottom: 12px; border-bottom: 2px solid var(--border);
}
.section-header h2 { font-size: 1.75rem; }
.view-all { color: var(--accent); font-weight: 600; font-size: .9rem; }

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

.recipe-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}
.recipe-card:hover { transform: translateY(-4px); box-shadow: 0 6px 20px rgba(0,0,0,.1); }
.recipe-card-image { height: 190px; overflow: hidden; background: #ede4db; }
.recipe-card-image img { width: 100%; height: 100%; object-fit: cover; }
.recipe-card-body { padding: 16px 20px 20px; }
.recipe-card-body h3 { font-size: 1.15rem; margin-bottom: 4px; }
.recipe-card-province { font-size: .85rem; color: var(--text-muted); margin-bottom: 8px; }
.recipe-card-desc { font-size: .9rem; color: var(--text-muted); margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.recipe-card-meta { display: flex; gap: 12px; align-items: center; font-size: .82rem; color: var(--text-muted); }

.meta-difficulty {
  padding: 2px 10px; border-radius: 20px; font-weight: 600; font-size: .78rem; text-transform: uppercase;
}
.difficulty-easy { background: #e6f4e3; color: var(--green); }
.difficulty-medium { background: #fdf3d6; color: var(--yellow); }
.difficulty-hard { background: #fde6de; color: #c0392b; }

/* ---- Listing page ---- */
.listing-page { padding: 40px 0 60px; }
.listing-page h1 { font-size: 2rem; margin-bottom: 4px; }
.listing-subtitle { color: var(--text-muted); margin-bottom: 32px; }
.back-link { display: inline-block; color: var(--accent); font-weight: 500; margin-bottom: 16px; }

/* ---- Recipe detail ---- */
.recipe-detail { padding: 32px 0 60px; }
.recipe-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-bottom: 40px; align-items: start; }
.recipe-hero-image { border-radius: var(--radius); overflow: hidden; background: #ede4db; }
.recipe-hero-image img { width: 100%; height: 320px; object-fit: cover; display: block; }
.recipe-hero-info h1 { font-size: 2.2rem; margin-bottom: 8px; }
.recipe-province { color: var(--text-muted); margin-bottom: 12px; }
.recipe-description { margin-bottom: 16px; font-size: 1.05rem; line-height: 1.7; }
.recipe-meta-row { display: flex; gap: 16px; flex-wrap: wrap; font-size: .9rem; color: var(--text-muted); }

/* ---- Serving selector ---- */
.serving-selector {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 20px 24px; background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 36px;
}
.serving-selector label { font-weight: 600; font-size: .95rem; white-space: nowrap; }
.serving-buttons { display: flex; gap: 6px; flex-wrap: wrap; }
.serving-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--border);
  font-weight: 600; font-size: .9rem; transition: all .15s;
}
.serving-btn:hover { border-color: var(--accent); color: var(--accent); }
.serving-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---- Recipe body: ingredients + steps ---- */
.recipe-body-grid {
  display: grid; grid-template-columns: 400px 1fr; gap: 40px; align-items: start;
}
.recipe-ingredients {
  background: var(--surface); padding: 28px; border-radius: var(--radius); box-shadow: var(--shadow);
  position: sticky; top: 80px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.recipe-ingredients-overlay {
  background: rgba(255, 255, 255, 0.4);
  border-radius: 8px;
  padding: 20px 16px;
  color: #000;
}
.recipe-ingredients-overlay h2,
.recipe-ingredients-overlay .ing-amount,
.recipe-ingredients-overlay li,
.recipe-ingredients-overlay span {
  color: #000 !important;
}
.recipe-ingredients h2 { font-size: 1.3rem; margin-bottom: 16px; }
.recipe-ingredients ul { list-style: none; }
.recipe-ingredients li {
  padding: 10px 0; border-bottom: 1px solid var(--border); display: flex; gap: 12px;
  align-items: baseline; font-size: .95rem;
}
.recipe-ingredients li:last-child { border-bottom: none; }
.ing-amount {
  font-weight: 700; color: var(--accent); white-space: nowrap; min-width: 72px;
  font-size: .9rem;
}

.recipe-steps h2 { font-size: 1.3rem; margin-bottom: 20px; }
.recipe-steps ol { list-style: none; counter-reset: steps; }
.recipe-steps li { counter-increment: steps; margin-bottom: 24px; position: relative; padding-left: 52px; }
.recipe-steps li::before {
  content: counter(steps);
  position: absolute; left: 0; top: 0;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem;
}
.recipe-steps p { font-size: 1rem; line-height: 1.7; }

/* ---- About ---- */
.about-page { max-width: 720px; }
.about-page h2 { font-size: 1.4rem; margin: 32px 0 12px; }
.about-page p, .about-page li { margin-bottom: 12px; font-size: 1.05rem; line-height: 1.7; }
.about-page a { color: var(--accent); text-decoration: underline; }

/* ---- Footer ---- */
.site-footer {
  text-align: center; padding: 32px 0; margin-top: 48px;
  border-top: 1px solid var(--border); font-size: .85rem; color: var(--text-muted);
}

/* ---- Category browse ---- */
.category-browse {
  padding: 24px 0 48px;
  text-align: center;
}
.category-browse h2 {
  font-size: 1.75rem;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.recipe-total {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-muted);
  font-family: 'Lato', system-ui, sans-serif;
}
.category-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}
.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 36px;
  min-width: 160px;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.category-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(192,98,58,.12);
}
.category-card h3 {
  font-size: 1.15rem;
  margin-bottom: 4px;
}
.recipe-count {
  font-size: .85rem;
  color: var(--text-muted);
}
.meta-category {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  background: #f0ebe6;
  color: var(--accent);
  font-weight: 600;
  font-size: .78rem;
}

/* ---- Category listing page ---- */
.category-section {
  padding: 40px 0 60px;
}
.category-section h1 {
  font-size: 2rem;
  margin-bottom: 4px;
}
.empty-state {
  text-align: center;
  padding: 48px 0;
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .hero h1 { font-size: 2rem; }
  .recipe-hero { grid-template-columns: 1fr; gap: 24px; }
  .recipe-body-grid { grid-template-columns: 1fr; }
  .recipe-ingredients { position: static; }
  .recipe-hero-image img { height: 220px; }
  .main-nav { gap: 16px; }
  .serving-selector { flex-direction: column; align-items: flex-start; }
}
