@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@100..900&family=Young+Serif&display=swap");

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

:root {
  /* --- Colors --- */
  --white: hsl(0, 0%, 100%);

  /* Neutrals (Stone) */
  --stone-100: hsl(30, 54%, 90%);
  --stone-150: hsl(30, 18%, 87%);
  --stone-600: hsl(30, 10%, 34%);
  --stone-900: hsl(24, 5%, 18%);

  /* Accents (Brown & Rose) */
  --brown-800: hsl(14, 45%, 36%);
  --rose-800: hsl(332, 51%, 32%);
  --rose-100: rgb(255, 247, 252);
  --rose-50: hsl(330, 100%, 98%);

  /* --- Typography --- */
  /* Heading font */
  --ff-serif: "Young Serif", serif;

  /* Body font */
  --ff-sans: "Outfit", sans-serif;

  /* Font Weights for Outfit */
  --fw-light: 300;
  --fw-regular: 400;
  --fw-medium: 600;
  --fw-bold: 700;
}

body {
  background-color: var(--stone-100);
  font-family: var(--ff-sans);
  color: var(--stone-600);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  margin: 0;
  padding: 40px 60px 20px;
}

/* The Recipe Card */
.container {
  background-color: var(--white);
  max-width: 736px;
  padding: 40px;
  border-radius: 24px;
}

/* The Image */

.recipe-img img {
  width: 100%;
  border-radius: 12px;
  margin-bottom: 40px;
}

/* Headings */

h1 {
  font-family: var(--ff-serif);
  font-weight: var(--fw-regular);
  color: var(--stone-900);
  font-size: 2.5rem;
  margin-bottom: 24px;
}

h2 {
  font-family: var(--ff-serif);
  font-weight: var(--fw-light);
  color: var(--brown-800);
  margin-bottom: 16px;
}

/* The Preparation Box */

.recipe-preparation-time {
  background-color: var(--rose-50);
  padding: 24px;
  border-radius: 12px;
  margin: 40px 0;
}

.recipe-preparation-time h3 {
  color: var(--rose-800);
  margin-top: 0;
  margin-bottom: 10px;
}

.recipe-ingredients li::marker {
  color: var(--brown-800);
}

/* Lists-Global */

ul,
ol {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-left: 22px;
}

li {
  padding-left: 1rem;
}

/* Recipe Instructions */

.recipe-instructions li::marker {
  color: var(--brown-800);
  font-weight: var(--fw-bold);
}

/* Nutrition Table */

.recipe-nutrition .nutrition-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 24px;
}

.recipe-nutrition .nutrition-table tr {
  border-bottom: 1px solid var(--stone-150);
}

.recipe-nutrition .nutrition-table tr:last-child {
  border-bottom: none;
}

.recipe-nutrition .nutrition-table td {
  padding: 12px 32px;
  width: 50%;
}

.nutrition-table td:last-child {
  color: var(--brown-800); /* Our accent color */
  font-weight: var(--fw-normal);
}

.nutrition-table td:first-child {
  padding-left: 32px;
  color: var(--stone-600);
}

/* Horizontal Rule Styling */

hr {
  border: 0;
  border-top: 1px solid var(--stone-150);
  margin: 32px 0;
}

/* Attribution */

.attribution {
  font-size: 11px;
  text-align: center;
  margin-top: 40px;
  margin-bottom: 20px;
  width: 100%;
  color: var(--stone-600);
}

.attribution a {
  color: var(--brown-800);
  text-decoration: none;
  font-weight: 700;
}

.attribution a:hover {
  text-decoration: underline;
}

/* Media Queries */

@media screen and (max-width: 480px) {
  body {
    padding: 0;
    background-color: var(--white);
  }

  .container {
    width: 100%;
    padding: 0 0 40px 0;
    border-radius: 0;
  }

  .recipe-img img {
    border-radius: 0;
    margin-bottom: 32px;
  }

  .recipe-header,
  .recipe-preparation-time,
  .recipe-ingredients,
  .recipe-instructions,
  .recipe-nutrition,
  hr {
    padding-inline: 32px;
  }

  h1 {
    font-size: 2rem;
  }

  .attribution {
    position: static; /* Moves it from the bottom of the screen to the end of the content */
    margin-top: 20px;
    padding-bottom: 20px;
  }
}
