/* timothychubb.com — one stylesheet, no build step.
   Type: Newsreader (display + prose), IBM Plex Sans (navigation, dates, outlet names).
   Palette: cool paper, green-black ink, one bottle-green for links and marks. */

:root {
  --paper: #F5F6F3;
  --paper-deep: #ECEEEA;
  --ink: #15221D;
  --ink-2: #3B4742;
  --mute: #5E6864;
  --rule: #D3D8D3;
  --green: #1F5440;
  --green-deep: #143A2C;
  --focus: #8CB89F;

  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;

  --measure: 36rem;        /* prose line length */
  --wide: 66rem;           /* page container */
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121B17;
    --paper-deep: #182420;
    --ink: #E9ECE8;
    --ink-2: #C2C9C4;
    --mute: #93A09A;
    --rule: #2A3A33;
    --green: #8FC7A8;
    --green-deep: #B6DFC7;
    --focus: #5E9E7D;
  }
}

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

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

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

a {
  color: var(--green);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.14em;
  text-decoration-color: color-mix(in srgb, var(--green) 45%, transparent);
}
a:hover { color: var(--green-deep); text-decoration-color: currentColor; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: var(--paper);
  padding: 0.5rem 0.75rem; font-family: var(--sans); font-size: 0.9rem;
}
.skip:focus { left: 1rem; top: 1rem; z-index: 10; }

.wrap {
  width: min(100% - 2 * var(--gutter), var(--wide));
  margin-inline: auto;
}

/* Header ------------------------------------------------------------ */

.site-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem 2rem;
  flex-wrap: wrap;
  padding: 1.6rem 0 1.2rem;
  border-bottom: 1px solid var(--rule);
}
.wordmark {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.25rem;
  letter-spacing: -0.005em;
  color: var(--ink);
  text-decoration: none;
}
.wordmark:hover { color: var(--green); }
.site-nav {
  display: flex;
  gap: 1.5rem;
  font-family: var(--sans);
  font-size: 0.9375rem;
}
.site-nav a {
  color: var(--ink-2);
  text-decoration: none;
  padding-bottom: 0.15rem;
  border-bottom: 1px solid transparent;
}
.site-nav a:hover { color: var(--ink); border-bottom-color: var(--rule); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--green); }

/* Hero: one dated quotation, then who is speaking ------------------- */

.hero {
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.5rem, 6vw, 4.5rem);
  border-bottom: 1px solid var(--rule);
}
.lede-quote {
  margin: 0;
  max-width: 48rem;
}
.lede-quote p {
  margin: 0;
  font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.9rem);
  line-height: 1.22;
  font-weight: 400;
  letter-spacing: -0.012em;
  text-indent: -0.42em;         /* hang the opening quotation mark */
  text-wrap: pretty;
}
.lede-quote p::before { content: "\201C"; color: var(--green); }
.lede-quote p::after  { content: "\201D"; color: var(--green); }
.lede-quote.reported p { text-indent: 0; }
.lede-quote.reported p::before, .lede-quote.reported p::after { content: none; }
.lede-quote footer {
  margin-top: 1.1rem;
  font-family: var(--sans);
  font-size: 0.9375rem;
  color: var(--mute);
}
.lede-quote footer a { color: inherit; }
.lede-quote cite { font-style: normal; color: var(--ink-2); }

.standfirst {
  max-width: var(--measure);
  margin: clamp(1.75rem, 4vw, 2.75rem) 0 0;
  font-size: 1.1875rem;
  line-height: 1.5;
  color: var(--ink-2);
}
.standfirst strong { font-weight: 500; color: var(--ink); }

/* Sections ---------------------------------------------------------- */

.section { padding: clamp(2.25rem, 5vw, 3.75rem) 0; border-bottom: 1px solid var(--rule); }
.section:last-of-type { border-bottom: 0; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0 0 1rem;
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 1.4rem + 2.2vw, 3rem); }
h2 { font-size: 1.625rem; }
h3 { font-size: 1.25rem; }

.prose { max-width: var(--measure); }
.prose p { margin: 0 0 1.1em; }
.prose p:last-child { margin-bottom: 0; }

.lead { font-size: 1.1875rem; color: var(--ink-2); max-width: 40rem; margin: 0 0 1.5rem; }

/* The record: a dated list, scannable by outlet --------------------- */

.record {
  list-style: none;
  margin: 0;
  padding: 0;
}
.entry {
  display: grid;
  grid-template-columns: 7.25rem 10.5rem minmax(0, 1fr);
  gap: 0.35rem 1.5rem;
  padding: 1.05rem 0;
  border-top: 1px solid var(--rule);
}
.entry:first-child { border-top: 0; }
.entry time,
.entry .outlet {
  font-family: var(--sans);
  font-size: 0.9375rem;
  line-height: 1.5;
  padding-top: 0.2rem;      /* align with the serif title's x-height */
}
.entry time { color: var(--mute); font-variant-numeric: tabular-nums; white-space: nowrap; }
.entry time a { color: inherit; text-decoration: none; }
.entry time a:hover { color: var(--green); text-decoration: underline; }
.entry:target { background: var(--paper-deep); box-shadow: 0 0 0 0.6rem var(--paper-deep); border-radius: 2px; }
.entry { scroll-margin-top: 1.5rem; }
.entry .outlet { color: var(--ink-2); }
.entry .body { min-width: 0; }
.entry .title { margin: 0; font-size: 1.1875rem; line-height: 1.35; }
.entry .title a { color: var(--ink); text-decoration-color: color-mix(in srgb, var(--ink) 30%, transparent); }
.entry .title a:hover { color: var(--green); }
.entry .title .unlinked { color: var(--ink); }
.entry .said, .entry .about-it {
  margin: 0.3rem 0 0;
  font-size: 1.0625rem;
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 44rem;
}
.entry .said::before { content: "\201C"; color: var(--green); }
.entry .said::after  { content: "\201D"; color: var(--green); }
.entry .about-it { color: var(--mute); }

.record-more {
  margin: 1.5rem 0 0;
  font-family: var(--sans);
  font-size: 0.9375rem;
}

/* Year groups on the archive page */
.year-nav {
  display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem;
  margin: 0 0 1.5rem; padding: 0; list-style: none;
  font-family: var(--sans); font-size: 0.9375rem;
}
.year-nav a { color: var(--ink-2); text-decoration: none; border-bottom: 1px solid var(--rule); }
.year-nav a:hover { color: var(--ink); border-bottom-color: var(--green); }

.year {
  display: flex; align-items: baseline; gap: 0.9rem;
  margin: 2.5rem 0 0.25rem; padding-top: 1.5rem;
  border-top: 2px solid var(--ink);
  scroll-margin-top: 1rem;
}
.year:first-of-type { margin-top: 0.5rem; }
.year .count { font-family: var(--sans); font-size: 0.9375rem; font-weight: 400; color: var(--mute); }

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

.site-foot {
  margin-top: clamp(2rem, 5vw, 3.5rem);
  padding: 1.75rem 0 2.5rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--mute);
}
.site-foot p { margin: 0 0 0.75rem; max-width: 52rem; }
.site-foot a { color: var(--ink-2); }
.foot-links { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0 0 1rem; padding: 0; list-style: none; }

/* Small screens ----------------------------------------------------- */

@media (max-width: 44rem) {
  body { font-size: 1.0625rem; }
  .entry {
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 0.15rem 0.9rem;
  }
  .entry time, .entry .outlet { padding-top: 0; }
  .entry .body { grid-column: 1 / -1; }
  .entry .title { margin-top: 0.25rem; }
  .lede-quote p { text-indent: -0.38em; }
}
@media (min-width: 44.01rem) and (max-width: 60rem) {
  .entry { grid-template-columns: 6.75rem minmax(0, 1fr); }
  .entry .outlet { grid-column: 2; margin-top: -0.2rem; }
  .entry .body { grid-column: 2; }
}

@media print {
  .site-nav, .skip { display: none; }
  body { background: #fff; color: #000; }
  a { color: #000; text-decoration: none; }
  .entry .title a::after { content: " (" attr(href) ")"; font-size: 0.8em; color: #555; }
}
