/* TruthBear blog - warm paper, borrowed from the What Matters palette.
   Essays, not HUD: serif body, one readable column, gold as the only accent.
   The pixel face appears exactly once, on the masthead. */

@font-face {
  font-family: "Press Start 2P";
  src: url("../fonts/PressStart2P-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  --paper: #fdf6dd;
  --ink: #3a3826;
  --ink-soft: #6b6a4e;
  --line: #cfc49b;
  --gold-deep: #e0a028;
  --link: #7a5a10;
}

/* Light is the default for everyone - the site controls its aesthetics.
   Dark is an explicit choice (the masthead button), remembered per browser,
   for readers avoiding a bright screen at night. Never driven by the OS. */
:root[data-theme="dark"] {
  --paper: #211f16;
  --ink: #e6ddbd;
  --ink-soft: #a89f7c;
  --line: #4a4635;
  --gold-deep: #e0a028;
  --link: #ffd94a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Charter, "Bitstream Charter", Georgia, Cambria, serif;
  font-size: 1.0625rem;
  line-height: 1.65;
}

.masthead, main, .site-footer {
  max-width: 42rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 3px double var(--line);
}

.theme-toggle {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  align-self: center;
  line-height: 0;
  color: var(--ink-soft);
}

.theme-toggle:hover { color: var(--gold-deep); }

.theme-toggle svg { transition: transform 0.35s ease; }

:root[data-theme="dark"] .theme-toggle svg { transform: rotate(180deg); }

.masthead-title {
  font-family: "Press Start 2P", monospace;
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.masthead-title:hover { color: var(--gold-deep); }

main { padding-top: 2rem; padding-bottom: 3rem; }

h1 {
  font-size: 1.75rem;
  line-height: 1.25;
  margin: 0 0 0.35rem;
}

h2 { font-size: 1.3rem; margin-top: 2rem; }
h3 { font-size: 1.1rem; margin-top: 1.5rem; }

a { color: var(--link); }
a:hover { color: var(--gold-deep); }

.article-meta {
  color: var(--ink-soft);
  font-size: 0.9rem;
  margin: 0 0 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

article p { margin: 1rem 0; }

blockquote {
  margin: 1.25rem 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 3px solid var(--gold-deep);
  color: var(--ink-soft);
}

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

pre {
  overflow-x: auto;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 0.85rem;
  line-height: 1.5;
}

code { font-size: 0.9em; }

hr {
  border: none;
  border-top: 3px double var(--line);
  margin: 2.5rem auto;
  width: 60%;
}

/* index */

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-list li {
  display: flex;
  gap: 1.25rem;
  align-items: baseline;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}

.post-list a {
  text-decoration: none;
  font-size: 1.15rem;
}

.post-list a:hover { text-decoration: underline; }

.post-date {
  color: var(--ink-soft);
  font-size: 0.85rem;
  white-space: nowrap;
  min-width: 8.5rem;
}

.post-summary {
  margin: 0.25rem 0 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.site-footer {
  padding-top: 1rem;
  padding-bottom: 2.5rem;
  border-top: 3px double var(--line);
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.site-footer a { color: var(--ink-soft); }
.site-footer a:hover { color: var(--gold-deep); }

@media (max-width: 540px) {
  .post-list li { flex-direction: column; gap: 0.1rem; }
  .post-date { min-width: 0; }
}
