@import url('https://fonts.googleapis.com/css2?family=Twinkle+Star&display=swap');

/* ----------   Design tokens   ---------- */
:root {
  --accent: hsl(200 80% 50%);
  --bg: hsl(0 0% 96%);
  font-family: system-ui, sans-serif;
}

/* ----------   Basic page chrome   ---------- */
body {
  margin: 0;
  padding: 2rem 1.5rem;
  background: var(--bg);
}

h1 {
  font-family: 'Twinkle Star', cursive;   /* Twinkle first, cursive fallback */
  margin: 0 0 1.25rem;
  color: var(--accent);
}

.page-title {
  margin: 0 0 2rem;
  color: var(--accent);
  text-align: center;
}

/* ----------  Top nav bar (back + share)  ---------- */
.page-nav {
  display: flex;
  justify-content: space-between;   /* items at far ends */
  align-items: center;
  margin-bottom: 1.5rem;
}

/* Re-use your accent colour for both controls */
.back-link,
.share-btn {
  font-weight: 600;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: .25rem .5rem;
  font: inherit;        /* keeps the system-UI font */
  text-decoration: none;/* removes underline from link */
}

/* Tiny hover lift for symmetry with cards */
.back-link:hover,
.share-btn:hover,
.back-link:focus-visible,
.share-btn:focus-visible {
  transform: translateY(-1px);
}

/* ----------   Recipe grid   ---------- */
.recipe-grid {
  display: grid;
  gap: 1.5rem;
  /* auto-fill → as many columns as space allows, min 16 rem wide  */
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  max-inline-size: 75rem;   /* adjust to taste */
  margin-inline: auto;      /* shorthand for “margin-left/right: auto” */
}

/* ----------   Card visuals   ---------- */
.recipe-card {
  position: relative;
  aspect-ratio: 4 / 3;      /* keeps tiles equal height no matter the image */
  overflow: hidden;
  border-radius: 1rem;
  box-shadow: 0 4px 12px hsl(0 0% 0% / 0.15);
  display: block;          /* link behaves like a block element */
  text-decoration: none;   /* remove underline */
}

.recipe-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;       /* image fills card, cropping if necessary */
  display: block;          /* removes default baseline gap */
}

/* ----------   Title bar overlay   ---------- */
.recipe-title {
  position: absolute;
  inset-inline: 0;         /* stretches full width (LTR & RTL-safe) */
  bottom: 0;
  background: rgba(0, 0, 0, 0.66); /* 50 % black */
  color: #fff;
  padding: 0.75rem 1rem;
  font-weight: 600;
  text-align: center;
  font-size: 1.1rem;
}

/* Optional small touch: lift on hover/focus */
.recipe-card:hover,
.recipe-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px hsl(0 0% 0% / 0.25);
  transition: 150ms;
}

/* ----------  Navigation back-link  ---------- */
.back-nav {
  margin-bottom: 1.5rem;
}
.back-nav a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

/* ----------  Hero section  ---------- */
.recipe-hero {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 1rem;
  box-shadow: 0 4px 12px hsl(0 0% 0% / 0.15);
  margin-bottom: 2rem;
  max-inline-size: 50rem;   /* 50 rem ≈ 800 px */
  margin-inline: auto;
}
.recipe-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.recipe-hero h1 {
  font-family: 'Twinkle Star', cursive;
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  margin: 0;
  padding: 0.75rem 1rem;
  background: rgba(0,0,0,0.5);   /* same 50 % black overlay */
  color: #fff;
  text-align: center;
  font-size: clamp(1.75rem, 4vw + 0.5rem, 3rem);
}

/* ----------  Body text area  ---------- */
.recipe-body {
  max-inline-size: 50rem;        /* 50 rem ≈ 800 px */
  margin-inline: auto;           /* centre the column */
  display: grid;
  gap: 2rem;
}

/* Headings inside the recipe */
.recipe-body h2 {
  margin: 0 0 0.5rem;
  color: var(--accent);
}

/* Ingredient / considerations list styling */
.ingredients,
.considerations {
  list-style: square outside;
  padding-inline-start: 1.25rem;
  line-height: 1.5;
}

/* Method steps as numbered list */
.method {
  counter-reset: step;
  padding-inline-start: 1.75rem;
  line-height: 1.6;
}
.method li {
  margin-block-end: 0.75rem;
}