/* Blog styles: a light, easy-to-read page with the main site's dark header, Poppins and green accent. */
:root {
  color-scheme: light;
  --bg-color: #ffffff;
  --card: #f7f8f7;
  --code-bg: #16181a;
  --hl-color: #60d937;      /* bright brand green: bars, borders, bullets */
  --hl-text: #0f6b00;       /* darker green for text and links on white */
  --text-color: #111111;
  --body-text: #1f1f1f;
  --secondary-text-color: #555555;
  --grey: #d9dcd9;
  --tok-keyword: #6cb6ff;
  --tok-type: #4ec9b0;
  --tok-string: #e5c07b;
  --tok-comment: #8a9a8a;
  --tok-number: #d7a0ff;
  --tok-method: #dcdcaa;
  --tok-attr: #9cdcfe;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { background-color: var(--bg-color); }
body {
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  color: var(--text-color);
  line-height: 1.65;
  padding-bottom: 48px;
}
::selection { background-color: var(--hl-color); color: #000; }
a { color: var(--hl-text); }
a:hover { color: #0a4d00; }

/* The site header lives in /css/site.css, shared with the study kit. */
main, footer { max-width: var(--page-max, 1440px); margin: 0 auto; padding-left: var(--gutter, 16px); padding-right: var(--gutter, 16px); }
footer {
  margin-top: 64px; padding-top: 18px;
  background: linear-gradient(var(--grey), var(--grey)) var(--gutter, 16px) 0 / calc(100% - 2 * var(--gutter, 16px)) 1px no-repeat;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 14px; color: var(--secondary-text-color);
}

/* page intro */
main { display: flex; flex-direction: column; gap: 44px; padding-top: 40px; }
.intro { display: flex; flex-direction: column; gap: 16px; }
.eyebrow { color: var(--hl-text); font-size: 14px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; text-decoration: none; }
h1 {
  font-size: clamp(32px, 5.5vw, 46px); line-height: 1.2; font-weight: 700; text-wrap: balance;
  border-bottom: 4px solid var(--hl-color); padding-bottom: 12px;
}
.intro p { color: var(--secondary-text-color); max-width: 75ch; }
.intro .lead { color: var(--body-text); font-size: 20px; font-weight: 400; }
.meta { font-size: 15px; }
.badge {
  display: inline-block; margin-left: 6px; padding: 0 8px; border-radius: 20px;
  font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: #000; background: #f2cf73;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.chips a {
  display: inline-block; font-size: 14px; padding: 3px 14px; border: 1px solid #c4c8c4;
  border-radius: 20px; color: var(--secondary-text-color); text-decoration: none; background: #fff;
}
.chips a:hover, .chips a[aria-current] { border-color: var(--hl-text); color: var(--hl-text); background: #60d93714; }

/* post lists */
section { display: flex; flex-direction: column; gap: 18px; }
h2 { font-size: 20px; font-weight: 600; color: var(--text-color); display: flex; align-items: center; gap: 12px; }
section > h2::after { content: ""; flex: 1; height: 1px; background: var(--grey); }
.posts { list-style: none; display: flex; flex-direction: column; border-top: 1px solid var(--grey); }
.post-row {
  position: relative; display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 24px;
  padding: 22px 16px; margin: 0 -16px; border-bottom: 1px solid var(--grey);
  transition: background-color .15s ease-in;
}
.post-row:hover { background: var(--card); }
.post-row .date {
  display: flex; flex-direction: column; align-items: center; justify-content: center; align-self: start;
  padding: 8px 0; border: 1px solid var(--grey); border-top: 4px solid var(--hl-color); border-radius: 8px; background: #fff;
  line-height: 1.1; text-transform: uppercase;
}
.post-row .mon { font-size: 12.5px; font-weight: 600; letter-spacing: .08em; color: var(--hl-text); }
.post-row .day { font-size: 28px; font-weight: 700; color: var(--text-color); }
.post-row .dow { font-size: 11.5px; letter-spacing: .08em; color: var(--secondary-text-color); }
.row-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.row-body h3 { font-size: 22px; font-weight: 600; line-height: 1.3; }
.row-body h3 a { color: var(--text-color); text-decoration: none; }
.row-body h3 a::after { content: ""; position: absolute; inset: 0; }
.post-row:hover h3 a { color: var(--hl-text); }
.row-body h3 a:focus-visible { outline: none; }
.row-body h3 a:focus-visible::after { outline: 3px solid var(--hl-color); outline-offset: -3px; }
.row-body p { color: var(--secondary-text-color); font-size: 16.5px; max-width: 90ch; }
.row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13.5px; color: var(--secondary-text-color); margin-top: 2px; }
.row-meta .tag { font-size: 12.5px; color: var(--hl-text); background: #60d93722; border-radius: 8px; padding: 1px 8px; }
.row-meta .badge { margin-left: 0; }
.empty { color: var(--secondary-text-color); }
a.card {
  display: flex; flex-direction: column; gap: 8px; height: 100%; padding: 22px;
  background: var(--card); border: 1px solid var(--grey); border-radius: 12px;
  color: inherit; text-decoration: none; transition: border-color .2s ease-in, transform .2s ease-in, box-shadow .2s ease-in;
}
a.card:hover { border-color: var(--hl-color); transform: translateY(-2px); box-shadow: 0 6px 18px #0000000f; color: inherit; }
a.card:focus-visible { outline: 3px solid var(--hl-color); outline-offset: 3px; }

/* article */
/* Posts use the full page width, like the rest of the site; the table of contents stays at the top. */
.post article, .post .pager { width: 100%; }
.post article { display: flex; flex-direction: column; gap: 36px; }
.toc { border-left: 4px solid var(--hl-color); padding: 4px 0 4px 18px; font-size: 16px; }
.toc span { color: var(--secondary-text-color); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.toc ol { list-style: none; display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.toc a { text-decoration: none; color: var(--body-text); }
.toc a:hover { color: var(--hl-text); text-decoration: underline; }

.prose { font-size: 19px; line-height: 1.75; color: var(--body-text); display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.prose h2, .prose h3, .prose h4 { position: relative; scroll-margin-top: 100px; color: var(--text-color); line-height: 1.3; }
.prose h2 { font-size: 28px; font-weight: 700; margin-top: 22px; }
.prose h3 { font-size: 22px; font-weight: 600; margin-top: 10px; }
.prose h4 { font-size: 19px; font-weight: 600; }
.prose .anchor { position: absolute; left: -1em; width: 1em; opacity: 0; text-decoration: none; color: var(--hl-text); font-weight: 400; }
.prose h2:hover .anchor, .prose h3:hover .anchor, .prose h4:hover .anchor { opacity: 1; }
.prose strong { color: var(--text-color); font-weight: 600; }
.prose a { text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 1.4em; display: flex; flex-direction: column; gap: 8px; }
.prose ul { list-style: disc; }
.prose li::marker { color: var(--hl-text); }
.prose blockquote {
  border-left: 4px solid var(--hl-color); background: #60d9371c; border-radius: 0 8px 8px 0;
  padding: 14px 18px; display: flex; flex-direction: column; gap: 10px;
}
.prose hr { border: 0; border-top: 1px solid var(--grey); margin: 8px 0; }
.prose img { max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--grey); }
.prose code {
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  font-size: .85em; color: #0b3d02; background: #eef3ec; border: 1px solid #dde5da; border-radius: 5px; padding: .08em .35em;
}
/* Code blocks stay dark: the syntax colors read best there and they stand out from the text. */
.prose pre {
  position: relative; background: var(--code-bg); border: 1px solid #16181a; border-radius: 10px;
  padding: 18px; overflow-x: auto; line-height: 1.6; font-size: 15.5px;
}
.prose pre[data-lang] { padding-top: 32px; }
.prose pre[data-lang]::before {
  content: attr(data-lang); position: absolute; top: 7px; right: 12px;
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #9a9a9a;
}
.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; color: #e8e8e8; }
.table-wrap { overflow-x: auto; }
.prose table { border-collapse: collapse; width: 100%; font-size: 17px; }
.prose th, .prose td { border-bottom: 1px solid var(--grey); padding: 10px 12px; text-align: left; vertical-align: top; }
.prose th { color: var(--text-color); font-weight: 600; border-bottom: 2px solid var(--hl-color); }

.tok-keyword { color: var(--tok-keyword); }
.tok-type { color: var(--tok-type); }
.tok-string { color: var(--tok-string); }
.tok-comment { color: var(--tok-comment); font-style: italic; }
.tok-number { color: var(--tok-number); }
.tok-method { color: var(--tok-method); }
.tok-attr, .tok-tag { color: var(--tok-attr); }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; border-top: 1px solid var(--grey); padding-top: 28px; }
.pager .dir { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--hl-text); }
.pager .next { text-align: right; }

@media (max-width: 600px) {
  .post-row { grid-template-columns: 60px minmax(0, 1fr); gap: 16px; padding: 18px 16px; }
  .post-row .day { font-size: 24px; }
  .row-body h3 { font-size: 19px; }
  .row-body p { font-size: 15.5px; }
  body { font-size: 16.5px; }
  .pager { grid-template-columns: 1fr; }
  .prose { font-size: 18px; }
  .prose pre { font-size: 14.5px; }
  .prose .anchor { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  a.card, .post-row { transition: none; }
  a.card:hover { transform: none; }
}
