/* ============================================
   FONTS
   ============================================ */

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

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

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

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

/* ============================================
   TOKENS
   ============================================ */

:root {
  --bg:             #faf8f5;
  --text:           #1a1a1a;
  --text-muted:     #6b6b6b;
  --accent:         #b84a00;
  --accent-heading: #8b3a1a;  /* terracotta — warm, distinct from orange accent */
  --border:         #e0dbd4;
  --max-width:      740px;
  --font-body:      'Literata', Georgia, serif;
  --font-head:      'Fraunces', Georgia, serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:             #1a1917;
    --text:           #e8e4de;
    --text-muted:     #9a9590;
    --accent:         #e06020;
    --accent-heading: #d4855a;  /* lighter terracotta — legible on dark bg */
    --border:         #2e2c29;
  }
}

/* ============================================
   RESET
   ============================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ============================================
   BASE
   ============================================ */

html {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  font-variation-settings: 'opsz' 16;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

body {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ============================================
   PAGE TITLE
   Applied via .page-title class in templates.
   Intentionally distinct from content headings
   in size, weight, and colour. Nothing inside
   .post-content should match or exceed this.
   ============================================ */

.page-title {
  font-family: var(--font-head);
  font-size: 3.2rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--accent);
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

/* ============================================
   CONTENT HEADINGS — H1 through H6
   All use --accent-heading for consistent
   colour. Hierarchy through size and weight
   only. None approach .page-title in scale.
   ============================================ */

.post-content h1 {
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--accent-heading);
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

.post-content h2 {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--accent-heading);
  margin-top: 2.25rem;
  margin-bottom: 0.65rem;
}

.post-content h3 {
  font-family: var(--font-head);
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--accent-heading);
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.post-content h4 {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--accent-heading);
  margin-top: 1.75rem;
  margin-bottom: 0.4rem;
}

.post-content h5 {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--accent-heading);
  margin-top: 1.5rem;
  margin-bottom: 0.4rem;
}

.post-content h6 {
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--accent-heading);
  margin-top: 1.25rem;
  margin-bottom: 0.4rem;
}

/* ============================================
   BOLD IN CONTENT
   Uses body font (Literata) so bold text is
   clearly distinct from Fraunces headings.
   Dark mode gets a warmer tone and heavier
   weight to compensate for reduced contrast
   on dark backgrounds.
   ============================================ */

.post-content strong,
.post-content b {
  font-family: var(--font-body);
  font-weight: 700;
}

@media (prefers-color-scheme: dark) {
  .post-content strong,
  .post-content b {
    font-weight: 800;
    color: #f2ddd0;  /* pale terracotta — warmer signal in dark mode */
  }
}

/* ============================================
   GENERAL TYPOGRAPHY
   ============================================ */

p {
  margin-bottom: 1.4rem;
}

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

a:hover {
  text-decoration: none;
}

blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1.25rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-style: italic;
}

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

/* ============================================
   META — small text, optical sizing at 13px
   ============================================ */

.meta, .caption, time, .tag {
  font-size: 13px;
  font-variation-settings: 'opsz' 10;
  color: var(--text-muted);
}

.tag {
  display: inline-block;
  margin-left: 0.5rem;
}

.tag::before {
  content: '#';
}

/* ============================================
   HEADER & NAV
   ============================================ */

.site-header {
  padding: 2rem 0 1.5rem;
  border-bottom: 2px solid var(--accent);
  margin-bottom: 3rem;
}

.site-nav {
  display: flex;
  align-items: baseline;
  gap: 2rem;
  flex-wrap: wrap;
}

.site-title {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 600;
  font-variation-settings: 'WONK' 1;
  color: var(--text);
  text-decoration: none;
  margin-right: auto;
}

.site-title:hover {
  color: var(--accent);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

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

.nav-links a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ============================================
   MAIN
   ============================================ */

.site-main {
  padding-bottom: 4rem;
}

/* ============================================
   HOMEPAGE
   ============================================ */

.home-intro {
  margin-bottom: 3rem;
}

.home-intro p {
  font-size: 1.1rem;
  line-height: 1.7;
}

.home-section {
  margin-bottom: 3rem;
}

.home-section .post-item {
  margin-bottom: 1.25rem;
}

.home-section h2 {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-top: 0;
  margin-bottom: 1rem;
}

.home-section h2 a {
  color: inherit;
  text-decoration: none;
}

.home-section h2 a:hover {
  color: var(--accent);
}

/* ============================================
   POST LIST
   ============================================ */

.section-header {
  margin-bottom: 2.5rem;
}

.section-description {
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.post-list {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.post-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.post-item a {
  font-family: var(--font-head);
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
}

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

.post-description {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 0;
}

/* ============================================
   SINGLE POST
   ============================================ */

.post-header {
  margin-bottom: 2.5rem;
}

.post-meta {
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.post-content {
  max-width: 100%;
}

.post-content p,
.post-content li {
  max-width: 65ch;
}

.post-content ul,
.post-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.4rem;
}

.post-content li {
  margin-bottom: 0.5rem;
}

.post-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 2rem 0;
}

.post-content pre {
  background: var(--border);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  border-radius: 3px;
  margin-bottom: 1.4rem;
}

.post-content code {
  font-size: 0.88rem;
}

.post-content p code {
  background: var(--border);
  padding: 0.15em 0.35em;
  border-radius: 2px;
}

/* ============================================
   FOOTER
   ============================================ */

.site-footer {
  border-top: 2px solid var(--accent);
  padding: 1.5rem 0;
  color: var(--text-muted);
  font-size: 13px;
  font-variation-settings: 'opsz' 10;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 480px) {
  html {
    font-size: 16px;
  }

  .page-title {
    font-size: 2.4rem;
  }

  .site-nav {
    gap: 1rem;
  }

  .nav-links {
    gap: 1rem;
  }
}
