/* THE MARK — standalone editorial styling for the server-rendered blog.
   Token values mirror frontend/src/styles/theme.css so the Django-served blog
   matches the SPA's identity without pulling in the Tailwind build. */
:root {
  --bg: #f5f1e8;
  --surface: #efe8d8;
  --text: #111110;
  --muted: #6b6557;
  --gold: #b9780a;
  --verified: #1e7a4d;
  --line: #ddd2bb;
  --font-display: "Fraunces", ui-serif, Georgia, serif;
  --font-sans: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
}
/* Dark mode is class-based (`.dark` on <html>) so the blog honors the SPA's
   explicit theme toggle — set by the inline boot script in base.html, which
   also resolves system preference. Mirrors the SPA's own `.dark` strategy. */
.dark {
  --bg: #0b0b0c;
  --surface: #16151a;
  --text: #f3efe4;
  --muted: #9b9486;
  --gold: #e8b23a;
  --verified: #46b985;
  --line: #2b2a26;
}

* { box-sizing: border-box; }
html {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  color-scheme: light dark;
}
body { margin: 0; min-height: 100dvh; display: flex; flex-direction: column; }
::selection { background: var(--gold); color: var(--bg); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.wrap { width: 100%; max-width: 720px; margin: 0 auto; padding: 0 1.5rem; }
/* Site chrome (masthead + footer) runs wider than the reading column. */
.wrap--wide { max-width: 1180px; }

a { color: inherit; text-decoration: none; }
.prose a { color: var(--gold); text-decoration: underline; text-underline-offset: 2px; }

/* Masthead — mirrors the SPA AppHeader: real wordmark + uppercase nav. */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding-block: 1.25rem; }
.brand { display: inline-flex; align-items: center; color: var(--text); }
/* Match the SPA: header logo is h-12 (48px) → sm:h-18 (72px); footer is h-[42px]. */
.brand svg { display: block; height: 48px; width: auto; }
@media (min-width: 640px) { .site-header .brand svg { height: 72px; } }
.site-nav { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.site-nav a {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--text); transition: color 0.15s ease;
}
.site-nav a:hover, .site-nav a.is-active { color: var(--gold); }

/* Dark/light toggle — sits in the nav; shows the icon for the theme you'll get. */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.25rem; height: 2.25rem; padding: 0; margin: -0.4rem 0;
  background: none; border: 1px solid var(--line); border-radius: 999px;
  color: var(--muted); cursor: pointer; transition: color 0.15s ease, border-color 0.15s ease;
}
.theme-toggle:hover { color: var(--gold); border-color: var(--gold); }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
html.dark .theme-toggle .icon-sun { display: block; }
html.dark .theme-toggle .icon-moon { display: none; }

/* Footer — two tiers: brand + nav, then tagline + legal (mirrors AppFooter). */
.site-footer { border-top: 1px solid var(--line); margin-top: 5rem; }
.site-footer .brand svg { height: 42px; }
.footer-top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 1.5rem; padding-block: 2.5rem;
}
.footer-end { display: flex; flex-direction: column; align-items: flex-start; gap: 0.9rem; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 0.6rem 1.5rem; }
.footer-nav a {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.16em; color: var(--muted); transition: color 0.15s ease;
}
.footer-nav a:hover { color: var(--gold); }
.footer-social { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.footer-social a { display: inline-flex; color: var(--muted); transition: color 0.15s ease; }
.footer-social a:hover { color: var(--gold); }
.footer-social svg { width: 20px; height: 20px; display: block; fill: currentColor; }
@media (min-width: 640px) { .footer-end { align-items: flex-end; } }
.footer-bottom {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.75rem 1.5rem; border-top: 1px solid var(--line); padding-block: 1.5rem 2.5rem;
}
.footer-tagline {
  font-family: var(--font-display); font-style: italic; font-size: 1.05rem;
  color: var(--text); margin: 0;
}
.footer-legal { font-size: 0.72rem; color: var(--muted); margin: 0; letter-spacing: 0.02em; }
.footer-legal .sep { color: var(--line); margin: 0 0.45rem; }

/* Headings */
h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: -0.02em; line-height: 1.1; }
.page-head { padding-block: 3rem 1.5rem; }
.page-head h1 { font-size: clamp(2.5rem, 6vw, 4rem); margin: 0.25rem 0; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.15em; font-size: 0.75rem; color: var(--gold); margin: 0; }
.dek { color: var(--muted); font-size: 1.15rem; line-height: 1.5; }
.muted { color: var(--muted); }

/* Post list */
.post-list { list-style: none; padding: 0; margin: 0; }
.post-card { border-bottom: 1px solid var(--line); padding-block: 1.75rem; }
.post-card h2 { font-size: 1.6rem; margin: 0 0 0.4rem; }
.post-card:hover h2 { color: var(--gold); }
.post-card .dek { font-size: 1rem; margin: 0 0 0.5rem; }
.post-meta { font-size: 0.85rem; color: var(--muted); margin: 0; }
.cat { color: var(--gold); }

/* Single post */
.crumbs { font-size: 0.85rem; color: var(--muted); display: flex; gap: 0.4rem; padding-top: 2rem; }
.crumbs a:hover { color: var(--gold); }
.post-header { padding-block: 1.25rem 2rem; border-bottom: 1px solid var(--line); margin-bottom: 2rem; }
.post-header h1 { font-size: clamp(2.2rem, 5.5vw, 3.4rem); margin: 0.5rem 0; }
.prose { font-size: 1.125rem; line-height: 1.75; }
.prose h2 { font-size: 1.8rem; margin-top: 2.5rem; }
.prose h3 { font-size: 1.4rem; margin-top: 2rem; }
.prose blockquote { border-left: 3px solid var(--gold); margin: 1.5rem 0; padding: 0.25rem 0 0.25rem 1.25rem; color: var(--muted); font-style: italic; }
.prose pre { background: var(--surface); padding: 1rem; border-radius: 6px; overflow-x: auto; font-size: 0.9rem; }
.prose code { background: var(--surface); padding: 0.1em 0.35em; border-radius: 4px; font-size: 0.9em; }
.prose pre code { background: none; padding: 0; }
.prose img { max-width: 100%; height: auto; border-radius: 6px; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 2rem 0 0; margin: 0; }
.tags li { font-size: 0.8rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0.2rem 0.7rem; }

/* Pager */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 2.5rem; font-size: 0.95rem; }
.pager a:hover { color: var(--gold); }
