/* ============================================================
   Scrivick Blog — Shared Stylesheet
   ============================================================
   Vanilla CSS with zero external dependencies.
   To customize: override any variable in :root, or add your
   own rules after this stylesheet in a custom.css file.
   ============================================================ */

/* ============================================================
   TOKENS — override these to retheme the whole site
   ============================================================ */
:root {
  /* Fonts — system stacks, no network requests */
  --font-body:    ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
  --font-ui:      system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono:    ui-monospace, "SF Mono", SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* Sizes */
  --font-size-base:  19px;
  --font-size-mono:  15px;
  --line-height:     1.75;
  --sidebar-width:   220px;
  --content-max:     800px;

  /* Neutral hue — the background/text/border tint. A colour scheme retints the
     whole neutral palette by overriding just this (see the data-scheme blocks). */
  --neutral-hue: 250;

  /* Accent color */
  --accent:        oklch(52% 0.18 255);
  --accent-hover:  oklch(45% 0.18 255);
  --accent-soft:   oklch(52% 0.18 255 / 0.12);

  /* Light mode palette */
  --color-bg:           oklch(99% 0.004 var(--neutral-hue));
  --color-bg-sidebar:   oklch(93.5% 0.009 var(--neutral-hue));
  --color-bg-code:      #0d1117;
  --color-text:         oklch(15% 0.01 var(--neutral-hue));
  --color-text-muted:   oklch(48% 0.01 var(--neutral-hue));
  --color-text-sidebar: oklch(30% 0.01 var(--neutral-hue));
  --color-border:       oklch(88% 0.01 var(--neutral-hue));
  --color-border-faint: oklch(93% 0.007 var(--neutral-hue));
  --color-tag-bg:       oklch(92% 0.01 var(--neutral-hue));
  --color-tag-text:     oklch(38% 0.01 var(--neutral-hue));
}

/* ============================================================
   COLOUR SCHEMES — switch via <html data-scheme="...">, chosen
   per site on the dashboard Settings page (the Scheme model in
   app/src/scheme.php lists the same keys). Each scheme retints
   the accent and the neutral background hue; the light/dark
   lightness + chroma come from the palette blocks above/below.
   ============================================================ */
:root[data-scheme="blue"]   { --neutral-hue: 250; --accent: oklch(54% 0.18 250); --accent-hover: oklch(46% 0.18 250); --accent-soft: oklch(54% 0.18 250 / 0.13); }
:root[data-scheme="violet"] { --neutral-hue: 312; --accent: oklch(52% 0.21 312); --accent-hover: oklch(44% 0.21 312); --accent-soft: oklch(52% 0.21 312 / 0.13); }
:root[data-scheme="rose"]   { --neutral-hue: 350; --accent: oklch(58% 0.2 350);  --accent-hover: oklch(50% 0.2 350);  --accent-soft: oklch(58% 0.2 350 / 0.13); }
:root[data-scheme="red"]    { --neutral-hue: 22;  --accent: oklch(52% 0.22 22);  --accent-hover: oklch(44% 0.22 22);  --accent-soft: oklch(52% 0.22 22 / 0.13); }
:root[data-scheme="amber"]  { --neutral-hue: 68;  --accent: oklch(66% 0.16 68);  --accent-hover: oklch(58% 0.16 68);  --accent-soft: oklch(66% 0.16 68 / 0.13); }
:root[data-scheme="lime"]   { --neutral-hue: 108; --accent: oklch(63% 0.17 108); --accent-hover: oklch(55% 0.17 108); --accent-soft: oklch(63% 0.17 108 / 0.13); }
:root[data-scheme="green"]  { --neutral-hue: 150; --accent: oklch(53% 0.17 150); --accent-hover: oklch(45% 0.17 150); --accent-soft: oklch(53% 0.17 150 / 0.13); }
:root[data-scheme="teal"]   { --neutral-hue: 195; --accent: oklch(57% 0.14 195); --accent-hover: oklch(49% 0.14 195); --accent-soft: oklch(57% 0.14 195 / 0.13); }

/* Dark mode — auto (follows OS) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg:           oklch(16% 0.012 var(--neutral-hue));
    --color-bg-sidebar:   oklch(10.5% 0.014 var(--neutral-hue));
    --color-text:         oklch(90% 0.008 var(--neutral-hue));
    --color-text-muted:   oklch(58% 0.01 var(--neutral-hue));
    --color-text-sidebar: oklch(75% 0.01 var(--neutral-hue));
    --color-border:       oklch(25% 0.01 var(--neutral-hue));
    --color-border-faint: oklch(20% 0.01 var(--neutral-hue));
    --color-tag-bg:       oklch(22% 0.01 var(--neutral-hue));
    --color-tag-text:     oklch(65% 0.01 var(--neutral-hue));
  }
}
/* Dark mode — forced */
:root[data-theme="dark"] {
  --color-bg:           oklch(16% 0.012 var(--neutral-hue));
  --color-bg-sidebar:   oklch(10.5% 0.014 var(--neutral-hue));
  --color-text:         oklch(90% 0.008 var(--neutral-hue));
  --color-text-muted:   oklch(58% 0.01 var(--neutral-hue));
  --color-text-sidebar: oklch(75% 0.01 var(--neutral-hue));
  --color-border:       oklch(25% 0.01 var(--neutral-hue));
  --color-border-faint: oklch(20% 0.01 var(--neutral-hue));
  --color-tag-bg:       oklch(22% 0.01 var(--neutral-hue));
  --color-tag-text:     oklch(65% 0.01 var(--neutral-hue));
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: var(--font-size-base);
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: var(--line-height);
  min-height: 100vh;
  display: flex;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s, color 0.2s;
}

::selection {
  background: var(--accent-soft);
}

a {
  color: var(--accent);
}

/* ============================================================
   LAYOUT — sidebar + main
   ============================================================ */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--color-bg-sidebar);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  padding: 2.5rem 1.5rem 2rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition: background 0.2s, border-color 0.2s;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Wraps mobile nav + main on small screens; flex child of body */
.mobile-layout {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.content {
  max-width: var(--content-max);
  width: 100%;
  padding: 3.5rem 2.5rem 4rem;
  margin: 0 auto;
  flex: 1;
}

/* ============================================================
   CONTENT MASTHEAD — the site title at the top of every page's
   content column (a link home), distinct from the sidebar brand.
   On the home page it is the page <h1>; elsewhere a plain link.
   ============================================================ */
.content-masthead {
  display: block;
  font-family: var(--font-ui);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--color-border-faint);
}
.content-masthead,
.content-masthead a {
  color: var(--color-text);
  text-decoration: none;
  transition: color 0.12s;
}
a.content-masthead:hover,
.content-masthead a:hover {
  color: var(--accent);
}

/* ============================================================
   SIDEBAR CONTENTS
   ============================================================ */
.sidebar-brand {
  font-family: var(--font-ui);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin-bottom: 0.35rem;
  display: block;
}
.sidebar-brand:hover {
  color: var(--accent);
}

.sidebar-tagline {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--color-text-sidebar);
  margin-bottom: 2rem;
}

.sidebar-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
}

.sidebar-nav a {
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-sidebar);
  text-decoration: none;
  padding: 0.35rem 0.6rem;
  border-radius: 5px;
  display: block;
  transition: background 0.12s, color 0.12s;
}
.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border-faint);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ============================================================
   SIDEBAR SOCIAL ICONS
   ============================================================ */
.sidebar-social {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding-top: 1rem;
}

.sidebar-social a {
  color: var(--color-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  transition: color 0.12s, background 0.12s;
}
.sidebar-social a:hover {
  color: var(--accent);
  background: var(--accent-soft);
}
.sidebar-social svg {
  width: 17px;
  height: 17px;
  display: block;
}

/* ============================================================
   THEME TOGGLE BUTTON
   ============================================================ */
.theme-toggle {
  background: none;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: 6px;
  padding: 0.3rem 0.5rem;
  font-size: 0.75rem;
  font-family: var(--font-ui);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: border-color 0.15s, color 0.15s;
}
.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--color-border-faint);
  padding: 1.5rem 2.5rem;
  max-width: var(--content-max);
  width: 100%;
  margin: 0 auto;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--color-text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: center;
}

.site-footer a {
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.site-footer a:hover {
  color: var(--accent);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1rem;
}
.footer-links svg {
  width: 16px;
  height: 16px;
  display: block;
}

/* ============================================================
   PAGE & POST HEADERS
   ============================================================ */
.page-header {
  padding-bottom: 1.8rem;
  border-bottom: 1px solid var(--color-border-faint);
  margin-bottom: 2.2rem;
}

.page-header h1 {
  font-family: var(--font-ui);
  font-size: 2.2rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--color-text);
  margin-bottom: 0;
}

/* "All Tags" link in a page header (the /blog/ index and tag archives). */
.page-header-tags-link {
  margin: 0.6rem 0 0;
  font-family: var(--font-ui);
  font-size: 0.85rem;
}
.page-header-tags-link a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.page-header-tags-link a:hover {
  color: var(--accent-hover);
}

/* Post meta line (date · read time · tags) */
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  font-family: var(--font-ui);
  font-size: 0.83rem;
  color: var(--color-text-muted);
  margin-top: 0.75rem;
}
.post-meta-sep {
  color: var(--color-border);
}

/* Tag row, shown in the post header just below the date/author. The .tag pills
   are styled in the TAGS section; .post-tags only lays them out. */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.85rem;
}

/* ============================================================
   PROSE — readable body content
   ============================================================ */
/* Body copy a touch larger than the surrounding UI; headings keep their own
   rem sizes below, so only paragraphs/lists/inline scale with this. */
.prose {
  font-size: 1.12rem;
}
.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  font-family: var(--font-ui);
  font-weight: 600;
  line-height: 1.25;
  color: var(--color-text);
  letter-spacing: -0.02em;
  margin-bottom: 0.6em;
}
.prose h1 { font-size: 2.1rem; margin-top: 0; }
.prose h2 { font-size: 1.55rem; margin-top: 1.8em; }
.prose h3 { font-size: 1.25rem; margin-top: 1.45em; }
.prose h4 { font-size: 1rem;   margin-top: 1.5em; }

.prose p {
  margin-bottom: 1.3em;
}
.prose p:last-child {
  margin-bottom: 0;
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in oklch, currentColor 75%, var(--color-text-muted));
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  padding: 0 2px;
  border-radius: 3px;
  transition: color 0.15s, background-color 0.15s, text-decoration-color 0.15s, text-decoration-thickness 0.15s;
}
.prose a:visited {
  color: color-mix(in oklch, var(--accent) 68%, var(--color-text-muted));
  text-decoration-color: currentColor;
}
.prose a:hover,
.prose a:focus-visible {
  color: var(--accent-hover);
  background-color: var(--accent-soft);
  text-decoration-color: currentColor;
  text-decoration-thickness: 2px;
}

.prose strong { font-weight: 600; }
.prose em     { font-style: italic; }

.prose ul,
.prose ol {
  padding-left: 1.5em;
  margin-bottom: 1.3em;
}
.prose li {
  margin-bottom: 0.4em;
}

.prose hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2.5em 0;
}

.prose blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.2em 0 0.2em 1.2em;
  margin: 1.5em 0;
  color: var(--color-text-muted);
  font-style: italic;
}

/* Tables (GFM): distinct header, subtle zebra striping, subtle hover */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.8em 0;
  font-size: 0.95em;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
}
.prose th,
.prose td {
  padding: 0.6em 0.9em;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--color-border-faint);
}
.prose thead th {
  background: var(--color-border);
  font-weight: 600;
  color: var(--color-text);
  border-bottom: 2px solid var(--color-text-muted);
}
.prose tbody tr:nth-child(even) {
  background: var(--color-border-faint);
}
.prose tbody tr:hover {
  background: var(--accent-soft);
}
.prose tbody tr:last-child td {
  border-bottom: none;
}

/* Inline code */
.prose code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  background: var(--color-tag-bg);
  color: var(--color-text);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  border: 1px solid var(--color-border-faint);
}

/* Code blocks */
.prose pre {
  background: var(--color-bg-code);
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.8em 0;
  font-size: var(--font-size-mono);
  line-height: 1.6;
  border: 1px solid oklch(25% 0.01 250);
}
.prose pre code {
  font-family: var(--font-mono);
  background: none;
  border: none;
  padding: 1.25rem 1.4rem;
  font-size: inherit;
  color: #e6edf3;
  display: block;
}

/* Video embeds: a poster (one thumbnail, no player code) that swaps in an
   autoplaying player on click via assets/scrivick.js. Responsive 16:9; with no
   JavaScript the poster is just a link to the video. */
.prose .youtube-embed {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 1.8em 0;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}
.prose .youtube-embed__cover {
  display: block;
  width: 100%;
  height: 100%;
}
.prose .youtube-embed img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  margin: 0;
  border: 0;
  border-radius: 0;
}
.prose .youtube-embed__play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 68px;
  height: 48px;
  pointer-events: none;
  opacity: 0.85;
  transition: opacity 0.15s;
}
.prose .youtube-embed__cover:hover .youtube-embed__play {
  opacity: 1;
}
.prose .youtube-embed__play svg {
  display: block;
  width: 100%;
  height: 100%;
}
.prose .youtube-embed iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Images */
.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  display: block;
  margin: 1.8em auto;
  border: 1px solid var(--color-border-faint);
}
.prose figure {
  margin: 1.8em auto;
  text-align: center;
}
.prose figure img {
  margin: 0 auto;
}
.prose figcaption {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--color-text-muted);
  text-align: center;
  margin-top: 0.6em;
}

/* ============================================================
   CODE BLOCK WRAPPER (copy button)
   ============================================================ */
.code-block-wrap {
  position: relative;
  margin: 1.8em 0;
}
.code-block-wrap pre {
  margin: 0;
}

/* Selecting code: the dark code background washes out the browser's default
   selection colour and the inline-styled token colours, so give code blocks a
   high-contrast selection of their own (light text on a clearly visible blue).
   ::selection cannot be combined in a list with other selectors, so the inline
   and block cases are written out separately. */
.prose pre ::selection,
.prose pre code::selection {
  background: #2d4f7c;
  color: #ffffff;
}
.prose pre ::-moz-selection,
.prose pre code::-moz-selection {
  background: #2d4f7c;
  color: #ffffff;
}

.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: oklch(25% 0.01 250);
  border: 1px solid oklch(32% 0.01 250);
  color: oklch(65% 0.01 250);
  font-family: var(--font-ui);
  font-size: 0.7rem;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
}
.code-block-wrap:hover .copy-btn,
.copy-btn:focus-visible {
  opacity: 1;
}
.copy-btn:hover {
  background: oklch(32% 0.01 250);
  color: #fff;
}
.copy-btn.copied {
  color: oklch(70% 0.15 155);
}

/* ============================================================
   TAGS
   ============================================================ */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 500;
  background: var(--color-tag-bg);
  color: var(--color-tag-text);
  padding: 0.2rem 0.55rem;
  border-radius: 100px;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: background 0.12s, color 0.12s;
}
.tag:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

/* All-tags index page: sorting controls + responsive card grid. */
.tag-index-wrap {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tag-index-sort {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-ui);
}

.tag-index-sort-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.tag-index-sort-btn {
  appearance: none;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: transparent;
  color: var(--color-text-sidebar);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  padding: 0.35rem 0.8rem;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.tag-index-sort-btn:hover,
.tag-index-sort-btn.is-active {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent);
}

.tag-index {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.85rem;
}

.tag-index-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.9rem 1.1rem;
  background: var(--color-tag-bg);
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.12s;
}

.tag-index-item:hover {
  background: var(--accent-soft);
}

.tag-index-name {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
  transition: color 0.12s;
}

.tag-index-item:hover .tag-index-name {
  color: var(--accent);
}

.tag-index-count {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

.tag-index-sort-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

   ============================================================ */
.bio {
  padding: 1.5rem 0 2.2rem;
  border-bottom: 1px solid var(--color-border-faint);
  margin-bottom: 3.75rem;
  font-family: var(--font-ui);
  font-size: 1rem;
  color: var(--color-text-muted);
  line-height: 1.7;
}
.bio p {
  max-width: 52ch;
  margin-bottom: 0.75rem;
}
.bio p:last-child {
  margin-bottom: 0;
}

/* Compact list label (e.g. "Recent Posts" on the home page) -- a quiet section
   heading rather than the big .page-header h1 the archive pages use. */
.section-heading {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-top: 1rem;
  margin-bottom: 0.9rem;
}

.year-group {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  padding: 2rem 0 0.5rem;
}
.year-group:first-of-type {
  padding-top: 0;
}

.post-list {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.post-list-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--color-border-faint);
  text-decoration: none;
}
.post-list-item:first-child {
  border-top: 1px solid var(--color-border-faint);
}

.post-list-title {
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.3;
  letter-spacing: -0.01em;
  transition: color 0.12s;
}
.post-list-item:hover .post-list-title {
  color: var(--accent);
}

/* Title + tags stack in the left column */
.post-list-main {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

.post-list-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.post-list-tag {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--color-tag-text);
  background: var(--color-tag-bg);
  padding: 0.1rem 0.5rem;
  border-radius: 100px;
  transition: background 0.12s, color 0.12s;
}
.post-list-item:hover .post-list-tag {
  background: var(--accent-soft);
  color: var(--accent);
}

.post-list-date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

/* "All Posts" link below the home page's recent-posts list. */
.post-list-more {
  margin-top: 1.5rem;
}
.post-list-more a {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 500;
}

/* ============================================================
   POST FOOTER
   ============================================================ */
.post-footer {
  margin-top: 3.5rem;
  padding-top: 1.8rem;
  border-top: 1px solid var(--color-border-faint);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-ui);
  font-size: 0.875rem;
  color: var(--color-text-muted);
  text-decoration: none;
  margin-top: 1.5rem;
  transition: color 0.12s;
}
.back-link::before {
  content: "←";
}
.back-link:hover {
  color: var(--accent);
}

/* ============================================================
   STATIC PAGE — contact list
   ============================================================ */
.contact-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1.2em 0;
}
.contact-list li {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  font-family: var(--font-ui);
  font-size: 0.9rem;
}
.contact-label {
  font-weight: 500;
  color: var(--color-text-muted);
  min-width: 90px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================================
   MOBILE NAV
   ============================================================ */
.mobile-nav-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  background: var(--color-bg-sidebar);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
}

.mobile-brand {
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
}

.mobile-nav-toggle {
  background: none;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
}

.mobile-drawer {
  display: none;
  flex-direction: column;
  background: var(--color-bg-sidebar);
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 1.2rem 1.5rem;
  gap: 0.1rem;
}
.mobile-drawer.open {
  display: flex;
}
.mobile-drawer a {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-sidebar);
  text-decoration: none;
  padding: 0.45rem 0.5rem;
  border-radius: 5px;
  transition: background 0.12s, color 0.12s;
}
.mobile-drawer a:hover,
.mobile-drawer a.active {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
/* Roomier reading column + slightly larger type on wide viewports. */
@media (min-width: 1280px) {
  :root {
    --content-max:    900px;
    --font-size-base: 20px;
  }
}

@media (max-width: 768px) {
  body {
    flex-direction: column;
  }
  .sidebar {
    display: none;
  }
  .mobile-nav-bar {
    display: flex;
  }
  .content {
    padding: 2rem 1.25rem 3rem;
  }
  .site-footer {
    padding: 1.25rem 1.25rem;
  }
  .content-masthead {
    font-size: 1.2rem;
    padding-bottom: 0.9rem;
  }
  .page-header h1,
  .prose h1 {
    font-size: 1.75rem;
  }
  .prose h2 {
    font-size: 1.3rem;
  }
}

@media (max-width: 480px) {
  .content {
    padding: 1.5rem 1rem 2.5rem;
  }
  :root {
    --font-size-base: 18px;
  }
}
