@import url(../styles/main.css);

body {
  background-color: var(--gray);
}

/* header */
.header {
  width: 50%;
  margin: 1.5em auto 1.5em auto;
}

.header h1 {
  font-family: "Roboto Slab", serif;
  font-size: 1.6em;
  color: var(--soft-black);
  text-align: center;
}

/* Main */
main {
  display: grid;
  gap: 1.2em;
  grid-template-areas: "works courses";
  grid-template-columns: 820px 1fr;
  grid-auto-rows: auto;
  margin: 0 1.2em 1.2em 1.2em;
}

/* Work */
.works {
  grid-area: works;
  display: grid;
  grid-template-columns: 400px 400px;
  grid-template-rows: repeat(2, 200px) repeat(4, 230px);
  grid-auto-rows: 200px;
  gap: 1.2em;
}

.work {
  background-color: var(--light-blue);
  padding: 0.7em 1em;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.2em;
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.head-work h3 {
  font-family: "Roboto Slab", serif;
  color: var(--light-yellow);
  font-size: 1rem;
}

.middle-work {
  display: flex;
  align-items: center;
  gap: 1em;
}

.right-work p {
  font-size: 0.9em;
  color: var(--white);
  font-weight: 600;
}

.right-work p:not(:last-child) {
  padding-bottom: 0.4em;
}

.time-work span {
  color: var(--light-yellow) !important;
}

.time-work {
  font-weight: 400 !important;
}

.last-work {
  display: flex;
  flex-flow: row wrap;
  justify-content: space-between;
  align-items: center;
}

.last-left-work a,
.without-work a {
  border: 2px solid var(--light-yellow);
  color: var(--white);
  font-size: 0.9rem;
  padding: 0.2em 0.5em;
  border-radius: 39px;
}

.without-work {
  margin-top: 0.4em;
  height: 36px;
  float: right;
}

.last-left-work a:hover,
.without-work a:hover {
  border-color: transparent;
  background-color: var(--light-yellow);
  color: var(--black);
  font-weight: 600;
}

/* Courses */
.courses {
  grid-area: courses;
  display: flex;
  flex-direction: column;
  border-radius: 5px;
  gap: 1.2em;
}

.course {
  background-color: #f5c86f;
  border-radius: 5px;
  padding-bottom: 0.6em;
  box-shadow: var(--shadow);
}

.course > .image {
  background-color: var(--light-blue);
  height: 163.2px;
  border-radius: 5px;
  margin-bottom: 1em;
}

.art-course {
  padding-left: 1em;
  padding-right: 1em;
  hyphens: auto;
  margin-bottom: 1em;
}

.art-course h3 {
  font-family: "Roboto Slab", serif;
  font-size: 1.1rem;
  margin-bottom: 1em;
}

.art-course p {
  font-size: 1rem;
  color: var(--soft-black);
  font-weight: 600;
}

.art-course + a {
  color: var(--white);
  background-color: var(--light-blue);
  font-weight: 600;
  font-family: "Roboto Slab", serif;
  padding: 0.5em;
  float: right;
  border-radius: 5px;
  margin-right: 0.5em;
  box-shadow: var(--shadow);
  border: 1px solid transparent;
}

.art-course + a:hover {
  color: var(--black);
  background-color: transparent;
  box-shadow: 0 0 0 0;
  border-color: var(--light-blue);
}

/* Media */

@media screen and (max-width: 1250px) {
  main {
    grid-template-columns: 820px;
    grid-template-areas:
      "works"
      "courses";
    max-width: 820px;
    margin: 0 auto;
    gap: 5em;
    margin-bottom: 2em;
  }
  .courses {
    flex-direction: row;
    flex-wrap: wrap;
    max-width: 850px;
    justify-content: center;
    position: relative;
  }
  .course {
    max-width: 398px;
  }

  .courses::before {
    content: "Courses";
    position: absolute;
    top: -82px;
    font-weight: 600;
    padding: 0.4em;
    border-radius: 10px;
    box-shadow: var(--box-shadow);
    background-color: #f5c86f;
    font-size: 1.5rem;
    margin: 0.5rem auto;
  }
}

@media screen and (max-width: 860px) {
  main {
    gap: 1.2em;
    grid-template-columns: 400px;
    max-width: 400px;
  }
  .works {
    grid-template-columns: 400px;
    grid-template-rows: repeat(4, 200px) repeat(8, 230px);
  }
  .courses,
  .works {
    margin: 0 auto;
  }
  .courses {
    flex-direction: column;
    max-width: 400px;
  }
  .courses::before {
    position: static;
  }
}

@media screen and (max-width: 440px) {
  main {
    grid-template-columns: 300px;
    max-width: 300px;
  }
  .middle-work {
    flex-direction: column;
  }
  .head-work h3 {
    text-align: center;
  }
  .works {
    grid-template-columns: 300px;
    grid-template-rows: repeat(2, 290px) 340px repeat(2, 290px) 340px 290px 340px 340px 300px repeat(2, 340px);
    grid-auto-rows: 300px;
  }
  .courses {
    max-width: 300px;
  }
  .right-work p {
    text-align: center;
  }
  .last-work-without {
    display: flex;
    justify-content: center;
  }
}
