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

/* Playfair Display — variable font (400–900, upright) */
@font-face {
  font-display: swap;
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 400 900;
  src: url('/static/fonts/PlayfairDisplay[wght].woff2') format('woff2');
}

/* Playfair Display — variable font (400–900, italic) */
@font-face {
  font-display: swap;
  font-family: 'Playfair Display';
  font-style: italic;
  font-weight: 400 900;
  src: url('/static/fonts/PlayfairDisplay-Italic[wght].woff2') format('woff2');
}

/* Inter — variable font (100–900) */
@font-face {
  font-display: swap;
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  src: url('/static/fonts/Inter[wght].woff2') format('woff2');
}

html {
  font-size: 100%;
}

:root {
  /* brand palette */
  --deep-kitchen: #1E1008;
  --warm-stone:   #2F1A0E;
  --warm-cream:   #F5EAD0;
  --ember:        #E8612A;
  --deep-ember:   #C44D1E;
  --aged-linen:   #B89C7A;
  --clay:         #8B6040;

  /* typography */
  --heading-font: 'Playfair Display', Georgia, serif;
  --body-font: 'Inter', system-ui, sans-serif;
  --small-text: 0.75em;

  /* layout */
  --max-width: 1120px;
  --fixed-width: 600px;
  --border-radius: 4px;
  --letter-spacing: 0.14em;
  --transition: 0.2s ease-in-out all;

  /* shadows */
  --shadow-1: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
  --shadow-2: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-3: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.15);
}

body {
  background: var(--deep-kitchen);
  font-family: var(--body-font);
  font-weight: 400;
  font-size: 1.125rem;
  line-height: 1.75;
  color: var(--warm-cream);
}

p {
  margin-top: 0;
  margin-bottom: 1.5rem;
  max-width: 40em;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--heading-font);
  font-weight: 700;
  line-height: 1.3;
  margin-top: 0;
  color: var(--warm-cream);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.75rem; margin: 0; }
h3 { font-size: 1.25rem; margin: 0; }
h4 { font-size: 1.125rem; margin: 0; }
h5 { font-size: 1rem; margin: 0; }

small,
.text-small {
  font-size: var(--small-text);
}

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

a:hover {
  color: var(--ember);
}

ul {
  list-style-type: none;
  padding: 0;
}

.img {
  width: 100%;
  display: block;
  object-fit: cover;
}

/* Buttons */
.btn {
  cursor: pointer;
  color: var(--warm-cream);
  background: var(--ember);
  border: transparent;
  border-radius: var(--border-radius);
  letter-spacing: var(--letter-spacing);
  padding: 0.5rem 1.25rem;
  box-shadow: var(--shadow-1);
  transition: var(--transition);
  text-transform: uppercase;
  font-size: 0.8125rem;
  font-weight: 500;
  display: inline-block;
  font-family: var(--body-font);
}

.btn:hover {
  background: var(--deep-ember);
  color: var(--warm-cream);
  box-shadow: var(--shadow-2);
}

.btn-block {
  width: 100%;
}

.btn-primary {
  cursor: pointer;
  background: var(--ember);
  color: var(--warm-cream);
  border: none;
  border-radius: var(--border-radius);
  padding: 0.625rem 1.5rem;
  font-family: var(--body-font);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: var(--letter-spacing);
  text-transform: uppercase;
  transition: var(--transition);
  display: inline-block;
}

.btn-primary:hover {
  background: var(--deep-ember);
  color: var(--warm-cream);
}

.btn-outline {
  cursor: pointer;
  background: transparent;
  color: var(--ember);
  border: 1.5px solid var(--ember);
  border-radius: var(--border-radius);
  padding: 0.625rem 1.5rem;
  font-family: var(--body-font);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: var(--letter-spacing);
  text-transform: uppercase;
  transition: var(--transition);
  display: inline-block;
}

.btn-outline:hover {
  background: var(--ember);
  color: var(--warm-cream);
}

/* Form (contact page) */
.form {
  width: 90vw;
  max-width: var(--fixed-width);
  background: var(--warm-stone);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-2);
  padding: 2rem 2.5rem;
  margin: 3rem auto;
}

.form-label {
  display: block;
  font-size: var(--small-text);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing);
  color: var(--aged-linen);
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: var(--border-radius);
  background: var(--deep-kitchen);
  border: 1px solid var(--clay);
  color: var(--warm-cream);
  font-family: var(--body-font);
}

.form-row {
  margin-bottom: 1rem;
}

.form-textarea {
  height: 7rem;
}

::placeholder {
  font-family: inherit;
  color: var(--aged-linen);
  opacity: 0.6;
}

/*
===============
Navbar
===============
*/

.navbar {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--deep-kitchen);
  border-bottom: 1px solid var(--warm-stone);
}

.nav-center {
  width: 90vw;
  max-width: var(--max-width);
}

.nav-header {
  height: 5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-header img {
  width: 40px;
  height: 40px;
}

.nav-logo {
  display: flex;
  align-items: center;
}

.nav-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: var(--warm-cream);
}

.nav-btn i {
  font-size: 1.25rem;
}

.nav-links {
  height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.show-links {
  height: 6.5rem;
}

.nav-link {
  display: block;
  text-align: center;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing);
  color: var(--warm-cream);
  padding: 1rem 0;
  border-top: 1px solid var(--warm-stone);
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--ember);
}

@media screen and (min-width: 992px) {
  .navbar {
    height: 5rem;
  }

  .nav-center {
    display: flex;
    align-items: center;
  }

  .nav-header {
    padding: 0;
    margin-right: 2rem;
    height: auto;
  }

  .nav-btn {
    display: none;
  }

  .nav-links {
    height: auto !important;
    flex-direction: row;
    align-items: center;
    width: 100%;
    gap: 2rem;
  }

  .nav-link {
    padding: 0;
    border-top: none;
    font-size: 0.8125rem;
  }
}

/*
===============
Page
===============
*/

.page {
  width: 90vw;
  max-width: var(--max-width);
  margin: 0 auto;
  padding-top: 2rem;
  min-height: calc(100vh - 5rem - 4rem);
}

/*
===============
Footer
===============
*/

.page-footer {
  text-align: center;
  min-height: 4rem;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--warm-stone);
  color: var(--aged-linen);
  border-top: 1px solid var(--clay);
}

.page-footer p {
  margin-bottom: 0;
  font-size: 0.875rem;
}

.page-footer a {
  color: var(--ember);
}

.page-footer a:hover {
  color: var(--warm-cream);
}

/*
===============
Hero (text)
===============
*/

.hero {
  padding: 4rem 0 3rem;
  margin-bottom: 3rem;
}

/*
===============
Recipes / Cards
===============
*/

.recipes-container {
  display: grid;
  gap: 2rem 1rem;
}

.recipes-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1rem;
  align-items: start;
  padding-bottom: 3rem;
}

.tags-container {
  order: 1;
  display: flex;
  flex-direction: column;
  padding-bottom: 3rem;
}

.tags-container h4 {
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--aged-linen);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing);
  font-family: var(--body-font);
}

.tags-list {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
}

.tags-list a {
  text-transform: capitalize;
  display: block;
  color: var(--aged-linen);
  transition: var(--transition);
  font-size: 0.875rem;
}

.tags-list a:hover {
  color: var(--ember);
}

.recipe {
  display: flex;
  flex-direction: column;
  background: var(--warm-stone);
  border-radius: var(--border-radius);
  overflow: hidden;
  align-self: start;
}

.recipe-img {
  width: 100%;
  aspect-ratio: 29 / 16;
  height: 160px;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}

.recipe-img-placeholder {
  width: 100%;
  height: 160px;
  background: var(--warm-stone);
  object-fit: none;
  flex-shrink: 0;
}

.recipe-body {
  padding: 0.75rem 1rem 1rem;
}

.recipe h4 {
  margin-bottom: 0;
  margin-top: 0;
  line-height: 1.2;
  color: var(--warm-cream);
}

.recipe p {
  margin-bottom: 0;
  line-height: 1;
  color: var(--aged-linen);
  margin-top: 0.4rem;
  font-size: 0.875rem;
}

/* Meta chips on cards */
.chip {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--aged-linen);
  background: rgba(139, 96, 64, 0.2);
  border: 1px solid var(--clay);
  border-radius: 2px;
  padding: 0.1rem 0.5rem;
  margin-right: 0.35rem;
  margin-top: 0.5rem;
}

.stage-ingredients {
  background: var(--warm-stone);
  padding: 1rem;
  border-left: 3px solid var(--ember);
  margin-bottom: 1rem;
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.stage-ingredients h5 {
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--aged-linen);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing);
  font-family: var(--body-font);
}

.stage-ingredients ul {
  padding-left: 1.25rem;
  list-style: disc;
}

.stage-ingredients li {
  color: var(--warm-cream);
  font-size: 0.9375rem;
}

@media screen and (min-width: 576px) {
  .recipes-list {
    grid-template-columns: 1fr 1fr;
  }

  .recipe-img {
    height: 10rem;
  }
}

@media screen and (min-width: 992px) {
  .recipes-container {
    grid-template-columns: 200px 1fr;
    gap: 1rem;
  }

  .recipes-list {
    grid-template-columns: 1fr 1fr;
  }

  .recipe p {
    font-size: 0.85rem;
  }

  .tags-container {
    order: 0;
  }

  .tags-list {
    grid-template-columns: 1fr;
  }
}

@media screen and (min-width: 1200px) {
  .recipes-list {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

/*
===============
About Page
===============
*/

.about-page {
  display: grid;
  gap: 2rem 4rem;
  padding-bottom: 3rem;
}

.about-img {
  border-radius: var(--border-radius);
  height: 300px;
  object-fit: cover;
}

@media screen and (min-width: 992px) {
  .about-page {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 400px;
    align-items: center;
  }

  .about-img {
    height: 100%;
  }
}

.featured-title {
  text-align: center;
}

/*
===============
Contact Page
===============
*/

.contact-form {
  width: 100%;
  margin: 0;
}

.contact-container {
  display: grid;
  gap: 2rem 3rem;
  padding-bottom: 3rem;
}

@media screen and (min-width: 992px) {
  .contact-container {
    grid-template-columns: 1fr 450px;
    align-items: center;
  }
}

/*
===============
Tags Page
===============
*/

.tags-wrapper {
  display: grid;
  gap: 2rem;
  padding-bottom: 3rem;
}

.tag {
  background: var(--warm-stone);
  border-radius: var(--border-radius);
  text-align: center;
  color: var(--warm-cream);
  transition: var(--transition);
  padding: 0.75rem 0;
  border: 1px solid var(--clay);
}

.tag:hover {
  border-color: var(--ember);
  color: var(--ember);
}

.tag p {
  margin-bottom: 0;
  color: var(--aged-linen);
  font-size: 0.875rem;
}

.tag h5 {
  margin-bottom: 0;
  font-weight: 600;
  color: var(--warm-cream);
}

@media screen and (min-width: 576px) {
  .tags-wrapper {
    grid-template-columns: 1fr 1fr;
  }
}

@media screen and (min-width: 992px) {
  .tags-wrapper {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

/*
===============
Recipe Template
===============
*/

.recipe-hero {
  display: grid;
  gap: 3rem;
}

.recipe-hero-img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: var(--border-radius);
}

.recipe-info p {
  color: var(--aged-linen);
}

.recipe-icons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 2rem 0;
  text-align: center;
}

.recipe-icons i {
  font-size: 1.5rem;
  color: var(--ember);
}

.recipe-icons h2 {
  margin-bottom: 0;
  font-size: 0.85em;
}

.recipe-icons p {
  margin-bottom: 0;
  font-size: 0.85em;
  color: var(--aged-linen);
}

.recipe-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.7em;
  font-weight: 600;
}

.recipe-tags a {
  background: var(--ember);
  border-radius: var(--border-radius);
  color: var(--warm-cream);
  padding: 0.05rem 0.5rem;
  margin: 0 0.25rem;
  text-transform: capitalize;
}

@media screen and (min-width: 992px) {
  .recipe-hero {
    grid-template-columns: 4fr 5fr;
    align-items: center;
  }
}

.recipe-content {
  padding: 3rem 0;
  display: grid;
  gap: 2rem 5rem;
}

@media screen and (min-width: 992px) {
  .recipe-content {
    grid-template-columns: 2fr 1fr;
  }
}

.single-instruction header {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  align-items: center;
}

.single-instruction header p {
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ember);
  margin-bottom: 0;
  font-size: 0.8125rem;
  letter-spacing: var(--letter-spacing);
  font-family: var(--body-font);
}

.single-instruction > p {
  color: var(--warm-cream);
}

.single-instruction header div {
  height: 1px;
  background: var(--clay);
}

.images {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.images img {
  width: 100%;
  height: auto;
  border-radius: var(--border-radius);
}

.images img:only-child {
  grid-column: 1 / -1;
  justify-self: center;
  width: 50%;
  height: auto;
  border-radius: var(--border-radius);
}

.second-column {
  display: grid;
  row-gap: 2rem;
  align-content: start;
}

.single-ingredient {
  border-bottom: 1px solid var(--clay);
  padding-bottom: 0.75rem;
  color: var(--warm-cream);
}

.single-tool {
  border-bottom: 1px solid var(--clay);
  padding-bottom: 0.75rem;
  color: var(--ember);
  text-transform: capitalize;
}

/* Lazy image fade */
.lazy-fade {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lazy-fade.loaded {
  opacity: 1;
}

/* ============================================================
   Recipe page — specific styles (loaded via <link>)
   ============================================================ */

/* Full-width cover */
.recipe-cover {
  width: 100%;
  max-height: 500px;
  overflow: hidden;
  background: var(--warm-stone);
}

.recipe-cover-img {
  width: 100%;
  max-height: 500px;
  height: auto;
  object-fit: cover;
  display: block;
}

.recipe-cover-placeholder {
  width: 100%;
  height: 300px;
  background: var(--warm-stone);
  display: flex;
  align-items: center;
  justify-content: center;
}

@media screen and (min-width: 768px) {
  .recipe-cover-placeholder {
    height: 400px;
  }
}

/* Recipe page layout */
.recipe-page {
  padding-bottom: 4rem;
}

.recipe-header {
  padding-top: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--clay);
  margin-bottom: 2.5rem;
}

.recipe-header h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 0.75rem;
}

.recipe-description {
  color: var(--aged-linen);
  font-size: 1.0625rem;
  max-width: 60ch;
  margin-bottom: 1rem;
}

.recipe-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.recipe-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.recipe-tag {
  background: var(--warm-stone);
  border: 1px solid var(--clay);
  border-radius: var(--border-radius);
  color: var(--aged-linen);
  padding: 0.1rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.recipe-tag:hover {
  border-color: var(--ember);
  color: var(--ember);
}

/* CTAs */
.recipe-ctas {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
  align-items: center;
}

/* Master ingredients panel */
.master-ingredients {
  background: var(--warm-stone);
  border-left: 3px solid var(--ember);
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
  padding: 1.5rem;
  margin-bottom: 3rem;
}

.master-ingredients h2 {
  font-size: 1.125rem;
  margin-bottom: 1.25rem;
  color: var(--warm-cream);
  font-family: var(--body-font);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing);
}

.ingredient-group {
  margin-bottom: 1.25rem;
}

.ingredient-group:last-child {
  margin-bottom: 0;
}

.ingredient-group-title {
  color: var(--aged-linen);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing);
  font-family: var(--body-font);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.ingredient-group ul {
  list-style: disc;
  padding-left: 1.25rem;
}

.ingredient-group li {
  color: var(--warm-cream);
  font-size: 0.9375rem;
  padding: 0.2rem 0;
}

/* Steps */
.recipe-steps {
  max-width: 720px;
}

.recipe-steps > h2 {
  font-size: 1.125rem;
  margin-bottom: 2rem;
  font-family: var(--body-font);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing);
  color: var(--aged-linen);
}

.step {
  padding-bottom: 2.5rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--clay);
}

.step:last-child {
  border-bottom: none;
}

.step-header {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.step-num {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--ember);
  line-height: 1;
  flex-shrink: 0;
  min-width: 2rem;
}

.step-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--warm-cream);
  padding-top: 0.4rem;
}

.step-text {
  color: var(--warm-cream);
  line-height: 1.8;
  max-width: 65ch;
}

/* Cook mode — hide images when Start Cooking is active */
body[data-cooking] .images {
  display: none;
}

/* Error page */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 0;
}

.error-code {
  font-size: 6rem;
  font-weight: 900;
  color: var(--ember);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.error-msg {
  color: var(--aged-linen);
  margin-bottom: 2rem;
}
