/* Ultimate TTX blog.

   The palette tokens are the same names the Django templates use in
   _site_palette.html, redeclared here because this is a separate static site
   that does not include a Django partial. Keep the values in step: if one
   moves, both move. New rules use the --site-* names rather than the legacy
   positional ramp. */
:root {
  --site-background: #f8fafc;
  --site-surface: #ffffff;
  --site-muted: #f1f5f9;
  --site-ink: #0f172a;
  --site-secondary: #475569;
  --site-brand: #2563eb;
  --site-brand-dark: #1d4ed8;
  --site-border: #cbd5e1;
  --site-max: 46rem;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0 auto;
  padding: 16px;
  max-width: var(--site-max);
  background: var(--site-background);
  color: var(--site-ink);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Matches the .sitenav rules in templates/_site_nav.html. */
.sitenav {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 0 0 14px; padding: 10px;
  background: rgba(203, 213, 225, .45);
  border: 1px solid rgba(15, 23, 42, .24);
  border-radius: 10px;
}
.sitenav img { height: 34px; width: auto; object-fit: contain; }
.sitenav .sitenav-name { font-size: 14px; font-weight: 700; color: var(--site-ink); }
.sitenav nav { margin-left: auto; display: flex; gap: 14px; flex-wrap: wrap; }
.sitenav nav a { font-size: 14px; color: var(--site-brand-dark); text-decoration: none; }
.sitenav nav a:hover, .sitenav nav a:focus { text-decoration: underline; }
.sitenav nav a[aria-current="page"] { font-weight: 700; text-decoration: underline; }
@media (max-width: 38rem) { .sitenav nav { margin-left: 0; width: 100%; } }

main { background: var(--site-surface); border: 1px solid var(--site-border);
       border-radius: 10px; padding: 20px 24px; }

h1 { font-size: 1.7rem; line-height: 1.25; margin: 0 0 .4em; }
h2 { font-size: 1.25rem; margin: 1.8em 0 .4em; }
h3 { font-size: 1.05rem; margin: 1.5em 0 .4em; }
p, ul, ol, blockquote { margin: 0 0 1em; }
li { margin: 0 0 .35em; }

a { color: var(--site-brand-dark); }
a:hover, a:focus { color: var(--site-brand); }

.masthead { border-bottom: 1px solid var(--site-border); margin-bottom: 1.2em; }
.subtitle { color: var(--site-secondary); margin-bottom: 1em; }

.meta { color: var(--site-secondary); font-size: .875rem; margin: 0 0 1.2em; }
.tag { white-space: nowrap; }

.postlist { list-style: none; padding: 0; }
.postlist > li { border-bottom: 1px solid var(--site-border); padding-bottom: 1em; margin-bottom: 1.4em; }
.postlist > li:last-child { border-bottom: 0; }
.postlist h2 { margin-top: 0; }
.postlist h2 a { text-decoration: none; }
.postlist h2 a:hover, .postlist h2 a:focus { text-decoration: underline; }

blockquote { border-left: 3px solid var(--site-border); margin-left: 0;
             padding: .2em 0 .2em 1em; color: var(--site-secondary); }
code { background: var(--site-muted); padding: .1em .3em; border-radius: 4px;
       font-size: .9em; }
pre { background: var(--site-muted); padding: 12px; border-radius: 8px; overflow-x: auto; }
pre code { background: none; padding: 0; }

table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
th, td { border: 1px solid var(--site-border); padding: 6px 10px; text-align: left; }
th { background: var(--site-muted); }

img { max-width: 100%; height: auto; }

.pagination { display: flex; gap: 16px; }
.backlink { margin-top: 1.5em; }

footer { color: var(--site-secondary); font-size: .875rem; padding: 14px 4px; }
footer a { color: var(--site-brand-dark); }
