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

/* Prevent font size inflation */
html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

/* Remove default margin in favour of better control in authored CSS */
body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  margin-block-end: 0;
}

/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
ul[role="list"],
ol[role="list"] {
  list-style: none;
}

/* Set core body defaults */
body {
  line-height: 1.5;
  min-height: 100vh;
  font-family: "Inter", sans-serif;
  margin: 0;
  font-size: 0.9375rem;

  background-color: var(--Off-white);
}

/* Set shorter line heights on headings and interactive elements */
h1,
h2,
h3,
h4,
button,
input,
label {
  line-height: 1.1;
}

/* Balance text wrapping on headings */
h1,
h2,
h3,
h4 {
  text-wrap: balance;
}

/* A elements that don't have a class get default styles */
a:not([class]) {
  text-decoration-skip-ink: auto;
  color: currentColor;
}

/* Make images easier to work with */
img,
picture {
  max-width: 100%;
  display: block;
}

/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
}

/* Make sure textareas without a rows attribute are not tiny */
textarea:not([rows]) {
  min-height: 10em;
}

/* Anything that has been anchored to should have extra scroll margin */
:target {
  scroll-margin-block: 5ex;
}

:root {
  /* ### Primary */

  --Soft-orange: hsl(35, 77%, 62%);
  --Soft-red: hsl(5, 85%, 63%);

  /* ### Neutral */

  --Off-white: hsl(36, 100%, 99%);
  --Grayish-blue: hsl(233, 8%, 79%);
  --Dark-grayish-blue: hsl(236, 13%, 42%);
  --Very-dark-blue: hsl(240, 100%, 5%);

  /* spacing / typo system */
  /* Typography System */
  --font-size-4: 0.25rem; /* 4px */
  --font-size-8: 0.5rem; /* 8px */
  --font-size-10: 0.625rem; /* 10px */
  --font-size-12: 0.75rem; /* 12px */
  --font-size-14: 0.875rem; /* 14px */
  --font-size-16: 1rem; /* 16px */
  --font-size-18: 1.125rem; /* 18px */
  --font-size-20: 1.25rem; /* 20px */
  --font-size-24: 1.5rem; /* 24px */
  --font-size-30: 1.875rem; /* 30px */
  --font-size-36: 2.25rem; /* 36px */
  --font-size-44: 2.75rem; /* 44px */
  --font-size-52: 3.25rem; /* 52px */
  --font-size-62: 3.875rem; /* 62px */
  --font-size-74: 4.625rem; /* 74px */
  --font-size-86: 5.375rem; /* 86px */
  --font-size-98: 6.125rem; /* 98px */

  /*Clamping/Scaling Typo scale */

  --clamp-font-20: clamp(1.25rem, 2vw, 1.5rem); /* 20px → scales to 24px */
  --clamp-font-24: clamp(1.5rem, 2.5vw, 1.875rem); /* 24px → scales to 30px */
  --clamp-font-30: clamp(1.875rem, 3vw, 2.25rem); /* 30px → scales to 36px */
  --clamp-font-36: clamp(2.25rem, 3.5vw, 2.75rem); /* 36px → scales to 44px */
  --clamp-font-44: clamp(2.75rem, 4vw, 3.25rem); /* 44px → scales to 52px */
  --clamp-font-52: clamp(3.25rem, 5vw, 3.875rem); /* 52px → scales to 62px */
  --clamp-font-62: clamp(3.875rem, 6vw, 4.625rem); /* 62px → scales to 74px */
  --clamp-font-74: clamp(4.625rem, 7vw, 5.375rem); /* 74px → scales to 86px */
  --clamp-font-86: clamp(5.375rem, 8vw, 6.125rem); /* 86px → scales to 98px */
  --clamp-font-98: clamp(6.125rem, 9vw, 7rem); /* 98px → scales to 112px */

  /* Clamp variations */
  --clamp-font-24-v2: clamp(1.5rem, 2.5vw, 2.75rem); /* 24px → scales to 44px */
  --clamp-font-24-v3: clamp(1.5rem, 3vw, 3rem); /* 24px → scales to 48px */

  /* Spacing System */
  --spacing-2: 0.125rem; /* 2px */
  --spacing-4: 0.25rem; /* 4px */
  --spacing-8: 0.5rem; /* 8px */
  --spacing-12: 0.75rem; /* 12px */
  --spacing-16: 1rem; /* 16px */
  --spacing-24: 1.5rem; /* 24px */
  --spacing-32: 2rem; /* 32px */
  --spacing-36: 2.25rem; /* 36px */
  --spacing-40: 2.5rem; /* 40px */
  --spacing-44: 2.75rem; /* 44px */
  --spacing-48: 3rem; /* 48px */
  --spacing-64: 4rem; /* 64px */
  --spacing-80: 5rem; /* 80px */
  --spacing-96: 6rem; /* 96px */
  --spacing-128: 8rem; /* 128px */
}

.no-scroll {
  overflow: hidden;
  height: 100vh; /* Optional: prevents some iOS scrolling issues */
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 100vw;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1;
}

.flex {
  display: flex;
}

.grid {
  display: grid;
}

.container {
  margin: 0 auto;
}

.visually-hidden {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

.hidden {
  display: none;
}

.active {
  display: block;
}

.two-col {
  grid-template-columns: repeat(2, 1fr);
}

.three-col {
  grid-template-columns: repeat(3, 1fr);
}

.btn {
  text-decoration: none;
  display: inline-block;
}

/* Utilities above */
.header {
  position: relative;
}

.header__logo-menu {
  width: 100%;
  margin: var(--spacing-24) auto;

  justify-content: space-between;
  max-width: 345px;
}

.header__logo-link {
}
.header__logo {
  max-width: 40px;
}
.header__menu-button {
  border: none;
  background: none;
  cursor: pointer;

  padding: 0;
}

.header__menu-button--close {
  justify-content: end;
  align-items: start;
}

.header__menu-icon {
}

.nav {
  z-index: 2;

  background-color: var(--Off-white);
  position: fixed;

  right: 0;

  width: 70vw;
  height: 100vh;

  padding: var(--spacing-24) var(--spacing-24) 0;
}

.nav__list {
  margin: var(--spacing-96) 0 0;
  padding: 0;
  list-style-type: none;

  flex-direction: column;
  gap: var(--spacing-24);
}
.nav__link {
  text-decoration: none;
  color: var(--Very-dark-blue);

  font-weight: 400;
  font-size: var(--font-size-20);
}

.main-content {
  max-width: 345px;
}

.featured-new {
}
.featured {
}
.featured__image-container {
  margin: 0;
}
.featured__image {
}

.featured__title-description {
}
.featured__title-container {
}
.featured__title {
  font-size: var(--font-size-44);
  font-weight: 800;

  text-wrap: wrap;
  color: var(--Very-dark-blue);
}
.featured__description {
  color: var(--Dark-grayish-blue);
}

.featured__read-more {
  margin-block-start: var(--spacing-24);

  background-color: var(--Soft-red);
  color: var(--Very-dark-blue);

  padding: var(--spacing-12) var(--spacing-32);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 3px;
}

.featured__read-more:hover,
.featured__read-more:active {
  background-color: var(--Very-dark-blue);
  color: var(--Off-white);
}

.new-articles {
  background-color: var(--Very-dark-blue);

  margin-block-start: var(--spacing-64);
  padding: var(--spacing-24) var(--spacing-16) var(--spacing-16)
    var(--spacing-16);
}
.new__heading {
  font-size: var(--font-size-30);

  margin: 0;
  color: var(--Soft-orange);
}
.new__item {
}
.new__item + .new__item {
  border-top: 1px solid var(--Dark-grayish-blue);
}
.new__title {
  margin-block-start: var(--spacing-32);
}

.new__link {
  text-decoration: none;
  color: var(--Off-white);
}

.new__link:hover,
.new__link:active {
  color: var(--Soft-orange);
}
.new__summary {
  padding-block-end: var(--spacing-32);
  color: var(--Grayish-blue);
}

.new__item:nth-child(4) .new__summary {
  padding-block-end: var(--spacing-12);
}

.popular {
  flex-direction: column;

  margin-block-start: var(--spacing-64);
  margin-block-end: var(--spacing-80);
}

.popular__heading {
  color: var(--Soft-orange);
}

.popular__list {
  list-style-type: none;
  padding: 0;
  margin: 0;

  gap: var(--spacing-32);
}
.popular__item {
}

.popular__article {
  gap: var(--spacing-24);
}

.popular__image {
  /* max-height: 125px; */
  max-width: 30%;
}
.popular__content {
  flex-direction: column;

  justify-content: space-between; /* centers children vertically */
}
.popular__rank {
  color: var(--Soft-red);
  font-weight: 700;
  font-size: var(--font-size-30);
}
.popular__link {
  text-decoration: none;
  color: var(--Very-dark-blue);
}
.popular__link:hover,
.popular__link:active {
  color: var(--Soft-red);
}
.popular__title {
  font-size: var(--font-size-18);

  margin: 0;

  font-weight: 800;
}
.popular__summary {
  color: var(--Dark-grayish-blue);
  margin: 0;
}

/* tablets */
@media (min-width: 48em) {
  .header__logo-menu,
  .main-content {
    max-width: 555px;
  }

  .nav__link {
    /* font-size: var(--font-size-24); */
  }

  .popular__content {
    justify-content: space-around;
  }
}

/* Desktop */
@media (min-width: 90em) {
  .nav.grid.two-col {
    grid-template-columns: none;
  }

  .overlay {
    display: none;
  }

  .header {
    max-width: 1100px;
    margin: var(--spacing-64) auto var(--spacing-48);
  }

  .header__logo-menu {
    margin: 0;
  }

  .header__logo-menu,
  .main-content {
    max-width: 1100px;
  }

  .header__menu-button {
    display: none;
  }

  .nav {
    position: relative;
    z-index: auto;
    width: auto;
    height: auto;
    padding: 0;

    background-color: transparent;

    display: flex;
  }

  .nav__list {
    margin: 0;

    flex-direction: row;
    gap: var(--spacing-48);
  }

  .nav__link {
    color: var(--Dark-grayish-blue);
  }

  .nav__link:hover {
    color: var(--Soft-red);
  }

  .new__item:nth-child(4) .new__summary {
    padding-block-end: 0;
  }

  .featured {
    display: grid;

    flex: 2;
  }

  .featured-new {
    display: flex;

    gap: var(--spacing-24);
  }

  .featured__title-description {
    display: grid;
    grid-template-columns: repeat(2, 1fr);

    gap: var(--spacing-32);
  }

  .featured__title {
    margin: var(--spacing-24) 0 var(--spacing-4);

    font-size: var(--font-size-62);

    line-height: 1;
    /* max-width: 325px; */
  }

  .featured__description-container {
    display: grid;
  }

  .featured__description {
    line-height: 1.7;
    margin-block-start: auto;
  }

  .featured__read-more {
    margin-block-start: auto;
    justify-self: start;
  }

  .new__heading {
    font-size: var(--font-size-36);
  }

  .new-articles {
    flex: 0.86;

    margin: 0;
  }

  .new__link {
    font-size: var(--font-size-20);
  }

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

  .popular__list {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-48);
  }

  .popular__article {
    gap: var(--spacing-16);
  }
}
