/* ============================================================
   SwiftCMS — DISPATCH v3
   Desktop: max 1200px, sidebar 30% | Tablet: 768–1199px | Mobile: <768px
   ============================================================ */

/* ── DESIGN TOKENS ─────────────────────────────────────────────────────── */
:root {
  --paper: #F7F4EE;
  --ink: #14110F;
  --accent: #C8472A;
  --sage: #5B6B5C;
  --surface: #FFFFFF;
  --line: #E3DDD0;

  /* Layout */
  --max-width: 1200px;
  --sidebar-w: 30%;          /* sidebar is exactly 30% of content area */
  --content-w: calc(70% - 48px); /* article column with gap subtracted */
  --side-pad: 24px;

  /* Typography */
  --font-body: 'Source Serif 4 Fallback', Georgia, serif;
  --font-headings: 'Source Serif 4 Fallback', Georgia, serif;
  --font-ui: 'Inter', -apple-system, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --font-size-base: 17px;

  /* Visual */
  --radius: 8px;
  --radius-sm: 4px;
  --shadow: 0 2px 12px rgba(20,17,15,.07);
  --shadow-hover: 0 8px 32px rgba(20,17,15,.13);
  --transition: .18s ease;
}

/* ── RESET ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  background: #EDEAE4;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1,h2,h3,h4,h5,h6 { font-family: var(--font-headings); font-weight: 700; line-height: 1.2; color: var(--ink); }
a { color: inherit; text-decoration: none; }
/* ── CLS: ALL images always reserve their space ── */
img { display: block; max-width: 100%; height: auto; }

/* ── LAYOUT WRAPPER ─────────────────────────────────────────────────────── */
.wrap { max-width: var(--max-width); margin: 0 auto; padding: 0 var(--side-pad); }
.site-main {
  background: var(--surface);
  max-width: var(--max-width);
  margin: 0 auto;
  box-shadow: 0 0 40px rgba(0,0,0,.08);
  min-height: 60vh;
}

/* ── HEADER ─────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: -webkit-sticky;
  position: sticky;
  top: 0; z-index: 200;
  box-shadow: 0 2px 12px rgba(20,17,15,.06);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--side-pad);
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}
.site-logo a {
  font-family: var(--font-headings);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  flex-shrink: 0;
}
.site-logo a::before {
  content: '';
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.primary-nav { flex: 1; display: flex; justify-content: center; overflow: hidden; }
.primary-nav ul { list-style: none; display: flex; gap: 2px; }
.primary-nav a {
  display: block;
  padding: 7px 12px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  border-radius: 6px;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}
.primary-nav a:hover, .primary-nav li.current-menu-item a {
  color: var(--accent);
  background: rgba(200,71,42,.07);
}
.header-date {
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--sage);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-left: auto;
  flex-shrink: 0;
}
/* Mobile hamburger — hidden on desktop */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-left: auto;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
}
.nav-toggle span {
  display: block;
  width: 22px; height: 2px;
  background: var(--ink);
  margin: 5px auto;
  border-radius: 2px;
  transition: var(--transition);
}

/* ── HERO (Homepage) 40% image | 60% text ────────────────────────────────── */
.home-hero { background: var(--surface); border-bottom: 1px solid var(--line); }
/* CLS: reserve full hero height before image loads */
.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 40% 60%;
  /* height driven by image aspect-ratio — no fixed min-height needed */
}
/* Image column */
.hero-img-link {
  display: block;
  overflow: hidden;
  background: var(--line);
  /* CLS: aspect-ratio reserves exact space → zero shift when image loads */
  aspect-ratio: 4 / 3;
  /* Fallback for browsers without aspect-ratio support */
  min-height: 380px;
}
.hero-img {
  width: 100%;
  height: 100%;
  min-height: 380px;
  -o-object-fit: cover;
  object-fit: cover;
  display: block;
  transition: transform .5s ease;
  /* LCP: hint browser this is the most important image */
  will-change: transform;
}
.hero-img-placeholder { width: 100%; height: 100%; min-height: 460px; background: var(--line); }
.hero-img-link:hover .hero-img { transform: scale(1.04); }
/* Text column */
.hero-content {
  padding: 48px 52px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero-eyebrow { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.hero-eyebrow .accent-bar { width: 26px; height: 3px; background: var(--accent); border-radius: 2px; flex-shrink: 0; }
.hero-eyebrow .eyebrow-label { font-family: var(--font-ui); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .14em; color: var(--accent); }
.hero-title { font-size: 32px; font-weight: 800; line-height: 1.14; letter-spacing: -.025em; margin-bottom: 14px; color: var(--ink); }
.hero-title a { color: inherit; transition: color var(--transition); }
.hero-title a:hover { color: var(--accent); }
.hero-excerpt {
  font-size: 16px; line-height: 1.7; color: #3a3631; margin-bottom: 18px;
  overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical;
  -webkit-line-clamp: 3; max-height: calc(16px * 1.7 * 3);
}
.hero-meta { font-family: var(--font-ui); font-size: 12px; color: var(--sage); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.hero-meta .meta-dot { opacity: .4; }
.hero-read-more {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--accent); color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui); font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  transition: background var(--transition), transform var(--transition);
  width: -moz-fit-content; width: fit-content;
}
.hero-read-more:hover, .hero-read-more:focus { background: #a33a21; transform: translateY(-2px); color: #fff; text-decoration: none; }
.read-more-arrow { display: inline-block; transition: transform var(--transition); }
.hero-read-more:hover .read-more-arrow { transform: translateX(3px); }

/* ── HOMEPAGE ARTICLE GRID ──────────────────────────────────────────────── */
.section-header { display: flex; align-items: center; gap: 14px; padding: 28px 0 16px; }
.section-header h2 { font-family: var(--font-ui); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: var(--ink); white-space: nowrap; }
.section-header::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.article-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; padding-bottom: 48px; }
.article-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex; flex-direction: column;
  contain: layout style;
  /* content-visibility: off-screen cards skip paint → faster LCP */
  content-visibility: auto;
  contain-intrinsic-size: 0 360px; /* estimated card height */
}
.article-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
/* Card thumbnail — 16:10, CLS-safe */
.card-thumb {
  position: relative;
  overflow: hidden;
  background: var(--line);
  flex-shrink: 0;
  aspect-ratio: 16 / 10;
  /* padding-top fallback for pre-aspect-ratio browsers */
}
.card-thumb::before {
  content: ''; display: block;
  padding-top: 62.5%; /* 10/16 = 62.5% */
}
@supports (aspect-ratio: 1) {
  .card-thumb::before { display: none; }
}
.card-thumb img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  -o-object-fit: cover; object-fit: cover;
  display: block;
  transition: transform .4s ease;
  will-change: transform;
}
.card-thumb-placeholder { position: absolute; inset: 0; background: var(--line); }
.article-card:hover .card-thumb img { transform: scale(1.04); }
.card-category-badge {
  position: absolute; top: 10px; left: 10px;
  font-family: var(--font-ui); font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  background: var(--accent); color: #fff;
  padding: 3px 9px; border-radius: 3px;
}
.card-body { padding: 16px 16px 18px; flex: 1; display: flex; flex-direction: column; }
.card-body h3 { font-size: 16px; font-weight: 700; line-height: 1.3; margin-bottom: 7px; }
.card-body h3 a:hover { color: var(--accent); }
.card-excerpt { font-size: 13.5px; color: #4a4540; line-height: 1.55; margin-bottom: 10px; flex: 1; }
.card-footer { display: flex; align-items: center; justify-content: space-between; font-family: var(--font-ui); font-size: 11px; color: var(--sage); border-top: 1px solid var(--line); padding-top: 9px; margin-top: auto; }
.card-read-more { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-family: var(--font-ui); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); transition: opacity var(--transition); }
.card-read-more:hover { opacity: .8; text-decoration: none; color: var(--accent); }

/* ── SINGLE ARTICLE: article(70%) + sidebar(30%) ────────────────────────── */
.single-page-wrap { background: var(--surface); }
.single-two-col {
  display: grid;
  /* 70% article, 30% sidebar — exactly as specified */
  grid-template-columns: minmax(0, 1fr) var(--sidebar-w);
  gap: 48px;
  padding-top: 32px;
  padding-bottom: 80px;
  /* NOTE: no align-items here — Firefox sticky needs align-self on the child */
}
.single-article { min-width: 0; /* prevent grid blowout */ }

/* Breadcrumbs */
.breadcrumbs { padding: 14px 0; font-family: var(--font-ui); font-size: 12px; color: var(--sage); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.breadcrumbs a { color: var(--sage); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { color: var(--line); }

/* Article header */
.article-header { margin-bottom: 24px; }
.eyebrow-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.eyebrow-rule { width: 3px; height: 18px; background: var(--accent); border-radius: 2px; flex-shrink: 0; }
.category-tag { font-family: var(--font-ui); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.article-header h1 { font-size: 38px; font-weight: 800; line-height: 1.12; letter-spacing: -.02em; margin-bottom: 14px; }
.deck { font-size: 19px; color: #3a3631; font-style: italic; line-height: 1.55; margin-bottom: 16px; }

/* Article byline */
.article-byline { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.author-avatar { width: 42px; height: 42px; min-width: 42px; border-radius: 50%; overflow: hidden; background: var(--line); flex-shrink: 0; }
.author-avatar img { width: 42px; height: 42px; -o-object-fit: cover; object-fit: cover; }
.byline-name { font-family: var(--font-ui); font-size: 14px; font-weight: 700; }
.byline-name a:hover { color: var(--accent); }
.byline-meta { font-family: var(--font-ui); font-size: 12px; color: var(--sage); margin-top: 2px; }
.reading-badge { font-family: var(--font-ui); font-size: 11px; font-weight: 600; color: var(--sage); background: var(--paper); border: 1px solid var(--line); border-radius: 99px; padding: 4px 11px; white-space: nowrap; margin-left: auto; }

/* Featured image — CLS: aspect-ratio reserves space before load */
.article-featured-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--line);
  border-radius: var(--radius);
  margin-bottom: 28px;
}
.article-featured-image img { width: 100%; height: 100%; -o-object-fit: cover; object-fit: cover; display: block; }
.article-featured-image figcaption { font-family: var(--font-ui); font-size: 13px; color: var(--sage); text-align: center; padding: 9px; }

/* Article content typography */
.article-content { font-size: 18px; line-height: 1.72; }
.article-content > * + * { margin-top: 1.5em; }
.article-content h2 { font-size: 26px; font-weight: 800; margin-top: 2.2em; padding-top: .6em; border-top: 2px solid var(--line); }
.article-content h3 { font-size: 21px; font-weight: 700; margin-top: 1.8em; }
.article-content a { color: var(--accent); text-decoration: underline; text-decoration-color: rgba(200,71,42,.35); }
.article-content a:hover { text-decoration-color: var(--accent); }
.article-content blockquote { border-left: 4px solid var(--accent); padding: 14px 0 14px 22px; margin: 2em 0; font-size: 1.08em; font-style: italic; color: #3a3631; }
.article-content blockquote p { margin: 0; }
.article-content code { font-family: var(--font-mono); font-size: .85em; background: var(--line); padding: 2px 6px; border-radius: 3px; }
.article-content pre { background: var(--ink); color: #f0ebe0; border-radius: var(--radius); padding: 18px 22px; overflow-x: auto; font-family: var(--font-mono); font-size: 13.5px; line-height: 1.6; }
.article-content pre code { background: none; padding: 0; color: inherit; }
.article-content ul, .article-content ol { padding-left: 1.4em; }
.article-content li { margin-bottom: .35em; }
.article-content img { border-radius: var(--radius); margin: 1.5em 0; max-width: 100%; height: auto; background: var(--line); }
.article-content button, .article-content .btn { display: inline-block; padding: 10px 22px; background: var(--accent); color: #fff; border: none; border-radius: var(--radius-sm); font-family: var(--font-ui); font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; cursor: pointer; text-decoration: none; line-height: 1.4; transition: background var(--transition), transform var(--transition); }
.article-content button:hover, .article-content .btn:hover { background: var(--ink); transform: translateY(-1px); color: #fff; }
.article-content figure { margin: 2em 0; }
.article-content figcaption { font-family: var(--font-ui); font-size: 13px; color: var(--sage); margin-top: 7px; text-align: center; }
.article-content table { width: 100%; border-collapse: collapse; font-size: 15px; }
.article-content th { background: var(--ink); color: #fff; padding: 9px 13px; text-align: left; font-weight: 700; font-family: var(--font-ui); font-size: 13px; }
.article-content td { padding: 9px 13px; border-bottom: 1px solid var(--line); }
.article-content tr:hover td { background: rgba(0,0,0,.02); }
.article-content hr { border: none; border-top: 1px solid var(--line); margin: 2.5em 0; }

/* Tags */
.tag-cloud { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--line); }
.tag-pill { font-family: var(--font-ui); font-size: 12px; font-weight: 600; border: 1px solid var(--line); padding: 5px 13px; border-radius: 99px; color: var(--sage); transition: border-color var(--transition), color var(--transition); }
.tag-pill:hover { border-color: var(--accent); color: var(--accent); }

/* Author box */
.author-box { margin-top: 44px; padding: 26px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); display: flex; gap: 18px; align-items: flex-start; }
.author-box-avatar { width: 68px; height: 68px; min-width: 68px; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: var(--line); }
.author-box-avatar img { width: 68px; height: 68px; -o-object-fit: cover; object-fit: cover; }
.author-box-name { font-family: var(--font-ui); font-size: 15px; font-weight: 800; margin-bottom: 5px; }
.author-box-name a:hover { color: var(--accent); }
.author-box-bio { font-size: 14.5px; color: #4a4540; line-height: 1.6; }
.author-box-links { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.author-social-link { font-family: var(--font-ui); font-size: 12px; font-weight: 600; color: var(--sage); border: 1px solid var(--line); padding: 4px 11px; border-radius: 99px; transition: color var(--transition), border-color var(--transition); }
.author-social-link:hover { color: var(--accent); border-color: var(--accent); }

/* ── SIDEBAR — 30% width, Firefox-compatible sticky ─────────────────────── */
.article-sidebar {
  /* Firefox needs align-self + height on the sticky child, NOT align-items on parent */
  align-self: start;
  height: -moz-fit-content;
  height: fit-content;
  position: -webkit-sticky;
  position: sticky;
  top: 80px;
  min-width: 0;
}
.sidebar-widget { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.sidebar-widget-title { font-family: var(--font-ui); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: var(--sage); padding: 14px 18px; background: var(--paper); border-bottom: 1px solid var(--line); }
.sidebar-widget-cat { color: var(--accent); }
.sidebar-post-list { list-style: none; padding: 8px 0; }
.sidebar-post-item { display: flex; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); transition: background var(--transition); }
.sidebar-post-item:hover { background: var(--paper); }
.sidebar-post-item:last-child { border-bottom: none; }
/* Thumbnail — explicit 64×64, CLS-safe */
.sidebar-post-thumb {
  display: block;
  width: 64px; height: 64px;
  min-width: 64px; min-height: 64px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  background: var(--line);
  position: relative;
}
.sidebar-post-thumb img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  -o-object-fit: cover; object-fit: cover;
  display: block;
  transition: transform .3s ease;
  will-change: transform;
}
.sidebar-post-item:hover .sidebar-post-thumb img { transform: scale(1.06); }
.sidebar-post-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; justify-content: center; }
.sidebar-post-title {
  font-size: 13px; font-weight: 700; line-height: 1.35; color: var(--ink);
  overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical;
  -webkit-line-clamp: 3; max-height: calc(13px * 1.35 * 3);
  transition: color var(--transition);
}
.sidebar-post-title:hover { color: var(--accent); text-decoration: none; }
.sidebar-post-date { font-family: var(--font-ui); font-size: 11px; color: var(--sage); }
.sidebar-more-link { display: flex; align-items: center; justify-content: center; padding: 11px 14px; font-family: var(--font-ui); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); border-top: 1px solid var(--line); transition: background var(--transition); }
.sidebar-more-link:hover { background: var(--paper); color: var(--accent); text-decoration: none; }

/* ── ARCHIVE ─────────────────────────────────────────────────────────────── */
.archive-header-wrap { padding: 44px 0 28px; }
.archive-eyebrow { font-family: var(--font-ui); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.archive-eyebrow::before { content: ''; width: 22px; height: 3px; background: var(--accent); border-radius: 2px; }
.archive-header-wrap h1 { font-size: 36px; font-weight: 800; letter-spacing: -.02em; }
.archive-description { font-size: 16px; color: var(--sage); margin-top: 6px; }

/* ── AUTHOR PROFILE ──────────────────────────────────────────────────────── */
.author-profile-header { background: var(--surface); border-bottom: 1px solid var(--line); padding: 52px 0 36px; }
.author-profile-inner { max-width: var(--max-width); margin: 0 auto; padding: 0 var(--side-pad); display: flex; gap: 32px; align-items: flex-start; }
.author-profile-avatar { width: 100px; height: 100px; min-width: 100px; border-radius: 50%; overflow: hidden; flex-shrink: 0; border: 4px solid var(--line); background: var(--line); }
.author-profile-avatar img { width: 100%; height: 100%; -o-object-fit: cover; object-fit: cover; }
.author-profile-name { font-size: 32px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 5px; }
.author-profile-role { font-family: var(--font-ui); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin-bottom: 12px; }
.author-profile-bio { font-size: 16.5px; line-height: 1.65; color: #3a3631; max-width: 600px; }
.author-profile-links { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }

/* ── PAGE ────────────────────────────────────────────────────────────────── */
.page-wrap { max-width: 760px; margin: 0 auto; padding: 44px var(--side-pad) 80px; }
.page-wrap h1 { font-size: 40px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 28px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }

/* ── FOOTER ──────────────────────────────────────────────────────────────── */
.site-footer { background: #12100e; color: var(--paper); }
.footer-top-bar { background: var(--accent); height: 4px; }
.footer-inner {
  max-width: var(--max-width); margin: 0 auto; padding: 56px 32px 32px;
  display: grid; grid-template-columns: 2.2fr 1fr 1fr 1fr; gap: 48px; align-items: start;
}
.footer-logo { font-family: var(--font-headings); font-size: 22px; font-weight: 800; color: var(--paper); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.footer-logo::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.footer-tagline { font-size: 14px; color: #8a837c; line-height: 1.7; max-width: 280px; margin-bottom: 20px; }
.footer-social { display: flex; gap: 10px; flex-wrap: wrap; }
.footer-social-link { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 8px; border: 1px solid rgba(255,255,255,.12); color: #8a837c; font-family: var(--font-ui); font-size: 11px; font-weight: 700; text-transform: uppercase; transition: border-color var(--transition), color var(--transition), background var(--transition); }
.footer-social-link:hover { border-color: var(--accent); color: var(--paper); background: rgba(200,71,42,.15); }
.footer-col h4 { font-family: var(--font-ui); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .14em; color: var(--accent); margin-bottom: 18px; padding-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,.08); }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { font-size: 13.5px; color: #8a837c; transition: color var(--transition); display: inline-flex; align-items: center; gap: 5px; }
.footer-col a:hover { color: var(--paper); }
.footer-col a::before { content: ''; display: inline-block; width: 0; height: 1.5px; background: var(--accent); transition: width .2s ease; }
.footer-col a:hover::before { width: 8px; }
.footer-bottom { max-width: var(--max-width); margin: 0 auto; padding: 20px 32px; border-top: 1px solid rgba(255,255,255,.07); display: flex; justify-content: space-between; align-items: center; font-family: var(--font-ui); font-size: 12px; color: #5a5450; flex-wrap: wrap; gap: 8px; }
.footer-bottom-links { display: flex; gap: 20px; }
.footer-bottom-links a { color: #5a5450; transition: color var(--transition); }
.footer-bottom-links a:hover { color: var(--paper); }

/* ── PAGINATION ──────────────────────────────────────────────────────────── */
.pagination { display: flex; justify-content: center; gap: 8px; padding: 36px 0; }
.pagination a, .pagination span { font-family: var(--font-ui); font-size: 13px; font-weight: 700; width: 38px; height: 38px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); transition: var(--transition); }
.pagination a:hover, .pagination .current { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── AMAZON PRODUCTS ─────────────────────────────────────────────────────── */
.sw-amazon-products { margin: 2.8em 0; clear: both; }
.sw-amazon-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.sw-amazon-heading span { font-family: var(--font-ui); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--sage); white-space: nowrap; }
.sw-amazon-heading::before, .sw-amazon-heading::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.sw-amazon-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; width: 100%; }
.sw-amazon-card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); display: flex; flex-direction: column; transition: box-shadow .18s ease, transform .18s ease; }
.sw-amazon-card:hover { box-shadow: 0 8px 28px rgba(0,0,0,.12); transform: translateY(-3px); }
.sw-amazon-link { display: flex; flex-direction: column; flex: 1; text-decoration: none; color: inherit; min-width: 0; }
.sw-amazon-link:hover { text-decoration: none; color: inherit; }
.sw-amazon-img-wrap { position: relative; width: 100%; padding-top: 75%; background: var(--paper); border-bottom: 1px solid var(--line); overflow: hidden; flex-shrink: 0; }
.sw-amazon-img-inner { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 12px; }
.sw-amazon-img { max-width: 100%; max-height: 100%; width: auto; height: auto; -o-object-fit: contain; object-fit: contain; display: block; margin: 0 auto; transition: transform .3s ease; }
.sw-amazon-card:hover .sw-amazon-img { transform: scale(1.04); }
.sw-amazon-img-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-family: var(--font-ui); font-size: 12px; color: var(--sage); }
.sw-amazon-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.sw-amazon-title { font-size: 13px; font-weight: 600; line-height: 1.45; margin: 0; color: var(--ink); overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; max-height: 5.655em; }
.sw-amazon-price-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 4px; }
.sw-amazon-price { font-family: var(--font-ui); font-size: 14px; font-weight: 800; color: var(--ink); }
.sw-amazon-badge { font-family: var(--font-ui); font-size: 10px; font-weight: 700; background: #e8472a; color: #fff; padding: 2px 7px; border-radius: 99px; }
.sw-amz-btn { background-color:#FF9900;color:#111111;display: block; text-align: center; padding: 9px 12px; border-radius: var(--radius-sm); font-family: var(--font-ui); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; cursor: pointer; transition: filter .15s ease, transform .12s ease; margin-top: auto; text-decoration: none; box-sizing: border-box; line-height: 1.4; }
.sw-amz-btn:hover { filter: brightness(.88); transform: translateY(-1px); }
.sw-amazon-disc { font-family: var(--font-ui); font-size: 11px; color: var(--sage); margin: 10px 0 0; font-style: italic; text-align: center; }

/* ── CONTACT PAGE ─────────────────────────────────────────────────────────── */
.contact-page-wrap { background: var(--surface); }
.contact-hero { background: linear-gradient(135deg, var(--ink) 0%, #2a1f18 100%); padding: 64px 24px; text-align: center; color: var(--paper); }
.contact-hero-inner { max-width: 560px; margin: 0 auto; }
.contact-hero-eyebrow { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 18px; font-family: var(--font-ui); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: var(--accent); }
.ch-line { flex: 1; max-width: 50px; height: 1px; background: var(--accent); opacity: .5; }
.contact-hero-title { font-size: 42px; font-weight: 800; letter-spacing: -.03em; margin-bottom: 14px; color: #fff; }
.contact-hero-sub { font-size: 16px; line-height: 1.7; color: rgba(255,255,255,.65); }
.contact-main { padding: 52px 24px 80px; }
.contact-layout { display: grid; grid-template-columns: 1fr 320px; gap: 48px; align-items: start; }
.contact-form-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 36px; box-shadow: 0 4px 24px rgba(0,0,0,.07); }
.cfc-header { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.cfc-icon { width: 52px; height: 52px; min-width: 52px; border-radius: 12px; background: rgba(200,71,42,.1); color: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cfc-title { font-size: 20px; font-weight: 700; margin-bottom: 3px; }
.cfc-sub { font-family: var(--font-ui); font-size: 12px; color: var(--sage); }
.cf-alert { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 8px; font-size: 14px; line-height: 1.5; margin-bottom: 20px; }
.cf-alert--success { background: #edfaf1; color: #1a5c2a; border: 1px solid #9dd4ad; }
.cf-alert--error { background: #fef2f2; color: #8b1c1c; border: 1px solid #fca5a5; }
.cf-alert__icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.cf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cf-field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.cf-label { font-family: var(--font-ui); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink); }
.cf-req { color: var(--accent); }
.cf-input-wrap { position: relative; display: flex; align-items: center; }
.cf-input-icon { position: absolute; left: 13px; color: var(--sage); pointer-events: none; display: flex; align-items: center; }
.cf-input { width: 100%; padding: 11px 14px 11px 40px; border: 1.5px solid var(--line); border-radius: 8px; font-family: inherit; font-size: 15px; color: var(--ink); background: var(--surface); transition: border-color .15s, box-shadow .15s; outline: none; }
.cf-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(200,71,42,.1); }
.cf-textarea { width: 100%; padding: 12px 16px; border: 1.5px solid var(--line); border-radius: 8px; font-family: inherit; font-size: 15px; color: var(--ink); background: var(--surface); resize: vertical; min-height: 148px; line-height: 1.6; transition: border-color .15s, box-shadow .15s; outline: none; }
.cf-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(200,71,42,.1); }
.cf-captcha-wrap { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cf-captcha-question { display: flex; align-items: center; gap: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 10px 16px; flex-shrink: 0; }
.cf-captcha-badge { font-size: 18px; }
.cf-captcha-text { font-family: var(--font-mono); font-size: 16px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.cf-captcha-input { max-width: 120px; }
.cf-captcha-refresh { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: none; color: var(--sage); cursor: pointer; transition: color .15s, border-color .15s, transform .2s; flex-shrink: 0; }
.cf-captcha-refresh:hover { color: var(--accent); border-color: var(--accent); transform: rotate(90deg); }
.cf-submit { display: inline-flex; align-items: center; gap: 10px; margin-top: 22px; background: var(--accent); color: #fff; border: none; padding: 14px 28px; border-radius: 8px; font-family: var(--font-ui); font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; cursor: pointer; transition: background .15s, transform .15s; }
.cf-submit:hover:not(:disabled) { background: #a33a21; transform: translateY(-2px); }
.cf-submit:disabled { opacity: .7; cursor: wait; }
.cf-submit-spinner { display: none; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: cf-spin .6s linear infinite; }
@keyframes cf-spin { to { transform: rotate(360deg); } }
.contact-info-panel { display: flex; flex-direction: column; gap: 20px; }
.cip-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 24px; }
.cip-heading { font-family: var(--font-ui); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .14em; color: var(--accent); margin-bottom: 18px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.cip-item { display: flex; align-items: flex-start; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: color .15s; }
.cip-item:last-child { border-bottom: none; padding-bottom: 0; }
.cip-item:hover { color: var(--accent); }
.cip-item-icon { width: 36px; height: 36px; min-width: 36px; border-radius: 8px; background: rgba(200,71,42,.08); color: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cip-item-label { font-family: var(--font-ui); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--sage); margin-bottom: 3px; }
.cip-item-value { font-size: 14px; font-weight: 600; word-break: break-word; }
.cip-social-btn { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: none; transition: border-color .15s, color .15s, background .15s; margin-bottom: 8px; }
.cip-social-btn:hover { border-color: var(--accent); color: var(--accent); }
.cip-response { display: flex; align-items: center; gap: 14px; }
.cip-response-icon { width: 44px; height: 44px; min-width: 44px; border-radius: 10px; background: rgba(200,71,42,.08); color: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cip-response-main { font-weight: 700; font-size: 15px; margin-bottom: 2px; }
.cip-response-sub { font-family: var(--font-ui); font-size: 12px; color: var(--sage); }

/* ── ACCESSIBILITY ───────────────────────────────────────────────────────── */
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* =================================================================
   RESPONSIVE BREAKPOINTS
   - Desktop:  ≥ 1024px  (full layout, sidebar on right)
   - Tablet:   768–1023px (condensed, sidebar drops below)
   - Mobile:   < 768px   (single column, hamburger nav)
   ================================================================= */

/* ── TABLET (768–1199px) ────────────────────────────────────────────────── */
@media (max-width: 1199px) {
  :root { --max-width: 100%; --side-pad: 20px; }
}

@media (max-width: 1023px) {
  /* Hero: stack image on top, text below */
  .hero-inner { grid-template-columns: 1fr; min-height: auto; }
  .hero-img-link { min-height: 320px; height: 320px; }
  .hero-img { min-height: 320px; }
  .hero-content { padding: 32px var(--side-pad); }
  .hero-title { font-size: 28px; }

  /* Article grid: 2 columns on tablet */
  .article-grid { grid-template-columns: repeat(2, 1fr); }

  /* Single article: sidebar drops below article on tablet */
  .single-two-col {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .article-sidebar {
    position: static;
    align-self: auto;
    height: auto;
    margin-top: 0;
  }

  /* Footer: 2-column on tablet */
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-brand { grid-column: span 2; }

  /* Header: hide date, show hamburger */
  .header-date { display: none; }
  .nav-toggle { display: flex; flex-direction: column; justify-content: center; }
  .primary-nav {
    display: none;
    position: absolute;
    top: 64px; left: 0; right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    z-index: 200;
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
  }
  .primary-nav.open { display: block; }
  .primary-nav ul { flex-direction: column; padding: 8px 0; }
  .primary-nav a { padding: 12px 24px; border-radius: 0; border-left: 3px solid transparent; }
  .primary-nav a:hover { border-left-color: var(--accent); background: transparent; }
}

/* ── MOBILE (< 768px) ───────────────────────────────────────────────────── */
@media (max-width: 767px) {
  :root { --side-pad: 16px; --font-size-base: 16px; }

  /* Header */
  .header-inner { height: 56px; padding: 0 var(--side-pad); gap: 12px; }
  .site-logo a { font-size: 18px; }
  .primary-nav { top: 56px; }

  /* Hero: compact on mobile */
  .hero-img-link { min-height: 220px; height: 220px; }
  .hero-img { min-height: 220px; }
  .hero-title { font-size: 22px; }
  .hero-content { padding: 24px var(--side-pad); }
  .hero-excerpt { -webkit-line-clamp: 2; max-height: calc(16px * 1.7 * 2); }

  /* Article grid: single column on mobile */
  .article-grid { grid-template-columns: 1fr; gap: 16px; }

  /* Article heading */
  .article-header h1 { font-size: 26px; }
  .article-content { font-size: 16px; }
  .deck { font-size: 17px; }

  /* Author box */
  .author-box { flex-direction: column; }

  /* Footer: single column */
  .footer-inner { grid-template-columns: 1fr; gap: 24px; padding: 40px 20px 24px; }
  .footer-brand { grid-column: span 1; }
  .footer-bottom { padding: 16px 20px; flex-direction: column; align-items: flex-start; gap: 6px; }
  .footer-bottom-links { flex-wrap: wrap; gap: 12px; }

  /* Contact */
  .contact-layout { grid-template-columns: 1fr; }
  .contact-info-panel { order: -1; }
  .contact-form-card { padding: 22px; }
  .cf-grid { grid-template-columns: 1fr; }
  .contact-hero { padding: 40px var(--side-pad); }
  .contact-hero-title { font-size: 28px; }

  /* Amazon */
  .sw-amazon-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px; }

  /* Breadcrumbs */
  .breadcrumbs { font-size: 11px; }
}

/* ── SMALL MOBILE (< 480px) ─────────────────────────────────────────────── */
@media (max-width: 479px) {
  .hero-img-link { min-height: 180px; height: 180px; }
  .hero-img { min-height: 180px; }
  .hero-title { font-size: 20px; }
  .article-grid { gap: 12px; }
  .sw-amazon-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .cf-captcha-wrap { flex-direction: column; align-items: flex-start; }
  .author-profile-inner { flex-direction: column; }
}

/* ── LCP OPTIMIZATION: will-change on LCP candidates ───────────────────── */
.hero-img { will-change: transform; }
.card-thumb img, .sidebar-post-thumb img { will-change: transform; }
.article-card { contain: layout style; }

/* ── Site logo image (set via Admin → Settings → Site Identity) ─────── */
.site-logo-img,.site-title img{display:block;max-height:52px;width:auto;max-width:240px;object-fit:contain}
@media(max-width:600px){.site-logo-img,.site-title img{max-height:38px;max-width:160px}}

/* ── CTA Button fixes ──────────────────────────────────────────────────────
   Problem 1: .article-content a{} sets color + text-decoration which overrides
   any inline-styled <a> button the user writes in the post editor.
   Problem 2: .article-content button/.btn hardcodes background/padding which
   overrides user-specified inline styles on custom CTA buttons.
   Fix: attribute selector [style] has higher specificity than .article-content a{}
   so inline-styled anchors/buttons get their own values honoured. */

/* Any <a> or <button> with an explicit inline style is a CTA — don't override it */
.article-content a[style]{color:inherit;text-decoration:none}
.article-content a[style]:hover{text-decoration:none;opacity:.88}
.article-content button[style],.article-content a[style].btn,.article-content a[style].sw-btn{background:revert;padding:revert;color:revert;border-radius:revert;font-size:revert;font-weight:revert;text-transform:revert;letter-spacing:revert}

/* Dedicated .sw-cta-btn class: fully user-controlled, theme never overrides */
.article-content .sw-cta-btn{display:inline-block;text-decoration:none;cursor:pointer;transition:opacity .15s,transform .15s;line-height:1.4}
.article-content .sw-cta-btn:hover{opacity:.88;transform:translateY(-1px);text-decoration:none}

/* Scoped <style> blocks inside .article-content are allowed (used for CTA buttons) */
.article-content style{display:none}

/* ── sbx12 CTA button compatibility ───────────────────────────────────────
   sbx12 generates buttons as: <div style="display:flex;justify-content:center">
   <style>#btnId{padding:18px 45px;background-color:COLOR;...}</style>
   <a id="btnId" href="...">text</a></div>
   The rules below ensure those inline-flex styles and scoped <style> blocks
   render correctly inside .article-content. */

/* Scoped <style> tags inside content are intentional (CTA button styles) — hide visually */
.article-content style{display:none!important}

/* Wrapper div that sbx12 creates around each CTA button */
.article-content div[style*="justify-content:center"],
.article-content div[style*="justify-content: center"]{display:flex!important;justify-content:center!important;align-items:center!important}

/* The actual <a> button — when it has an id (sbx12 scopes CSS to #id)
   force display:inline-flex so padding, border-radius apply correctly */
.article-content a[id^="cta_"]{display:inline-flex!important;align-items:center!important;justify-content:center!important;text-decoration:none!important}
.article-content a[id^="cta_"]:hover{text-decoration:none!important}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE FIXES — cross-browser, all breakpoints
   ═══════════════════════════════════════════════════════════════════ */

/* ── Global overflow guard ── */
html { overflow-x: hidden; }
body { overflow-x: hidden; -webkit-overflow-scrolling: touch; }

/* ── Safe area insets (notched phones, home-bar phones) ── */
.site-header { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
.site-footer { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); padding-bottom: env(safe-area-inset-bottom); }

/* ── Grid children always min-width:0 to prevent blowout ── */
.article-grid > *, .footer-inner > *, .single-two-col > * { min-width: 0; }

/* ── Ensure all images and embeds can never exceed container ── */
img, video, iframe, embed, object, canvas, svg { max-width: 100%; }
iframe { width: 100%; }

/* ── Tables scroll horizontally on narrow screens ── */
.article-content table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ── Pre / code: horizontal scroll without page overflow ── */
pre { overflow-x: auto; white-space: pre; max-width: 100%; }

/* ── Tablet fixes (768–1023px) ── */
@media (max-width: 1023px) {
  .contact-layout { grid-template-columns: 1fr !important; }
  .contact-info-panel { order: -1; }
  .footer-inner { grid-template-columns: 1fr 1fr !important; }
  .hero-inner { grid-template-columns: 1fr !important; }
  .single-two-col { grid-template-columns: 1fr !important; }
  .article-sidebar { position: static !important; height: auto !important; }
}

/* ── Mobile fixes (< 768px) ── */
@media (max-width: 767px) {
  .article-grid { grid-template-columns: 1fr !important; }
  .footer-inner { grid-template-columns: 1fr !important; gap: 20px !important; padding: 36px 16px 20px !important; }
  .footer-bottom { flex-direction: column; align-items: flex-start; padding: 14px 16px; }
  .footer-bottom-links { flex-wrap: wrap; gap: 10px; }
  .contact-layout { grid-template-columns: 1fr !important; }
  .contact-form-card { padding: 18px !important; }
  .cf-grid { grid-template-columns: 1fr !important; }
  .author-profile-inner { flex-direction: column !important; }
  .author-box { flex-direction: column !important; }
  .sw-amazon-grid { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
  .hero-content { padding: 20px 16px 24px !important; }
  .article-header h1 { font-size: clamp(20px, 6vw, 30px) !important; }
  .card-body h3 { font-size: clamp(14px, 4vw, var(--font-size-card, 16px)) !important; }
}

/* ── Very small mobile (< 480px) ── */
@media (max-width: 479px) {
  :root { --side-pad: 12px; }
  .sw-amazon-grid { grid-template-columns: 1fr !important; }
  .hero-title { font-size: clamp(18px, 5.5vw, 26px) !important; }
  .article-header h1 { font-size: clamp(18px, 5.5vw, 26px) !important; }
  .pagination a, .pagination span { width: 32px; height: 32px; font-size: 12px; }
  .cf-captcha-wrap { flex-direction: column; align-items: flex-start; }
  .author-profile-inner { flex-direction: column !important; }
  .breadcrumbs { font-size: 10px; }
}

/* ── Touch-friendly tap targets ── */
@media (pointer: coarse) {
  .primary-nav a { padding: 12px 16px; min-height: 44px; }
  .nav-toggle { min-width: 44px; min-height: 44px; }
  .pagination a, .pagination span { min-width: 44px; min-height: 44px; width: auto; padding: 0 10px; }
  .tag-pill { min-height: 36px; display: inline-flex; align-items: center; }
}

/* ── Firefox: fix sticky sidebar ── */
@-moz-document url-prefix() {
  .article-sidebar { position: -moz-sticky; position: sticky; }
}

/* ── Print ── */
@media print {
  .site-header, .article-sidebar, .site-footer, .pagination, .nav-toggle { display: none !important; }
  .single-two-col { grid-template-columns: 1fr !important; }
  body { font-size: 12pt; color: #000; background: #fff; }
  a { color: #000; text-decoration: underline; }
  .article-content { font-size: 11pt; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   AUTHOR PAGE — sidebar layout
   ═══════════════════════════════════════════════════════════════════════════ */

/* Hero banner */
.author-hero { background: var(--surface); border-bottom: 1px solid var(--line); padding: 40px 0; }
.author-hero-inner { display: flex; align-items: flex-start; gap: 28px; flex-wrap: wrap; }
.author-hero-avatar { width: 96px; height: 96px; border-radius: 50%; overflow: hidden; flex-shrink: 0; border: 3px solid var(--line); background: var(--paper); }
.author-hero-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.author-hero-initial { width: 100%; height: 100%; background: var(--line); display: flex; align-items: center; justify-content: center; font-size: 36px; color: var(--sage); font-weight: 700; }
.author-hero-info { flex: 1; min-width: 0; }
.author-hero-name { font-size: clamp(22px, 4vw, 30px); font-weight: 800; color: var(--ink); margin: 0 0 6px; }
.author-hero-role { font-size: 13px; color: var(--sage); margin-bottom: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.author-hero-bio { font-size: 15px; line-height: 1.65; color: var(--ink); margin: 0 0 14px; max-width: 600px; }
.author-hero-links { display: flex; flex-wrap: wrap; gap: 8px; }
.author-social-link { display: inline-flex; align-items: center; padding: 5px 12px; border: 1px solid var(--line); border-radius: 20px; font-size: 12px; font-weight: 600; color: var(--sage); text-decoration: none; transition: all .15s; }
.author-social-link:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* Author body: main grid + sidebar */
.author-body { display: grid; grid-template-columns: 1fr 280px; gap: 40px; padding-top: 36px; padding-bottom: 60px; align-items: start; }
.author-main { min-width: 0; }
.author-sidebar { min-width: 0; position: sticky; top: 80px; }
.no-posts-msg { color: var(--sage); padding: 40px 0; }
.pagination-ellipsis { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; color: var(--sage); }

/* ═══════════════════════════════════════════════════════════════════════════
   SINGLE ARTICLE — narrow readable column + sticky sidebar
   ═══════════════════════════════════════════════════════════════════════════ */
.single-article { max-width: 720px; }
.article-content { max-width: 680px; font-size: var(--font-size-base, 17px); line-height: 1.8; }
.article-header { max-width: 720px; }

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — Mobile-first media queries per W3Schools RWD guide
   Breakpoints: 480px (phone), 768px (tablet), 1024px (small desktop)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Base (all screens) ── */
*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: hidden; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { overflow-x: hidden; min-width: 320px; }
img, video, iframe, embed, object { max-width: 100%; height: auto; display: block; }
table { width: 100%; border-collapse: collapse; }

/* ── Extra small — phones < 480px ── */
@media screen and (max-width: 479px) {
  :root { --side-pad: 14px; }
  .wrap { padding-left: var(--side-pad); padding-right: var(--side-pad); }

  /* Nav */
  .site-header .wrap { padding-left: 14px; padding-right: 14px; }
  .primary-nav { display: none; flex-direction: column; gap: 0; background: var(--surface); border-top: 1px solid var(--line); position: absolute; top: 100%; left: 0; right: 0; z-index: 200; box-shadow: 0 4px 12px rgba(0,0,0,.1); }
  .primary-nav.open { display: flex; }
  .primary-nav a { padding: 14px 20px; border-bottom: 1px solid var(--line); font-size: 15px; min-height: 48px; display: flex; align-items: center; }
  .nav-toggle { display: flex !important; }

  /* Hero */
  .hero-inner { grid-template-columns: 1fr !important; gap: 0 !important; }
  .hero-content { padding: 20px 14px 24px !important; }
  .hero-title { font-size: clamp(18px, 5.5vw, 26px) !important; }
  .hero-meta { font-size: 11px; }

  /* Cards grid */
  .article-grid { grid-template-columns: 1fr !important; gap: 20px; }
  .card-body h3 { font-size: clamp(15px, 4vw, 18px) !important; }

  /* Author hero */
  .author-hero-inner { gap: 16px; }
  .author-hero-avatar { width: 72px; height: 72px; }
  .author-hero-name { font-size: 20px !important; }
  .author-body { grid-template-columns: 1fr !important; gap: 24px; padding-top: 20px; }
  .author-sidebar { position: static !important; order: -1; }

  /* Single article */
  .single-two-col { grid-template-columns: 1fr !important; gap: 32px; padding-top: 20px; }
  .article-sidebar { position: static !important; height: auto !important; }
  .article-header h1 { font-size: clamp(20px, 6vw, 28px) !important; }
  .article-content { font-size: 16px !important; }
  .article-content table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  pre { overflow-x: auto; white-space: pre; }

  /* Footer */
  .footer-inner { grid-template-columns: 1fr !important; gap: 28px; padding: 36px 14px 20px !important; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; }
  .footer-bottom-links { flex-wrap: wrap; gap: 10px; }

  /* Amazon grid */
  .sw-amazon-grid { grid-template-columns: 1fr !important; }

  /* Misc */
  .breadcrumbs { font-size: 11px; gap: 4px; }
  .tag-cloud { gap: 6px; }
  .pagination a, .pagination span, .pagination .current { width: 36px; height: 36px; font-size: 12px; }
  .contact-layout { grid-template-columns: 1fr !important; }
  .cf-grid { grid-template-columns: 1fr !important; }
}

/* ── Small — tablets 480px–767px ── */
@media screen and (min-width: 480px) and (max-width: 767px) {
  .article-grid { grid-template-columns: 1fr 1fr !important; gap: 20px; }
  .hero-inner { grid-template-columns: 1fr !important; }
  .author-body { grid-template-columns: 1fr !important; gap: 28px; }
  .author-sidebar { position: static !important; order: -1; }
  .single-two-col { grid-template-columns: 1fr !important; }
  .article-sidebar { position: static !important; height: auto !important; }
  .footer-inner { grid-template-columns: 1fr 1fr !important; gap: 24px; }
  .sw-amazon-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .contact-layout { grid-template-columns: 1fr !important; }
  .author-hero-avatar { width: 80px; height: 80px; }
}

/* ── Medium — tablets 768px–1023px ── */
@media screen and (min-width: 768px) and (max-width: 1023px) {
  .article-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .author-body { grid-template-columns: 1fr 240px !important; gap: 28px; }
  .single-two-col { grid-template-columns: 1fr 220px !important; gap: 32px; }
  .footer-inner { grid-template-columns: 1fr 1fr !important; }
  .sw-amazon-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .contact-layout { grid-template-columns: 1fr !important; }
  .hero-inner { grid-template-columns: 1fr !important; }
  .article-header h1 { font-size: clamp(24px, 4vw, 36px); }
}

/* ── Large — desktops 1024px+ ── */
@media screen and (min-width: 1024px) {
  .article-grid { grid-template-columns: repeat(3, 1fr); }
  .author-body { grid-template-columns: 1fr 280px; gap: 40px; }
  .single-two-col { grid-template-columns: minmax(0, 1fr) var(--sidebar-w, 300px); gap: 48px; }
  .sw-amazon-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Touch devices — larger tap targets ── */
@media (hover: none) and (pointer: coarse) {
  .primary-nav a { min-height: 48px; padding-top: 12px; padding-bottom: 12px; }
  .nav-toggle { min-width: 48px; min-height: 48px; }
  .pagination a, .pagination .current { min-width: 44px; min-height: 44px; }
  .btn, button { min-height: 44px; }
  .tag-pill { min-height: 36px; padding: 0 12px; display: inline-flex; align-items: center; }
}

/* ── Safe area (notched phones, home bar) ── */
@supports (padding: env(safe-area-inset-left)) {
  .site-header, .site-footer { 
    padding-left: env(safe-area-inset-left); 
    padding-right: env(safe-area-inset-right); 
  }
  .site-footer { padding-bottom: env(safe-area-inset-bottom); }
}

/* ── Print ── */
@media print {
  .site-header, .article-sidebar, .author-sidebar, .site-footer, 
  .pagination, .nav-toggle, .tag-cloud { display: none !important; }
  .single-two-col, .author-body { grid-template-columns: 1fr !important; }
  body { font-size: 12pt; color: #000; background: #fff; }
  a::after { content: " (" attr(href) ")"; font-size: 10pt; color: #555; }
  .article-content { font-size: 11pt; line-height: 1.6; }
}

/* --- Color scheme override --- */
:root {
  --paper: #F7F4EE;
  --ink: #14110F;
  --accent: #C8472A;
  --sage: #5B6B5C;
  --surface: #FFFFFF;
  --line: #E3DDD0;
}

:root {
  --font-body: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-headings: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-size-base: 19px;
  --font-size-card: 19px;
  --font-size-header: 38px;
}
body { font-family: var(--font-body); font-size: var(--font-size-base); }
h1,h2,h3,h4,h5,h6 { font-family: var(--font-headings); }
.card-body h3 { font-size: var(--font-size-card); }
.article-header h1 { font-size: var(--font-size-header); }
.hero-title { font-size: calc(var(--font-size-header) * 0.84); }
