.article-content {
  line-height: 1.6;
  font-size: 1rem;
  color: #e5e7eb; /* text-gray-200 */
  background-color: transparent;
  padding: 0.125rem;
  border-radius: 0;
  margin-bottom: 0;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
  font-weight: 600;
  margin-top: 1.2em;
  margin-bottom: 0.6em;
  color: #fff;
  /* Increase heading sizes so they stand out */
}

.article-content h1 { font-size: 2rem; }
.article-content h2 { font-size: 1.75rem; }
.article-content h3 { font-size: 1.5rem; }
.article-content h4 { font-size: 1.25rem; }
.article-content h5 { font-size: 1.125rem; }
.article-content h6 { font-size: 1rem; }

.article-content p {
  margin: 0.5em 0;
}

.article-content a {
  color: var(--color-primary);
  text-decoration: underline;
}

.article-content ul,
.article-content ol {
  padding-left: 1.5rem;
  margin: 0.5em 0;
}

.article-content li {
  margin: 0.25em 0;
}

/* use primary color for ordered list numbers */
.article-content ol li::marker {
  color: var(--color-primary);
}

.article-content blockquote {
  margin: 1em 0;
  padding: 0.5em 1em;
  border-left: 4px solid var(--color-primary);
  background-color: rgba(255,255,255,0.05);
  color: #d1d5db;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
}

.article-content th,
.article-content td {
  border: 1px solid #4b5563; /* gray-700 */
  padding: 0.5em;
}

.article-content th {
  background-color: #374151; /* gray-800 */
}

.article-content code {
  font-family: monospace;
  background-color: #374151;
  padding: 0.2em 0.4em;
  border-radius: 4px;
  color: #facc15; /* yellow-400 */
}

.article-content pre {
  background-color: #1f2937; /* gray-900 */
  padding: 1em;
  border-radius: 6px;
  white-space: pre-wrap;
  word-break: break-word;
}

.article-content hr {
  border: none;
  border-top: 1px solid #4b5563;
  margin: 2em 0;
}

.article-content img {
  max-width: 100%;
  border-radius: 0.5rem;
  margin: 1em 0;
  cursor: pointer;
}

/* carousel of images */
.article-content .carousel {
  position: relative;
  overflow: hidden;
}

.article-content .carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 1rem;
  padding-bottom: 1rem;
}

.article-content .carousel-track img {
  flex-shrink: 0;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  scroll-snap-align: center;
  border-radius: 0.75rem;
  cursor: pointer;
}

.article-content .carousel button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.5rem;
  height: 2.5rem;
  background: rgba(0,0,0,0.5);
  color: white;
  border: none;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.article-content .carousel button.prev { left: 0.5rem; }
.article-content .carousel button.next { right: 0.5rem; }

/* collapsible quotes */
.article-content details.quote {
  margin: 1em 0;
  background-color: rgba(255, 255, 255, 0.05);
  border-left: 4px solid var(--color-primary);
  border-radius: 0.25rem;
}

.article-content details.quote summary {
  cursor: pointer;
  padding: 0.5em 1em;
  color: var(--color-primary);
  list-style: none;
  user-select: none;
}

.article-content details.quote summary::-webkit-details-marker {
  display: none;
}

.article-content details.quote blockquote {
  margin: 0;
  padding: 0.5em 1em 1em 1em;
  border: none;
  background: transparent;
  color: #d1d5db;
}

/* preview a bit of text when quote is collapsed */
.article-content details.quote:not([open]) blockquote {
  display: block;
  max-height: 1.6em; /* show only one line */
  overflow: hidden;
  position: relative;
}

.article-content details.quote:not([open]) blockquote::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1.2em;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(31, 41, 55, 0), rgba(31, 41, 55, 0.9));
}

/* fancy lists */
.article-content ul.fancy-list {
  list-style: none;
  padding-left: 0;
}

.article-content ul.fancy-list li {
  position: relative;
  padding-left: 1.5em;
  margin: 0.5em 0;
}

.article-content ul.fancy-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 0.75em;
  height: 0.75em;
  background: var(--color-primary);
  border-radius: 50%;
}

/* Table of contents
   Place <div class="toc"></div> inside article-content.
   JavaScript fills it with a list of all headings. Clicking a link
   smoothly scrolls to the corresponding section. */
.article-content .toc {
  background-color: #1f2937;
  border: 1px solid #374151;
  padding: 1em;
  margin: 1em 0;
  border-radius: 0.5rem;
}
.article-content .toc ul {
  list-style: none;
  padding-left: 0;
}
.article-content .toc li {
  margin: 0.25em 0;
}
.article-content .toc li.level-2 { margin-left: 1em; }
.article-content .toc li.level-3 { margin-left: 2em; }
.article-content .toc li.level-4 { margin-left: 3em; }
.article-content .toc li.level-5 { margin-left: 4em; }
.article-content .toc li.level-6 { margin-left: 5em; }
.article-content .toc a {
  color: var(--color-primary);
  text-decoration: underline;
}

/* zebra table rows */
.article-content tbody tr:nth-child(odd) {
  background-color: #1f2937;
}

/* full screen image viewer */
#image-modal {
  background: rgba(0,0,0,0.8);
}
#image-modal img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 0.5rem;
}
#image-modal button {
  position: absolute;
  top: 1rem;
  right: 1rem;
  color: white;
  background: transparent;
  font-size: 2rem;
}
