/* Shared styles for every post, loaded by layouts/partials/head.html.
   Scoped to the article body so the site header and footer are untouched.
   The theme renders post text as 24px thin gray (font-thin text-gray-500),
   which is hard to read on the dark background; these rules raise contrast
   and tighten the measure. */

.single-article .article-body {
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1.75;
  color: var(--color-gray-300);
  max-width: 56rem;
}

.single-article .article-body p {
  padding: 0;
  margin: 0 0 1.25rem;
}

.single-article .article-body strong {
  font-weight: 700;
  color: var(--color-gray-100);
}

.single-article .article-body em {
  color: var(--color-gray-100);
}

/* Older posts set their own text color inline, e.g. dark text on the light
   Pros/Cons cards. Bold and italic text there must keep that color. */
.single-article .article-body [style*="color"] strong,
.single-article .article-body [style*="color"] em {
  color: inherit;
}

.single-article .article-body a {
  color: var(--color-sky-300, #7dd3fc);
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.single-article .article-body a:hover {
  color: var(--color-sky-200, #bae6fd);
}

/* Headings: same red accent as the mentoring post, so the series looks consistent */
.single-article .article-body h2 {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-gray-100);
  border-left: 3px solid var(--color-red-500);
  padding-left: 12px;
  margin: 2.75rem 0 1rem;
}

.single-article .article-body h3 {
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-gray-300);
  margin: 2rem 0 0.75rem;
}

/* Lists */
.single-article .article-body ul {
  margin: 0 0 1.25rem;
  padding-left: 1.5rem;
}

.single-article .article-body li {
  margin-bottom: 0.5rem;
}

.single-article .article-body li::marker {
  color: var(--color-red-500);
}

/* Tables: full grid lines and a shaded header row */
.single-article .article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0 2rem;
  font-size: 1.05rem;
  line-height: 1.5;
  border: 1px solid var(--color-gray-600);
}

.single-article .article-body th,
.single-article .article-body td {
  border: 1px solid var(--color-gray-600);
  padding: 10px 14px;
  vertical-align: top;
  text-align: left;
}

.single-article .article-body thead th {
  background-color: var(--color-gray-800);
  color: var(--color-gray-100);
  font-weight: 600;
}

.single-article .article-body tbody tr {
  background-color: var(--color-gray-900);
}

.single-article .article-body tbody tr:nth-child(even) {
  background-color: color-mix(in oklch, var(--color-gray-900), var(--color-gray-800));
}

.single-article .article-body tbody td:first-child {
  color: var(--color-gray-100);
  font-weight: 600;
}

/* Code */
.single-article .article-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
  background-color: var(--color-gray-800);
  color: var(--color-gray-100);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}

.single-article .article-body pre {
  margin: 1.25rem 0 1.75rem;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  border: 1px solid var(--color-gray-700);
  overflow-x: auto;
  font-size: 0.95rem;
  line-height: 1.6;
  /* Without this the browser draws a white scrollbar under the dark code block */
  color-scheme: dark;
  scrollbar-color: var(--color-gray-600) transparent;
}

.single-article .article-body pre code {
  background: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

/* Diagram */
.single-article .article-body img[src$=".svg"] {
  display: block;
  margin: 1.5rem 0 2rem;
}

/* Phones: smaller text, and wide tables scroll sideways instead of squeezing */
@media (max-width: 640px) {
  .single-article .article-body {
    font-size: 1.1rem;
  }

  .single-article .article-body h2 {
    font-size: 1.45rem;
  }

  .single-article .article-body table {
    display: block;
    overflow-x: auto;
    font-size: 0.95rem;
  }

  .single-article .article-body th,
  .single-article .article-body td {
    padding: 8px 10px;
  }
}
