/* refresh.css — scholarly-engineering aesthetic.
   Drops legacy CDN deps and lifts the rjcheale.com palette + button patterns.
   Self-hosted Merriweather for nav + heading + post body; system sans stack for non-serif text.
   See docs/adr/0005-theme-evaluation.md and ~/Sites/rjcheale-author-site/static/css/custom.css. */

/* Self-hosted Merriweather — scholarly serif used across the site (variable weights 400-700). */
@font-face {
  font-family: 'Merriweather';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/merriweather/merriweather-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Merriweather';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/merriweather/merriweather-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Palette — inherits from rjcheale.com (~/Sites/rjcheale-author-site/static/css/custom.css L27-38)
     with #031002 dark-section + #fffff9 header + #F7F7F1 light-section per user requests. */
  --rc-bg: #fafaf6;
  --rc-bg-muted: #f3f0ea;
  --rc-bg-hero: #F7F7F1;          /* light alternating-section bg */
  --rc-bg-header: #fffff9;        /* nav/header bg — paler than body for visual layer */
  --rc-fg: #1D2A3A;
  --rc-fg-muted: #4a5a70;
  --rc-accent: #1D2A3A;
  --rc-accent-hover: #C7A45B;
  --rc-sage: #abc77e;
  --rc-sage-deep: #6E8C50;
  --rc-gold: #C7A45B;
  --rc-cream: #F5F0E6;
  --rc-nav-active-bg: #031002;
  --rc-nav-active-fg: #F5F0E6;
  --rc-nav-hover-bg: #f3f0ea;
  --rc-section-dark: #031002;     /* user-requested deep blackgreen for dark sections */
  --rc-section-dark-fg: #F5F0E6;
  --rc-on-accent: #F5F0E6;        /* readable text colour on top of --rc-accent (cream on navy = ~12:1) */
  --rc-border: #e3e2da;
  --rc-link: #1D2A3A;
  --rc-link-hover: #C7A45B;
  --rc-code-bg: #f0ede3;
  --rc-card-shadow: 0 1px 3px rgba(3, 16, 2, 0.06), 0 4px 12px rgba(3, 16, 2, 0.06);
  --rc-card-shadow-hover: 0 4px 8px rgba(3, 16, 2, 0.08), 0 12px 28px rgba(3, 16, 2, 0.1);
  --rc-radius: 4px;
  --rc-radius-pill: 25px;
  --rc-transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Font stacks — use these tokens for font-family declarations so a future typeface change
     (e.g. swap Merriweather for Source Serif Pro) touches one line, not 27. */
  --rc-font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --rc-font-serif: 'Merriweather', Georgia, "Times New Roman", serif;
  --rc-font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* Typographic scale — 1.25 (Major Third) modular ratio.
     Body anchored at clamp(1rem, fluid-vw, 1.125rem) = 16-18px (mobile → ultrawide).
     Calibrated against rjcheale-author-site's perceived density (~14-16px body)
     while preserving long-form engineering-blog readability.
     Every other size derives from --fs-body via calc(), so changing --fs-body
     rescales the entire hierarchy — no per-element clamp recalculation needed.
     Industry-standard ratio (Material Design, Tailwind default, Utopia).
     Nav buttons + brand intentionally use fixed 1rem so they don't track body. */
  --fs-body:     clamp(1rem, 0.97rem + 0.13vw, 1.125rem);   /* 16 → 18px */
  --fs-xs:       calc(var(--fs-body) * 0.7);                 /* 11.2 → 12.6 — footer fine print, micro-meta */
  --fs-meta:     calc(var(--fs-body) * 0.8);                 /* 12.8 → 14.4 — small/meta line, card dates */
  --fs-lead:     calc(var(--fs-body) * 1.15);                /* 18.4 → 20.7 — taglines, lead paragraphs */
  --fs-h4:       calc(var(--fs-body) * 1.25);                /* 20 → 22.5 — card titles, minor section heads */
  --fs-h3:       calc(var(--fs-body) * 1.5625);              /* 25 → 28.1 — section heads (Recent Posts) */
  --fs-h2:       calc(var(--fs-body) * 1.953);               /* 31.25 → 35.2 — post h2 */
  --fs-h1:       calc(var(--fs-body) * 2.441);               /* 39 → 43.9 — page/post hero titles */
  --fs-display:  calc(var(--fs-body) * 4.768);               /* 76.3 → 85.8 — homepage hero name */

  /* Spacing scale — use these tokens for paddings/margins/gaps so the design system stays consistent.
     Scale: 1.25× modular (each step ~25% larger than the previous). */
  --rc-space-1: 0.25rem;   /*  4px */
  --rc-space-2: 0.5rem;    /*  8px */
  --rc-space-3: 0.75rem;   /* 12px */
  --rc-space-4: 1rem;      /* 16px */
  --rc-space-5: 1.5rem;    /* 24px */
  --rc-space-6: 2rem;      /* 32px */
  --rc-space-7: 3rem;      /* 48px */
  --rc-space-8: 4rem;      /* 64px */
  --rc-space-9: 6rem;      /* 96px */
  --rc-space-10: 8rem;     /* 128px */
}

/* DARK MODE — applies in two cases:
   1. User has data-theme="dark" set explicitly via the toggle (localStorage persistence)
   2. User has no manual override AND OS prefers-color-scheme: dark
   The :not([data-theme="light"]) guard means "if the user manually picked light, never go dark". */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --rc-bg: #11161e;
    --rc-bg-muted: #1a212c;
    --rc-bg-hero: #1a212c;       /* Phase 4 — alt-section bg, visibly lighter than --rc-section-dark for rhythm */
    --rc-bg-header: #1a212c;     /* Phase 4 — header bg flips with theme (was stuck cream from light tokens) */
    --rc-fg: #e8e5dc;
    --rc-fg-muted: #a8aab0;
    --rc-accent: #abc77e;
    --rc-accent-hover: #d4b97a;
    --rc-nav-active-bg: #abc77e;
    --rc-nav-active-fg: #0c1018;
    --rc-nav-hover-bg: #2a3445;
    --rc-section-dark: #0c1018;
    --rc-section-dark-fg: #e8e5dc;
    --rc-on-accent: #0c1018;     /* dark text on sage = ~8:1 contrast (was cream on sage = 1.5:1, AA-fail) */
    --rc-border: #2a313c;
    --rc-link: #abc77e;
    --rc-link-hover: #d4b97a;
    --rc-code-bg: #1a212c;
    --rc-card-shadow: 0 1px 3px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.4);
    --rc-card-shadow-hover: 0 4px 8px rgba(0, 0, 0, 0.6), 0 12px 28px rgba(0, 0, 0, 0.5);
  }
}
/* Explicit dark mode (user toggled it on regardless of OS) */
:root[data-theme="dark"] {
  --rc-bg: #11161e;
  --rc-bg-muted: #1a212c;
  --rc-bg-hero: #1a212c;         /* Phase 4 — see comment above */
  --rc-bg-header: #1a212c;
  --rc-fg: #e8e5dc;
  --rc-fg-muted: #a8aab0;
  --rc-accent: #abc77e;
  --rc-accent-hover: #d4b97a;
  --rc-nav-active-bg: #abc77e;
  --rc-nav-active-fg: #0c1018;
  --rc-nav-hover-bg: #2a3445;
  --rc-section-dark: #0c1018;
  --rc-section-dark-fg: #e8e5dc;
  --rc-on-accent: #0c1018;
  --rc-border: #2a313c;
  --rc-link: #abc77e;
  --rc-link-hover: #d4b97a;
  --rc-code-bg: #1a212c;
  --rc-card-shadow: 0 1px 3px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.4);
  --rc-card-shadow-hover: 0 4px 8px rgba(0, 0, 0, 0.6), 0 12px 28px rgba(0, 0, 0, 0.5);
}

/* System font stack — body / non-serif chrome. Merriweather is scoped to nav buttons,
   hero name, section titles, card titles, post body, and footer text via explicit selectors.

   font-size: 100% restores the user-preferred browser root size (typically 16px)
   over Bootstrap 3's `html { font-size: 10px }` reset, so 1rem = 16px and our
   --fs-* clamp tokens resolve to their intended sizes. Verified: BS3 only uses
   the string "rem" inside class names (glyphicon-remove*), never as a unit. */
html {
  font-size: 100%;
  font-family: var(--rc-font-sans);
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html, body {
  background-color: var(--rc-bg);
  color: var(--rc-fg);
}
body {
  line-height: 1.65;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: inherit;
  letter-spacing: 0.01em;            /* Merriweather: slight positive tracking, not tight */
  color: var(--rc-fg);
  font-weight: 700;
}

/* Recent posts section heading — Merriweather, matches the hero treatment.
   Inherits per-section colours via .page-section--dark / --light scoping below. */
.recent-posts-title, .blog-main-title, .books-main-title {
  font-family: var(--rc-font-serif);
  font-size: var(--fs-h3);
  font-weight: 700;
  letter-spacing: 0.02em;            /* Merriweather scholarly tracking */
  line-height: 1.15;                  /* Merriweather wears generous leading well */
  margin: 0 0 1rem;
  color: var(--rc-fg);
}

.recent-posts-text, .blog-main-subtitle, .lead {
  font-family: var(--rc-font-serif);
  font-size: var(--fs-lead);
  font-style: italic;
  font-weight: 400;
  color: var(--rc-fg-muted);
  max-width: 70ch;
  line-height: 1.55;
  text-align: center;             /* centre under the title */
  margin: 0 auto 2.5rem;          /* horizontal-centre + breathing room before the post grid */
}

p.author-category, p.recent-posts-subtitle {
  color: var(--rc-fg-muted);
}

code, kbd, pre, samp {
  font-family: var(--rc-font-mono);
  font-size: 0.92em;
}
code {
  background-color: var(--rc-code-bg);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  border: 1px solid var(--rc-border);
}
.highlight pre, pre code, .highlight {
  background-color: var(--rc-code-bg);
  border-radius: var(--rc-radius);
  padding: 1em 1.25em;
  overflow-x: auto;
  font-size: 0.88em;
  line-height: 1.55;
}
.highlight pre code {
  background-color: transparent;
  border: none;
  padding: 0;
}

a {
  color: var(--rc-link);
  transition: color var(--rc-transition);
}
a:hover, a:focus {
  color: var(--rc-link-hover);
}

/* ============================================================================
   STICKY HEADER + CHUNKY-BUTTON NAV (rjcheale.com pattern, in sans-serif)
   ============================================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--rc-bg-header);     /* #fffff9 — user-requested paler-than-body header */
  border-bottom: 1px solid var(--rc-border);
}
.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: flex-end;                  /* no brand on the left — nav goes flush right */
  padding: 0;
  gap: 0;
  flex-wrap: wrap;
  min-height: 64px;                            /* Phase 5 — was 80px; reclaim ~21% of iPhone SE viewport */
  max-width: none;
}
.site-brand {
  text-decoration: none;
  color: var(--rc-fg);
  font-family: var(--rc-font-serif);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  padding: 0 1.5rem;
}
.site-brand:hover, .site-brand:focus { color: var(--rc-gold); }
.site-brand--invisible { visibility: hidden; }

.site-nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0;                       /* flush buttons */
  list-style: none;
  padding: 0;
  margin: 0;
  align-items: stretch;
}
.site-nav-item { display: flex; }
.site-nav-item a, .site-nav-item button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--rc-fg);
  font-family: var(--rc-font-serif);
  font-size: 1rem;                          /* Phase 5 — was 1.65rem; chrome no longer competes with content */
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: none;
  padding: 1.1rem 1.4rem;                   /* Phase 5 — was 1.5rem 1.75rem; nav button height ~44px */
  border: 0;
  border-top: 3px solid transparent;        /* top-border indicator — appears on hover/active */
  border-radius: 0;
  background-color: transparent;
  cursor: pointer;
  transition: background-color var(--rc-transition), color var(--rc-transition), border-top-color var(--rc-transition);
}
.site-nav-item button { -webkit-appearance: none; appearance: none; }
.site-nav-item a:hover, .site-nav-item a:focus,
.site-nav-item button:hover, .site-nav-item button:focus {
  background-color: var(--rc-nav-hover-bg);
  color: var(--rc-fg);
  border-top-color: var(--rc-accent);        /* coloured top border on hover — rjcheale-style tab indicator */
}
.site-nav-item.is-active a {
  /* Phase 5 — gold top-border ONLY for active; no fill. Differentiates from hover (cream fill, accent border). */
  background-color: transparent;
  color: var(--rc-fg);
  border-top-color: var(--rc-gold);
}
.site-nav-item.is-active a:hover, .site-nav-item.is-active a:focus {
  background-color: var(--rc-nav-hover-bg);
  color: var(--rc-fg);
  border-top-color: var(--rc-gold);
}
.site-nav-item--icon a, .site-nav-item--icon button { padding: 1.5rem 1rem; }
.site-nav-item--icon a svg, .site-nav-item--icon button svg { display: block; }

@media (max-width: 540px) {
  .site-header-inner { min-height: auto; }
  .site-brand { padding: 0.65rem 1rem; }
  .site-nav-item a { padding: 0.9rem 1.1rem; font-size: 0.85rem; letter-spacing: 0.08em; }
}

/* ============================================================================
   HOMEPAGE HERO — LARGE, LEFT-ALIGNED, FLAT BG, CINZEL NAME
   ============================================================================ */

/* ============================================================================
   ALTERNATING SECTIONS — scalable rhythm (user request).
   Every direct <section> child of <main> alternates dark/light.
   The hero is the 1st <section> (odd = dark).
   recent_posts.html outputs the 2nd <section> (even = light).
   Future sections auto-alternate as you add them. No template changes required.
   ============================================================================ */

main > section:nth-of-type(odd),
main > .home-hero {
  background-color: var(--rc-section-dark);
  color: var(--rc-section-dark-fg);
}
main > section:nth-of-type(even):not(.home-hero) {
  background-color: var(--rc-bg-hero);
  color: var(--rc-fg);
}

/* When a section is dark, flip ALL heading + paragraph + link colours inside it. */
main > section:nth-of-type(odd) h1,
main > section:nth-of-type(odd) h2,
main > section:nth-of-type(odd) h3,
main > section:nth-of-type(odd) h4,
main > section:nth-of-type(odd) .recent-posts-title,
main > section:nth-of-type(odd) .recent-posts-text,
main > section:nth-of-type(odd) .lead,
main > section:nth-of-type(odd) p {
  color: var(--rc-section-dark-fg);
}
main > section:nth-of-type(odd) .recent-posts-text,
main > section:nth-of-type(odd) .lead {
  color: color-mix(in srgb, var(--rc-section-dark-fg) 75%, transparent);
}

.home-hero {
  padding: 4.5rem 2.5rem 4rem;     /* Phase 2 — was 7rem 2.5rem 6rem; less marketing-furniture, more writing */
  text-align: left;
}

/* ============================================================================
   PAGE HERO — used by /posts/, /about/, /artifacts/, /tags/, /categories/ etc.
   Smaller than the homepage hero but uses the same dark-section visual language.
   ============================================================================ */
.page-hero {
  background-color: var(--rc-section-dark);
  color: var(--rc-section-dark-fg);
  padding: 5rem 2.5rem 4rem;
  border-bottom: 1px solid var(--rc-border);
}
.page-hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  text-align: left;
}
.page-hero-title {
  font-family: var(--rc-font-serif);
  font-size: var(--fs-h1);
  font-weight: 700;
  letter-spacing: 0.025em;            /* positive tracking suits Merriweather */
  line-height: 1.1;
  margin: 0 0 1rem;
  color: var(--rc-section-dark-fg);
}
.page-hero-subtitle {
  font-family: var(--rc-font-serif);
  font-size: var(--fs-lead);
  font-style: italic;
  font-weight: 500;
  color: color-mix(in srgb, var(--rc-section-dark-fg) 80%, transparent);
  max-width: 60ch;
  line-height: 1.5;
  margin: 0;
}

.page-body {
  background-color: var(--rc-bg-hero);
  padding: var(--rc-space-8) var(--rc-space-5) var(--rc-space-9);
  min-height: 50vh;
}

/* ============================================================================
   BLOG POST LAYOUT — used by layouts/posts/single.html
   Centered hero, 2-column body+sidebar, social share, author bio, related.
   ============================================================================ */

.post-hero {
  background-color: var(--rc-section-dark);
  color: var(--rc-section-dark-fg);
  padding: var(--rc-space-9) var(--rc-space-5) var(--rc-space-8);
  border-bottom: 1px solid var(--rc-border);
  text-align: center;                 /* centered for blog posts (user request) */
}
.post-hero-inner {
  max-width: 70ch;
  margin: 0 auto;
}
.post-hero-title {
  font-family: var(--rc-font-serif);
  font-size: var(--fs-h1);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  margin: 0 0 var(--rc-space-4);
  color: var(--rc-section-dark-fg);
}
.post-hero-meta {
  font-family: var(--rc-font-serif);
  font-style: italic;
  font-size: var(--fs-meta);
  color: color-mix(in srgb, var(--rc-section-dark-fg) 75%, transparent);
  margin: 0;
}

.post-layout .row { display: flex; flex-wrap: wrap; }
.post-main .post-content-body {
  margin: 0;                          /* sit at left edge of main column, not centred within it */
  max-width: none;
}

.post-sidebar { padding-left: var(--rc-space-5); }

@media (max-width: 991px) {
  .post-sidebar { padding-left: 0; margin-top: var(--rc-space-7); }
}
@media (max-width: 991px) {
  /* Phone + small-tablet (iPad portrait, small laptops): the sidebar duplicates
     primary nav and stutters the reading flow between author-bio and related-posts.
     Hide entirely; sidebar content is reachable from the primary nav + /tags/ + /categories/. */
  .post-sidebar { display: none; }
}

/* ============================================================================
   SOCIAL SHARE — "Carry it further" (renamed from "Cultivate a Conversation")
   ============================================================================ */
.social-share {
  margin: var(--rc-space-8) 0 var(--rc-space-6);
  padding: var(--rc-space-6) 0;
  border-top: 1px solid var(--rc-border);
  border-bottom: 1px solid var(--rc-border);
  text-align: center;
}
.social-share-title {
  font-family: var(--rc-font-serif);
  font-size: var(--fs-h4);
  font-weight: 600;
  font-variant-caps: small-caps;
  letter-spacing: 0.08em;
  color: var(--rc-fg);
  margin: 0 0 var(--rc-space-4);
  text-transform: none;
}
.social-share-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--rc-space-3);
  padding: 0;
  margin: 0;
  list-style: none;
}
.social-share-links li { margin: 0; }
/* Social share buttons — token-based so the pill theme-switches with the rest of the site.
   Light mode: muted-cream pill with navy text. Dark mode: bg-muted pill with light text.
   Hover (both themes): inverts to accent fill + cream text. */
.social-share-links a {
  display: inline-flex;
  align-items: center;
  gap: var(--rc-space-2);
  font-family: var(--rc-font-serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--rc-fg);
  background-color: var(--rc-bg-muted);
  border: 1px solid var(--rc-border);
  border-radius: var(--rc-radius-pill);
  padding: 0.5rem 1.1rem;
  text-decoration: none;
  transition: background-color var(--rc-transition), color var(--rc-transition), border-color var(--rc-transition);
}
.social-share-links a:hover, .social-share-links a:focus {
  background-color: var(--rc-accent);
  color: var(--rc-on-accent);    /* token theme-switches: cream on navy (light) / dark on sage (dark) */
  border-color: var(--rc-accent);
}
.social-share-links a .icon,
.social-share-links a svg {
  width: 1em;
  height: 1em;
  fill: currentColor;
  color: inherit;
}
.social-share-links a svg path { fill: currentColor; }

/* ============================================================================
   AUTHOR BIO — "About Rob Cheale" below each post
   ============================================================================ */
.author-bio {
  display: flex;
  gap: var(--rc-space-5);
  align-items: flex-start;
  margin: var(--rc-space-6) 0;
  padding: var(--rc-space-6);
  background-color: var(--rc-bg);
  border: 1px solid var(--rc-border);
  border-radius: var(--rc-radius);
  border-left: 4px solid var(--rc-gold);
}
.author-bio-avatar img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--rc-bg-muted);
  flex-shrink: 0;
}
.author-bio-content { flex: 1; }
.author-bio-title {
  font-family: var(--rc-font-serif);
  font-size: var(--fs-h4);
  font-weight: 600;
  font-variant-caps: small-caps;
  letter-spacing: 0.06em;
  color: var(--rc-fg);
  margin: 0 0 var(--rc-space-2);
  text-transform: none;
}
.author-bio-content p {
  font-family: var(--rc-font-serif);
  font-size: var(--fs-body);
  line-height: 1.55;
  color: var(--rc-fg);
  margin: 0 0 var(--rc-space-2);
}
.author-bio-content p:last-child { margin-bottom: 0; }
.author-bio-content p.author-bio-links {
  font-style: italic;
  font-size: 0.95rem;
  color: var(--rc-fg-muted);
}
.author-bio-content a {
  color: var(--rc-link);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--rc-link) 40%, transparent);
}
.author-bio-content a:hover { color: var(--rc-gold); text-decoration-color: var(--rc-gold); }

@media (max-width: 600px) {
  .author-bio { flex-direction: column; align-items: center; text-align: center; }
}

/* ============================================================================
   RELATED POSTS — "More Field Notes" (renamed from "Other Shoots from the Garden")
   ============================================================================ */
.related-posts {
  margin: var(--rc-space-8) 0 var(--rc-space-6);
  padding-top: var(--rc-space-6);
  border-top: 1px solid var(--rc-border);
}
.related-posts-title {
  font-family: var(--rc-font-serif);
  font-size: var(--fs-h3);
  font-weight: 600;
  font-variant-caps: small-caps;
  letter-spacing: 0.06em;
  color: var(--rc-fg);
  text-align: center;
  margin: 0 0 var(--rc-space-6);
  text-transform: none;
}
.related-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--rc-space-5);
}
@media (max-width: 900px) {
  .related-posts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .related-posts-grid { grid-template-columns: minmax(0, 1fr); }
}
.home-hero-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
  text-align: left;
}
.home-hero-inner.has-headshot {
  grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr);
}
@media (max-width: 900px) {
  .home-hero { padding: 4rem 1.5rem 3.5rem; }
  .home-hero-inner.has-headshot { grid-template-columns: 1fr; }
}

.home-hero-name {
  font-family: var(--rc-font-serif);
  font-size: var(--fs-display);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.05;
  margin: 0 0 1.5rem;
  color: var(--rc-section-dark-fg);
  text-align: left;
}
.home-hero-tagline {
  font-family: var(--rc-font-serif);
  font-size: var(--fs-lead);
  color: var(--rc-section-dark-fg);
  font-weight: 500;
  margin: 0 0 1.5rem;
  letter-spacing: 0.01em;
  line-height: 1.3;
  text-transform: none;
  font-variant-caps: normal;
  font-style: italic;
}
.home-hero-bio p {
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--rc-section-dark-fg);
  max-width: 60ch;
  margin: 0 0 1.5rem;
  font-weight: 400;
}
.home-hero-bio p:last-child { margin-bottom: 0; }
.home-hero-bio a {
  color: var(--rc-section-dark-fg);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, var(--rc-section-dark-fg) 50%, transparent);
  text-underline-offset: 4px;
  transition: color var(--rc-transition), text-decoration-color var(--rc-transition);
}
.home-hero-bio a:hover, .home-hero-bio a:focus {
  color: var(--rc-gold);
  text-decoration-color: var(--rc-gold);
}
.home-hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0;
}
.home-hero-headshot { display: flex; justify-content: center; align-items: center; }
.home-hero-headshot img {
  width: 100%;
  max-width: 320px;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: var(--rc-card-shadow);
  border: 4px solid var(--rc-bg);
}

/* ============================================================================
   BUTTONS — chunky pill, inversion on hover (rjcheale .continue-reading-btn pattern)
   Larger CTA size per user request.
   ============================================================================ */

.btn-template-main {
  display: inline-block;
  background-color: var(--rc-accent);
  color: var(--rc-cream);
  border: 1px solid var(--rc-accent);
  border-radius: var(--rc-radius-pill);
  padding: 0.95rem 2.25rem;          /* larger CTA */
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color var(--rc-transition), color var(--rc-transition), border-color var(--rc-transition);
}
.btn-template-main:hover, .btn-template-main:focus {
  background-color: var(--rc-cream);
  color: var(--rc-accent);
  border-color: var(--rc-accent);
}

.btn-template-ghost {
  display: inline-block;
  background-color: transparent;
  color: var(--rc-fg);
  border: 1px solid var(--rc-fg);
  border-radius: var(--rc-radius-pill);
  padding: 0.95rem 2.25rem;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color var(--rc-transition), color var(--rc-transition);
}
.btn-template-ghost:hover, .btn-template-ghost:focus {
  background-color: var(--rc-accent);
  color: var(--rc-cream);
  border-color: var(--rc-accent);
}

.continue-reading-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  background-color: var(--rc-cream);
  color: var(--rc-accent);
  border: 1px solid var(--rc-cream);
  border-radius: var(--rc-radius-pill);
  padding: 0.6rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color var(--rc-transition), color var(--rc-transition);
}
.continue-reading-btn .icon-link {
  width: 0.95em;
  height: 0.95em;
  display: inline-block;
  vertical-align: -0.1em;
}
.continue-reading-btn:hover, .continue-reading-btn:focus {
  background-color: var(--rc-accent);
  color: var(--rc-cream);
  border-color: var(--rc-cream);
}

/* ============================================================================
   SECTIONS + CARDS
   ============================================================================ */

.home-section, .box, .box-simple {
  background-color: var(--rc-bg-muted);
  color: var(--rc-fg);
}
.home-section-blue, .home-section-dark, .bg-default, .bg-blue {
  background-color: var(--rc-section-dark);
  color: var(--rc-section-dark-fg);
}
.home-section-blue h1, .home-section-blue h2, .home-section-blue h3,
.home-section-blue h4, .home-section-blue h5, .home-section-blue h6,
.home-section-blue p, .home-section-blue .lead {
  color: var(--rc-section-dark-fg);
}

/* CSS Grid container for the homepage Recent Posts — equal card heights, no BS3 cols */
.recent-posts-grid {
  display: grid;
  /* minmax(0, 1fr) prevents track explosion when an img inside a card has a
     natural width > track size; with plain 1fr each track grows to min-content
     (= the image's natural width), bursting the max-width constraint. */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--rc-space-6);
  max-width: 1200px;
  margin: 0 auto;
  align-items: stretch;
}
@media (max-width: 900px) { .recent-posts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .recent-posts-grid { grid-template-columns: minmax(0, 1fr); } }

/* ----------------------------------------------------------------------------
   UNIFIED CARD SYSTEM (.rc-card)
   Single primitive replacing the .box-image-text.blog (home) + .blog-post-card
   (/posts/, related) duplicates. BEM-style child classes; size variants via
   --md (home + related, 3-up) / --lg (/posts/ list, larger title).
   Always anchor-wrapped (whole-card link). No hover overlay (low-value).
   ---------------------------------------------------------------------------- */

.rc-card {
  background-color: var(--rc-bg);
  border: 1px solid var(--rc-border);
  border-radius: 12px;              /* matches rjcheale-author-site .blog-post-card border-radius */
  box-shadow: var(--rc-card-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;                     /* belt-and-suspenders — never burst the grid track */
  text-align: center;
  text-decoration: none;
  color: inherit;
  transition: box-shadow var(--rc-transition), transform var(--rc-transition);
}
.rc-card:hover, .rc-card:focus {
  box-shadow: var(--rc-card-shadow-hover);
  transform: translateY(-3px);
  text-decoration: none;
  color: inherit;
}

.rc-card__image {
  aspect-ratio: 16/10;
  overflow: hidden;
  background: var(--rc-bg-muted);
  flex-shrink: 0;
}
.rc-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms ease;
}
.rc-card:hover .rc-card__image img { transform: scale(1.05); }

.rc-card__body {
  padding: 1.75rem 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  justify-content: center;
}

.rc-card__title {
  font-family: var(--rc-font-serif);
  font-size: 1.4rem;              /* matches rjcheale-author-site .blog-post-card .card-title */
  font-weight: 600;
  font-variant-caps: small-caps;
  letter-spacing: 0.04em;
  line-height: 1.2;
  margin: 0 0 0.75rem;
  text-transform: none;
  color: var(--rc-fg);
  transition: color var(--rc-transition);
}
.rc-card:hover .rc-card__title,
.rc-card:focus .rc-card__title { color: var(--rc-gold); }

.rc-card__meta {
  font-family: var(--rc-font-serif);
  font-style: italic;
  font-size: 0.9rem;              /* matches rjcheale-author-site .blog-post-card .card-meta */
  font-weight: 400;
  color: var(--rc-fg-muted);
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.4;
  margin: 0;
}

.rc-card__text {
  font-family: var(--rc-font-serif);
  font-size: 14px;                /* matches rjcheale-author-site body text inside cards */
  line-height: 1.65;
  color: var(--rc-fg);
  margin: 0.85rem 0 0;
  flex-grow: 1;
}

/* Size modifier — --md is the default; --lg gets a slightly larger title for /posts/ list */
.rc-card--lg .rc-card__title { font-size: 1.55rem; }

/* Theme's recent_posts.html outputs <section class="bar background-white"> — neutralise to inherit
   from the alternating-section rule. */
.bar.background-white {
  background-color: inherit;
  padding: 5rem 2.5rem;
}

/* ============================================================================
   POST BODY (single.html /about/, /posts/<slug>/) — long-form readable prose
   ============================================================================ */
.post-content-body {
  font-family: var(--rc-font-serif);
  font-size: var(--fs-body);
  line-height: 1.7;
  color: var(--rc-fg);
  max-width: 70ch;
  margin: 0 auto;
}
.post-content-body h1, .post-content-body h2, .post-content-body h3, .post-content-body h4 {
  font-family: var(--rc-font-serif);
  color: var(--rc-fg);
  letter-spacing: 0.01em;            /* positive Merriweather tracking */
  line-height: 1.25;
  margin-top: var(--rc-space-7);
  margin-bottom: var(--rc-space-4);
}
.post-content-body h2 {
  font-size: var(--fs-h2);
  font-weight: 700;
  letter-spacing: 0.015em;
  font-variant-caps: small-caps;     /* scholarly small-caps for h2s, like rjcheale */
}
.post-content-body h3 {
  font-size: var(--fs-h3);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.post-content-body h4 {
  font-size: var(--fs-h4);
  font-weight: 600;
  font-variant-caps: small-caps;
  letter-spacing: 0.04em;
}
.post-content-body p { margin: 0 0 1.5rem; }
.post-content-body a {
  color: var(--rc-link);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--rc-link) 40%, transparent);
  text-underline-offset: 3px;
  transition: color var(--rc-transition), text-decoration-color var(--rc-transition);
}
.post-content-body a:hover { color: var(--rc-gold); text-decoration-color: var(--rc-gold); }
.post-content-body ul, .post-content-body ol {
  margin: 0 0 1.5rem;
  padding-left: 1.5rem;
}
.post-content-body li { margin-bottom: 0.5rem; }
.post-content-body strong { font-weight: 700; color: var(--rc-fg); }
.post-content-body em { font-style: italic; }
.post-content-body code {
  font-family: var(--rc-font-mono);
  background-color: var(--rc-code-bg);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  border: 1px solid var(--rc-border);
  font-size: 0.9em;
}
.post-content-body blockquote {
  border-left: 3px solid var(--rc-gold);
  padding-left: 1.5rem;
  margin-left: 0;
  font-style: italic;
  color: var(--rc-fg-muted);
}

/* ============================================================================
   SIDEBAR WIDGETS (/posts/ listing page — Search, Categories, Tags, RSS)
   ============================================================================ */
.panel.panel-default.sidebar-menu {
  background-color: var(--rc-bg);
  border: 1px solid var(--rc-border);
  border-radius: var(--rc-radius);
  box-shadow: var(--rc-card-shadow);
  margin-bottom: 1.5rem;
  overflow: hidden;
}
.panel.panel-default.sidebar-menu .panel-heading {
  background-color: var(--rc-bg-muted);
  border-bottom: 1px solid var(--rc-border);
  padding: 1rem 1.25rem;
  border-radius: 0;
}
.panel.panel-default.sidebar-menu .panel-heading .panel-title,
.panel.sidebar-menu .panel-heading h3 {
  font-family: var(--rc-font-serif);
  font-size: var(--fs-h4);
  font-weight: 600;
  font-variant-caps: small-caps;
  letter-spacing: 0.08em;
  margin: 0;
  color: var(--rc-fg);
  text-transform: none;
  display: inline-block;
  border-bottom: 4px solid var(--rc-gold);    /* GOLD underline — replaces theme's blue */
  padding-bottom: var(--rc-space-2);
  line-height: 1.1;
}
.panel.panel-default.sidebar-menu .panel-body {
  padding: 1.25rem;
  background-color: var(--rc-bg);
}
.sidebar-menu ul.nav { padding: 0; margin: 0; }
.sidebar-menu ul.nav li { list-style: none; }
.sidebar-menu ul.nav li a {
  font-family: var(--rc-font-serif);
  font-style: italic;
  font-size: var(--fs-body);
  font-weight: 400;
  color: var(--rc-fg);
  padding: 0.6rem 0.75rem;
  border-radius: 3px;
  transition: background-color var(--rc-transition), color var(--rc-transition);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}
.sidebar-menu ul.nav li a:hover, .sidebar-menu ul.nav li a:focus {
  background-color: var(--rc-bg-muted);
  color: var(--rc-gold);
}
.sidebar-menu ul.nav li a .icon-rss {
  flex-shrink: 0;
  width: 1.4em;
  height: 1.4em;
  color: var(--rc-accent);            /* RSS orange isn't on-brand; navy works against parchment */
}
.sidebar-menu ul.nav li a:hover .icon-rss { color: var(--rc-gold); }

/* Inline search input (replaces the old "Search posts" button) */
.sidebar-search-form {
  display: flex;
  border: 1px solid var(--rc-border);
  border-radius: 3px;
  overflow: hidden;
  background: var(--rc-bg);
}
.sidebar-search-input {
  flex: 1;
  padding: 0.65rem 0.85rem;
  border: 0;
  background: transparent;
  color: var(--rc-fg);
  font-family: var(--rc-font-serif);
  font-size: var(--fs-body);
  font-style: italic;
  letter-spacing: 0.02em;
}
.sidebar-search-input::placeholder {
  color: var(--rc-fg-muted);
  font-style: italic;
  opacity: 0.8;
}
.sidebar-search-input:focus {
  outline: none;
  background: var(--rc-bg-muted);
}
.sidebar-search-btn {
  border: 0;
  background: var(--rc-accent);
  color: var(--rc-cream);
  padding: 0 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--rc-transition), color var(--rc-transition);
}
.sidebar-search-btn:hover, .sidebar-search-btn:focus {
  background: var(--rc-gold);
  color: var(--rc-accent);
}

/* Tag-cloud pills */
.sidebar-menu .tag-cloud a, .sidebar-menu div.tags a {
  display: inline-block;
  font-family: var(--rc-font-serif);
  font-size: 0.85rem;
  font-style: italic;
  background-color: var(--rc-bg-muted);
  color: var(--rc-fg);
  border: 1px solid var(--rc-border);
  border-radius: 15px;
  padding: 0.3rem 0.8rem;
  margin: 0.2rem 0.15rem;
  text-decoration: none;
  text-transform: none;
}
.sidebar-menu .tag-cloud a:hover, .sidebar-menu div.tags a:hover {
  background-color: var(--rc-accent);
  color: var(--rc-cream);
  border-color: var(--rc-accent);
}

/* /posts/ list page — 3-up grid on desktop (user-specified design intent),
   2-up on tablet, 1-up on mobile. minmax(0, 1fr) prevents track explosion. */
.blog-post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}
@media (max-width: 900px) {
  .blog-post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .blog-post-grid { grid-template-columns: minmax(0, 1fr); }
}

/* legacy .blog-post-card removed — superseded by unified .rc-card system above */
/* Blog pagination buttons */
.pager .blog-pagination-btn a, .pager a {
  font-family: var(--rc-font-serif);
  font-size: 0.95rem;
  font-variant-caps: small-caps;
  letter-spacing: 0.05em;
  background: transparent;
  color: var(--rc-fg);
  border: 1px solid var(--rc-border);
  border-radius: var(--rc-radius-pill);
  padding: 0.5rem 1.2rem;
  text-decoration: none;
}
.pager .blog-pagination-btn a:hover { background: var(--rc-accent); color: var(--rc-cream); border-color: var(--rc-accent); }

/* ============================================================================
   FOOTER — disclaimer + meta
   ============================================================================ */

#copyright {
  background-color: var(--rc-section-dark);
  color: var(--rc-section-dark-fg);
  padding: 2.5rem 1.25rem;
}
.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;           /* centre all children including disclaimer */
  gap: 1.25rem;
  max-width: 1000px;
  margin: 0 auto;
}
.footer-disclaimer {
  font-size: var(--fs-xs);    /* 0.7× body — footer fine-print scale */
  line-height: 1.6;
  color: var(--rc-cream);
  opacity: 0.9;
  margin: 0;
  text-align: center;
  max-width: 70ch;
  margin: 0 auto;
}
.footer-disclaimer strong { color: var(--rc-cream); font-weight: 700; }
.footer-disclaimer a { color: var(--rc-gold); }
.footer-disclaimer a:hover, .footer-disclaimer a:focus { color: var(--rc-cream); }
.footer-meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: var(--fs-xs);
  color: var(--rc-cream);
  opacity: 0.75;
  border-top: 1px solid color-mix(in srgb, var(--rc-cream) 20%, transparent);
  padding-top: 1.5rem;
  width: 100%;                    /* meta line stretches full width even though parent is align-items: center */
  align-self: stretch;
}
.footer-meta-line { margin: 0; }
.footer-meta a {
  color: var(--rc-cream);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--rc-cream) 40%, transparent);
}
.footer-meta a:hover, .footer-meta a:focus { color: var(--rc-gold); }

/* ============================================================================
   UTILITY HOOKS — small classes extracted from inline-style cleanups.
   ============================================================================ */
.blog-list-wrap { padding-top: var(--rc-space-6); }
.search-results { margin-top: var(--rc-space-6); }
.search-noscript {
  margin-top: var(--rc-space-6);
  padding: var(--rc-space-4);
  background: var(--rc-bg-muted);
  border: 1px solid var(--rc-border);
  border-radius: var(--rc-radius);
}

/* ============================================================================
   ACCESSIBILITY PRIMITIVES
   ============================================================================ */

*:focus-visible {
  outline: 2px solid var(--rc-accent);
  outline-offset: 2px;
  border-radius: 3px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .rc-card:hover {
    transform: none;
  }
}

.icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  fill: currentColor;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--rc-accent);
  color: var(--rc-cream);
  padding: 0.6em 1em;
  z-index: 9999;
  text-decoration: none;
}
.skip-link:focus { left: 1em; top: 1em; }
