/* TOKENS */
/* Fonts are self-hosted. woff2 files are in /fonts/.
   To revert to Google Fonts CDN, comment out the @font-face block below
   and restore the three Google Fonts <link> lines in /Boilerplate/core-head-links. */

@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-v21-latin-300.woff2') format('woff2');
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-v21-latin-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-v21-latin-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 300;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-v21-latin-300italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-v21-latin-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('/fonts/jost-v20-latin-300.woff2') format('woff2');
}
@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/jost-v20-latin-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/jost-v20-latin-500.woff2') format('woff2');
}

:root {

  /* ── Raw colour palette
     OPTION A — Dark warm (currently active)
     To revert to Option B light: swap the bg/ink assignments
     and uncomment the original palette values below. */

  --warm-white:     #f0ede8;
  --warm-black:     #1c1916;
  --warm-gray:      #c4bfb8;
  --warm-silver:    #9e9894;
  --clay:           #c07a4a;
  --clay-pale:      #2a2320;

  /* Original light palette (uncomment to revert)
  --warm-white:     #f5f3ee;
  --warm-black:     #1c1916;
  --warm-gray:      #5a5550;
  --warm-silver:    #767270;
  --clay:           #8c5e3c;
  --clay-pale:      #e8ddd3;
  */

  /* ── Category palette — lightened for dark background */
  --sage:           #7ab68a;
  --slate-blue:     #5e9cb8;
  --violet-muted:   #a48fd0;
  --ochre:          #c4a84a;
  --dusty-rose:     #cc7a9e;

  /* Original category palette (for light bg — uncomment to revert)
  --sage:           #5a6e50;
  --slate-blue:     #3d5f73;
  --violet-muted:   #6e5e8c;
  --ochre:          #6b5c26;
  --dusty-rose:     #8c3c5e;
  */

  /* ── Semantic tokens — dark bg, light ink */
  --bg:             var(--warm-black);
  --ink:            var(--warm-white);
  --ink-mid:        var(--warm-gray);
  --ink-light:      var(--warm-silver);
  --accent:         var(--clay);
  --accent-pale:    var(--clay-pale);

  --border:         color-mix(in srgb, var(--ink) 10%, transparent);
  --border-mid:     color-mix(in srgb, var(--ink) 18%, transparent);

  --img-transition:   transform 0.7s var(--ease-out), filter 0.4s;
  --img-filter:       saturate(0.88);
  --img-hover-scale:  scale(1.03);

  --post-gutter:    clamp(var(--gutter), 8vw, 6rem);
  --post-max-w:     860px;

  --font-display: 'Cormorant Garamond', 'Georgia', serif;
  --font-body:    'Jost', system-ui, sans-serif;

  --nav-h:     3.25rem;
  --gutter:    clamp(1.25rem, 4vw, 3rem);
  --gap:       clamp(0.75rem, 2vw, 1.5rem);
  --max-w:     1360px;

  --ease-out:  cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── RESET & BASE ───────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

a {
  color: inherit;
  text-decoration: underline dotted;
  text-decoration-color: color-mix(in srgb, var(--ink) 25%, transparent);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s;
}

a:hover {
  text-decoration-style: solid;
  text-decoration-color: color-mix(in srgb, var(--ink) 60%, transparent);
}

.site-header a, .site-footer a, .main-nav a, .nav-toggle,
.filter-btn, .post-item a, .post-nav a, .post-back, .read-more,
.contact-link, .site-title, .page-hero a, .post-header__meta a,
.blog-topics a, .post-tags a, .archive-year-link {
  text-decoration: none;
}

ul { list-style: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 1px;
}
:focus:not(:focus-visible) { outline: none; }

.container {
  max-width: var(--max-w);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* ── HEADER / NAV ───────────────────────── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease-out), background 0.3s var(--ease-out);
}

.site-header.scrolled { border-color: var(--border-mid); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 var(--gutter);
  max-width: var(--max-w);
  margin: 0 auto;
}

.site-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--ink);
  white-space: nowrap;
  transition: color 0.2s;
}
.site-title:hover { color: var(--accent); }

.main-nav ul {
  display: flex;
  align-items: center;
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

.main-nav a {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mid);
  transition: color 0.2s;
  position: relative;
}

.main-nav a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.25s var(--ease-out);
}

.main-nav a:hover,
.main-nav a[aria-current="page"] { color: var(--ink); }

.main-nav a:hover::after,
.main-nav a[aria-current="page"]::after { width: 100%; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 22px; height: 1px;
  background: var(--ink);
  transition: transform 0.3s var(--ease-out), opacity 0.3s;
}
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child  { transform: translateY(-6px) rotate(-45deg); }

/* ── PAGE SCAFFOLD ──────────────────────── */
.page-body {
  padding-top: var(--nav-h);
  min-height: 100vh;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--gutter);
  padding: 0.5rem 1rem;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  z-index: 200;
  transition: top 0.2s;
}
.skip-link:focus { top: 0.75rem; }

/* Category pip colours */
.cat--simple-living      { --cat-color: var(--sage); }
.cat--books-ideas        { --cat-color: var(--slate-blue); }
.cat--learning-making    { --cat-color: var(--clay); }
.cat--systems-thinking   { --cat-color: var(--violet-muted); }
.cat--places-experiences { --cat-color: var(--ochre); }
.cat--health-wellbeing   { --cat-color: var(--dusty-rose); }

/* POST CARD — unified vertical card component
   Used in: blog list, featured posts, home page.
   Context overrides below control per-area differences. */
.post-card {
  display: flex;
  flex-direction: column;
  list-style: none;
}

.post-card a { text-decoration: none; }

.post-card__image {
  display: block;
  overflow: hidden;
  aspect-ratio: 3/2;
  background: var(--accent-pale);
  margin-bottom: 0.85rem;
}

.post-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--img-transition);
  filter: var(--img-filter);
}

.post-card:hover .post-card__image img {
  transform: var(--img-hover-scale);
  filter: saturate(1);
}

.post-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.post-card__meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.post-card__cat { color: var(--cat-color, var(--ink-light)); }

.post-card__date {
  color: var(--ink-light);
  font-weight: 300;
}

.post-card__date::before {
  content: '—';
  margin-right: 0.4rem;
  color: var(--border-mid);
}

.post-card__title {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 1.8vw, 1.4rem);
  font-weight: 400;
  line-height: 1.2;
  color: var(--ink);
  transition: color 0.2s;
}

.post-card:hover .post-card__title { color: var(--accent); }

.post-card__excerpt {
  font-size: 0.85rem;
  font-weight: 300;
  line-height: 1.65;
  color: var(--ink-mid);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Posts without images: accent left border */
.post-card:not(:has(.post-card__image)) .post-card__body {
  border-left: 2px solid var(--cat-color, var(--ink-light));
  padding-left: 1rem;
}

/* Separator — dotted bottom edge on every blog list card.
   Subtle in multi-column grid, clear divider when stacked. */
.blog-list .post-card {
  padding-bottom: clamp(1.25rem, 2.5vw, 1.75rem);
  border-bottom: 1px dotted var(--border);
}

/* Blog list context
   auto-fill grid: columns are at least 280px, fills available space.
   Naturally collapses 3-col > 2-col > 1-col as viewport narrows.
   No explicit breakpoints needed for column count. */
.blog-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: clamp(var(--gap), 3vw, 2.5rem);
  padding: 0 clamp(var(--gutter), 6vw, 5rem) calc(var(--gap) * 6);
  max-width: 1100px;
  margin: 0 auto;
  list-style: none;
  align-items: start;
}

/* Featured posts context
   2-column grid. Date hidden. Larger title. */
.featured-posts {
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

.featured-posts__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1rem, 3vw, 2rem);
  list-style: none;
}

.featured-posts__grid .post-card__date { display: none; }
.featured-posts__grid .post-card__title {
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
}
.featured-posts__grid .post-card__image {
  aspect-ratio: 16/9;
}

/* PAGE TRANSITIONS */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.animate-in { animation: fadeUp 0.6s var(--ease-out) both; }
.animate-in:nth-child(1) { animation-delay: 0.05s; }
.animate-in:nth-child(2) { animation-delay: 0.12s; }
.animate-in:nth-child(3) { animation-delay: 0.19s; }
.animate-in:nth-child(4) { animation-delay: 0.26s; }
.animate-in:nth-child(5) { animation-delay: 0.33s; }
.animate-in:nth-child(6) { animation-delay: 0.40s; }
.animate-in:nth-child(7) { animation-delay: 0.47s; }
.animate-in:nth-child(8) { animation-delay: 0.54s; }
.animate-in:nth-child(9) { animation-delay: 0.61s; }

/* TAG FILTER */
.tag-filter-notice {
  margin-bottom: 1.25rem;
  font-size: 0.82rem;
  color: var(--ink-mid);
  letter-spacing: 0.02em;
}

.tag-filter-clear {
  background: none;
  border: 1px solid var(--border-mid);
  border-radius: 2px;
  color: var(--ink-mid);
  font-size: 0.78rem;
  font-family: var(--font-body);
  margin-left: 0.6rem;
  padding: 0.1rem 0.5rem;
  transition: border-color 0.2s, color 0.2s;
}

.tag-filter-clear:hover {
  border-color: var(--border-mid);
  color: var(--ink);
}

/* V1 horizontal row layout
   Only active when Blog Post Card template is used. */
.post-item {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 4vw, 4rem);
  align-items: start;
  padding: clamp(2.5rem, 5vw, 4rem) 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
}

.post-item:first-child { padding-top: clamp(2rem, 4vw, 3.5rem); }

.post-item--text {
  grid-template-columns: 1fr;
  padding-left: clamp(1.25rem, 3vw, 2.5rem);
  border-left: 2px solid var(--cat-color, var(--ink-light));
}

.post-item__image {
  overflow: hidden;
  aspect-ratio: 16/10;
  background: var(--accent-pale);
}

.post-item__image img {
  transition: var(--img-transition);
  filter: var(--img-filter);
}

.post-item:hover .post-item__image img {
  transform: var(--img-hover-scale);
  filter: saturate(1);
}

.post-item__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.6rem;
}

.post-item__meta { display: flex; align-items: center; gap: 0.75rem; }

.post-item__cat {
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cat-color, var(--ink-light));
}

.post-item__date {
  font-size: 0.65rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--ink-light);
}

.post-item__date::before {
  content: '—';
  margin-right: 0.75rem;
  color: var(--border-mid);
}

.post-item__title {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.5vw, 1.75rem);
  font-weight: 400;
  line-height: 1.15;
  color: var(--ink);
  transition: color 0.2s;
}

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

.post-item__excerpt {
  font-size: 0.9rem;
  font-weight: 300;
  line-height: 1.7;
  color: var(--ink-mid);
  max-width: 55ch;
}

.post-item__read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mid);
  margin-top: 0.25rem;
  transition: color 0.2s, gap 0.2s;
}

.post-item:hover .post-item__read-more { color: var(--accent); gap: 0.65rem; }
.post-item__read-more::after { content: '→'; }

/* V1 blog-list override — flex column for row layout */
.blog-list:has(.post-item) {
  display: flex;
  flex-direction: column;
  padding: 0 clamp(var(--gutter), 10vw, 8rem) calc(var(--gap) * 6);
  max-width: 1100px;
  margin: 0 auto;
}

@media (max-width: 700px) {
  .post-item { grid-template-columns: 1fr; }
  .post-item__image { aspect-ratio: 16/9; }
}

/* Responsive */
/* blog-list columns handled by auto-fill minmax — no breakpoints needed */
@media (max-width: 600px) {
  .featured-posts__grid { grid-template-columns: 1fr; }
}

/* POST PAGE
   --post-gutter and --post-max-w defined in tokens.css
   Shared by .post-page and .post-nav so a change to either token
   updates both automatically */

.post-page {
  max-width: var(--post-max-w);
  margin: 0 auto;
  padding: 0 var(--post-gutter) clamp(4rem, 8vw, 7rem);
}

/* Post header */
.post-header {
  padding-top: clamp(3rem, 7vw, 5.5rem);
  padding-bottom: clamp(2rem, 4vw, 3rem);
  border-bottom: 1px solid var(--border);
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.post-header__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 1rem;
  margin-bottom: 1.25rem;
}

.post-header__cat {
  font-size: 0.67rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--cat-color, var(--ink-light));
  white-space: nowrap;
}

.post-header__date-cats,
.post-header__topics {
  font-size: 0.67rem;
  font-weight: 300;
  letter-spacing: 0.05em;
  color: var(--ink-light);
}

.post-header__date-cats a {
  color: var(--ink-light);
  border-bottom: 1px solid var(--border-mid);
  transition: color 0.2s, border-color 0.2s;
}

/* Topic links use ink-mid so they stand out from surrounding ink-light text */
.post-header__topics a {
  color: var(--ink-mid);
  border-bottom: 1px solid var(--border-mid);
  transition: color 0.2s, border-color 0.2s;
}

.post-header__date-cats a:hover,
.post-header__topics a:hover {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--ink) 35%, transparent);
}

.post-header__title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5.5vw, 3.8rem);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 1.25rem;
}

.post-header__lede {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-weight: 300;
  font-style: italic;
  line-height: 1.6;
  color: var(--ink-mid);
  max-width: 52ch;
}

/* Featured image */
.post-hero-image {
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
  overflow: hidden;
  aspect-ratio: 16/9;
}

.post-hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post-hero-image figcaption {
  padding-top: 0.6rem;
  font-size: 0.7rem;
  font-weight: 300;
  letter-spacing: 0.07em;
  color: var(--ink-light);
  font-style: italic;
}

/* Body copy */
.post-body {
  font-family: var(--font-body);
  font-size: clamp(0.975rem, 1.5vw, 1.05rem);
  font-weight: 400;
  line-height: 1.85;
  color: var(--ink-mid);
  max-width: 68ch;
}

.post-body > * + * { margin-top: 1.5em; }

.post-body p:first-child::first-letter {
  font-family: var(--font-display);
  font-size: 3.6em;
  font-weight: 400;
  line-height: 0.82;
  float: left;
  margin-right: 0.1em;
  margin-top: 0.06em;
  color: var(--ink);
}

.post-body h2 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  font-weight: 400;
  line-height: 1.2;
  color: var(--ink);
  margin-top: 2.75em;
  margin-bottom: -0.5em;
}

.post-body h3 {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  margin-top: 2.5em;
  margin-bottom: -0.75em;
}

.post-body strong { font-weight: 500; color: var(--ink); }
.post-body em { font-style: italic; }

.post-body a {
  color: var(--ink);
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 30%, transparent);
  transition: color 0.2s, border-color 0.2s;
}
.post-body a:hover { color: var(--accent); border-color: var(--accent); }

.post-body blockquote {
  margin: 2.5em 0;
  padding: 0 0 0 clamp(1.5rem, 3vw, 2.5rem);
  border-left: 2px solid var(--accent);
}

.post-body blockquote p {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  font-style: italic;
  line-height: 1.55;
  color: var(--ink);
  margin-top: 0;
}

.post-body blockquote cite {
  display: block;
  margin-top: 0.75em;
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-light);
}

.post-body ul, .post-body ol { padding-left: 1.5em; }
.post-body ul { list-style: disc; }
.post-body ol { list-style: decimal; }
.post-body li { margin-top: 0.4em; }

/* Inline figures */
.post-body figure { margin: 2.5em 0; }
.post-body figure img { width: 100%; height: auto; object-fit: cover; }

.post-body figure.figure--wide {
  margin-left: clamp(-2rem, -6vw, -4rem);
  margin-right: clamp(-2rem, -6vw, -4rem);
}

.post-body figure.figure--small { max-width: 132px; }
.post-body figure.figure--small img { width: auto; max-width: 100%; height: auto; object-fit: contain; }

.post-body figure.figure--float-left { float: left; margin: 0.25em 1.75em 1em 0; }
.post-body figure.figure--float-right { float: right; margin: 0.25em 0 1em 1.75em; }

.post-body .figure--video iframe,
.post-body .figure--video video,
.post-body .figure--video embed {
  width: 100%;
  aspect-ratio: 16/9;
  height: auto;
  border: none;
  display: block;
}

.post-body figure figcaption {
  margin-top: 0.6rem;
  font-size: 0.7rem;
  font-weight: 300;
  letter-spacing: 0.07em;
  color: var(--ink-light);
  font-style: italic;
}

/* Quotebacks */
.post-body blockquote.quoteback {
  border-left: none;
  padding: 1.25rem 1.5rem;
  margin: 2.5em 0;
  background: var(--accent-pale);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-style: normal;
  color: var(--ink-mid);
}

.post-body blockquote.quoteback p {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-style: normal;
  color: var(--ink-mid);
  line-height: 1.7;
}

.post-body blockquote.quoteback footer {
  margin-top: 0.75rem;
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--ink-light);
}

.post-body blockquote.quoteback footer cite a {
  border-bottom: none;
  color: var(--ink-light);
}

.post-body quoteback-component { display: block; margin: 2.5em 0; }

/* Post footer: tags + back link */
.post-footer {
  margin-top: clamp(3rem, 6vw, 5rem);
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.post-tag {
  font-size: 0.67rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-light);
  border: 1px solid var(--border-mid);
  padding: 0.3rem 0.65rem;
  transition: color 0.2s, border-color 0.2s;
}
.post-tag:hover {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--ink) 35%, transparent);
}

.post-back {
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mid);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.2s, gap 0.2s;
  white-space: nowrap;
}
.post-back::before { content: '\2190'; }
.post-back:hover { color: var(--accent); gap: 0.65rem; }

/* Prev / next navigation
   Shares --post-max-w and --post-gutter with .post-page */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--border);
  margin-top: clamp(2rem, 4vw, 3.5rem);
  max-width: var(--post-max-w);
  margin-left: auto;
  margin-right: auto;
  padding: 0 var(--post-gutter);
}

.post-nav__item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  text-decoration: none;
  color: inherit;
  transition: background 0.25s;
}
.post-nav__item:hover { background: var(--accent-pale); }

.post-nav__item--prev { border-right: 1px solid var(--border); }
.post-nav__item--next { grid-column: 2; text-align: right; }

.post-nav__label {
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-light);
}

.post-nav__title {
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  font-weight: 400;
  line-height: 1.25;
  color: var(--ink);
  transition: color 0.2s;
}
.post-nav__item:hover .post-nav__title { color: var(--accent); }

/* Responsive */
@media (max-width: 600px) {
  .post-nav {
    grid-template-columns: 1fr;
    padding: 0 var(--gutter);
  }
  .post-nav__item--next { grid-column: 1; text-align: left; }
  .post-nav__item--prev { border-right: none; border-bottom: 1px solid var(--border); }
  .post-body p:first-child::first-letter { font-size: 2.8em; }
  .post-body figure.figure--float-left,
  .post-body figure.figure--float-right { float: none; margin-left: 0; margin-right: 0; }
}

/* PAGE HERO (interior pages)
   Uses .container class from tokens.css for horizontal margins */
.page-hero {
  padding-top: clamp(3rem, 8vw, 6rem);
  padding-bottom: clamp(2rem, 4vw, 3rem);
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
}

.page-hero__eyebrow {
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-light);
  margin-bottom: 0.75rem;
}

.page-hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.page-hero__title em { font-style: italic; color: var(--accent); }

.page-hero__lede {
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  font-weight: 300;
  font-style: italic;
  line-height: 1.6;
  color: var(--ink-mid);
  margin-top: 1rem;
  max-width: 52ch;
}

.page-hero__meta {
  margin-top: 1rem;
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-light);
}

/* BLOG / PORTFOLIO FILTER BAR */
.blog-filters {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 8%, transparent);
}

.filter-btn {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-light);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0;
  position: relative;
  transition: color 0.2s;
}

.filter-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.25s var(--ease-out);
}

.filter-btn:hover,
.filter-btn.active { color: var(--ink); }
.filter-btn.active::after,
.filter-btn:hover::after { width: 100%; }

/* ARCHIVE */
.archive-content {
  padding-top: clamp(2rem, 4vw, 3rem);
  padding-bottom: calc(var(--gap) * 4);
  max-width: 42rem;  /* narrower than standard — overrides .container max-width */
}

/* FOOTER — outside <main>, manages its own horizontal spacing */
.site-footer {
  border-top: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  padding: 1.5rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-w);
  margin: 0 auto;
}

.site-footer p {
  font-size: 0.7rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--ink-light);
  text-transform: uppercase;
}

.footer-links { display: flex; gap: 1.5rem; }

.footer-links a {
  font-size: 0.7rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--ink-light);
  text-transform: uppercase;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--ink); }

/* Work/portfolio items */
.work-item {
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.work-item__image {
  overflow: hidden;
  aspect-ratio: 4/5;
  background: var(--accent-pale);
  margin-bottom: 0.75rem;
}

.work-item__image img {
  transition: transform 0.7s var(--ease-out), filter 0.4s;
  filter: saturate(0.85);
}
.work-item:hover .work-item__image img {
  transform: scale(1.04);
  filter: saturate(1);
}

.work-item__title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.work-item__details {
  font-size: 0.7rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-light);
}

/* Responsive */
@media (max-width: 640px) {
  .blog-filters {
    gap: 1.25rem;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 1rem;
  }
}

/* TAXONOMY PAGES — SHARED (Index + Detail) */

/* Breadcrumb — used in taxonomy detail and gallery pages */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.68rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-light);
  margin-bottom: 1.5rem;
}

.breadcrumb a { color: var(--ink-light); transition: color 0.2s; }
.breadcrumb a:hover { color: var(--ink); }
.breadcrumb__sep { color: var(--border-mid); }
.breadcrumb__current { color: var(--ink); }

/* TAXONOMY INDEX — card grid
   Uses .container class from template for horizontal margins.
   auto-fill grid collapses naturally: 3-col > 2-col > 1-col. */
.taxonomy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
  gap: clamp(1px, 0.15vw, 2px);
  padding-top: clamp(1.5rem, 3vw, 2.5rem);
  padding-bottom: clamp(4rem, 8vw, 7rem);
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  /* max-width, margin, horizontal padding handled by .container */
}

.taxonomy-card {
  background: var(--bg);
  padding: clamp(1.5rem, 2.5vw, 2.25rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: background 0.25s;
}
.taxonomy-card:hover { background: var(--accent-pale); }

.taxonomy-card__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.taxonomy-card__title {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 1.8vw, 1.4rem);
  font-weight: 400;
  line-height: 1.2;
}

.taxonomy-card__title a { color: var(--ink); transition: color 0.2s; }
.taxonomy-card__title a:hover { color: var(--accent); }

.taxonomy-card__count {
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-light);
  white-space: nowrap;
  flex-shrink: 0;
}

.taxonomy-card__description {
  font-size: 0.85rem;
  font-weight: 300;
  line-height: 1.65;
  color: var(--ink-mid);
}

.taxonomy-card__recent {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--border);
  padding-top: 0.85rem;
}

.taxonomy-card__recent-label {
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-light);
  margin-bottom: 0.5rem;
}

.taxonomy-card__recent-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.taxonomy-card__recent-list li a {
  font-size: 0.8rem;
  font-weight: 300;
  line-height: 1.4;
  color: var(--ink-mid);
  transition: color 0.2s;
}
.taxonomy-card__recent-list li a:hover { color: var(--ink); }

.taxonomy-card__view-all {
  font-size: 0.67rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-light);
  margin-top: 0.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: color 0.2s, gap 0.2s;
}
.taxonomy-card__view-all::after { content: '→'; }
.taxonomy-card:hover .taxonomy-card__view-all { color: var(--accent); gap: 0.55rem; }

/* Taxonomy type accent dots */
.taxonomy-card.categories-card .taxonomy-card__title a::before,
.taxonomy-card.topics-card .taxonomy-card__title a::before,
.taxonomy-card.tags-card .taxonomy-card__title a::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cat-color, var(--accent));
  margin-right: 0.5rem;
  vertical-align: middle;
}

/* taxonomy-grid columns handled by auto-fill minmax — no breakpoints needed */
@media (max-width: 560px) {
  .taxonomy-grid { gap: 1px; }
}

/* ARCHIVE */
.archive-years {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.archive-year-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}

.archive-year-link {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  font-weight: 300;
  color: var(--ink);
  transition: color 0.2s;
}
.archive-year-link:hover { color: var(--accent); }

.archive-year-count {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-light);
}

/* Per-year post list */
.archive-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.archive-row {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
}

.archive-row__date {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--ink-light);
  white-space: nowrap;
  min-width: 4.5rem;
}

.archive-row__title {
  font-size: 0.9rem;
  font-weight: 300;
  color: var(--ink-mid);
  transition: color 0.2s;
}
.archive-row__title:hover { color: var(--ink); }

/* GALLERY PAGES CSS
   Loaded on: home, gallery index, gallery detail, gallery image pages
   Uses .container from tokens.css for margins */

/* HOME GALLERY GRID */
.home-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  padding-top: var(--gap);
  padding-bottom: calc(var(--gap) * 3);
}

/* GALLERY DETAIL GRID */
.gallery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  padding-bottom: calc(var(--gap) * 3);
  align-items: start;
}

/* GALLERY ITEMS */
.gallery-item { cursor: pointer; min-width: 0; }
.gallery-item--wide { grid-column: 1 / -1; }
.gallery-item--tall { grid-row: span 2; }

.gallery-item .image-wrap {
  display: block;
  width: 100%;
  overflow: hidden;
  background: var(--accent-pale);
}

/* Wide hero: no forced aspect-ratio.
   Image displays at natural proportions,
   consistent with portfolio cover image. */
.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  transition: var(--img-transition);
  filter: var(--img-filter);
}

.gallery-item:hover img {
  transform: var(--img-hover-scale);
  filter: saturate(1);
}

.gallery-item figcaption {
  padding-top: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.05em;
  color: var(--ink-light);
  text-transform: uppercase;
}

/* GALLERY INDEX — CARDS */
.gallery-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
  padding-top: 1.5rem;
  padding-bottom: calc(var(--gap) * 4);
}

.gallery-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.gallery-card__cover {
  display: block;
  position: relative;
  overflow: hidden;
  background: var(--accent-pale);
}

.gallery-card__cover img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  transition: var(--img-transition);
  filter: var(--img-filter);
}

.gallery-card:hover .gallery-card__cover img {
  transform: var(--img-hover-scale);
  filter: saturate(1);
}

.gallery-card__count,
.gallery-card__service {
  position: absolute;
  bottom: 0.6rem;
  right: 0.6rem;
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(28, 25, 22, 0.7);
  color: #f5f3ee;
  padding: 0.2rem 0.55rem;
  border-radius: 1px;
  backdrop-filter: blur(4px);
}

.gallery-card__info {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.gallery-card__info h3 {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  font-weight: 400;
  line-height: 1.2;
}

.gallery-card__info h3 a { color: var(--ink); transition: color 0.2s; }
.gallery-card__info h3 a:hover { color: var(--accent); }

.gallery-card__meta {
  font-size: 0.67rem;
  font-weight: 300;
  letter-spacing: 0.07em;
  color: var(--ink-light);
}

.gallery-card__desc {
  font-size: 0.85rem;
  font-weight: 300;
  line-height: 1.6;
  color: var(--ink-mid);
}

.gallery-card__link {
  font-size: 0.67rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mid);
  transition: color 0.2s;
}
.gallery-card__link:hover { color: var(--accent); }

/* GALLERY DETAIL — PAGE HEADER */
.gallery-page-header {
  padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(1.5rem, 3vw, 2.5rem);
  border-bottom: 1px solid var(--border);
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.gallery-page-header nav { margin-bottom: 1.5rem; }

.gallery-page-header__title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5.5vw, 3.8rem);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 0.75rem;
}

.gallery-page-header__desc {
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  font-weight: 300;
  font-style: italic;
  line-height: 1.6;
  color: var(--ink-mid);
  max-width: 52ch;
  margin-bottom: 0.75rem;
}

.gallery-page-header__meta {
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--ink-light);
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* GALLERY IMAGE PAGE */
.gallery-image-page {
  padding-top: clamp(2rem, 5vw, 4rem);
  padding-bottom: calc(var(--gap) * 4);
}

.gallery-image-page__figure {
  margin: 0 0 clamp(1.5rem, 3vw, 2.5rem);
  overflow: hidden;
  background: var(--accent-pale);
}

.gallery-image-page__figure img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.gallery-image-page__info {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-width: 52ch;
}

.gallery-image-page__title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 300;
  line-height: 1.15;
  color: var(--ink);
}

.gallery-image-page__meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.67rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--ink-light);
}

.gallery-image-page__text {
  font-size: 0.9rem;
  font-weight: 300;
  line-height: 1.75;
  color: var(--ink-mid);
  margin-top: 0.5rem;
}

.gallery-image-page__back {
  font-size: 0.67rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mid);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.2s, gap 0.2s;
  margin-top: 0.5rem;
}
.gallery-image-page__back::before { content: '\2190'; }
.gallery-image-page__back:hover { color: var(--accent); gap: 0.65rem; }

/* DARK THEME */
body[data-theme="dark"] {
  --bg:          #1a1a1a;
  --ink:         #f0ede8;
  --ink-mid:     #c8c4be;
  --ink-light:   #8a8680;
  --accent-pale: #2a2826;
  --border:      color-mix(in srgb, #f0ede8 10%, transparent);
  --border-mid:  color-mix(in srgb, #f0ede8 18%, transparent);
}

body[data-theme="dark"] .site-header,
body[data-theme="dark"] .site-footer {
  border-color: var(--border);
}

/* BIO PAGE
   Uses .container class from tokens.css for horizontal margins */

.bio-body {
  padding-top: clamp(2rem, 5vw, 4rem);
  padding-bottom: calc(var(--gap) * 4);
}

/* Use flex column so .footnotes can be pushed to the end
   via CSS order, regardless of where MMD places them in source.
   JS hides .footnotes entirely when converting to sidenotes. */
.bio-text {
  display: flex;
  flex-direction: column;
}

/* Widen when sidenotes are active so the floated note has margin room */
@media (min-width: 900px) {
  .bio-text.sidenotes-container { max-width: 860px; }
}

.bio-text h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 300;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  color: var(--ink);
}

.bio-text p {
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.8;
  color: var(--ink-mid);
  margin-bottom: 1.25rem;
  max-width: 62ch;
}

.bio-text p:first-of-type {
  font-family: var(--font-display);
  font-size: 1.3rem;
  line-height: 1.6;
  color: var(--ink);
  font-weight: 300;
}

/* No-JS fallback: footnotes pushed to end, sized like sidenotes */
.bio-text .footnotes { order: 100; margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.bio-text .footnotes hr { display: none; }
.bio-text .footnotes ol { padding-left: 1.25rem; }
.bio-text .footnotes li,
.bio-text .footnotes p { font-size: 0.8rem; font-weight: 300; line-height: 1.65; color: var(--ink-light); max-width: 52ch; margin-bottom: 0; }

.bio-divider { width: 2rem; height: 1px; background: var(--accent); margin: 2.5rem 0; order: 101; }
.bio-nav { order: 102; }

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
  padding-bottom: 0.15rem;
  transition: color 0.2s, border-color 0.2s;
  margin-top: 0.5rem;
}
.contact-link:hover { color: var(--accent); border-color: var(--accent); }

/* NOW PAGE */

.now-body {
  padding-top: clamp(1.5rem, 3vw, 2.5rem);
  padding-bottom: calc(var(--gap) * 4);
}

.now-updated {
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--ink-light);
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

.now-section {
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
  padding-bottom: clamp(2rem, 5vw, 3.5rem);
  border-bottom: 1px solid var(--border);
}

.now-section:last-of-type { border-bottom: none; }

.now-section__label {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-light);
  margin-bottom: 1rem;
}

.now-section__content p {
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.8;
  color: var(--ink-mid);
  margin-bottom: 1rem;
  max-width: 62ch;
}

.now-section__content p:last-child { margin-bottom: 0; }

.book-list { display: flex; flex-direction: column; gap: 1.75rem; list-style: none; }

.book-entry {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 1.25rem;
  align-items: start;
}

.book-entry__cover { display: block; flex-shrink: 0; }

.book-entry__cover img {
  display: block;
  width: 100%;
  height: auto;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--ink) 15%, transparent);
}

.book-entry__info { display: flex; flex-direction: column; gap: 0.2rem; }

.book-entry__title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1.25;
  color: var(--ink);
  margin: 0;
}

.book-entry__title a { color: var(--ink); text-decoration: none; transition: color 0.2s; }
.book-entry__title a:hover { color: var(--accent); }

.book-entry__author { font-size: 0.82rem; font-weight: 300; font-style: italic; color: var(--ink-mid); margin: 0; }

.book-entry__note { font-size: 0.875rem; font-weight: 300; line-height: 1.7; color: var(--ink-mid); margin: 0.5rem 0 0; }
.book-entry__note p { font-size: 0.875rem; font-weight: 300; line-height: 1.7; color: var(--ink-mid); margin: 0 0 0.5rem; max-width: none; }
.book-entry__note p:last-child { margin-bottom: 0; }

.now-footer-note {
  font-size: 0.82rem;
  font-weight: 300;
  line-height: 1.7;
  color: var(--ink-light);
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  max-width: 52ch;
}

/* BOOK PAGE + BOOK INDEX CSS */

.book-page { padding-top: clamp(2rem, 5vw, 4rem); padding-bottom: calc(var(--gap) * 4); }
.book-entry-page { max-width: var(--post-max-w); }

.book-entry-page__header {
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

.book-entry-page__cover { position: relative; }

.book-cover {
  display: block; width: 100%; height: auto;
  box-shadow: 0 4px 20px color-mix(in srgb, var(--ink) 15%, transparent);
}

.book-entry-page__meta { display: flex; flex-direction: column; gap: 0.5rem; padding-top: 0.25rem; }

.book-entry-page__title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 300; line-height: 1.15; letter-spacing: -0.01em; color: var(--ink);
}

.book-entry-page__author {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2vw, 1.3rem);
  font-weight: 300; font-style: italic; color: var(--ink-mid); margin: 0;
}

.book-entry-page__isbn { font-size: 0.7rem; font-weight: 300; letter-spacing: 0.08em; color: var(--ink-light); margin: 0.5rem 0 0; }

.book-entry-page__note { border-top: 1px solid var(--border); padding-top: clamp(1.5rem, 3vw, 2rem); }
.book-entry-page__note p { font-size: 1rem; font-weight: 300; line-height: 1.8; color: var(--ink-mid); margin-bottom: 1.25rem; max-width: 62ch; }
.book-entry-page__note p:last-child { margin-bottom: 0; }
.book-entry-page__note a { color: var(--ink-mid); text-decoration: underline; text-underline-offset: 3px; }

.book-entry-page__footer { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }

.book-back {
  font-size: 0.72rem; font-weight: 400; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-light); transition: color 0.2s; text-decoration: none;
}
.book-back:hover { color: var(--accent); }

/* BOOK INDEX */
.book-index { padding-top: clamp(1.5rem, 3vw, 2.5rem); padding-bottom: calc(var(--gap) * 4); }

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(160px, 100%), 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
  list-style: none;
}

.book-card { display: flex; flex-direction: column; gap: 0.75rem; }
.book-card__cover { display: block; position: relative; overflow: hidden; background: var(--accent-pale); }

.book-card__cover img {
  display: block; width: 100%; height: auto;
  box-shadow: 0 3px 12px color-mix(in srgb, var(--ink) 15%, transparent);
  transition: var(--img-transition); filter: var(--img-filter);
}

.book-card:hover .book-card__cover img { transform: var(--img-hover-scale); filter: saturate(1); }

.book-card__info { display: flex; flex-direction: column; gap: 0.2rem; }

.book-card__title { font-family: var(--font-display); font-size: 1rem; font-weight: 400; line-height: 1.3; color: var(--ink); margin: 0; }
.book-card__title a { color: var(--ink); text-decoration: none; transition: color 0.2s; }
.book-card__title a:hover { color: var(--accent); }

.book-card__author { font-size: 0.78rem; font-weight: 300; font-style: italic; color: var(--ink-mid); margin: 0; }

@media (max-width: 560px) { .book-entry-page__header { grid-template-columns: 7rem 1fr; } }
@media (max-width: 420px) { .book-entry-page__header { grid-template-columns: 1fr; } .book-cover { max-width: 8rem; } }

/* ─────────────────────────────────────────────
   SIDENOTES
   Tufte-style margin notes for blog posts
   ───────────────────────────────────────────── */

/* ── Layout: widen post when sidenotes are active ── */
@media (min-width: 900px) {
  .post-page.has-sidenotes {
    max-width: 1080px;
  }

  .post-page.has-sidenotes .post-body {
    max-width: none;
  }
}

/* ── Inline wrapper ── */
.sidenote {
  display: inline;
}

/* ── Toggle: superscript marker ── */
.sidenote-toggle {
  cursor: pointer;
  user-select: none;
  font-size: 0.68em;
  vertical-align: super;
  color: var(--accent);
  margin-left: 0.05em;
  line-height: 0;
}

/* ── Checkbox hidden — controls open/close on mobile ── */
.sidenote-checkbox {
  display: none;
}

/* ── Automatic numbering ── */
.sidenotes-container {
  counter-reset: sidenote-counter;
}

.sidenote-numbered {
  counter-increment: sidenote-counter;
}

.sidenote-numbered .sidenote-toggle::before {
  content: counter(sidenote-counter);
}

.sidenote-numbered .sidenote-content::before {
  content: counter(sidenote-counter) ". ";
  font-weight: 500;
  color: var(--accent);
}

/* ── Sidenote & marginnote content: shared type styles ── */
.sidenote-content,
.marginnote {
  font-size: 0.8rem;
  line-height: 1.65;
  color: var(--ink-light);
  font-family: var(--font-body);
  font-weight: 300;
}

/* ── Desktop: float into right margin ── */
@media (min-width: 900px) {
  .sidenote-content,
  .marginnote {
    display: block;
    float: right;
    clear: right;
    width: 26%;
    margin-left: 2rem;
    margin-top: 0.25rem;
    margin-bottom: 1rem;
    padding-left: 0.875rem;
    border-left: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
  }
}

/* ── Mobile: collapsed inline, expand on toggle ── */
@media (max-width: 899px) {
  .sidenote-content {
    display: none;
    float: none;
    width: auto;
    margin: 0.6rem 0 0.6rem 1.25rem;
    padding: 0.65rem 0.875rem;
    border-left: 2px solid color-mix(in srgb, var(--ink) 15%, transparent);
    background: color-mix(in srgb, var(--ink) 3%, transparent);
  }

  .sidenote-checkbox:checked ~ .sidenote-content {
    display: block;
  }

  .sidenote-toggle {
    display: inline-block;
    padding: 1px 4px;
    border: 1px solid color-mix(in srgb, var(--ink) 20%, transparent);
    border-radius: 2px;
    font-size: 0.65em;
    vertical-align: super;
    line-height: 1.4;
  }

  .marginnote {
    display: block;
    float: none;
    margin: 0.75rem 0 0.75rem 1.25rem;
    padding: 0.65rem 0.875rem;
    border-left: 2px solid color-mix(in srgb, var(--ink) 15%, transparent);
  }
}

/* ── Links inside sidenotes ── */
.sidenote-content a,
.marginnote a {
  color: var(--ink-mid);
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 25%, transparent);
  text-decoration: none;
}

.sidenote-content a:hover,
.marginnote a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ── Tufte extras ── */

/* Small caps for opening words of a section */
.newthought {
  font-variant: small-caps;
  letter-spacing: 0.04em;
}

/* Epigraph: opening quote */
.epigraph {
  margin: 2.5em 0;
  padding-left: clamp(1.5rem, 3vw, 2.5rem);
  border-left: 2px solid var(--accent);
}

.epigraph p {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  font-style: italic;
  line-height: 1.55;
  color: var(--ink);
  margin: 0;
}

.epigraph footer {
  margin-top: 0.75em;
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-light);
}

/* ── Print: show all sidenotes ── */
@media print {
  .sidenote-content {
    display: block !important;
    float: right;
    width: 35%;
    font-size: 9pt;
  }
  .sidenote-toggle { display: none; }
}

/* ═══════════════════════════════════════
   HOME
   ═══════════════════════════════════════ */

/* Hide site title on home page — the big name serves this role */
.page-home .site-title { visibility: hidden; }

/* MASTHEAD */
.home-masthead {
  padding-top: clamp(3rem, 7vw, 5rem);
  padding-bottom: clamp(2rem, 4vw, 3.5rem);
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.home-masthead h1 {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 8vw, 6rem);
  font-weight: 400;
  line-height: 1.0;
  letter-spacing: -0.02em;
  color: var(--ink);
  white-space: nowrap;
}

.home-masthead h1 em {
  font-style: italic;
  color: var(--accent);
}

.home-masthead__intro {
  padding-top: 0.5rem;
}

.home-masthead__intro p {
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.8;
  color: var(--ink-mid);
  max-width: 48ch;
  margin: 0;
}

/* NOW STRIP — kept for any future use */
.now-strip {
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  margin-bottom: calc(var(--gap) * 2);
}

.now-strip__label {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-light);
  margin-bottom: 0.75rem;
  transition: color 0.2s;
}
.now-strip__label:hover { color: var(--accent); }

.now-strip__items { display: flex; flex-direction: column; gap: 0.3rem; }

.now-strip__item {
  display: flex;
  align-items: baseline;
  font-size: 0.82rem;
  font-weight: 300;
  line-height: 1.5;
}

.now-strip__item dt {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--ink);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 8rem;
}

.now-strip__item dt::after {
  content: '\2014';
  margin: 0 0.5rem;
  color: var(--border-mid);
  font-weight: 300;
}

.now-strip__item dd { color: var(--ink-mid); }

.now-strip__item dd a {
  color: var(--ink-mid);
  text-decoration: underline dotted;
  text-decoration-color: color-mix(in srgb, var(--ink-mid) 40%, transparent);
  text-underline-offset: 2px;
  transition: color 0.2s, text-decoration-color 0.2s;
}
.now-strip__item dd a:hover { color: var(--ink); text-decoration-style: solid; }

.now-strip__item dd.book-links a + a::before {
  content: ', ';
  color: var(--ink-mid);
  text-decoration: none;
  pointer-events: none;
}

.now-strip__more {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.75rem;
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-light);
  transition: color 0.2s, gap 0.2s;
}
.now-strip__more::after { content: '\2192'; }
.now-strip__more:hover { color: var(--accent); gap: 0.55rem; }

/* NOW STRIP — GRID VARIANT */
.now-strip--grid {
  display: grid;
  grid-template-columns: 5rem 1fr;
  grid-template-rows: auto auto;
  column-gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.now-strip--grid .now-strip__label {
  grid-row: 1; grid-column: 1;
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--ink);
  margin-bottom: 0;
  padding-top: 0.15rem;
}

.now-strip--grid .now-strip__items {
  grid-row: 1; grid-column: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem 3rem;
  flex-direction: unset;
}

.now-strip--grid .now-strip__item { flex-direction: column; align-items: flex-start; gap: 0.3rem; }

.now-strip--grid .now-strip__item dt {
  min-width: unset;
  font-size: 0.63rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.now-strip--grid .now-strip__item dt::before { content: '\25CF'; font-size: 0.5rem; line-height: 1; }
.now-strip--grid .now-strip__item dt::after { content: none; }
.now-strip--grid .now-strip__item dd { font-size: 0.9rem; font-weight: 300; line-height: 1.45; color: var(--ink-mid); }
.now-strip--grid .now-strip__more { grid-row: 2; grid-column: 2; margin-top: 0.5rem; }

/* RECENT POSTS */
.home-posts { padding-top: calc(var(--gap) * 0.5); padding-bottom: calc(var(--gap) * 4); }

.home-posts__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 1.75rem 0 1.5rem;
  border-top: 1px solid var(--border);
  margin-bottom: calc(var(--gap) * 1.5);
}

.home-posts__label { font-size: 0.72rem; font-weight: 400; letter-spacing: 0.15em; text-transform: uppercase; color: var(--ink-light); }

.home-posts__all {
  font-size: 0.72rem; font-weight: 400; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-mid); transition: color 0.2s, gap 0.2s; display: inline-flex; align-items: center; gap: 0.4rem;
}
.home-posts__all::after { content: '\2192'; }
.home-posts__all:hover { color: var(--accent); gap: 0.65rem; }

.home-posts__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 3vw, 2.5rem);
  list-style: none;
}

.home-posts__grid .post-card__date { display: none; }
.home-posts__grid .post-card__read-time { display: none; }
.home-posts__grid .post-card__title { font-size: clamp(1.1rem, 2vw, 1.4rem); }
.home-posts__grid .post-card__image { margin-bottom: 0.75rem; }

/* HOME RESPONSIVE */
@media (max-width: 860px) {
  .now-strip--grid .now-strip__items { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .home-posts__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .now-strip--grid { grid-template-columns: 1fr; }
  .now-strip--grid .now-strip__label { margin-bottom: 0.75rem; }
  .now-strip--grid .now-strip__more { grid-column: 1; }
  .now-strip__item dt { min-width: 6rem; }
  .now-strip__more { display: none; }
}
@media (max-width: 560px) {
  .home-masthead { grid-template-columns: 1fr; gap: 1.25rem; }
  .home-masthead h1 { white-space: normal; }
}
@media (max-width: 480px) {
  .home-posts__grid { grid-template-columns: 1fr; }
}