body {
  font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  margin: 0;
  background: #faf7f2;
  color: #222;
}

/* Header and search */

header {
  padding: 0.75rem 1rem;
  background: #f4d6a8;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

header h1 {
  font-size: 1.4rem;
  margin: 0;
}

.search-row {
  display: flex;
  flex: 1;
  gap: 0.4rem;
  align-items: center;
}

header input[type="search"] {
  flex: 1;
  min-width: 140px;
  padding: 0.5rem;
  font-size: 1rem;
  border-radius: 6px;
  border: 1px solid #ccc;
}

#voice-btn {
  font-size: 1.3rem;
  padding: 0.4rem 0.6rem;
  border-radius: 999px;
  border: 1px solid #ccc;
  background: #fff7e6;
  cursor: pointer;
}

#voice-btn.listening {
  border-color: #d46a6a;
  box-shadow: 0 0 0 2px rgba(212, 106, 106, 0.4);
}

/* Back link */

.back {
  text-decoration: none;
  margin-right: 0.5rem;
  font-size: 0.9rem;
  color: #4a3c2a;
}

.back:hover {
  text-decoration: underline;
}

/* Main layout */

main {
  padding: 1rem;
  max-width: 960px;
  margin: 0 auto;
}

/* Recipe list */

#recipe-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.recipe-card {
  display: block;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: #fff;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  transition: transform 0.05s ease, box-shadow 0.05s ease;
}

.recipe-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}

.recipe-card h2 {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
}

.recipe-card .summary {
  margin: 0.2rem 0 0;
  font-size: 0.9rem;
  color: #555;
}

.rating-line {
  font-size: 0.9rem;
  color: #8a5b20;
}

.rating-line .rating-value {
  font-weight: 600;
  margin-right: 0.35rem;
}

/* Meta section on detail page */

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.rating-chip {
  background: #fff;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.rating-chip.small {
  padding: 0.25rem 0.6rem;
  font-size: 0.85rem;
}

.rating-stars {
  font-weight: 600;
}

.rating-count {
  font-size: 0.85rem;
  color: #666;
}

.time-block div {
  margin-bottom: 0.15rem;
}

.servings-control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.servings-control input {
  width: 3.5rem;
  padding: 0.2rem;
  font-size: 0.95rem;
  text-align: center;
  border-radius: 6px;
  border: 1px solid #bbb;
}

.servings-control button {
  border-radius: 999px;
  border: 1px solid #bbb;
  background: #fff;
  padding: 0.2rem 0.5rem;
  font-size: 1rem;
  cursor: pointer;
}

.servings-control button:hover {
  background: #fff3dd;
}

.servings-original {
  font-size: 0.85rem;
  color: #666;
}

.btn-secondary {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #f7f7f7;
  color: #333;
  font-weight: 500;
  text-decoration: none;
}

.btn-secondary:hover {
  background: #eeeeee;
}

/* Hero image and lead text */

.hero img {
  max-width: 100%;
  border-radius: 10px;
  display: block;
  margin: 0 auto 1rem;
}

.lead {
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

/* Ingredients & instructions */

.ingredients h2,
.instructions h2,
.nutrition h2 {
  margin-top: 1.2rem;
  margin-bottom: 0.5rem;
}

.ingredient-group h3,
.instruction-group h3 {
  margin-top: 0.9rem;
  margin-bottom: 0.4rem;
  font-size: 1.05rem;
  color: #4a3c2a;
}

.ingredients ul,
.instructions ol {
  font-size: 1rem;
  line-height: 1.5;
  padding-left: 1.25rem;
}

.ingredients li,
.instructions li {
  margin-bottom: 0.35rem;
}

.ing-amount {
  font-weight: 600;
}

.ing-unit,
.ing-name,
.ing-notes {
  font-weight: 400;
}

.nutrition p {
  font-size: 0.95rem;
  color: #444;
}

.notes {
  margin-top: 1.2rem;
}

.notes h2 {
  margin-bottom: 0.4rem;
}

.notes-body {
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  background: #fffdf6;
  border: 1px dashed #e0c48b;
  font-size: 0.95rem;
  line-height: 1.5;
}

.notes-body a {
  color: #8a5b20;
  text-decoration: underline;
}

.search-panel {
  margin-bottom: 1rem;
}

.search-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}

.search-filter .field {
  display: flex;
  flex-direction: column;
  min-width: 180px;
}

.search-filter label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.2rem;
  color: #555;
}

.search-filter input,
.search-filter select {
  padding: 0.4rem 0.5rem;
  font-size: 0.95rem;
  border-radius: 6px;
  border: 1px solid #ccc;
}

.btn-primary {
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  border: none;
  background: #fbb040;
  color: #222;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary:hover {
  background: #f9a21a;
}

/* Smaller images on recipe cards (about half the height) */
.recipe-card .card-image {
  height: 220px;
  overflow: hidden;
}

.recipe-card .card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.favorite-form {
  margin: 0.5rem 0 1rem;
}

.favorite-btn {
  border: none;
  background: #ffe7b3;
  color: #6b4000;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
}

.favorite-btn:hover {
  background: #ffd88a;
}

.top-nav {
  margin-top: 0.4rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.top-nav a {
  font-size: 0.9rem;
  text-decoration: none;
  color: #444;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: #f1f1f1;
}

.top-nav a:hover {
  background: #e5e5e5;
}

.top-nav a.active {
  background: #ffcc80;
  color: #5a3800;
}

/* ---- Extra layout & card styling for static site ---- */

.layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem;
}

.subtitle {
  margin: 0;
  font-size: 0.95rem;
  color: #5a4a32;
}

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

.card-body {
  padding-top: 0.4rem;
}

.recipe-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.recipe-summary {
  margin: 0.25rem 0 0.4rem;
  font-size: 0.9rem;
  color: #555;
}

.recipe-tags {
  font-size: 0.8rem;
  color: #777;
}

.fav-pill {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: #ffe7b3;
  color: #7b4a00;
  font-size: 0.8rem;
}

.meta-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
