@font-face {
  font-family: 'Inter';
  src: url('./assets/fonts/Inter-VariableFont_slnt\,wght.ttf');
  font-style: normal;
}

:root {
  --clr-orange-200: hsl(35, 77%, 62%);
  --clr-red-200: hsl(5, 85%, 63%);
  --clr-off-white: hsl(36, 100%, 99%);
  --clr-grayish-blue: hsl(233, 8%, 79%);
  --clr-dark-grayish-blue: hsl(236, 13%, 42%);
  --clr-very-dark-blue: hsl(240, 100%, 5%);

  --clr-surface-1: var(--clr-off-white);
  --clr-surface-2: var(--clr-very-dark-blue);

  --clr-text-1: var(--clr-very-dark-blue);
  --clr-text-2: var(--clr-dark-grayish-blue);

  --clr-btn-bg-1: var(--clr-red-200);

  font-size: 15px;
}

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

h1,
h2,
h3,
h4,
h5,
h6,
p {
  margin: 0;
}

ul,
ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

img {
  width: 100%;
}

a {
  text-decoration: none;
  color: inherit;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  margin: 0;
  padding: 0;

  min-height: 100vh;

  font-family: 'Inter', sans-serif;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  margin-bottom: 4rem;

  width: 100%;
}

main {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);

  gap: 2rem;

  margin-inline: 1rem;
}

/*** Sections Grids ***/

.section-hero {
  grid-column: span 2;
  grid-row: span 2;
}

.section-new {
  grid-column: span 1;
  grid-row: span 2;
}

.section-popular {
  grid-column: span 3;
  grid-row: span 1;

  height: 129px;
}

/*** Navigation ***/

.nav-list {
  display: flex;
  align-items: center;
  gap: 3rem;
}

.nav-menu-wrapper {
  display: none;
  position: absolute;
  right: 0;
  margin-right: 1rem;
}

.nav-menu-button {
  position: absolute;
  right: 0;
  border: none;
  background: transparent;
  display: none;
  margin-right: 1rem;
}

/*** Section - Hero ***/

.section-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.hero-picture {
  grid-column: span 2;

  margin-bottom: 2rem;
}

.hero-title {
  display: flex;
  align-items: center;
}

.hero-body {
  display: flex;
  flex-direction: column;
  align-items: start;
  justify-content: space-between;

  gap: 29px;

  height: 100%;
}

.button {
  display: flex;
  align-items: center;
  justify-content: center;

  background-color: var(--clr-red-200);

  font-weight: 700;
  text-transform: uppercase;
  color: var(--clr-text-1);
  letter-spacing: 3px;

  width: 100%;
  max-width: 185px;
  min-height: 48px;
}

.button:hover {
  background-color: var(--clr-very-dark-blue);
  color: var(--clr-off-white);
}

/*** Section - New ***/

.section-new {
  height: 100%;
  color: var(--clr-off-white);
  background-color: var(--clr-surface-2);
  padding: 2rem;
}

.section-new-title {
  color: var(--clr-orange-200);

  margin-bottom: 2rem;
}

.new-posts-list {
  display: flex;
  flex-direction: column;
  justify-content: space-between;

  gap: 2rem;
}

.new-post-title {
  margin-bottom: 0.8rem;
}

.new-post-title > a:hover {
  color: var(--clr-orange-200);
}

.new-posts-list-item > p.new-post-description {
  color: var(--clr-grayish-blue);
}

.new-posts-list-item-seperator {
  border: none;

  width: 100%;
  height: 1px;
  background-color: var(--clr-dark-grayish-blue);

  margin: 0;
}

/*** Section - Popular ***/

.popular-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);

  margin-top: 4rem;
}

.popular-list-item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 1rem;

  max-width: 350px;
}

.popular-item-content-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.popular-item-number {
  color: var(--clr-red-200);
}

.popular-item-picture-link {
  overflow: hidden;
}

.popular-item-picture > img {
  /* max-width: 100px; */
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/*** Text ***/

.bold {
  font-weight: 700;
}

.heading-xl {
  font-size: 56px;
  font-weight: 800;
  line-height: 95%;
}

.heading-l {
  font-size: 40px;
}

.heading-md {
  font-size: 32px;
}

.heading-s {
  font-size: 20px;
}

.heading-xs,
h3 {
  font-size: 18px;
}

.body {
  font-size: 15px;
  line-height: 175%;
  color: var(--clr-text-2);
}

a:hover {
  color: var(--clr-red-200);
}

/*** Utility ***/

.max-width {
  max-width: 1110px;
}

/*** Tablet ***/
@media screen and (max-width: 768px) {
  .section-hero {
    grid-column: auto;
    grid-row: auto;
    grid-template-columns: auto;
  }

  /*** Section - Hero ***/

  .hero-picture {
    grid-column: auto;
    width: 100%;
    aspect-ratio: 1;
  }

  .hero-picture > img {
    object-fit: cover;
    height: 100%;
  }
}

/*** Mobile ***/

@media screen and (max-width: 1160px) {
  /*** Text ***/

  .heading-xl {
    font-size: 40px;
    line-height: 100%;
  }

  .heading-l {
    font-size: 40px;
  }

  .heading-md {
    font-size: 32px;
  }

  .heading-s {
    font-size: 20px;
  }

  .heading-xs,
  h3 {
    font-size: 18px;
  }

  .body {
    font-size: 15px;
    line-height: 175%;
    color: var(--clr-text-2);
  }

  /*** Nav ***/

  .nav-overlay {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 100;

    transition: opacity 0.15s ease-out;
  }

  .nav-overlay[data-active='true'] {
    opacity: 1;
    pointer-events: all;
  }

  .nav-overlay[data-active='false'] {
    opacity: 0;
    pointer-events: none;
  }

  .nav-list {
    position: fixed;
    right: 0;
    top: 0;

    display: flex;
    flex-direction: column;
    align-items: start;
    justify-content: center;
    gap: 1rem;

    transform: translateX(100%);

    background-color: var(--clr-off-white);

    height: 100%;
    width: 256px;

    padding-left: 1rem;
    padding-bottom: 6rem;

    z-index: 200;

    transition: transform 0.25s ease-out;
  }

  .nav-menu-button {
    position: absolute;
    display: inline-block;
    z-index: 300;
  }

  .nav-list-item.body {
    font-size: 18px;
    color: var(--clr-text-1);
  }

  .nav-menu-wrapper {
    display: inline-block;
  }

  a.logo {
    padding-left: 1rem;
  }

  /*** Grid Setting ***/
  .section-hero {
    margin-bottom: 3rem;
  }

  header {
    margin-top: 4rem;
  }

  main {
    display: flex;
    flex-direction: column;
  }

  .section-new {
    grid-column: auto;
    grid-row: auto;
  }

  .section-popular {
    grid-column: auto;
    grid-row: auto;

    height: auto;

    margin-bottom: 4rem;
  }

  /*** Section - Popular ***/

  .popular-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
  }
}
