main {
  padding-top: 2rem;
}

.title {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed var(--line);
}

.title h1,
.title h2,
.title h3 {
  margin: 0 0 0.5rem;
  font-family: var(--title);
  font-weight: 700;
  font-size: clamp(2.1rem, 1.5rem + 2.5vw, 3rem);
  line-height: 1.05;
  color: var(--amber);
  text-shadow: 0 0 8px hsl(39 98% 49% / 0.35);
  text-wrap: balance;
}

.title p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--dim);
}

.title p::before {
  content: "// ";
}

/* ~72 characters per line is the comfortable reading width. */
article {
  max-width: 72ch;
  font-size: 0.95rem;
  line-height: 1.75;
}

/* Headings look like Markdown source: ## / ### prefixes */
article h2,
article h3 {
  margin: 2.5rem 0 0.75rem;
  font-family: var(--title);
  font-weight: 700;
  line-height: 1.1;
  color: var(--green-soft);
}

article h2 { font-size: 1.9rem; }
article h3 { font-size: 1.6rem; }

article h2::before { content: "## "; color: var(--dim); }
article h3::before { content: "### "; color: var(--dim); }

/* CKEditor wraps heading text in <strong>; a synthetic bold pixel font looks smeared. */
article h2 strong,
article h3 strong {
  font-weight: 400;
}

article strong {
  color: #e6ece6;
}

article a {
  color: var(--amber);
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}

article a:hover {
  background: var(--amber);
  color: var(--bg);
  text-decoration: none;
}

article code {
  padding: 0.05rem 0.3rem;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--amber);
  font-family: var(--mono);
  font-size: 0.9em;
}

/*
  Code blocks come from CKEditor as <div style="background-color:#282c34; ...">.
  Inline styles win over normal rules, so !important is the only way to
  re-theme them without editing every post in the database.
*/
article div[style*="background-color"] {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem !important;
  overflow-x: auto;
  border: 1px solid var(--line) !important;
  border-left: 3px solid var(--green-deep) !important;
  background: var(--bg-code) !important;
  color: #b9f5b0 !important;
  font-family: var(--mono) !important;
  font-size: 0.85rem;
  line-height: 1.6;
}

article div[style*="background-color"] code {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
}

article blockquote {
  margin: 1.5rem 0;
  padding: 0.25rem 0 0.25rem 1rem;
  border-left: 2px solid var(--amber);
  color: var(--fg-soft);
}

/* Tables scroll sideways on phones instead of breaking the layout. */
article table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.85rem;
}

article th,
article td {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--line);
}

article th {
  color: var(--amber);
  text-align: left;
}

article ul {
  list-style: "- ";
}

article li::marker {
  color: var(--green-soft);
}

article hr {
  border: 0;
  border-top: 1px dashed var(--line);
}

article img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 2rem auto;
  border: 1px solid var(--line);
}
