.homepage-articles-section {
  overflow: hidden;
  padding-top: clamp(128px, 10vw, 156px);
  scroll-margin-top: var(--header-height, 92px);
  background: var(--bg);
}

.homepage-articles-head {
  max-width: 920px;
  margin: 0 auto 28px;
  text-align: center;
}

.homepage-articles-head .section-title {
  max-width: 820px;
  margin: 18px auto 14px;
  line-height: 1.04;
}

.homepage-articles-head .gradient-text {
  display: block;
}

.homepage-articles-head .section-sub {
  max-width: 850px;
  margin: 0 auto;
  text-align: center;
}

.homepage-articles-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 28px;
}

.homepage-articles-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.article-filter,
.article-carousel-arrow {
  border: 1px solid var(--border-2);
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .22s ease, color .22s ease, background .22s ease, transform .22s ease;
}

.article-filter {
  min-height: 42px;
  padding: 9px 18px;
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.article-filter:hover,
.article-filter:focus-visible {
  border-color: var(--accent);
}

.article-filter.is-active {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}

.article-carousel-arrow {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 50%;
}

.article-carousel-arrow:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.homepage-articles-viewport {
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y pinch-zoom;
}

.homepage-articles-viewport.is-dragging {
  cursor: grabbing;
}

.homepage-articles-viewport::-webkit-scrollbar {
  display: none;
}

.homepage-articles-track {
  display: flex;
  gap: 18px;
  align-items: stretch;
  min-width: 100%;
}

.homepage-article-card {
  flex: 0 0 calc((100% - 54px) / 4);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.homepage-articles-viewport.is-dragging .homepage-article-card {
  pointer-events: none;
}

.homepage-article-card[hidden] {
  display: none;
}

.homepage-article-media {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface-2);
}

.homepage-article-media img,
.homepage-article-media .articles-generated-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .55s cubic-bezier(.2,.65,.25,1);
}

.homepage-article-card:hover .homepage-article-media img,
.homepage-article-card:hover .homepage-article-media .articles-generated-cover {
  transform: scale(1.035);
}

.homepage-article-category {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 2;
  max-width: calc(100% - 32px);
  padding: 8px 13px;
  border-radius: 999px;
  color: var(--text);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border: 1px solid var(--border-2);
  box-shadow: 0 10px 24px rgba(0,0,0,.14);
  backdrop-filter: blur(12px);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.homepage-article-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 17px 4px 0;
}

.homepage-article-body time {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 650;
}

.homepage-article-body h3 {
  margin: 9px 0 10px;
  font-size: clamp(17px, 1.3vw, 21px);
  line-height: 1.25;
}

.homepage-article-body h3 a {
  color: var(--text);
  text-decoration: none;
}

.homepage-article-excerpt {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.homepage-article-excerpt p {
  margin: 0;
}

.homepage-article-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin-top: auto;
  padding-top: 16px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.homepage-articles-controls {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
}

.homepage-articles-empty {
  padding: 34px;
  border: 1px solid var(--border);
  border-radius: 18px;
  color: var(--text-muted);
  background: var(--surface);
  text-align: center;
}

.homepage-articles-progress {
  overflow: hidden;
  height: 3px;
  margin-right: 18px;
  border-radius: 999px;
  background: var(--border);
}

.homepage-articles-progress i {
  display: block;
  width: 18%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  will-change: transform;
}

.article-carousel-arrow {
  font-size: 19px;
}

.article-carousel-arrow--primary {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}

@media (max-width: 1080px) {
  .homepage-article-card {
    flex-basis: calc((100% - 18px) / 2);
  }
}

@media (max-width: 700px) {
  .homepage-articles-section {
    padding: 148px 0 72px;
  }

  .homepage-articles-head .section-title {
    font-size: clamp(34px, 10vw, 46px);
  }

  .homepage-articles-toolbar {
    align-items: flex-start;
  }

  .homepage-articles-filters {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-right: -10px;
    padding: 0 10px 5px 0;
    scrollbar-width: none;
  }

  .homepage-articles-filters::-webkit-scrollbar {
    display: none;
  }

  .article-filter {
    white-space: nowrap;
  }

  .homepage-article-card {
    flex-basis: min(86vw, 340px);
  }

  .homepage-articles-progress {
    margin-right: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .homepage-article-media img,
  .homepage-article-media .articles-generated-cover,
  .homepage-articles-progress i {
    transition: none;
  }
}
