:root {
  --clr-white: hsl(0, 0%, 100%);
  --clr-light-gray: hsl(0, 0%, 81%);
  --clr-light-gray-blue: hsl(210, 46%, 95%);
  --clr-violet: hsl(263, 55%, 52%);
  --clr-light-violet: hsl(264, 58%, 64%);
  --clr-gray-blue: hsl(217, 19%, 35%);
  --clr-dark-blue: hsl(219, 29%, 14%);
}

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

body {
  background-color: var(--clr-light-gray-blue);
  font-family: "Barlow Semi Condensed", sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--clr-gray-blue);
  line-height: 1.3;
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 100vh;
}

.card {
  border: 1px solid black;
  padding-top: 1rem;
  padding-bottom: 1rem;
  padding-left: 2rem;
  padding-right: 2rem;
  border-radius: 8px;
  /*one dimensional layout with children elements (article) laid out top to bottom*/
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  /*removes border from each card*/
  border: none;
}

main {
  margin-bottom: 2rem;
  margin-top: 2rem;
  width: 80%;
  /*centered horizontally*/
  margin-left: auto;
  margin-right: auto;
  /*one dimensional layout with children elements (article) laid out top to bottom*/
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-self: center;
}

img {
  width: 40px;
  height: 40px;
  border: 2px solid var(--clr-light-violet);
  /*make border circular*/
  border-radius: 50%;
}

header {
  /*create flex box one dimensional laid out from left to right*/
  display: flex;
  flex-direction: row;
  gap: 1rem;
  /*center aligned vertically (up & down) on cross axis*/
  align-content: center;
}

h3 {
  font-size: 18.72px;
}

/*selects p element that is second of parent*/
p:nth-child(2) {
  font-size: 11px;
  opacity: 50%;
}

/*selects p element that is third of parent*/
p:nth-child(3) {
  opacity: 70%;
}

/*selects the first card element*/
.card:first-of-type {
  background-color: var(--clr-violet);
  color: var(--clr-white);
  background-image: url(/images/bg-pattern-quotation.svg);
  background-repeat: no-repeat;
  /* position background to the top right 30px*/
  background-position-x: right 30px;
  background-position-y: top 0px;
}

/*selects the second card element of its parent*/
.card:nth-of-type(2) {
  background-color: var(--clr-gray-blue);
  color: var(--clr-white);
}

/*selects the third and fifth card element of its parent*/
.card:nth-of-type(3),
.card:nth-of-type(5) {
  background-color: var(--clr-white);
}

.card:nth-of-type(4) {
  background-color: var(--clr-dark-blue);
  color: var(--clr-white);
}

/*larger screen with min width of 900px*/
@media screen and (min-width: 900px) {
  main {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
  .card:first-of-type {
    grid-column-start: 1;
    grid-column-end: 3;
  }

  .card:nth-of-type(2) {
    grid-column-start: 3;
    grid-column-end: 4;
  }

  /*have third element of type span 1 row*/
  .card:nth-of-type(3) {
    grid-column: 1;
    grid-row: span 1;
  }
  .card:nth-of-type(4) {
    grid-column-start: 2;
    grid-column-end: 4;
  }

  .card:nth-of-type(5) {
    grid-column-start: 1;
    grid-column-end: 4;
  }
}

/*larger screen with min width of 1200px*/
@media screen and (min-width: 1200px) {
  main {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    max-width: 1200px;
  }

  .card:nth-of-type(5) {
    grid-column-start: 4;
    grid-row-start: 1;
    grid-row-end: 3;
  }
}

footer {
  justify-items: center;
  background-color: var(--clr-light-gray);
  padding-top: 1rem;
  padding-bottom: 1rem;
  padding-left: 2rem;
  padding-right: 2rem;
}
