@import url("https://fonts.googleapis.com/css2?family=Spartan:wght@400;500;700&display=swap");

/** Resets **/
:root {
  box-sizing: border-box;
}

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

body {
  margin: 0;
}

h1,
h2,
ul,
p {
  padding: 0;
  margin: 0;
}

img {
  vertical-align: bottom;
}

/** Styles **/
body {
  --clr-primary-very-dark-magenta: hsl(300, 43%, 22%);
  --clr-primary-soft-pink: hsl(333, 80%, 67%);

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

  --border-radius: 8px;

  font-family: "Spartan", sans-serif;
  font-size: 15px;
  background: url(./images/bg-pattern-top-mobile.svg) top left no-repeat,
    url(./images/bg-pattern-bottom-mobile.svg) bottom right no-repeat;
}

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

.main {
  width: 92%;
  max-width: 1200px;
  margin: 5em auto;
}

@media (min-width: 900px) {
  .main {
    display: grid;
    grid-template-columns: 40% 1fr;
    column-gap: 9em;
    margin-top: 9em;
  }
}

.title {
  color: var(--clr-primary-very-dark-magenta);
  max-width: 12ch;
  margin: 0 auto 1em;
}

@media (min-width: 900px) {
  .title {
    font-size: 2.8rem;
    margin: 0 0 0.25em;
  }
}

.header {
  text-align: center;
  margin-bottom: 3em;
}

@media (min-width: 900px) {
  .header {
    text-align: initial;
    margin-bottom: 4em;
  }
}

.header__prose {
  color: var(--dark-grayish-magenta);
  line-height: 1.6;
}

.ratings {
  display: flex;
  flex-direction: column;
  gap: 1em;
  margin-top: 1em;
  margin-bottom: 3.5em;
}

.rating {
  color: var(--clr-primary-very-dark-magenta);
  font-weight: 700;
  display: flex;
  flex-direction: column;
  row-gap: 1em;
  column-gap: 2em;
  align-items: center;
  padding: 1.25em 2em;
  background: var(--light-grayish-magenta);
  border-radius: var(--border-radius);
}

@media (min-width: 900px) {
  .rating {
    flex-direction: row;
    width: 85%;
  }

  .rating:first-of-type {
    align-self: flex-start;
  }

  .rating:nth-of-type(2) {
    align-self: center;
  }

  .rating:nth-of-type(3) {
    align-self: flex-end;
  }
}

.rating__visual {
  display: flex;
  gap: 0.5em;
}

.testimonials {
  display: flex;
  flex-direction: column;
  row-gap: 1em;
  column-gap: 2em;
}

@media (min-width: 900px) {
  .testimonials {
    grid-column: span 2;
    flex-direction: row;
  }

  .testimonials > :nth-of-type(2) {
    position: relative;
    top: 1em;
  }

  .testimonials > :nth-of-type(3) {
    position: relative;
    top: 2em;
  }
}

.card {
  background: var(--clr-primary-very-dark-magenta);
  color: var(--white);
  padding: 3em 2em 2em;
  border-radius: var(--border-radius);
}

@media (min-width: 900px) {
  .card {
    flex: 1;
  }
}

.card__header {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 1.5em;
  row-gap: 0.25em;
  margin-bottom: 2em;
}
.card__image {
  width: 42px;
  border-radius: 50%;
  grid-row: span 2;
  align-self: center;
}

.card__author {
  font-size: 15px;
  align-self: end;
}

.card__author-status {
  color: var(--clr-primary-soft-pink);
}

.card__body {
  line-height: 1.6;
}

/** Utility classes **/

.hidden:not(:focus):not(:active) {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}
