@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;500;600;700;800&display=swap');

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

:root {
  --cream:    #FFF0F7;
  --tan:      #F5D8EC;
  --brown:    #0C1A3E;
  --mid:      #1D3870;
  --terra:    #9B3060;
  --gold:     #D4A017;
  --shadow:   rgba(12,26,62,.12);
  --font:     'Manrope', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--cream);
  color: var(--brown);
  font-family: var(--font);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.7;
}

/* ── Nav ── */
nav {
  background: var(--brown);
  padding: .9rem 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}

nav .brand {
  font-family: var(--font);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--tan);
  text-decoration: none;
  flex: 1;
  white-space: nowrap;
}

nav a {
  color: #e8d8c0;
  text-decoration: none;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  transition: color .2s;
}
nav a:hover { color: var(--cream); }

/* ── Hero ── */
.hero {
  background: var(--brown);
  color: var(--cream);
  text-align: center;
  padding: 5rem 2rem 4rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero h1 {
  font-family: var(--font);
  font-size: clamp(2rem, 6vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.1;
  position: relative;
}
.hero h1 span { color: var(--tan); font-weight: 300; letter-spacing: -.01em; }
.hero p {
  margin-top: 1rem;
  font-size: 1rem;
  font-weight: 400;
  color: #c8b8a0;
  max-width: 520px;
  margin-inline: auto;
  position: relative;
  line-height: 1.7;
}
.hero .divider {
  margin: 1.5rem auto;
  width: 80px;
  height: 2px;
  background: var(--terra);
  position: relative;
}

/* ── Grid ── */
.section-label {
  text-align: center;
  padding: 3rem 1rem 1.5rem;
  font-family: var(--font);
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--mid);
}
.section-label span {
  display: block;
  font-size: .72rem;
  font-family: var(--font);
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--terra);
  font-style: normal;
  margin-bottom: .4rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  max-width: 1100px;
  margin: 0 auto 4rem;
  padding: 0 2rem;
}

.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px var(--shadow);
  overflow: hidden;
  transition: transform .25s, box-shadow .25s;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 32px var(--shadow);
}
.card-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  object-position: top;
  display: block;
}
.card-img-placeholder {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--tan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}
.card-body { padding: 1.4rem; flex: 1; display: flex; flex-direction: column; }
.card-category {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--terra);
  margin-bottom: .4rem;
}
.card-title {
  font-family: var(--font);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.2;
  margin-bottom: .6rem;
}
.card-meta {
  font-size: .8rem;
  font-weight: 400;
  color: #888;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: .8rem;
}
.card-meta span::before { margin-right: .3rem; }

/* ── Recipe page layout ── */
.recipe-hero {
  background: var(--brown);
  color: var(--cream);
  padding: 3rem 2rem 2.5rem;
  text-align: center;
}
.recipe-hero .crumb {
  font-size: .78rem;
  font-weight: 500;
  color: #a08060;
  margin-bottom: 1rem;
}
.recipe-hero .crumb a { color: var(--tan); text-decoration: none; }
.recipe-hero .crumb a:hover { text-decoration: underline; }
.recipe-hero h1 {
  font-family: var(--font);
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.1;
}
.recipe-hero .tagline {
  color: #c8b8a0;
  font-weight: 300;
  margin-top: .6rem;
  font-size: 1rem;
}
.recipe-hero .meta-bar {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  font-size: .88rem;
}
.recipe-hero .meta-bar dt { color: var(--tan); font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.recipe-hero .meta-bar dd { color: #e8d8c0; font-weight: 700; }

.recipe-body {
  max-width: 860px;
  margin: 0 auto;
  padding: 3rem 2rem;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 3rem;
  align-items: start;
}
@media (max-width: 680px) {
  .recipe-body { grid-template-columns: 1fr; gap: 2rem; }
}

/* ── Ingredients ── */
.ingredients-col h2, .directions-col h2 {
  font-family: var(--font);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--mid);
  border-bottom: 2px solid var(--tan);
  padding-bottom: .5rem;
  margin-bottom: 1.2rem;
}
.ingredients-col h3 {
  font-family: var(--font);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--terra);
  margin: 1.2rem 0 .5rem;
}
.ingredients-col ul {
  list-style: none;
  padding: 0;
}
.ingredients-col ul li {
  padding: .35rem 0 .35rem 1.4rem;
  position: relative;
  font-size: .95rem;
  font-weight: 400;
  border-bottom: 1px solid #f0e8d8;
  line-height: 1.5;
}
.ingredients-col ul li::before {
  content: '✦';
  position: absolute;
  left: 0;
  color: var(--terra);
  font-size: .6rem;
  top: .6rem;
}

/* ── Directions ── */
.directions-col ol {
  counter-reset: steps;
  list-style: none;
  padding: 0;
}
.directions-col ol li {
  counter-increment: steps;
  padding: .8rem 0;
  border-bottom: 1px solid #f0e8d8;
  display: flex;
  align-items: flex-start;
  gap: .9rem;
  font-size: .97rem;
  font-weight: 400;
  line-height: 1.65;
}
.directions-col ol li::before {
  content: counter(steps);
  flex-shrink: 0;
  width: 1.8rem;
  height: 1.8rem;
  background: var(--terra);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  margin-top: .2rem;
}

.tip-box {
  background: var(--tan);
  border-left: 4px solid var(--gold);
  border-radius: 0 8px 8px 0;
  padding: 1rem 1.2rem;
  margin-top: 1.5rem;
  font-size: .9rem;
  font-weight: 400;
  line-height: 1.6;
}
.tip-box strong { color: var(--mid); font-weight: 700; }

/* ── Original photo ── */
.original-photo { margin-top: 2rem; }
.original-photo h3 {
  font-family: var(--font);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: .6rem;
}
.original-photo img {
  width: 100%;
  border-radius: 8px;
  border: 3px solid var(--tan);
  cursor: pointer;
  transition: opacity .2s;
}
.original-photo img:hover { opacity: .9; }
.original-photo figcaption {
  font-size: .75rem;
  font-weight: 400;
  color: #999;
  margin-top: .4rem;
  text-align: center;
}

/* ── Lightbox ── */
.lightbox {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.85);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 90vw; max-height: 90vh; border-radius: 6px; }
.lightbox-close {
  position: fixed;
  top: 1rem; right: 1.5rem;
  color: #fff;
  font-size: 2rem;
  font-weight: 300;
  cursor: pointer;
  background: none;
  border: none;
  line-height: 1;
}

/* ── Recipe nav ── */
.recipe-nav {
  background: var(--tan);
  padding: 2rem;
  text-align: center;
}
.recipe-nav p { color: var(--mid); font-size: .82rem; font-weight: 400; margin-bottom: 1rem; }
.recipe-nav .links { display: flex; flex-wrap: wrap; justify-content: center; gap: .8rem; }
.recipe-nav .links a {
  background: var(--brown);
  color: var(--cream);
  padding: .5rem 1.1rem;
  border-radius: 100px;
  text-decoration: none;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  transition: background .2s;
}
.recipe-nav .links a:hover { background: var(--terra); }
.recipe-nav .links a.active { background: var(--terra); }

/* ── Footer ── */
footer {
  background: var(--brown);
  color: #a08060;
  text-align: center;
  padding: 2rem;
  font-size: .8rem;
  font-weight: 400;
  line-height: 1.8;
}
footer span { color: var(--tan); font-weight: 600; }

/* ── Nav dropdown ── */
.nav-dropdown { position: relative; }
.nav-dropdown-btn {
  background: none;
  border: none;
  color: #e8d8c0;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  cursor: pointer;
  font-family: var(--font);
  padding: 0;
  transition: color .2s;
  white-space: nowrap;
}
.nav-dropdown-btn:hover { color: var(--cream); }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + .9rem);
  right: 0;
  background: var(--brown);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  min-width: 190px;
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
  overflow: hidden;
  z-index: 200;
}
.nav-dropdown-menu.open { display: block; }
.nav-dropdown-menu a {
  display: block;
  padding: .65rem 1.1rem;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #e8d8c0;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.07);
  transition: background .15s, color .15s;
}
.nav-dropdown-menu a:last-child { border-bottom: none; }
.nav-dropdown-menu a:hover { background: var(--terra); color: var(--cream); }

/* ── Nav search ── */
.nav-search { margin-left: auto; position: relative; }
.nav-search input {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 20px;
  color: var(--cream);
  font-family: var(--font);
  font-size: .78rem;
  padding: .35rem 1rem;
  width: 155px;
  outline: none;
  transition: background .2s, border-color .2s, width .3s;
}
.nav-search input::placeholder { color: rgba(255,255,255,.38); }
.nav-search input:focus {
  background: rgba(255,255,255,.15);
  border-color: var(--terra);
  width: 220px;
}
.search-results {
  display: none;
  position: absolute;
  top: calc(100% + .75rem);
  right: 0;
  width: 310px;
  background: var(--brown);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.55);
  overflow: hidden;
  z-index: 300;
  max-height: 380px;
  overflow-y: auto;
}
.search-results.open { display: block; }
.search-result-item {
  display: block;
  padding: .6rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
  text-decoration: none;
  color: #e8d8c0;
  transition: background .15s;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover,
.search-result-item.active { background: var(--terra); color: var(--cream); }
.search-result-title { font-size: .82rem; font-weight: 600; line-height: 1.3; }
.search-result-sub { font-size: .68rem; color: rgba(255,255,255,.45); margin-top: .15rem; text-transform: uppercase; letter-spacing: .05em; font-family: 'Courier New', monospace; }
.search-result-item:hover .search-result-sub,
.search-result-item.active .search-result-sub { color: rgba(255,255,255,.7); }
.search-no-results { padding: .85rem 1rem; color: rgba(255,255,255,.35); font-size: .78rem; font-style: italic; }

/* ── Print ── */
@media print {
  nav, .recipe-nav, footer, .original-photo { display: none; }
  .recipe-hero { background: #fff; color: #000; padding: 1rem 0; }
  .recipe-hero h1 { color: #000; }
  .recipe-hero .meta-bar dt, .recipe-hero .meta-bar dd { color: #444; }
  .recipe-body { grid-template-columns: 1fr; }
}
