/*
  Josh's Custom CSS Reset
  https://www.joshwcomeau.com/css/custom-css-reset/
*/

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

* {
  margin: 0;
}

body {
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/* General styles and layout */

@font-face {
  font-family: "Young Serif";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url(./assets/fonts/young-serif/YoungSerif-Regular.woff2) format("woff2");
}

@font-face {
  font-family: "Outfit";
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  src: url(./assets/fonts/outfit/Outfit-VariableFont_wght.woff2) format("woff2");
}

:root {
  --white: rgb(255, 255, 255);
  --stone-100: rgb(243, 230, 216);
  --stone-150: rgb(228, 222, 216);
  --stone-600: rgb(95, 87, 78);
  --stone-900: rgb(48, 45, 44);
  --brown-800: rgb(133, 70, 50);
  --rose-800: rgb(123, 40, 79);
  --rose-50: rgb(255, 245, 250);
}

body {
  font-family: "Outfit", sans-serif;
  font-size: 1rem;
  font-weight: 400;
  font-style: normal;
  color: var(--stone-600);
  background-color: var(--stone-100);
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  padding-bottom: 24px;
}

main {
  flex-grow: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding-bottom: 24px;
}

/* Recipe component: general styles and layout */

.recipe {
  background-color: var(--white);
  max-width: 45rem;
}

.image {
  margin-bottom: 2rem;
}

.recipe-text {
  padding: 0 2rem 2rem;
}

.main-heading {
  font-family: "Young Serif", serif;
  font-size: 2.25rem;
  font-weight: 400;
  line-height: 1;
  color: var(--stone-900);
  margin-bottom: 1.75rem;
}

.section-heading {
  font-family: "Young Serif", serif;
  font-size: 1.75rem;
  font-weight: 400;
  color: var(--brown-800);
  margin: 1.5rem 0 1rem;
}

.recipe-paragraph {
  margin-bottom: 1.5rem;
}

/* Card: Preparation Time */

.card {
  background-color: var(--rose-50);
  border-radius: 0.75rem;
  padding: 1.5rem;
}

.card-heading {
  color: var(--rose-800);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

/* Recipe component: lists */
.list em {
  font-weight: 600;
  font-style: normal;
}

.list li + li {
  margin-top: 0.5rem;
}

.unordered {
  list-style: none;
  padding-left: 0;
}

.unordered li {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  padding-left: 0.25rem;
}

.unordered li::before {
  content: "•";
  font-weight: 700;
}

.time li::before {
  color: var(--rose-800);
}

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

.instructions {
  padding-left: 1.25rem;
}

.instructions li {
  padding-left: 1.25rem;
}

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

.ingredients,
.instructions {
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--stone-150);
}

/* Table: Nutrition */

.nutrition {
  table-layout: fixed;
  width: 100%;
  text-align: left;
  border-collapse: collapse;
}

.nutrition th {
  font-weight: 400;
  padding: 0.5rem 0 0.5rem 2rem;
}

.nutrition td {
  color: var(--brown-800);
  font-weight: 700;
  padding: 0.5rem 0;
}

.nutrition tr ~ tr {
  border-top: 1px solid var(--stone-150);
}

/* Footer */
.attribution {
  font-size: 0.75rem;
  text-align: center;
}
.attribution a {
  color: var(--brown-800);
}

/* Desktop design */

@media only screen and (min-width: 45rem) {
  body {
    padding: 128px 0 24px;
  }
  .recipe {
    border-radius: 1rem;
    padding: 2rem;
  }
  .image {
    border-radius: 0.75rem;
  }
  .recipe-text {
    padding: 0;
  }
  .main-heading {
    font-size: 2.5rem;
  }
}
