/* Topic index: Wiki-inspired covers with complete, readable article lists. */
body[data-page-layout="index_topic"] {
  --width-main: var(--width-main-wiki-list);
}

body[data-page-layout="index_topic"] .site-main > .pin-slider,
body[data-page-layout="index_topic"] .site-main > .listing-nav {
  display: none;
}

body[data-page-layout="index_topic"] .topic-index-header {
  display: flex;
  box-sizing: border-box;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  width: calc(100% - 2rem);
  margin: 1rem 1rem 0;
  padding: 1rem 1.25rem;
  border: 1px solid var(--block-border);
  border-radius: 8px;
  background: var(--card);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

body[data-page-layout="index_topic"] .topic-index-heading {
  min-width: 0;
}

body[data-page-layout="index_topic"] .topic-index-eyebrow {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--theme);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0;
}

body[data-page-layout="index_topic"] .topic-index-heading h1 {
  margin: 0;
  color: var(--text-p1);
  font-size: 1.5rem;
  line-height: 1.3;
}

body[data-page-layout="index_topic"] .topic-index-heading p {
  margin: 0.35rem 0 0;
  color: var(--text-p3);
  font-size: 0.82rem;
  line-height: 1.6;
}

body[data-page-layout="index_topic"] .topic-index-stats {
  display: flex;
  flex: none;
  gap: 1.25rem;
}

body[data-page-layout="index_topic"] .topic-index-stats > span {
  min-width: 4.25rem;
  color: var(--text-p3);
  font-size: 0.72rem;
  text-align: center;
}

body[data-page-layout="index_topic"] .topic-index-stats strong {
  display: block;
  margin-bottom: 0.05rem;
  color: var(--text-p1);
  font-size: 1.15rem;
  line-height: 1.2;
}

body[data-page-layout="index_topic"] .post-list.topic {
  --topic-gap: 1rem;
  display: grid;
  box-sizing: border-box;
  width: calc(100% - 2rem);
  margin: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: var(--topic-gap);
}

body[data-page-layout="index_topic"] .post-list.topic .topic-column {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--topic-gap);
}

body[data-page-layout="index_topic"] .post-list.topic .post-card-wrap {
  display: block;
  min-width: 0;
  width: 100%;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--block-border);
  border-radius: 8px;
  background: var(--card);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

body[data-page-layout="index_topic"] .post-list.topic .post-card {
  overflow: hidden;
  border-radius: inherit;
  background: var(--card);
}

body[data-page-layout="index_topic"] .topic-card-cover {
  position: relative;
  display: flex;
  box-sizing: border-box;
  min-height: 12rem;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  padding: 1.15rem;
  isolation: isolate;
  color: #fff;
}

body[data-page-layout="index_topic"] .topic-card-cover::before {
  position: absolute;
  z-index: -2;
  content: "";
  inset: 0;
  background-color: #18202b;
  background-image: var(--topic-cover);
  background-position: center;
  background-size: cover;
  transform: scale(1.001);
  transition: transform 0.6s ease;
}

body[data-page-layout="index_topic"] .topic-card-cover::after {
  position: absolute;
  z-index: -1;
  content: "";
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 11, 18, 0.05) 28%, rgba(7, 11, 18, 0.86) 100%);
}

body[data-page-layout="index_topic"] .topic-card-cover:hover::before,
body[data-page-layout="index_topic"] .topic-card-cover:focus-visible::before {
  transform: scale(1.035);
}

body[data-page-layout="index_topic"] .topic-card-cover:focus-visible {
  outline: 2px solid var(--theme);
  outline-offset: -3px;
}

body[data-page-layout="index_topic"] .topic-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.72rem;
  line-height: 1.4;
}

body[data-page-layout="index_topic"] .topic-card-title {
  margin: 0;
  color: #fff;
  font-size: 1.35rem;
  line-height: 1.35;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

body[data-page-layout="index_topic"] .post-list.topic .post-card.topic article {
  display: grid;
  box-sizing: border-box;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  padding: 0 1.15rem;
}

body[data-page-layout="index_topic"] .post-list.topic .post-card.topic article .topic-desc {
  margin: 0;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--block-border);
  color: var(--text-p3);
  font-size: 0.82rem;
  line-height: 1.65;
  text-align: left;
  overflow-wrap: anywhere;
}

/* The first article is a peer of the remaining list, not a large cover. */
body[data-page-layout="index_topic"] .post-list.topic .post-card.topic article .topic-first-post {
  display: flex;
  box-sizing: border-box;
  align-items: center;
  width: 100%;
  overflow: visible;
  padding: 7px 0 6px;
  border: 0;
  border-bottom: 1px solid var(--block-border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  outline: none;
  aspect-ratio: auto;
  clip-path: none;
}

body[data-page-layout="index_topic"] .post-list.topic .post-card.topic article .topic-first-post::before,
body[data-page-layout="index_topic"] .post-list.topic .post-card.topic article .topic-first-post::after,
body[data-page-layout="index_topic"] .post-list.topic .post-card.topic article .topic-first-post > img {
  display: none;
}

body[data-page-layout="index_topic"] .post-list.topic .post-card.topic article .topic-first-post .cover-info {
  position: static;
  box-sizing: border-box;
  width: 100%;
  padding: 0;
  color: var(--text-p1);
}

body[data-page-layout="index_topic"] .post-list.topic .post-card.topic article .topic-first-post .headline,
body[data-page-layout="index_topic"] .post-list.topic .archive-list a.post {
  min-width: 0;
  overflow: visible;
  color: var(--text-p1);
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 22px;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

body[data-page-layout="index_topic"] .post-list.topic .post-card.topic article .topic-first-post .headline,
body[data-page-layout="index_topic"] .post-list.topic .archive-list a.post span {
  transform: translateY(-10px);
}

body[data-page-layout="index_topic"] .post-list.topic .post-card.topic article .topic-first-post .caption,
body[data-page-layout="index_topic"] .post-list.topic .archive-list time {
  display: none;
}

body[data-page-layout="index_topic"] .post-list.topic .post-card.topic article .topic-posts {
  display: contents;
}

body[data-page-layout="index_topic"] .post-list.topic .archive-list a.post {
  display: flex;
  box-sizing: border-box;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 7px 0 6px;
  border: 0;
  border-bottom: 1px solid var(--block-border);
}

body[data-page-layout="index_topic"] .post-list.topic .archive-list a.post span {
  display: block;
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
}

body[data-page-layout="index_topic"] .post-list.topic .archive-list:last-child a.post {
  padding-bottom: 7px;
  border-bottom: 0;
}

body[data-page-layout="index_topic"] .post-list.topic .post-card.topic article .topic-first-post:hover,
body[data-page-layout="index_topic"] .post-list.topic .post-card.topic article .topic-first-post:focus-visible,
body[data-page-layout="index_topic"] .post-list.topic .archive-list a.post:hover,
body[data-page-layout="index_topic"] .post-list.topic .archive-list a.post:focus-visible {
  border-bottom-color: var(--theme);
  color: var(--theme);
}

@media screen and (max-width: 680px) {
  body[data-page-layout="index_topic"] .topic-index-header {
    display: block;
  }

  body[data-page-layout="index_topic"] .topic-index-stats {
    justify-content: flex-start;
    margin-top: 0.9rem;
    gap: 1.5rem;
  }

  body[data-page-layout="index_topic"] .topic-index-stats > span {
    min-width: 0;
    text-align: left;
  }

  body[data-page-layout="index_topic"] .post-list.topic {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-page-layout="index_topic"] .post-list.topic .topic-column {
    display: contents;
  }

  body[data-page-layout="index_topic"] .post-list.topic .post-card-wrap {
    order: var(--topic-order);
  }

  body[data-page-layout="index_topic"] .topic-card-cover {
    min-height: 11rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-page-layout="index_topic"] .topic-card-cover::before {
    transition: none;
  }
}
