.hero {
  max-width: 1000px;
  width: 100%;
  gap: 20px;
}

.hero h1 {
  width: 100%;
}

.hero .cat {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  transition: flex 0.5s ease;
  cursor: pointer;
  border: none;

  background: linear-gradient(
    202.04deg,
    rgba(102, 102, 102, 0) 59.01%,
    rgba(0, 0, 0, 0.3) 96.46%
  );
}

.hero .cat h5 {
  font-weight: 800;
  position: absolute;
  bottom: 20px;
  left: 20px;
  color: #fff;
}

.hero .cat-holder {
  gap: 10px;
}

.hero img {
  width: 100%;
  height: 500px;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
  z-index: -1;
}

.cat:first-child {
  flex: 1.5;
}

.cat-holder:has(.cat:nth-child(2):hover) .cat,
.cat-holder:has(.cat:nth-child(3):hover) .cat {
  flex: 1;
}

.hero .cat-holder:has(.cat:hover) .cat:hover {
  flex: 2;
}

.cat:hover img {
  transform: scale(1.03);
}

.list {
  max-width: 1000px;
  width: 100%;
}

.list .headings {
  width: 100%;
  justify-content: space-between;
}

.list .line {
  width: 100%;
  height: 1px;
  background: #000;
  margin: 10px 0;
}

.snipped-holder {
  width: 100%;
  gap: 30px;
  padding: 20px 0;
}

.snipped-holder .snipped {
  width: 100%;
  justify-content: space-between;
}

.snipped-holder .snipped .left {
  gap: 20px;
}

.snipped-holder .snipped .text {
  height: 100%;
  justify-content: flex-start;
}

.snipped-holder .snipped .text * {
  max-width: 480px;
  width: 100%;
}

.snipped-holder .snipped .text h3 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.snipped-holder .snipped .text p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.snipped-holder .snipped img {
  width: 100px;
  height: 100px;
  object-fit: cover;
}

.category-select {
  position: relative;
}

.category-select-button {
  display: flex;
  align-items: center;
  gap: 8px;

  padding: 0;
  border: 0;
  background: transparent;

  font: inherit;
  color: inherit;

  cursor: pointer;
}

.category-arrow {
  transition: transform 0.25s ease;
  color: rgba(0, 0, 0, 0.4);
}

.category-select-button[aria-expanded="true"] .category-arrow {
  transform: rotate(180deg);
}

.category-options {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;

  min-width: 150px;

  display: flex;
  flex-direction: column;

  padding: 8px;

  background: white;
  border: 1px solid rgba(0, 0, 0, 0.1);

  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);

  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0.2s ease;

  z-index: 20;
}

.category-select.open .category-options {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.category-options button {
  padding: 8px 10px;

  border: 0;
  background: transparent;

  text-align: left;
  font: inherit;

  cursor: pointer;
}

.category-options button h2 {
  text-align: left;
}

.category-options button:hover {
  background: rgba(0, 0, 0, 0.05);
}

@media (max-width: 1024px) {
  .hero,
  .list {
    width: 100%;
    padding-left: 28px;
    padding-right: 28px;
    box-sizing: border-box;
  } /* Trending categories. */
  .hero .cat img {
    height: 420px;
  } /* Keep the featured behaviour, but make the difference slightly subtler. */
  .hero .cat:first-child {
    flex: 1.35;
  }
  .hero .cat-holder:has(.cat:hover) .cat:hover {
    flex: 2.1;
  } /* Snippets. */
  .snipped-holder {
    gap: 26px;
  }
  .snipped-holder .snipped .text * {
    max-width: 420px;
  }
} /* ========================================================= MOBILE 700px ========================================================= */
@media (max-width: 700px) {
  h1 {
    font-size: 42px;
    line-height: 1.15;
  }
  /* Page spacing. */
  .hero,
  .list {
    width: 100%;
    padding-left: 20px;
    padding-right: 20px;
    box-sizing: border-box;
  } /* Hero heading. */
  .hero {
    gap: 18px;
  }
  .hero .cat-holder {
    gap: 4px;
  }
  .hero .cat img {
    height: 300px;
  } /* On touch devices there is no meaningful hover. Keep the three cards equal. */
  .hero .cat,
  .hero .cat:first-child {
    flex: 1;
  }
  .hero .cat-holder:has(.cat:nth-child(2):hover) .cat,
  .hero .cat-holder:has(.cat:nth-child(3):hover) .cat,
  .hero .cat-holder:has(.cat:hover) .cat:hover {
    flex: 1;
  } /* Category labels. */
  .hero .cat h5 {
    bottom: 12px;
    left: 12px;
    font-size: 16px;
    line-height: 20px;
  } /* Disable the desktop zoom effect. */
  .hero .cat:hover img {
    transform: none;
  } /* Articles section. */
  .list {
    align-items: stretch;
  } /* Heading becomes a vertical stack. */
  .list .headings {
    align-items: flex-start;
    gap: 8px;
  } /* Keep dropdown aligned with the section. */
  .category-select {
    width: auto;
  } /* Dropdown can safely extend over the snippets. */
  .category-options {
    min-width: 170px;
  } /* Snippets become horizontal compact cards. */
  .snipped-holder {
    gap: 24px;
    padding: 16px 0;
  }
  .snipped-holder .snipped {
    align-items: flex-start;
    gap: 16px;
  }
  .snipped-holder .snipped .left {
    align-items: flex-start;
    gap: 14px;
    min-width: 0;
  }
  .snipped-holder .snipped img {
    width: 90px;
    height: 90px;
  }
  .snipped-holder .snipped .text {
    min-width: 0;
  }
  .snipped-holder .snipped .text * {
    max-width: none;
  } /* Keep titles readable without causing horizontal overflow. */
  .snipped-holder .snipped h3 {
    font-size: 20px;
    line-height: 25px;
  }
  .snipped-holder .snipped .text p {
    font-size: 15px;
    line-height: 21px;
    -webkit-line-clamp: 2;
  } /* Category shown on the right of the snippet is hidden on mobile to preserve space. */
  .snipped-holder .snipped .right {
    display: none;
  }
} /* ========================================================= SMALL MOBILE 420px ========================================================= */
@media (max-width: 420px) {
  .hero,
  .list {
    padding-left: 20px;
    padding-right: 20px;
  }
  .hero .cat img {
    height: 230px;
  }
  .hero .cat h5 {
    bottom: 9px;
    left: 9px;
    font-size: 14px;
    line-height: 18px;
  } /* Slightly smaller article thumbnail. */
  .snipped-holder .snipped img {
    width: 78px;
    height: 78px;
  }
  .snipped-holder .snipped {
    gap: 12px;
  }
  .snipped-holder .snipped .left {
    gap: 12px;
  }
  .snipped-holder .snipped h3 {
    font-size: 18px;
    line-height: 23px;
  }
  .snipped-holder .snipped .text p {
    font-size: 14px;
    line-height: 19px;
  }
}
