/* Blog pages on any landing. Colors and fonts come from the variables each
   page sets in its own <style> (landings/blog_theme.py); the values here are
   only a fallback. */
:root {
  --bg: #FFFFFF;
  --surface: #1F2937;
  --text: #1F2937;
  --muted: #5B6270;
  --heading: #111827;
  --accent: #2563EB;
  --on-accent: #FFFFFF;
  --font-h: system-ui, sans-serif;
  --font-b: Georgia, serif;
  --font-ui: system-ui, sans-serif;
  --h-style: normal;
  --text-soft: color-mix(in srgb, var(--text) 80%, var(--bg));
  --rule: color-mix(in srgb, var(--heading) 18%, transparent);
  --measure: 680px;
  --gutter: clamp(20px, 5vw, 48px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-b);
  font-optical-sizing: auto;
  font-size: 19px;
  line-height: 1.7;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--heading); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--heading); text-decoration-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip {
  position: absolute; left: -9999px; top: 12px;
  background: var(--heading); color: var(--bg); padding: 8px 14px; border-radius: 999px;
  font-family: var(--font-ui); font-size: 14px; text-decoration: none; z-index: 20;
}
.skip:focus { left: 12px; }

/* Nav and footer mirror the home. */
.nav {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px var(--gutter);
  max-width: 1200px; margin: 0 auto;
  font-family: var(--font-ui);
}
.logo { display: inline-flex; align-items: center; gap: 10px; line-height: 1; text-decoration: none; color: var(--text); }
.logo-img { height: 38px; width: auto; border-radius: 6px; flex-shrink: 0; }
.logo-word { font-family: var(--font-h); font-style: var(--h-style); font-weight: 400; font-size: 26px; letter-spacing: -0.01em; }
.is-home .logo-word::after { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); vertical-align: super; margin-left: 3px; }
.nav-right { display: flex; align-items: center; gap: 18px; }
.nav-link { font-size: 14px; font-weight: 500; text-decoration: none; color: var(--text-soft); }
.nav-link[aria-current="page"] { color: var(--heading); text-decoration: underline; text-underline-offset: 6px; text-decoration-color: var(--accent); }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 11px 20px; border-radius: 999px;
  background: var(--accent); color: var(--on-accent);
  font-family: var(--font-ui); font-size: 14px; font-weight: 500; letter-spacing: 0.01em;
  text-decoration: none; border: 1px solid transparent;
  transition: transform .2s ease, background .2s ease;
}
.btn:hover { background: color-mix(in srgb, var(--accent) 88%, #000); color: var(--on-accent); transform: translateY(-1px); }

main { max-width: var(--measure); margin: 0 auto; padding: clamp(28px, 6vw, 64px) var(--gutter) 0; }

/* Post */
.crumbs { font-family: var(--font-ui); font-size: 14px; margin: 0 0 22px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--heading); }
.post-head h1, .index-head h1 {
  font-family: var(--font-h); font-style: var(--h-style); font-weight: 400;
  font-size: clamp(38px, 7vw, 62px); line-height: 1.04; letter-spacing: -0.015em;
  margin: 0 0 20px; color: var(--heading);
}
.deck { font-family: var(--font-ui); font-size: 19px; line-height: 1.55; color: var(--text-soft); margin: 0 0 22px; }
.meta { font-family: var(--font-ui); font-size: 14px; color: var(--muted); margin: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.meta .by { color: var(--text); font-weight: 500; }
.cover { margin: 36px 0 0; }
.cover img { border-radius: 10px; aspect-ratio: 16 / 10; object-fit: cover; }
/* The share image stands in for a missing cover: 1200x630, shown whole. */
.cover-default img { aspect-ratio: 1200 / 630; }

.body { padding-top: 36px; border-top: 1px solid var(--rule); margin-top: 36px; }
.body > :first-child { margin-top: 0; }
.body h2 { font-family: var(--font-h); font-weight: 500; font-size: clamp(27px, 4vw, 33px); line-height: 1.18; margin: 2.2em 0 .6em; color: var(--heading); }
.body h3 { font-family: var(--font-h); font-weight: 600; font-size: 23px; line-height: 1.3; margin: 1.8em 0 .5em; color: var(--heading); }
.body h4 { font-family: var(--font-ui); font-weight: 600; font-size: 16px; margin: 1.6em 0 .4em; }
.body p { margin: 0 0 1.15em; }
.body ul, .body ol { padding-left: 1.3em; margin: 0 0 1.15em; }
.body li { margin-bottom: .35em; }
.body li::marker { color: var(--accent); }
.body blockquote { margin: 1.4em 0; padding: .2em 0 .2em 1.1em; border-left: 3px solid color-mix(in srgb, var(--accent) 55%, var(--bg)); color: var(--text-soft); font-style: italic; }
.body blockquote p:last-child { margin-bottom: 0; }
.body img { border-radius: 8px; margin: 1.5em 0; }
.body figure { margin: 1.5em 0; }
.body figcaption { font-family: var(--font-ui); font-size: 14px; color: var(--muted); margin-top: .5em; }
.body hr { border: 0; border-top: 1px solid var(--rule); margin: 2.4em 0; }
.body table { border-collapse: collapse; width: 100%; margin: 1.4em 0; font-family: var(--font-ui); font-size: 15px; line-height: 1.45; }
.body th, .body td { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.body th { font-weight: 600; color: var(--heading); }
.body code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; background: color-mix(in srgb, var(--heading) 7%, transparent); padding: .1em .35em; border-radius: 4px; }
.body pre { background: var(--surface); color: var(--bg); padding: 16px 18px; border-radius: 8px; overflow-x: auto; font-size: 14px; line-height: 1.5; }
.body pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.body strong { font-weight: 600; }
.body .footnote { font-family: var(--font-ui); font-size: 15px; color: var(--text-soft); }

/* Call to action: an inverted box, the page background as its text color. */
.cta {
  margin: clamp(48px, 8vw, 80px) 0 0;
  padding: 32px clamp(22px, 4vw, 36px);
  background: var(--surface); color: var(--bg);
  border-radius: 14px;
}
.cta-title { font-family: var(--font-h); font-style: var(--h-style); font-weight: 400; font-size: clamp(26px, 4vw, 32px); line-height: 1.15; margin: 0 0 12px; }
.cta p { font-family: var(--font-ui); font-size: 16px; line-height: 1.6; margin: 0 0 20px; color: color-mix(in srgb, var(--bg) 85%, transparent); }

.more { margin-top: clamp(40px, 7vw, 64px); }
.more h2 { font-family: var(--font-h); font-weight: 500; font-size: 24px; margin: 0 0 14px; color: var(--heading); }
.more ul { list-style: none; margin: 0; padding: 0; }
.more li { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; padding: 12px 0; border-top: 1px solid var(--rule); }
.more li a { font-size: 19px; }
.more time { font-family: var(--font-ui); font-size: 13px; color: var(--muted); white-space: nowrap; }

.preview-note {
  font-family: var(--font-ui); font-size: 14px; line-height: 1.5;
  background: #FFF3CD; color: #5c4400; border: 1px solid #f0d58a; border-radius: 8px;
  padding: 12px 16px; margin-bottom: 28px;
}
.preview-note a { color: inherit; }

/* Index */
.index-head { margin-bottom: 8px; }
.entries { list-style: none; margin: 0; padding: 0; }
.entry { display: flex; gap: 24px; align-items: flex-start; padding: 28px 0; border-top: 1px solid var(--rule); }
.entry:last-child { border-bottom: 1px solid var(--rule); }
.entry-text { flex: 1 1 auto; min-width: 0; }
.entry time, .entry .read { font-family: var(--font-ui); font-size: 13px; color: var(--muted); }
.entry h2 { font-family: var(--font-h); font-weight: 500; font-size: clamp(24px, 3.4vw, 30px); line-height: 1.2; margin: 6px 0 10px; }
.entry h2 a { text-decoration: none; color: var(--heading); }
.entry h2 a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.entry p { margin: 0 0 8px; font-size: 17px; line-height: 1.6; color: var(--text-soft); }
.entry-thumb { flex: 0 0 220px; }
.entry-thumb img { border-radius: 8px; aspect-ratio: 16 / 10; object-fit: cover; }
.entry-thumb-default img { aspect-ratio: 1200 / 630; }
.empty { font-family: var(--font-ui); color: var(--text-soft); padding: 32px 0; border-top: 1px solid var(--rule); }

/* Footer */
.foot { max-width: 1200px; margin: clamp(56px, 8vw, 96px) auto 0; padding: 0 var(--gutter) 36px; font-family: var(--font-ui); }
.foot-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; padding-top: 28px; border-top: 1px solid color-mix(in srgb, var(--text) 8%, transparent); }
.foot-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 14px; }
.foot-links a { color: var(--text-soft); text-decoration: none; }
.foot-links a:hover { color: var(--heading); text-decoration: underline; }
.foot-bottom { margin-top: 24px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); letter-spacing: 0.06em; }
.made { display: inline-flex; align-items: center; gap: 8px; }
.sun { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); display: inline-block; }

@media (max-width: 720px) {
  body { font-size: 18px; }
  .logo-img { height: 32px; }
  .logo-word { font-size: 22px; }
  .nav-right { gap: 14px; }
  .btn { padding: 9px 14px; font-size: 13px; }
  .entry { flex-direction: column-reverse; gap: 14px; }
  .entry-thumb { flex-basis: auto; width: 100%; }
  .more li { flex-direction: column; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
  .btn:hover { transform: none; }
}
