/*
Theme Name: Serial
Theme URI: https://example.com/serial
Author: Sarah
Description: A modern, bold, typography-first WordPress theme built for serialized memoir and long-form personal writing. Generous white space, a self-hosted Syne display face for headings, and a quiet reading-friendly serif body let chapters breathe.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: serial
*/

/* -----------------------------------------
   0. Design tokens
----------------------------------------- */
:root {
  --color-ink: #111111;
  --color-ink-soft: #4a4a48;
  --color-paper: #fdfcf9;
  --color-paper-dim: #f4f2ec;
  --color-accent: #c1440e;
  --color-line: #e4e0d6;

  --font-display: "Syne", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-meta: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --measure: 42rem;
  --measure-wide: 60rem;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 2rem;
  --space-4: 4rem;
  --space-5: 6rem;
  --space-6: 9rem;
}

/* -----------------------------------------
   0b. Self-hosted Syne (headings)
   Files live in /fonts/syne — paths below are relative to this
   stylesheet, which WordPress serves from the theme root.
----------------------------------------- */
@font-face {
  font-family: "Syne";
  src: url("fonts/syne/Syne-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Syne";
  src: url("fonts/syne/Syne-Medium.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Syne";
  src: url("fonts/syne/Syne-SemiBold.woff") format("woff");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Syne";
  src: url("fonts/syne/Syne-Bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Syne";
  src: url("fonts/syne/Syne-ExtraBold.woff") format("woff");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* -----------------------------------------
   1. Reset & base
----------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

::selection { background: var(--color-accent); color: var(--color-paper); }

/* -----------------------------------------
   2. Typography
----------------------------------------- */
h1, h2, h3, h4,
.font-display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.02;
  margin: 0 0 var(--space-2);
}

h1 { font-size: clamp(2.75rem, 6vw, 5.5rem); font-weight: 800; }
h2 { font-size: clamp(2rem, 4vw, 3.25rem); }
h3 { font-size: clamp(1.5rem, 2.5vw, 2rem); font-weight: 600; }

p { margin: 0 0 1.5em; }

.eyebrow {
  font-family: var(--font-meta);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--color-ink-soft);
}

.lede {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  color: var(--color-ink-soft);
  max-width: var(--measure);
}

/* Drop cap for chapter openings */
.chapter-content > p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-size: 4.6rem;
  font-weight: 800;
  float: left;
  line-height: 0.8;
  padding: 0.08em 0.08em 0 0;
  color: var(--color-accent);
}

/* -----------------------------------------
   3. Layout
----------------------------------------- */
.wrap {
  max-width: var(--measure-wide);
  margin: 0 auto;
  padding: 0 var(--space-3);
}

.prose {
  max-width: var(--measure);
  margin: 0 auto;
}

.site-header {
  padding: var(--space-4) 0 var(--space-3);
}

.site-header .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  border-bottom: 1px solid var(--color-line);
  padding-bottom: var(--space-3);
}

.site-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}
.site-title a { text-decoration: none; }

.site-description {
  font-family: var(--font-meta);
  font-size: 0.85rem;
  color: var(--color-ink-soft);
  margin-top: 0.35rem;
}

.primary-nav ul {
  list-style: none;
  display: flex;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  font-family: var(--font-meta);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
}
.primary-nav a { text-decoration: none; }

main { padding: var(--space-5) 0 var(--space-6); }

.site-footer {
  border-top: 1px solid var(--color-line);
  padding: var(--space-4) 0;
  font-family: var(--font-meta);
  font-size: 0.8rem;
  color: var(--color-ink-soft);
}
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* -----------------------------------------
   4. Front page / hero
----------------------------------------- */
.hero {
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--color-line);
  margin-bottom: var(--space-5);
}

.hero .eyebrow { margin-bottom: var(--space-2); }

.hero h1 { max-width: 16ch; }

.hero-cta {
  display: inline-block;
  margin-top: var(--space-3);
  font-family: var(--font-meta);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 2px solid var(--color-accent);
  padding-bottom: 4px;
}

/* -----------------------------------------
   5. Chapter list / archive
----------------------------------------- */
.chapter-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.chapter-list li {
  display: flex;
  gap: var(--space-3);
  align-items: baseline;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-line);
}

.chapter-list .chapter-number {
  font-family: var(--font-meta);
  font-size: 0.85rem;
  color: var(--color-accent);
  min-width: 4.5rem;
  flex-shrink: 0;
}

.chapter-list h2 {
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  margin: 0 0 0.35rem;
}

.chapter-list a { text-decoration: none; }

.chapter-list .chapter-excerpt {
  color: var(--color-ink-soft);
  font-size: 1rem;
  margin: 0;
}

.chapter-list .chapter-meta {
  font-family: var(--font-meta);
  font-size: 0.75rem;
  color: var(--color-ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* -----------------------------------------
   6. Single chapter
----------------------------------------- */
.chapter-header {
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-line);
}

.chapter-header .chapter-number {
  display: inline-block;
  font-family: var(--font-meta);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-2);
}

.chapter-content { font-size: 1.2rem; }
.chapter-content p { margin-bottom: 1.6em; }

.chapter-nav {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-line);
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.chapter-nav a {
  text-decoration: none;
  max-width: 20ch;
}

.chapter-nav .direction {
  display: block;
  font-family: var(--font-meta);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-ink-soft);
  margin-bottom: 0.25rem;
}

.chapter-nav .next { margin-left: auto; text-align: right; }

/* -----------------------------------------
   7. Static page
----------------------------------------- */
.page-content { font-size: 1.15rem; }

/* -----------------------------------------
   8. 404
----------------------------------------- */
.not-found {
  text-align: center;
  padding: var(--space-6) 0;
}

/* -----------------------------------------
   9. Responsive
----------------------------------------- */
@media (max-width: 640px) {
  .site-header .wrap { flex-direction: column; align-items: flex-start; }
  .chapter-list li { flex-direction: column; gap: var(--space-1); }
  .chapter-nav .next { text-align: left; margin-left: 0; }
}
