/* Writing section. Colour tokens and fonts match the homepage (index.html). */

:root {
  --bg: #faf9f7;
  --surface: #ffffff;
  --surface2: #f3f1ee;
  --border: #e8e4df;
  --text: #1a1714;
  --muted: #7a7168;
  --accent: #d97706;
  --nav-bg: rgba(250,249,247,0.92);
}
@media (prefers-color-scheme: dark) {
  html[data-theme="system"] {
    --bg: #181614;
    --surface: #211f1c;
    --surface2: #2a2724;
    --border: #332f2b;
    --text: #f0ece6;
    --muted: #8a8078;
    --accent: #f59e0b;
    --nav-bg: rgba(24,22,20,0.92);
  }
}
html[data-theme="dark"] {
  --bg: #181614;
  --surface: #211f1c;
  --surface2: #2a2724;
  --border: #332f2b;
  --text: #f0ece6;
  --muted: #8a8078;
  --accent: #f59e0b;
  --nav-bg: rgba(24,22,20,0.92);
}
html[data-theme="light"] {
  --bg: #faf9f7;
  --surface: #ffffff;
  --surface2: #f3f1ee;
  --border: #e8e4df;
  --text: #1a1714;
  --muted: #7a7168;
  --accent: #d97706;
  --nav-bg: rgba(250,249,247,0.92);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Newsreader', Georgia, serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background .2s, color .2s;
}
h1, h2, h3 { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 600; }
a { color: inherit; }

/* Nav (same as homepage) */
nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
}
.nav-right { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.nav-brand { display: flex; align-items: center; gap: 9px; text-decoration: none; flex-shrink: 0; }
.nav-brand-photo { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; border: 1.5px solid var(--border); flex-shrink: 0; }
.nav-name { font-size: 16px; font-weight: 800; letter-spacing: -0.3px; color: var(--text); }
.nav-name span { color: var(--accent); }
.nav-avail {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; color: #16a34a;
  background: rgba(22,163,74,.1); border: 1px solid rgba(22,163,74,.25);
  border-radius: 99px; padding: 3px 9px; letter-spacing: 0.1px;
}
.nav-avail-dot { width: 6px; height: 6px; border-radius: 50%; background: #16a34a; flex-shrink: 0; }
.nav-links { display: flex; gap: 20px; align-items: center; }
.nav-links a { font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; transition: color .15s; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); }
.nav-mobile-cta {
  display: none;
  padding: 7px 16px; background: var(--accent); color: #fff !important;
  border-radius: 8px; font-size: 13px; font-weight: 700; text-decoration: none !important;
  white-space: nowrap; flex-shrink: 0;
}
.theme-toggle {
  display: flex; align-items: center; gap: 2px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 99px; padding: 3px; flex-shrink: 0;
}
.theme-btn {
  border: none; background: none; cursor: pointer;
  font-size: 13px; padding: 4px 8px; border-radius: 99px;
  color: var(--muted); transition: all .15s; line-height: 1;
}
.theme-btn.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.1); }

/* Layout */
.wrap { max-width: 680px; margin: 0 auto; padding: 56px 24px 96px; }
.eyebrow {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
}
.eyebrow a { color: inherit; text-decoration: none; }
h1 {
  font-size: clamp(30px, 5vw, 44px); font-weight: 700; line-height: 1.15;
  letter-spacing: -0.8px; margin-bottom: 14px;
}

/* Post list */
.post-list { list-style: none; }
.post-item { padding: 28px 0; border-bottom: 1px solid var(--border); }
.post-item:first-child { padding-top: 8px; }
.post-item time { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.post-item h2 { font-size: 22px; line-height: 1.25; letter-spacing: -0.3px; margin-bottom: 8px; }
.post-item h2 a { text-decoration: none; }
.post-item h2 a:hover { color: var(--accent); }
.post-item p { font-size: 16px; color: var(--muted); line-height: 1.55; }
.post-item .tags { margin-top: 14px; }

/* Single post */
.meta { font-size: 14px; color: var(--muted); margin-bottom: 40px; padding-bottom: 32px; border-bottom: 1px solid var(--border); }
.post-body p, .post-body li { font-size: 18px; line-height: 1.7; }
.post-body p { margin-bottom: 22px; }
.post-body h2 { font-size: 24px; letter-spacing: -0.3px; margin: 48px 0 16px; }
.post-body ol, .post-body ul { padding-left: 1.4em; margin-bottom: 22px; }
.post-body li { margin-bottom: 8px; }
.post-body a { color: var(--accent); text-underline-offset: 3px; }
.post-body hr { border: none; border-top: 1px solid var(--border); margin: 48px 0; }
.post-body > p:first-child { font-size: 21px; line-height: 1.6; color: var(--text); }
.post-body li::marker { color: var(--accent); }
.post-body blockquote {
  margin: 36px 0; padding: 4px 0 4px 22px;
  border-left: 3px solid var(--accent);
}
.post-body blockquote p {
  font-family: 'Bricolage Grotesque', sans-serif; font-size: 26px; font-weight: 600;
  line-height: 1.3; letter-spacing: -0.4px; color: var(--text); margin: 0;
}
.post-body h2.facts { margin-top: 56px; }
.post-body h2.facts + ul {
  list-style: none; padding: 8px 22px; margin: 0 0 22px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
}
.post-body h2.facts + ul li {
  padding: 12px 0; margin: 0; border-bottom: 1px solid var(--border); font-size: 17px;
}
.post-body h2.facts + ul li:last-child { border-bottom: none; }
.post-body h2.facts + ul strong {
  display: block; font-family: 'Bricolage Grotesque', sans-serif; font-size: 11px;
  letter-spacing: 1px; text-transform: uppercase; color: var(--accent); margin-bottom: 2px;
}
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 48px; }
.tags li {
  font-family: 'Bricolage Grotesque', sans-serif; font-size: 12px; color: var(--muted);
  border: 1px solid var(--border); border-radius: 99px; padding: 3px 10px;
}
.back { display: inline-block; margin-top: 40px; font-size: 14px; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--text); }

@media (max-width: 640px) {
  .nav-links { gap: 12px; }
  .nav-links a { font-size: 12px; }
  .nav-links a[href="/#career"],
  .nav-links a[href="/#articles"] { display: none; }
  .wrap { padding: 40px 16px 80px; }
  .post-body p, .post-body li { font-size: 17px; }
}
@media (max-width: 480px) {
  nav { padding: 10px 16px; gap: 0; }
  .nav-avail { display: none; }
  .nav-links { display: none; }
  .theme-toggle { display: none; }
  .nav-mobile-cta { display: inline-flex; margin-left: auto; }
}

/* Search and topic filter */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.writing-search { margin: 8px 0 24px; }
.writing-search input {
  width: 100%; font: 16px 'Bricolage Grotesque', sans-serif; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px;
}
.writing-search input:focus { outline: none; border-color: var(--accent); }
.tag-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tag-filter {
  font: 13px 'Bricolage Grotesque', sans-serif; color: var(--muted); background: transparent;
  border: 1px solid var(--border); border-radius: 99px; padding: 4px 12px; cursor: pointer;
}
.tag-filter span { opacity: 0.6; margin-left: 2px; }
.tag-filter:hover { color: var(--text); }
.tag-filter.active { color: var(--bg); background: var(--accent); border-color: var(--accent); }
.tag-filter.active span { opacity: 0.85; }
.search-status { font: 13px 'Bricolage Grotesque', sans-serif; color: var(--muted); margin-top: 12px; min-height: 1em; }
.no-results { color: var(--muted); padding: 28px 0; }
.tags li a { color: inherit; text-decoration: none; }
.tags li:has(a):hover { color: var(--text); border-color: var(--muted); }
.post-item[hidden] { display: none; }
