/* single.php
   Mobile: single column, TOC below the header, above the content.
   Desktop (min-width): 75% content / 25% sticky anchor sidebar.
*/

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  margin-bottom: 1rem;
}

.article-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}
.back-link {
  font-family: var(--font-mono, monospace);
  font-size: 0.85rem;
  color: var(--bland, #68A298);
  white-space: nowrap;
}
.back-link:hover { color: var(--flame, #24FFB2); }

.article-header {
  padding-bottom: 0;
}

.article-title {
  max-width: 28em;
}

.article-meta {
  font-family: var(--font-mono, monospace);
  font-size: 0.85rem;
  color: var(--bland, #68A298);
  margin-bottom: 2rem;
}

.article-thumb {
  margin: 0;
}
.article-thumb img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  border-radius: var(--radius-md, 0.9rem);
}

.article-layout {
  display: grid;
  gap: 2.5rem;
}

.article-content {
  min-width: 0; /* prevents long words/code from blowing out the grid column */
}
.article-content h2 {
  margin-bottom: 1rem;
  scroll-margin-top: 5rem; /* keeps the heading clear of the sticky header when jumped to */
}
.article-content p {
  color: var(--white, #F3F3F3);
  margin-bottom: 1rem;
  line-height: 1.7;
}
.article-content img {
  width: 100%;
  border-radius: var(--radius-md, 0.9rem);
  margin-block: 1.5rem;
}

.article-toc {
  order: -1; /* on mobile, show the TOC above the article body */
}
.article-toc-label {
  font-family: var(--font-mono, monospace);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--flame, #24FFB2);
  margin-bottom: 0.75rem;
}
.article-toc ul {
  display: flex;
  flex-direction: column;
  gap: 0.6em;
  border-left: 2px solid var(--border-soft, rgba(104,162,152,0.35));
  padding-left: 1rem;
}
.article-toc a {
  font-size: 0.9rem;
  color: var(--bland, #68A298);
  line-height: 1.4;
  display: block;
}
.article-toc a:hover {
  color: var(--flame, #24FFB2);
}

@media (min-width: 56em) {
  .article-layout {
    grid-template-columns: 3fr 1fr; /* 75% / 25% */
    align-items: start;
  }
  .article-toc {
    order: 0;
    position: sticky;
    top: 6rem; /* clears the sticky site header */
  }
}