/* Topic page styles (evolution, cosmology, etc.) */

.intro {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--text);
  border-top: 2px solid var(--accent);
  padding-top: 1rem;
  margin-bottom: 2rem;
  max-width: 600px;
}

h3 {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

/* Topic-level numbering (1.1, 1.2, 1.3, etc.) */
main {
  counter-reset: item;
}

section ul li {
  counter-increment: item;
  display: flex;
  align-items: center;
  min-width: 0;
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 0;
  transition: opacity 0.15s;
}

section ul li::before {
  content: var(--topic-prefix) counter(item);
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-micro);
  min-width: 2.5rem;
  flex-shrink: 0;
}

section ul li:last-child {
  border-bottom: none;
}

section ul li:hover::before {
  color: var(--accent);
}

section ul:hover li:not(:hover) {
  opacity: 0.6;
}

section ul li a {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s, color 0.15s;
}

section ul li a:hover {
  border-color: var(--accent);
}

.article-desc {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-faint);
  line-height: 1.45;
  margin-top: 0.2rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Hide topic content when searching */
main.searching > :not(input):not(.search-results) {
  display: none;
}

/* Section dividers */
section {
  margin-bottom: 2rem;
}

section:last-of-type {
  margin-bottom: 0;
}

/* Entry thumbnails */
.entry-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  margin-right: 0.75rem;
  opacity: 0.85;
  transition: opacity 0.15s;
}

section ul li:hover .entry-thumb {
  opacity: 1;
}

/* Reading list / resources */
.resources {
  background: var(--border);
  padding: 1.5rem;
  margin-top: 3rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border-muted);
}

.resources h2 {
  margin-top: 0;
}

.resources li {
  margin-bottom: 0.75rem;
  counter-increment: none;
}

.resources li::before {
  display: none;
}

/* Mobile adjustments */
@media (max-width: 480px) {
  .intro {
    font-size: 0.95rem;
    padding-top: 0.75rem;
    margin-bottom: 1.5rem;
  }

  section {
    margin-bottom: 1.5rem;
  }

  section ul li::before {
    min-width: 2rem;
  }

  li a {
    padding: 0.375rem 0;
  }

  .resources {
    margin-top: 2rem;
    margin-left: -1rem;
    margin-right: -1rem;
    padding: 1rem;
  }

  .article-desc {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .entry-thumb {
    width: 36px;
    height: 36px;
  }
}
