.wechat-articles-page {
  margin: 0;
}

.wechat-articles {
  --article-gap: clamp(16px, 2vw, 28px);
  --article-gutter: clamp(16px, 5vw, 48px);
  --article-border: rgba(0, 0, 0, .10);
  --article-card-bg: #fff;
  --article-cover-bg: #ececee;
  --article-title: var(--text-light-primary);
  --article-secondary: var(--text-light-secondary);
}

.wechat-articles [hidden] {
  display: none;
}

.wechat-articles--home {
  --article-border: rgba(255, 255, 255, .15);
  --article-card-bg: #161315;
  --article-cover-bg: #23191d;
  --article-title: var(--text-dark-primary);
  --article-secondary: rgba(255, 255, 255, .68);
  padding-block: clamp(64px, 8vw, 116px);
  background: #0a090a;
}

.wechat-articles--directory {
  padding-bottom: clamp(64px, 8vw, 116px);
  background: #f7f7f8;
  min-height: 65vh;
}

.wechat-articles__container {
  width: min(var(--container-max), 100% - 2 * var(--article-gutter));
  margin-inline: auto;
}

.wechat-articles__breadcrumb {
  padding-top: 24px;
}

.wechat-articles__breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--article-secondary);
  font-size: 13px;
}

.wechat-articles__breadcrumb li + li::before {
  content: "/";
  margin-inline-end: 10px;
  opacity: .55;
}

.wechat-articles__breadcrumb a {
  color: inherit;
  text-decoration: none;
}

.wechat-articles__intro {
  margin-block: clamp(36px, 5vw, 76px) clamp(28px, 4vw, 56px);
}

.wechat-articles__intro h1,
.wechat-articles__heading h2 {
  margin: 0;
}

.wechat-articles__intro p {
  margin: 14px 0 0;
  font-size: clamp(16px, 1.3vw, 19px);
  text-wrap: balance;
}

.wechat-articles__heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: clamp(20px, 3vw, 40px);
}

.wechat-articles__all,
.wechat-articles__read {
  font-size: 14px;
  font-weight: var(--fw-medium);
  letter-spacing: .01em;
}

.wechat-articles__all {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--article-title);
  text-decoration: none;
}

.wechat-articles__grid,
.wechat-articles__rail {
  display: grid;
  gap: var(--article-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

.wechat-articles__grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.wechat-articles__carousel {
  position: relative;
}

.wechat-articles__rail {
  scrollbar-width: none;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 2 * var(--article-gap)) / 3);
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x proximity;
}

.wechat-articles__rail::-webkit-scrollbar {
  display: none;
}

.wechat-articles__rail > li {
  scroll-snap-align: start;
}

.wechat-articles__item {
  display: flex;
  min-width: 0;
}

.wechat-articles__card {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--article-border);
  border-radius: 10px;
  background: var(--article-card-bg);
  color: var(--article-title);
  text-decoration: none;
  transition: border-color .18s ease, background-color .18s ease;
}

.wechat-articles__cover {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--article-cover-bg);
}

.wechat-articles__cover::before {
  content: "SALANG";
  color: var(--article-secondary);
  font-size: 14px;
  font-weight: var(--fw-semibold);
  letter-spacing: .22em;
}

.wechat-articles__cover img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wechat-articles__copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: clamp(16px, 2vw, 24px);
}

.wechat-articles__title,
.wechat-articles__summary {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  margin: 0;
}

.wechat-articles__title {
  color: var(--article-title);
  font-size: clamp(16px, 1.5vw, 21px);
  line-height: 1.45;
  -webkit-line-clamp: 2;
}

.wechat-articles__summary {
  color: var(--article-secondary);
  font-size: 14px;
  -webkit-line-clamp: 3;
}

.wechat-articles__date {
  color: var(--article-secondary);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.wechat-articles__read {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-top: auto;
  padding-top: 8px;
  color: var(--article-secondary);
}

.wechat-articles__read-arrow {
  color: var(--salang-red);
}

.wechat-articles__status {
  margin: 0;
  color: var(--article-secondary);
}

.wechat-articles__status:empty {
  display: none;
}

.wechat-articles__actions,
.wechat-articles__rail-controls {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.wechat-articles__rail-controls {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.wechat-articles__button,
.wechat-articles__rail-controls button {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--article-border);
  border-radius: 6px;
  background: var(--article-card-bg);
  color: var(--article-title);
  font: inherit;
  font-size: 14px;
  font-weight: var(--fw-medium);
  cursor: pointer;
}

.wechat-articles__button {
  margin-top: 28px;
}

.wechat-articles__rail-controls button {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  border-color: rgba(255, 255, 255, .16);
  border-radius: 50%;
  background: rgba(10, 10, 10, .82);
  color: #fff;
  pointer-events: auto;
  transform: translateY(-50%);
}

.wechat-articles__rail-controls [data-article-prev] { left: 12px; }
.wechat-articles__rail-controls [data-article-next] { right: 12px; }
.wechat-articles__rail-controls svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.wechat-articles__rail-controls button:disabled {
  visibility: hidden;
}

.wechat-articles :is(a, button):focus-visible {
  outline: 2px solid var(--salang-red);
  outline-offset: 3px;
}

.wechat-articles__card:focus-visible {
  outline-offset: -3px;
}

.wechat-articles__card:active {
  border-color: var(--salang-red);
  background: color-mix(in srgb, var(--salang-red) 6%, var(--article-card-bg));
}

@media (hover: hover) {
  .wechat-articles__card:hover,
  .wechat-articles__button:hover,
  .wechat-articles__rail-controls button:enabled:hover {
    border-color: var(--salang-red);
  }

  .wechat-articles__all:hover,
  .wechat-articles__breadcrumb a:hover,
  .wechat-articles__card:hover .wechat-articles__read {
    color: var(--salang-red);
  }
}

@media (max-width: 1023px) {
  .wechat-articles__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wechat-articles__rail {
    grid-auto-columns: calc((100% - var(--article-gap)) / 2);
  }
}

@media (max-width: 768px) {
  .wechat-articles__heading h2,
  .wechat-articles__intro h1 {
    font-size: clamp(30px, 7vw, 44px);
  }

  .wechat-articles__rail {
    grid-auto-columns: min(84%, 400px);
  }
}

@media (max-width: 599px) {
  .wechat-articles__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
