:root {
  --cream: #fff8f3;
  --paper: #fff;
  --rose: #e9b8c4;
  --rose-light: #f7e1e5;
  --brown: #5b3526;
  --brown-soft: #8b6757;
  --text: #3f342f;
  --muted: #85756e;
  --shadow: 0 18px 45px rgba(91, 53, 38, .10);
  --radius: 28px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--rose);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
}

a {
  background: var(--cream);
  padding: 6px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  display: inline-block;
  transition: background .12s, transform .12s;
}
a:hover {
  background: var(--paper);
  transform: translateY(-2px);
}


/* ── Top bar ── */

.top-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: transparent;
}

.top-bar-inner {
  max-width: 1200px;
  margin: auto;
  padding: 15px 25px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.top-meals,
.top-prefs {
  display: flex;
  gap: 8px;
  align-items: center;
}

.top-meal-btn,
.top-pref-btn {
  border: 0;
  background: #fff;
  padding: 9px 16px;
  border-radius: 999px;
  color: var(--brown-soft);
  font-weight: 600;
  cursor: pointer;
  transition: .2s;
}

.top-meal-btn:hover,
.top-pref-btn:hover,
.top-meal-btn.active,
.top-pref-btn.active {
  background: var(--rose-light);
  color: var(--brown-soft);
}


/* ── Hero ── */

.hero {
  max-width: 1200px;
  height: 460px;
  margin: 40px auto;
  border-radius: 40px;
  overflow: hidden;
  background-color: var(--cream);
  background-repeat: repeat-x;
  background-position: center;
  background-size: auto 100%;
  display: flex;
  align-items: center;
  box-shadow: 0 30px 60px rgba(233, 184, 196, 0.16);
}

.hero-content,
.hero .content {
  padding: 60px;
  max-width: 650px;
  border-radius: 14px;
}

.hero h1,
.hero h2 {
  font-family: Georgia, serif;
  font-size: 70px;
  line-height: 1;
  margin: 0;
  color: var(--brown);
}

.hero p {
  font-size: 20px;
  color: var(--brown-soft);
}

/* About page centers hero content */
.about .hero {
  justify-content: center;
}

.about .hero-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Tabs under search on recipes page */
.hero-tabs {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.hero-tabs .top-meals,
.hero-tabs .top-prefs {
  display: flex;
  gap: 10px;
}

.hero-tabs .top-prefs {
  margin-left: 12px;
}


/* ── Main ── */

main {
  max-width: 1200px;
  margin: auto;
  padding: 0 24px 80px;
}

.search {
  border: 0;
  border-radius: 999px;
  padding: 14px 20px;
  width: 280px;
  background: white;
  box-shadow: var(--shadow);
}


/* ── Email capture ── */

.email-capture {
  background: white;
  border-radius: var(--radius);
  padding: 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 40px;
  box-shadow: var(--shadow);
}

.email-capture form {
  display: flex;
  gap: 10px;
}

.email-capture input {
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid #ddd;
}

.hero .hero-email {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: none;
  padding: 18px;
  border-radius: 14px;
  margin-top: 22px;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.hero .hero-email .btn {
  padding: 10px 18px;
}


/* ── Recipe grid ── */

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}


/* ── Featured ── */

.featured {
  max-width: 1200px;
  margin: 30px auto;
  padding: 0 24px;
}

.featured h2 {
  font-family: Georgia, serif;
  font-size: 32px;
  color: var(--brown);
  margin: 8px 0 18px;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.featured .card {
  height: 420px;
}

.featured .card img {
  height: 260px;
}


/* ── Cards ── */

.card {
  background: var(--paper);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: .25s;
  height: 100%;
}

.card:hover {
  transform: translateY(-8px);
}

.card img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  display: block;
}

.card-body {
  padding: 24px;
}

/* Hide details on card; show in popup only */
.card .card-body ul,
.card .card-body ol,
.card .card-body .meta {
  display: none;
}

.details .panel ul,
.details .panel ol,
.details .panel .tags,
.details .panel .meta {
  display: block;
}

.meta {
  color: var(--muted);
  font-size: 14px;
}

.title,
.card h2 {
  font-family: Georgia, serif;
  font-size: 28px;
  color: var(--brown);
  margin: 10px 0;
}

.tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  background: var(--rose-light);
  color: var(--brown);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
}


/* ── Button ── */

.btn {
  background: var(--brown);
  color: white;
  border: 0;
  border-radius: 999px;
  padding: 12px 25px;
  font-weight: 700;
  cursor: pointer;
  transition: .2s;
}

.btn:hover {
  background: var(--rose);
  color: var(--brown);
}


/* ── Detail popup ── */

.details {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #0004;
  display: none;
  align-items: center;
  justify-content: center;
}

.details.open {
  display: flex;
}

.details .panel {
  position: relative;
  width: min(850px, 90%);
  background: white;
  padding: 35px;
  border-radius: 35px;
  box-shadow: var(--shadow);
  max-height: 90vh;
  overflow-y: auto;
}

.details .panel #closeBtn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: white;
  border-radius: 999px;
  border: 1px solid #eee;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: var(--brown-soft);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  z-index: 60;
}

.details .panel #closeBtn:hover {
  background: var(--rose-light);
  color: var(--brown);
  transform: scale(1.04);
}


/* ── Footer ── */

footer {
  text-align: center;
  padding: 40px;
  color: var(--muted);
}


/* ── Responsive ── */

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

  .hero h1,
  .hero h2 {
    font-size: 50px;
  }

  .featured-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-tabs {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 600px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .hero {
    height: 350px;
  }

  .hero-content,
  .hero .content {
    padding: 30px;
  }

  .email-capture,
  .email-capture form {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }

  .search {
    width: 100%;
  }

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

  .featured .card {
    height: 360px;
  }

  .featured .card img {
    height: 220px;
  }
}