/* ### CUSTOM PROPERTIES ### */

:root {
  --primary-very-dark-magenta: hsl(300, 43%, 22%);
  --primary-soft-pink: hsl(333, 80%, 67%);

  --neutral-dark-grayish-magenta: hsl(303, 10%, 53%);
  --neutral-light-grayish-magenta: hsl(300, 24%, 96%);
  --neutral-white: hsl(0, 0%, 100%);

  /* typography */
  --ff-league-spartan: "League Spartan", sans-serif;
  --fw-400: 400;
  --fw-500: 500;
  --fw-700: 700;
}

/* ### CSS RESET ### */

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

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

/* ### UTILITIES ### */

.text-dark-magenta {
  color: var(--primary-very-dark-magenta);
}

.text-pink {
  color: var(--primary-soft-pink);
}

.stack > * + * {
  margin-top: var(--stack-gap, 1rem);
}

/* ### GLOBAL STYLES ### */

body {
  font-family: var(--ff-league-spartan);
  background-color: var(--neutral-white);
  font-size: 0.938rem;
  font-weight: var(--fw-400);
  background: top left no-repeat url(./images/bg-pattern-top-mobile.svg),
    bottom right no-repeat url(./images/bg-pattern-bottom-mobile.svg);
}

main {
  padding: 4rem 1.5rem;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ### GRID ### */

.grid {
  display: grid;
  gap: 2rem;
  grid-template-areas:
    "hero"
    "ratings"
    "testimonials";
}

/* ## HERO ## */

.hero {
  grid-area: hero;
  text-align: center;
}

.hero h1 {
  font-size: 2.5rem;
  max-width: 15ch;
  margin-inline: auto;
  font-weight: var(--fw-700);
  line-height: 0.8;
}

.hero .subtitle {
  color: var(--neutral-dark-grayish-magenta);
  font-size: 1.2rem;
  line-height: 1.3;
}

/* ## RATINGS CONTAINER ## */

.ratings-container {
  grid-area: ratings;
}

.rating {
  background-color: var(--neutral-light-grayish-magenta);
  border-radius: 0.6rem;
  padding: 0.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}

.stars {
  display: flex;
  gap: 0.4rem;
}

.rating h2 {
  font-size: 1.125rem;
  font-weight: var(--fw-700);
}

/* ### TESTIMONIALS CONTAINER ### */

.testimonials-container {
  grid-area: testimonials;
}

.testimonial {
  background-color: var(--primary-very-dark-magenta);
  border-radius: 0.5rem;
  padding: 2rem;
  color: var(--neutral-light-grayish-magenta);
}

.testimonials__header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.testimonials__header img {
  width: 36px;
  border-radius: 100%;
}

.testimonials__id {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.testimonials__name,
.testimonials__tag {
  font-size: 1.125em;
}

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

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

.testimonial blockquote {
  margin-top: 1.7rem;
  line-height: 1.4;
  font-size: 1.035rem;
  font-weight: var(--fw-500);
}

/* ### MEDIA QUERIES ### */

@media (min-width: 60em) {
  body {
    background: top left no-repeat url(./images/bg-pattern-top-desktop.svg),
      bottom right no-repeat url(./images/bg-pattern-bottom-desktop.svg);
  }

  .grid {
    max-width: 1100px;
    grid-template-areas:
      "hero ratings"
      "testimonials testimonials";
  }

  /* ## HERO ## */

  .hero {
    --stack-gap: 2rem;
    text-align: start;
  }

  .hero h1 {
    margin-inline: unset;
    font-size: 3rem;
  }

  .hero .subtitle {
    max-width: 43ch;
  }

  /* ## RATINGS ## */

  .ratings-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    gap: 1rem;
  }

  .ratings-container > .rating {
    width: 450px;
    margin-top: unset;
  }

  .rating {
    padding: 1rem 2rem;
    flex-direction: row;
    gap: 2rem;
  }

  .rating:nth-child(1) {
    margin-inline-end: 6rem;
  }

  .rating:nth-child(2) {
    margin-inline-end: 3rem;
  }

  /* ## TESTIMONIALS ## */

  .testimonials-container {
    margin-top: 5rem;
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
  }

  .testimonials-container > .testimonial {
    margin-top: unset;
    /* align-self: flex-start; */
    /* flex: 1; */
    padding: 2rem;
    /* min-height: 235px; */
  }

  .testimonial:nth-child(2) {
    margin-top: 1rem;
  }

  .testimonial:nth-child(3) {
    margin-top: 2rem;
  }
}
