/* ── Fonts ────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;1,400&family=Inter:wght@300;400;500;600&display=swap');

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

/* ── Tokens: light ────────────────────────────────────────── */
:root {
  --bg:          #f7f4ef;
  --bg-2:        #ffffff;
  --border:      #e6e0d6;
  --text:        #1c1917;
  --text-2:      #78716c;
  --accent:      #c2652a;
  --accent-dim:  #f5ede4;
  --accent-ring: #c2652a40;
  --tag-bg:      #eeeae4;
  --tag-text:    #6b6560;
  --step-bg:     #c2652a;
  --step-text:   #ffffff;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.06);
  --shadow-md:   0 4px 12px rgba(0,0,0,.08), 0 8px 28px rgba(0,0,0,.08);
  --shadow-lg:   0 8px 24px rgba(0,0,0,.10), 0 20px 48px rgba(0,0,0,.10);
  --radius:      14px;
  --radius-sm:   8px;
  --font-sans:   'Inter', system-ui, -apple-system, sans-serif;
  --font-serif:  'Playfair Display', Georgia, serif;
  --transition:  .2s ease;
}

/* ── Tokens: dark ─────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:          #111110;
    --bg-2:        #1c1b1a;
    --border:      #2e2c2a;
    --text:        #f0ece6;
    --text-2:      #a09890;
    --accent:      #e07840;
    --accent-dim:  #2e1f14;
    --accent-ring: #e0784030;
    --tag-bg:      #252320;
    --tag-text:    #9b9188;
    --step-bg:     #e07840;
    --step-text:   #ffffff;
    --shadow-sm:   0 1px 3px rgba(0,0,0,.25), 0 2px 8px rgba(0,0,0,.25);
    --shadow-md:   0 4px 12px rgba(0,0,0,.35), 0 8px 28px rgba(0,0,0,.30);
    --shadow-lg:   0 8px 24px rgba(0,0,0,.45), 0 20px 48px rgba(0,0,0,.35);
  }
}

/* ── Base ─────────────────────────────────────────────────── */
html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a   { color: inherit; text-decoration: none; }

/* ── Layout ───────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

main { flex: 1; }

/* ── Site header ──────────────────────────────────────────── */
.site-header {
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

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

.site-logo {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -.01em;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-2);
  transition: color var(--transition);
}
.back-link:hover { color: var(--accent); }

/* ── Index: page hero ─────────────────────────────────────── */
.index-hero {
  padding: 4rem 0 3.5rem;
  text-align: center;
}

.index-hero h2 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.02em;
  margin-bottom: .6rem;
}

.index-hero p {
  font-size: 1rem;
  color: var(--text-2);
  font-weight: 300;
  letter-spacing: .01em;
}

/* ── Recipe grid ──────────────────────────────────────────── */
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.75rem;
  padding-bottom: 4rem;
}

.recipe-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}
.recipe-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.recipe-card-img {
  height: 210px;
  overflow: hidden;
  background: var(--accent-dim);
}
.recipe-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.recipe-card:hover .recipe-card-img img { transform: scale(1.05); }

.recipe-card-body {
  padding: 1.25rem 1.35rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  flex: 1;
}

.recipe-card-body h2 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.3;
}

.recipe-card-body p {
  font-size: .875rem;
  color: var(--text-2);
  line-height: 1.55;
  flex: 1;
}

.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .25rem; }

.tag {
  display: inline-block;
  background: var(--tag-bg);
  color: var(--tag-text);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .03em;
  text-transform: uppercase;
  padding: .25rem .65rem;
  border-radius: 99px;
}

/* ── Recipe page: banner ──────────────────────────────────── */
.recipe-banner {
  position: relative;
  width: 100%;
  height: clamp(280px, 45vw, 480px);
  overflow: hidden;
  background: var(--accent-dim);
}

.recipe-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.recipe-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,.72) 0%,
    rgba(0,0,0,.28) 55%,
    rgba(0,0,0,.05) 100%
  );
  display: flex;
  align-items: flex-end;
}

.recipe-banner-text {
  padding: 2rem 1.5rem;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.recipe-banner-text h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
  letter-spacing: -.02em;
  margin-bottom: .4rem;
  text-shadow: 0 1px 4px rgba(0,0,0,.3);
}

.recipe-source {
  font-size: .82rem;
  color: rgba(255,255,255,.7);
  margin-bottom: .75rem;
}

.recipe-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.recipe-meta span {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: .8rem;
  font-weight: 500;
  padding: .3rem .75rem;
  border-radius: 99px;
  border: 1px solid rgba(255,255,255,.2);
}

/* ── Recipe page: body ────────────────────────────────────── */
.recipe-body {
  max-width: 780px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
}

.recipe-intro {
  font-size: 1.05rem;
  color: var(--text-2);
  font-weight: 300;
  font-style: italic;
  font-family: var(--font-serif);
  line-height: 1.75;
  padding: 1.5rem 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.recipe-columns {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 3rem;
}

@media (max-width: 640px) {
  .recipe-columns { grid-template-columns: 1fr; gap: 2rem; }
}

/* ── Ingredients ──────────────────────────────────────────── */
.ingredients h3,
.steps h3 {
  font-family: var(--font-sans);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.ingredients ul { list-style: none; }

.ingredients li {
  display: flex;
  align-items: baseline;
  gap: .75rem;
  padding: .6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
}
.ingredients li:last-child { border-bottom: none; }

.amount {
  font-size: .8rem;
  font-weight: 600;
  color: var(--accent);
  min-width: 52px;
  flex-shrink: 0;
  text-align: right;
}

/* ── Steps ────────────────────────────────────────────────── */
.steps ol {
  list-style: none;
  counter-reset: steps;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.steps li {
  counter-increment: steps;
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: .85rem;
  align-items: start;
  font-size: .92rem;
  line-height: 1.65;
}

.steps li::before {
  content: counter(steps);
  background: var(--step-bg);
  color: var(--step-text);
  font-size: .72rem;
  font-weight: 700;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: .1rem;
  box-shadow: 0 2px 8px var(--accent-ring);
}

/* ── Recipe note ──────────────────────────────────────────── */
.recipe-note {
  margin-top: 2.5rem;
  background: var(--accent-dim);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: .9rem 1.2rem;
  font-size: .875rem;
  color: var(--text-2);
}

/* ── Footer ───────────────────────────────────────────────── */
footer {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  text-align: center;
  font-size: .78rem;
  color: var(--text-2);
  letter-spacing: .02em;
}
