/* ==========================================================================
   Technoblade Wiki — articles.css
   Article and listing page styles: breadcrumbs, article header, table of
   contents, infobox, prose sections, figures, references, tags and
   related-article cards.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Article page shell
   -------------------------------------------------------------------------- */
.article {
  max-width: var(--reading-width);
}

/* Breadcrumb navigation */
.breadcrumbs {
  margin-bottom: var(--space-4);
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.breadcrumbs li {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.breadcrumbs li + li::before {
  content: "/";
  color: var(--color-border-strong);
}

.breadcrumbs a {
  color: var(--color-text-muted);
}

.breadcrumbs a:hover {
  color: var(--color-accent);
}

.breadcrumbs [aria-current="page"] {
  color: var(--color-text);
  font-weight: 500;
}

/* Article header */
.article-header {
  border-bottom: 1px solid var(--color-border);
  padding-bottom: var(--space-4);
  margin-bottom: var(--space-5);
}

.article-title {
  font-size: var(--text-3xl);
  font-weight: 700;
  margin-bottom: var(--space-3);
}

.article-lead {
  font-size: var(--text-md);
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: var(--space-3);
}

.article-meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.article-meta a {
  color: var(--color-text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-meta a:hover {
  color: var(--color-accent);
}

/* --------------------------------------------------------------------------
   2. Table of contents
   -------------------------------------------------------------------------- */
.toc {
  background-color: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-5);
}

.toc-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-heading);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-2);
}

.toc ol {
  list-style: none;
  padding: 0;
  columns: 2;
  column-gap: var(--space-6);
}

.toc li {
  break-inside: avoid;
  padding-block: 0.2rem;
  counter-increment: toc-counter;
}

.toc li::before {
  content: counter(toc-counter) ". ";
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.toc a {
  font-size: var(--text-sm);
}

.toc ol ol {
  columns: auto;
  counter-reset: none;
  padding-left: 1.25rem;
  margin-top: 0.1rem;
}

@media (max-width: 639.98px) {
  .toc ol {
    columns: 1;
  }
}

/* --------------------------------------------------------------------------
   3. Prose (article body typography)
   -------------------------------------------------------------------------- */
.article-section {
  margin-bottom: var(--space-6);
}

.article-section h2 {
  font-size: var(--text-xl);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.4rem;
  margin-bottom: var(--space-3);
}

.article-section h3 {
  font-size: var(--text-md);
  margin-top: var(--space-5);
  margin-bottom: var(--space-2);
}

.article-body p + p {
  margin-top: var(--space-3);
}

.article-body ul,
.article-body ol {
  padding-left: 1.5rem;
  margin-top: var(--space-3);
}

.article-body li + li {
  margin-top: 0.3rem;
}

.article-body blockquote {
  border-left: 3px solid var(--color-accent);
  background-color: var(--color-accent-soft);
  padding: var(--space-3) var(--space-4);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  margin-top: var(--space-3);
}

/* --------------------------------------------------------------------------
   4. Figures & images with captions
   -------------------------------------------------------------------------- */
.article-figure {
  margin: var(--space-4) 0 var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: var(--color-surface);
}

.article-figure img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.article-figure figcaption {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  padding: var(--space-2) var(--space-3);
  border-top: 1px solid var(--color-border);
  background-color: var(--color-bg-subtle);
}

/* --------------------------------------------------------------------------
   5. Infobox (right-side quick-facts card, floats like a wiki infobox)
   -------------------------------------------------------------------------- */
.infobox {
  float: right;
  width: 300px;
  margin: 0 0 var(--space-4) var(--space-5);
  background-color: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  font-size: var(--text-sm);
}

.infobox-title {
  font-size: var(--text-md);
  font-weight: 700;
  text-align: center;
  color: var(--color-heading);
  background-color: var(--color-bg-muted);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-3);
}

.infobox-figure {
  padding: var(--space-3);
}

.infobox-figure img {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

.infobox-figure figcaption {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-align: center;
  padding-top: var(--space-2);
}

.infobox-data {
  margin: 0;
  border-top: 1px solid var(--color-border);
}

.infobox-data > div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
}

.infobox-data > div + div {
  border-top: 1px solid var(--color-border);
}

.infobox-data dt {
  font-weight: 600;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

.infobox-data dd {
  margin: 0;
  font-size: var(--text-xs);
  color: var(--color-text);
  overflow-wrap: anywhere;
}

/* Stack the infobox on narrow screens */
@media (max-width: 767.98px) {
  .infobox {
    float: none;
    width: 100%;
    margin: 0 0 var(--space-5);
  }
}

/* --------------------------------------------------------------------------
   6. Article footer: tags, related articles, references
   -------------------------------------------------------------------------- */
.article-footer {
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-5);
  margin-top: var(--space-6);
}

.article-tags {
  margin-bottom: var(--space-6);
}

.article-tags .tags-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-right: var(--space-2);
}

.related-articles {
  margin-bottom: var(--space-6);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-4);
}

.related-grid .card {
  padding: var(--space-4);
}

.related-grid .card-title {
  font-size: var(--text-sm);
}

.references {
  margin-bottom: var(--space-6);
}

.references-list {
  padding-left: 1.5rem;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.references-list li + li {
  margin-top: var(--space-2);
}

.references-note {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-style: italic;
  margin-top: var(--space-3);
}

/* --------------------------------------------------------------------------
   7. Listing pages (categories, archive)
   -------------------------------------------------------------------------- */
.listing-count {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.other-categories {
  margin-top: var(--space-6);
}

.other-categories .tag-list {
  margin-top: var(--space-3);
}
