:root {
  --bg: #fafaf7;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #b45309;
  --accent-hover: #92400e;
  --accent-soft: #fff7ed;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.25rem;
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.site-title {
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: -0.01em;
}

.site-title a {
  color: var(--text);
  text-decoration: none;
}

.site-tagline {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

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

.notice {
  background: var(--accent-soft);
  border: 1px solid #fcd9b6;
  color: #7c2d12;
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  margin: 1rem 0 1.5rem;
  font-size: 0.95rem;
}

.search-bar {
  margin: 1rem 0 1.5rem;
}

.search-bar input {
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  -webkit-appearance: none;
  appearance: none;
}

.search-bar input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.15);
}

.recipe-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

@media (min-width: 600px) {
  .recipe-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .recipe-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.recipe-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.recipe-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.06);
}

.recipe-card a.recipe-card-link {
  color: inherit;
  text-decoration: none;
  display: block;
}

.recipe-card-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #f3f0e8, #e9e4d6);
  background-size: cover;
  background-position: center;
  display: block;
}

.recipe-card-image.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 2rem;
}

.recipe-card-body {
  padding: 1rem 1.1rem 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.recipe-card-title {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.3;
  color: var(--text);
}

.recipe-card-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}

.recipe-card-actions {
  margin-top: auto;
  padding-top: 0.5rem;
}

.btn {
  display: inline-block;
  padding: 0.55rem 0.95rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.btn:hover {
  text-decoration: none;
  border-color: var(--accent);
  color: var(--accent);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}

.no-results {
  color: var(--muted);
  text-align: center;
  padding: 2rem 1rem;
  display: none;
}

.no-results.is-visible {
  display: block;
}

/* Recipe page */

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

.recipe-header {
  margin-bottom: 1.5rem;
}

.recipe-title {
  margin: 0 0 0.5rem;
  font-size: 1.8rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.recipe-description {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 1rem;
}

.recipe-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.9rem;
  color: var(--muted);
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.recipe-meta strong {
  color: var(--text);
  font-weight: 600;
}

.recipe-image {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  display: block;
}

.recipe-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 2rem;
}

.recipe-section {
  margin-bottom: 2rem;
}

.recipe-section h2 {
  font-size: 1.3rem;
  margin: 0 0 0.75rem;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.4rem;
  display: inline-block;
}

.ingredients-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ingredients-list li {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.ingredients-list li::before {
  content: "•";
  color: var(--accent);
  font-weight: bold;
  flex-shrink: 0;
}

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

.ingredients-group-title {
  margin-top: 1rem;
  font-weight: 600;
  color: var(--text);
}

.instructions-list {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: step;
}

.instructions-list li {
  counter-increment: step;
  padding: 0.85rem 0 0.85rem 2.5rem;
  position: relative;
  border-bottom: 1px solid var(--border);
}

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

.instructions-list li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.85rem;
  width: 1.8rem;
  height: 1.8rem;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
}

.instructions-list li h3 {
  margin: 0 0 0.3rem;
  font-size: 1.05rem;
}

.instructions-list li p {
  margin: 0;
}

.notes {
  background: #f9fafb;
  border-left: 3px solid var(--accent);
  padding: 0.85rem 1rem;
  border-radius: 0 8px 8px 0;
  font-size: 0.95rem;
}

.notes p {
  margin: 0 0 0.5rem;
}

.notes p:last-child {
  margin-bottom: 0;
}

.copy-feedback {
  display: inline-block;
  margin-left: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.2s;
}

.copy-feedback.is-visible {
  opacity: 1;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.25rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 3rem;
}
