/* 
  1. Hero section
    1.1 Global styles
    1.2 Animation
  2. Best sellers
  3. Book award
    3.1 Section
    3.2 Repsonive
*/

/* 1. Hero section */

/* 1.1 Hero section - Animation */
.hero {
  background-color: rgb(244, 247, 245);
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.hero--content {
  display: grid;
  gap: 5rem;
  grid-template-columns: 5fr 4fr;
  align-items: center;
  max-width: var(--max-container-width);
  margin: 0 auto;
  padding: 4rem var(--container-padding-x);
  min-height: 100vh;
}

.headline {
  font-weight: 800;
  font-size: 5rem;
  line-height: 1.1;
  max-width: 13ch;
}

.subheadline {
  font-weight: 400;
  font-size: 1.5rem;
  padding: 1rem 0 1.5rem 0;
}

.background {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 50%;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  z-index: -1;
}

.background div {
  box-shadow: inset 50px 0 5rem rgba(167, 170, 169, 0.1);
}

.cta {
  display: inline-block;
  background-color: var(--primary-color);
  color: white;
  padding: 0.5em 1em;
  border-radius: 0.25rem;
  font-size: 1.25rem;
}

.hero--book--container {
  position: relative;
  height: 100%;
}

.hero--book--container img {
  position: absolute;
  top: 50%;
  left: 0;
  max-height: 70%;
  box-shadow: 5px 5px 20px rgba(0, 0, 0, 0.4);
  border-radius: 0.5rem;
  translate: 0 -50%;
}

.hero--book--container .book2 {
  scale: 0.8;
  left: 10vw;
  animation-delay: 600ms;
}

.hero--book--container .book1 {
  scale: 0.6;
  left: 20vw;
  animation-delay: 900ms;
}

/* 1.2 Hero section - Animation */
@keyframes slide-in {
  to {
    transform: translate(0, 0);
    opacity: 1;
  }
}

.hero h1,
.hero p,
.hero .cta {
  transform: translateY(2rem);
  opacity: 0;
  animation: slide-in 600ms ease forwards;
}

.hero img {
  transform: translateX(-5rem);
  opacity: 0;
  animation: slide-in 1200ms ease 300ms forwards;
}

.hero p {
  animation-delay: 300ms;
}

.hero .cta {
  animation-delay: 600ms;
}

/* 1.3 Responsive styles */
@media screen and (max-width: 1080px) {
  .hero h1 {
    font-size: 3.5rem;
  }

  .hero p {
    font-size: 1.25rem;
  }
}

@media screen and (max-width: 620px) {
  .hero--content {
    text-align: center;
    grid-template-columns: 1fr;
  }

  .hero--book--container {
    height: 50vh;
    left: 20%;
  }

  .hero--book--container img {
    max-height: 100%;
  }
}

/* 2. Best sellers */
.best-sellers--section {
  max-width: var(--max-container-width);
  padding: 5rem var(--container-padding-x);
  margin: 0 auto;
}

.best-sellers--section h2 {
  font-size: 1.75rem;
  font-weight: 600;
  padding-bottom: 1rem;
}

.book--container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
  gap: 1rem;
}

/* 3.1 Book award section */
.award--section {
  background-color: rgb(244, 247, 245);
}

.award--container {
  max-width: var(--max-container-width);
  padding: 2rem var(--container-padding-x);
  margin: 0 auto;
  display: grid;
  align-items: center;
  grid-template-columns: 2fr 3fr;
}

.award--container h2 {
  font-size: 2.75rem;
  line-height: 1;
  font-weight: 600;
  padding-bottom: 2rem;
}

.award--container a {
  display: inline-block;
  padding: 0.5em 1em;
  border-radius: 0.25rem;
  background-color: var(--primary-color);
  font-size: 1.125rem;
  color: white;
  transition: opacity 300ms ease;
}

.award--container a:hover {
  opacity: 0.9;
}

.award--container img {
  max-height: 25rem;
  margin: auto;
}

/* 3.2 Book award - Responsive */
@media screen and (max-width: 620px) {
  .award--container {
    text-align: center;
    display: block;
  }

  .award--container h2 {
    font-size: 1.75rem;
  }

  .award--container img {
    margin-top: 2rem;
    max-width: min(80%, 15rem);
  }
}
