/* Shared styles for the blog: /blogs (index) and every post in /blogs/<slug>/.
   Green (personal) theme from docs/design-system.md; course promos use the yellow course tokens. */
:root {
  --ink: #101318;
  --muted: #5b6472;
  --line: #e6e9ee;
  --panel: #f7f8fa;
  --accent: #0f7a5b;
  --accent-dark: #08533e;
  --accent-soft: #eef5f1;
  /* Yellow course theme, only for course promos (links to /learn and /free) */
  --course-accent: #e8a317;
  --course-ink: #8a5d00;
  --course-soft: #fff8e9;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --read: 952px;
}
* { box-sizing: border-box; }
body {
  margin: 0; color: var(--ink); background: #fff;
  font-family: var(--font); font-size: 17px;
  line-height: 1.65; -webkit-text-size-adjust: 100%;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-dark); }
.wrap { max-width: calc(var(--read) + 48px); margin: 0 auto; padding: 0 24px 96px; }
.top { display: flex; justify-content: space-between; gap: 16px; margin: 0; padding: 32px 0 0; font-size: 14px; font-weight: 600; line-height: 1.5; }
.top a { text-decoration: none; }
header.post { padding: 32px 0 8px; }
.meta { font-size: 14px; line-height: 1.5; color: var(--muted); }
h1 { font-size: clamp(36px, 6vw, 56px); font-weight: 800; line-height: 1.08; letter-spacing: -0.03em; margin: 12px 0 16px; }
.dek { font-size: 20px; line-height: 1.5; color: var(--muted); margin: 0 0 8px; }
h2 { font-size: clamp(26px, 3.6vw, 34px); font-weight: 800; line-height: 1.2; letter-spacing: -0.02em; margin: 48px 0 16px; }
h3 { font-size: 20px; font-weight: 700; line-height: 1.3; margin: 32px 0 8px; }
h4 { font-size: 17px; font-weight: 700; line-height: 1.35; margin: 24px 0 8px; }
p, li { font-size: 17px; }
p, ul, ol { margin: 0 0 16px; }
li { margin-bottom: 8px; }
code {
  font-family: var(--mono); font-size: 0.86em;
  background: var(--panel); border: 1px solid var(--line); padding: 1px 5px; border-radius: 6px;
  /* inline code that wraps keeps its box on both lines */
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
pre {
  border: 1px solid var(--line); border-radius: 10px;
  padding: 16px; overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 24px; line-height: 1.5;
  white-space: pre;
  /* Scroll hint: a soft shade on the right edge while there is more code to the right
     (the "local" cover hides it once you reach the end). */
  background:
    linear-gradient(to left, var(--panel) 40%, rgba(247, 248, 250, 0)) right center / 40px 100% no-repeat local,
    linear-gradient(to left, rgba(16, 19, 24, 0.14), rgba(16, 19, 24, 0)) right center / 16px 100% no-repeat scroll,
    var(--panel);
  scrollbar-width: thin; scrollbar-color: var(--muted) transparent;
}
pre::-webkit-scrollbar { height: 6px; }
pre::-webkit-scrollbar-track { background: transparent; }
pre::-webkit-scrollbar-thumb { background: var(--muted); border-radius: 999px; }
pre code { background: none; border: 0; padding: 0; font-size: 14px; }
.table-scroll { overflow-x: auto; margin: 0 0 24px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.5; }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
td:first-child { white-space: nowrap; }
.video { display: flex; justify-content: center; margin: 32px 0 8px; }
.video iframe { border: 0; border-radius: 20px; background: var(--panel); max-width: 100%; }
/* Reels are 9:16. When a phone is narrower than the embed, shrink the height with the width
   so the reel keeps its shape instead of leaving an empty grey strip. */
.video iframe[height="533"] { height: auto; aspect-ratio: 300 / 533; }
.video-note { text-align: center; font-size: 14px; line-height: 1.5; color: var(--muted); margin-bottom: 32px; }
.callout {
  margin: 24px 0; padding: 16px 24px; border-radius: 14px;
  background: var(--panel); border-left: 3px solid var(--accent);
}
.callout p:last-child { margin: 0; }
.cta {
  margin-top: 48px; padding: 24px; border-radius: 14px;
  background: var(--accent-soft); border: 1px solid var(--line);
}
.cta p { margin: 0 0 8px; }
.cta p:last-child { margin: 0; }

/* Course promos (links to the course and the free guide) use the yellow course theme. */
a[href^="/learn"], a[href^="/free"] {
  color: var(--course-ink); background: var(--course-soft);
  box-shadow: inset 0 -2px 0 var(--course-accent);
  padding: 0 4px; border-radius: 6px; font-weight: 600; text-decoration: none;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
a[href^="/learn"]:hover, a[href^="/free"]:hover { color: var(--ink); box-shadow: inset 0 -3px 0 var(--course-accent); }


@media (max-width: 600px) {
  .top { padding-top: 24px; }
  .dek { font-size: 17px; }
  /* Let the first column wrap so the description column is not squeezed to 2-3 words a line */
  td:first-child { white-space: normal; min-width: 7em; }
  td code { overflow-wrap: anywhere; }
  th, td { padding: 12px 8px; }
  th:first-child, td:first-child { padding-left: 0; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px 64px; }
}
