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

:root {
  --terracotta: #c4704b;
  --terracotta-dark: #a85a3a;
  --cream: #fff8f0;
  --brown: #3d2b1f;
  --gold: #d4a76a;
  --sage: #7c8c6e;
  --white: #ffffff;
  --warm-gray: #f5efe8;
  --text: #3d2b1f;
  --text-light: #6b5a4e;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--text);
  background: var(--cream);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--terracotta);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--terracotta-dark);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Header */

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

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.site-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brown);
  letter-spacing: -0.02em;
}

.site-title span {
  color: var(--terracotta);
}

nav {
  display: flex;
  gap: 1.5rem;
}

nav a {
  color: var(--text-light);
  font-size: 0.95rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 0.8rem;
  font-weight: 600;
}

nav a:hover,
nav a[aria-current="page"] {
  color: var(--terracotta);
}

/* Hero */

.hero {
  position: relative;
  height: 320px;
  overflow: hidden;
}

.hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(61, 43, 31, 0.7), rgba(61, 43, 31, 0.1));
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2rem;
}

.hero-overlay h1 {
  color: var(--white);
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.2;
  max-width: 600px;
}

.hero-overlay p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.05rem;
  margin-top: 0.5rem;
  max-width: 500px;
}

/* Main content */

main {
  flex: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  width: 100%;
}

.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--brown);
  margin-bottom: 1.5rem;
  position: relative;
  padding-bottom: 0.5rem;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 3rem;
  height: 3px;
  background: var(--terracotta);
  border-radius: 2px;
}

/* Recipe cards */

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.recipe-card {
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(61, 43, 31, 0.08);
  transition: transform 0.2s, box-shadow 0.2s;
}

.recipe-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(61, 43, 31, 0.12);
}

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

.recipe-card-body {
  padding: 1.25rem;
}

.recipe-card-body h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--brown);
  margin-bottom: 0.4rem;
}

.recipe-card-body p {
  color: var(--text-light);
  font-size: 0.92rem;
  margin-bottom: 0.75rem;
}

.recipe-meta {
  display: flex;
  gap: 1rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.8rem;
  color: var(--text-light);
}

.recipe-meta span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* Recipe detail page */

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

.recipe-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--brown);
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.recipe-header .tagline {
  color: var(--text-light);
  font-size: 1.05rem;
  font-style: italic;
}

.recipe-detail-meta {
  display: flex;
  gap: 1.5rem;
  margin: 1rem 0 1.5rem;
  padding: 1rem;
  background: var(--warm-gray);
  border-radius: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.9rem;
  flex-wrap: wrap;
}

.recipe-detail-meta div {
  display: flex;
  flex-direction: column;
}

.recipe-detail-meta strong {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--terracotta);
  margin-bottom: 0.15rem;
}

.recipe-hero-img {
  width: 100%;
  height: 360px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 2rem;
}

.recipe-content {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 2rem;
  align-items: start;
}

.ingredients {
  background: var(--white);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(61, 43, 31, 0.06);
  position: sticky;
  top: 5rem;
}

.ingredients h2 {
  font-size: 1.2rem;
  color: var(--terracotta);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--warm-gray);
}

.ingredients ul {
  list-style: none;
}

.ingredients li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--warm-gray);
  font-size: 0.95rem;
}

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

.instructions h2 {
  font-size: 1.2rem;
  color: var(--terracotta);
  margin-bottom: 1rem;
}

.instructions ol {
  padding-left: 1.5rem;
}

.instructions li {
  margin-bottom: 1rem;
  padding-left: 0.5rem;
  font-size: 0.98rem;
}

.instructions li::marker {
  color: var(--terracotta);
  font-weight: 700;
}

.recipe-note {
  margin-top: 2rem;
  padding: 1.25rem;
  background: var(--warm-gray);
  border-left: 4px solid var(--gold);
  border-radius: 0 8px 8px 0;
  font-size: 0.95rem;
  color: var(--text-light);
}

.recipe-note strong {
  color: var(--brown);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  color: var(--terracotta);
}

/* Footer */

.site-footer {
  background: var(--brown);
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  padding: 1.5rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.85rem;
  margin-top: auto;
}

.site-footer a {
  color: var(--gold);
}

/* Responsive */

@media (max-width: 640px) {
  .hero {
    height: 240px;
  }

  .hero-overlay h1 {
    font-size: 1.5rem;
  }

  .hero-overlay p {
    font-size: 0.9rem;
  }

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

  .ingredients {
    position: static;
  }

  .recipe-hero-img {
    height: 220px;
  }

  .recipe-header h1 {
    font-size: 1.5rem;
  }

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

  nav {
    gap: 1rem;
  }
}
