@font-face {
  font-family: "Outfit";
  src: url("./assets/fonts/outfit/Outfit-VariableFont_wght.ttf");
  font-display: swap;
  font-weight: 400 600 700;
}

@font-face {
  font-family: "Young Serif";
  src: url("./assets/fonts/young-serif/YoungSerif-Regular.ttf");
  font-display: swap;
}

:root {
  --clr-rose-800: 332 51 32;
  --clr-rose-50: 330 100 98;

  --clr-stone-900: 24 5 18;
  --clr-stone-600: 30 10 34;
  --clr-stone-150: 30 18 87;
  --clr-stone-100: 30 54 90;

  --clr-brown-800: 14 45 36;

  --clr-white: 0 0 100;

  --spacing-1600: 12.8rem;
  --spacing-600: 4.8rem;
  --spacing-500: 4rem;
  --spacing-400: 3.2rem;
  --spacing-300: 2.4rem;
  --spacing-200: 1.6rem;
  --spacing-150: 1.2rem;
  --spacing-100: 0.8rem;

  --fs-text-preset-900: clamp(3.6rem, 3.4592rem + 0.3756vw, 4rem);
  --fs-text-preset-800: 2.8rem;
  --fs-text-preset-700: 2rem;
  --fs-text-preset-600: 1.6rem;

  --ff-sans: "Outfit", sans-serif;
  --ff-serif: "Young Serif", serif;

  --fw-regular: 400;
  --fw-semibold: 600;
  --fw-bold: 700;
}

/* === reset === */

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

html {
  font-size: 62.5%;
}

body {
  display: grid;
  place-items: center;
  min-height: 100vh;

  color: hsl(var(--clr-stone-600));
  background-color: hsl(var(--clr-stone-100));
  font-size: var(--fs-text-preset-600);
  font-family: var(--ff-sans);
  font-weight: var(--fw-regular);
  line-height: 1.5;

  box-sizing: border-box;
}

@media screen and (min-width: 37.5em) {
  body {
    padding: var(--spacing-1600) var(--spacing-600);
  }
}

/* 
  enforce that lists that have their markers
  removed will still be accessible in Safari   
*/
ul[role="list"],
ol[role="list"] {
  list-style-type: none;
}

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

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

h1,
h2,
h3,
h4,
h5,
h6,
p {
  font-weight: var(--fw-regular);
}

a:link,
a:visited {
  text-decoration: none;
}

button {
  color: inherit;
  border: none;
  background-color: transparent;
  cursor: pointer;
}

/* === end of reset === */

/* === utilities === */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap; /* added line */
  border: 0;
}

.clr-stone-900 {
  color: hsl(var(--clr-stone-900));
}

.clr-rose-800 {
  color: hsl(var(--clr-rose-800));
}

.clr-brown-800 {
  color: hsl(var(--clr-brown-800));
}

.bg-white {
  background-color: hsl(var(--clr-white));
}

.bg-rose-50 {
  background-color: hsl(var(--clr-rose-50));
}

.ff-sans {
  font-family: var(--ff-sans);
}

.ff-serif {
  font-family: var(--ff-serif);
}

.fw-semibold {
  font-weight: var(--fw-semibold);
}

.fw-bold {
  font-weight: var(--fw-bold);
}

.lh-full {
  line-height: 1em;
}

.lh-150 {
  line-height: 1.5em;
}

.text-preset-1 {
  font-size: var(--fs-text-preset-900);
}

.text-preset-2 {
  font-size: var(--fs-text-preset-800);
}

.text-preset-3 {
  font-size: var(--fs-text-preset-700);
}

.text-preset-4 {
  font-size: var(--fs-text-preset-600);
}

/* === end of utilities === */

/* === recipe === */

.recipe {
  padding-bottom: var(--spacing-500);
  max-width: 73.6rem;

  border-radius: var(--recipe-border-radius, 0);

  & .recipe__thumbnail {
    margin-bottom: var(--spacing-500);
  }

  & .recipe__thumbnail-img {
    max-height: 30rem;
  }

  & .recipe__content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-400);
    padding-inline: var(--spacing-400);
  }

  & .recipe__heading {
    margin-bottom: var(--spacing-300);
  }

  & .recipe__prep-time {
    padding: var(--spacing-300);

    border-radius: calc(var(--recipe-border-radius, 2.4rem) / 2);
  }

  & .recipe__prep-list {
    margin-top: var(--spacing-200);
  }

  & .recipe__prep-list,
  & .recipe__ingredients-list,
  & .recipe__instructions-list {
    padding-left: var(--spacing-100);
  }

  & .recipe__ingredients-list,
  & .recipe__instructions-list,
  & .recipe__nutrition-table {
    margin-top: var(--spacing-300);
  }

  & .recipe__prep-list-item,
  & .recipe__ingredients-list-item,
  & .recipe__instructions-list-item {
    padding-left: var(--spacing-400);
  }

  & .recipe__section-separator {
    height: 0.1rem;

    border: 0;
    font-size: 0;
    background-color: hsl(var(--clr-stone-150));
  }

  & .recipe__nutrition-table {
    border-collapse: collapse;
    width: 100%;
  }

  & .recipe__nutrition-caption {
    text-align: left;
    margin-bottom: var(--spacing-300);
  }

  & .recipe__nutrition-row {
    --middle-inline-padding: var(--spacing-100);
    border-top: 1px solid hsl(var(--clr-stone-150));

    & .recipe__nutrition-col {
      padding: var(--spacing-150) var(--spacing-400);
    }

    & .recipe__nutrition-col:first-child {
      padding-right: var(--middle-inline-padding);
    }

    & .recipe__nutrition-col:last-child {
      padding-left: var(--middle-inline-padding);
    }
  }

  & .recipe__nutrition-row:where(:first-child) {
    border-top: none;

    & .recipe__nutrition-col {
      padding-top: 0;
    }
  }

  & .recipe__nutrition-row:where(:last-child) {
    & .recipe__nutrition-col {
      padding-bottom: 0;
    }
  }

  & .recipe__nutrition-col {
    width: 50%;
  }
}

@media screen and (min-width: 37.5em) {
  .recipe {
    --recipe-border-radius: 2.4rem;
    --recipe-inline-spacing: var(--spacing-500);

    padding-top: var(--spacing-500);

    & .recipe__thumbnail,
    & .recipe__content {
      padding-inline: var(--recipe-inline-spacing);
    }

    & .recipe__thumbnail-img {
      border-radius: calc(var(--recipe-border-radius) / 2);
    }
  }
}

/* === end of recipe === */

/* === custom lists === */

ul[role="list"].list.list--bullets {
  --marker-bg-color: var(--clr-rose-800);

  & > li.list-item {
    position: relative;
  }

  & > li.list-item::before {
    position: absolute;
    top: 50%;
    left: 0;
    display: inline-block;
    height: 0.4rem;

    background-color: hsl(var(--marker-bg-color));
    border-radius: 50%;

    content: "";
    aspect-ratio: 1;
    transform: translateY(-50%);
  }

  & > li.list-item:where(:not(:last-child)) {
    margin-bottom: var(--spacing-100);
  }
}

ol[role="list"].list.list--numbered {
  --marker-color: var(--clr-brown-800);

  & > li.list-item {
    position: relative;
    counter-increment: numbered-list 1;
  }

  & > li.list-item::before {
    position: absolute;
    top: 0;
    left: 0;
    display: inline-block;

    color: hsl(var(--marker-color));
    font-size: inherit;
    font-weight: var(--fw-bold);
    line-height: 1.5em;
    border-radius: 50%;

    content: counter(numbered-list) ".";
    aspect-ratio: 1;
  }

  & > li.list-item:where(:not(:last-child)) {
    margin-bottom: var(--spacing-100);
  }
}

/* === end of custom lists === */
