/* Flexoki-based theme (Steph Ango's color system) */

/* ---------- Inter (self-hosted variable font, weights 100–900) ---------- */

@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/Inter.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/Inter-Italic.woff2') format('woff2');
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #FFFCF0;
  --text: #100F0F;
  --muted: #6F6E69;
  --border: #E6E2CC;
  --accent: #284B63;
  --code-bg: #F2F0E5;
}

[data-theme="dark"] {
  --bg: #100F0F;
  --text: #CECDC3;
  --muted: #878580;
  --border: #33322E;
  --accent: #8DA5A4;
  --code-bg: #1C1B1A;
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1.15rem;
  line-height: 1.65;
  max-width: 1000px;
  margin: 0 auto;
  padding: 4vh 6vw;
  color: var(--text);
  background: var(--bg);
  transition: background 0.25s, color 0.25s;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Navigation ---------- */

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0 2.5rem;
}

.site-name a {
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--text);
  text-decoration: none;
}

.site-name a:hover {
  color: var(--text);
}

.crumb {
  color: var(--muted);
  font-size: 1.35rem;
  margin-left: 0.35em;
  text-decoration: none;
}

.crumb:hover {
  color: var(--text);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  border: none;
  font-size: 1rem;
}

.nav-links a:hover {
  color: var(--text);
}

#theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 0.25em 0.7em;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1.4;
}

#theme-toggle:hover {
  border-color: var(--muted);
}

/* ---------- Typography ---------- */

h1, h2, h3 {
  color: var(--text);
  line-height: 1.3;
  font-weight: 600;
}

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

/* Big page titles (Topics, Writing) */
.page-title {
  font-size: 2rem;
  margin: 0 0 1em;
}

/* Two-tone topic heading: Topics / Money */
.topic-heading h1 {
  margin-bottom: 0.5em;
}

.muted-word {
  color: var(--muted);
}

.topic-count {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 1.5em;
}

a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--muted);
  text-underline-offset: 3px;
}

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

p { margin: 0 0 1em; }

time {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0.25em 0 1em;
}

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

/* ---------- Section labels (Latest / Topics / Writing) ---------- */
/* styled together with .related h2 in the footer-related block below */

/* ---------- Latest post ---------- */

.post-item h3 {
  font-size: 1.45rem;
  margin: 0 0 0.15em;
}

.post-item h3 a {
  text-decoration: none;
}

.post-item .excerpt {
  color: var(--text);
}

.read-more {
  color: var(--text);
  white-space: nowrap;
}

/* ---------- Topics: comma-separated links ---------- */

.tag-list {
  line-height: 2;
}

.tag-list a {
  text-transform: lowercase;
}

/* ---------- Writing: archive list ---------- */

.archive {
  list-style: none;
  padding: 0;
  margin: 0;
  line-height: 1.45;
}

.archive li {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  padding: 0.12em 0;
}

.archive-date {
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
  min-width: 5.5em;
}

/* ---------- Article page ---------- */

.article time {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.article-content {
  margin-top: 1rem;
}

/* ---------- Article tags: comma-separated ---------- */

.tags {
  margin-top: 2rem;
  padding-top: 1rem;
}

.tags .tag {
  display: inline;
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
  text-transform: lowercase;
}

.tags .tag::after {
  content: ", ";
  color: var(--muted);
  text-decoration: none;
}

.tags .tag:last-child::after {
  content: "";
}

/* ---------- Footer ---------- */

footer {
  margin-top: 3em;
  padding-top: 1.5em;
  border-top: 1px solid var(--border);
  font-size: 0.95em;
  color: var(--text);
}

.footer-label {
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- Related notes / plain bulleted lists ---------- */

.related h2, .latest h2, .topics h2, .writing h2 {
  font-size: 1rem;
  font-weight: 400;
  color: var(--muted);
  margin: 0 0 1em;
}

.writing h2 a, .topics h2 a {
  color: var(--muted);
  text-decoration: none;
}

.writing h2 a:hover, .topics h2 a:hover {
  color: var(--text);
}

.plain-list {
  list-style: disc;
  padding-left: 1.5em;
  margin: 0;
  line-height: 1.5;
}

.plain-list li {
  padding: 0.25em 0;
}

.plain-list li::marker {
  color: var(--muted);
}

/* ---------- Article tags: comma-separated ---------- */

.tag-comma {
  color: var(--muted);
}

/* ---------- Topics page sections ---------- */

.topic-section ul {
  list-style: none;
  padding: 0;
}

.topic-section li {
  padding: 0.3em 0;
}

/* ---------- Misc ---------- */

blockquote {
  margin: 1.5em 0;
  padding: 0.75em 1.25em;
  border-left: 3px solid var(--accent);
  background: var(--code-bg);
  border-radius: 0 4px 4px 0;
}

code {
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  font-size: 0.9em;
  font-family: "SF Mono", Monaco, monospace;
}

pre {
  background: var(--code-bg);
  padding: 1em;
  border-radius: 6px;
  overflow-x: auto;
}

pre code {
  background: none;
  padding: 0;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 1.5em auto;
  display: block;
}

ul, ol {
  padding-left: 1.5em;
  margin: 0 0 1em;
}

li {
  margin-bottom: 0.4em;
}

@media (max-width: 600px) {
  body { font-size: 1rem; padding: 3vh 5vw; }
  nav { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .archive li { flex-direction: column; gap: 0.15em; }
}
