/* =============================================
   improvewebdesign.com — Core Stylesheet
   Aesthetic: Editorial / Clean with confident type
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,700;0,900;1,700&family=DM+Sans:wght@300;400;500;600&family=DM+Mono:wght@400;500&display=swap');

:root {
  --ink: #0f0f0f;
  --ink-light: #3a3a3a;
  --ink-muted: #7a7a7a;
  --paper: #f9f7f4;
  --paper-warm: #f2ede6;
  --accent: #1a6b4a;
  --accent-bright: #24a672;
  --accent-pale: #e8f5ef;
  --rule: #e0dbd3;
  --white: #ffffff;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'DM Mono', monospace;
  --max-width: 1180px;
  --article-width: 740px;
}

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

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  overflow-x: hidden;
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ---- UTILITY ---- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 2rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ---- HEADER / NAV ---- */
.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--white);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-logo {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.25rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.site-logo span {
  color: var(--accent);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.site-nav a {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--ink-light);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color 0.2s;
}

.site-nav a:hover { color: var(--accent); }

.nav-cta {
  background: var(--accent) !important;
  color: var(--white) !important;
  padding: 0.5rem 1.125rem !important;
  border-radius: 4px;
  transition: background 0.2s !important;
}

.nav-cta:hover { background: var(--accent-bright) !important; }

/* ---- HERO ---- */
.site-hero {
  background: var(--ink);
  color: var(--white);
  padding: 5rem 2rem 4rem;
  position: relative;
  overflow: hidden;
}

.site-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(26,107,74,0.35) 0%, transparent 65%);
}

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 1.125rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-bright);
  margin-bottom: 1.25rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.03em;
  max-width: 680px;
  margin-bottom: 1.5rem;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: rgba(255,255,255,0.7);
  max-width: 520px;
  line-height: 1.6;
  margin-bottom: 2.5rem;
}

.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-size: 1.125rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--white);
}
.btn-primary:hover { background: var(--accent-bright); }

.btn-ghost {
  background: transparent;
  color: var(--white);
  border: 1.5px solid rgba(255,255,255,0.3);
}
.btn-ghost:hover { border-color: var(--white); }

/* ---- TOPICS BAR ---- */
.topics-bar {
  border-bottom: 1px solid var(--rule);
  background: var(--white);
  padding: 0 2rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.topics-bar::-webkit-scrollbar { display: none; }

.topics-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  gap: 0;
}

.topic-tab {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--ink-muted);
  text-decoration: none;
  padding: 0.875rem 1.25rem;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.topic-tab:hover, .topic-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ---- BLOG GRID ---- */
.blog-section {
  padding: 4rem 2rem;
}

.blog-section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 2.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-link {
  font-size: 1.125rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.section-link:hover { text-decoration: underline; }

/* Featured post — full width */
.post-featured {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--rule);
  align-items: center;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  border-radius: 8px;
  border: 1.5px solid transparent;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.post-featured:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.06); border-color: var(--rule); }
.post-featured:hover .post-title { color: var(--accent); }
.post-featured:hover .read-more { gap: 0.6rem; }
.post-featured:hover .read-more svg { transform: translateX(3px); }

.post-featured-image {
  background: var(--ink);
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 16/10;
  position: relative;
}

.post-thumb-graphic {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 5rem;
  background: linear-gradient(135deg, #0f0f0f 0%, #1a3a2a 100%);
  color: rgba(255,255,255,0.08);
  user-select: none;
  position: relative;
}

.post-thumb-graphic::after {
  content: attr(data-icon);
  position: absolute;
  font-size: 3.5rem;
  color: var(--accent-bright);
  opacity: 0.6;
}

.post-featured-content {}

.post-category {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-pale);
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  margin-bottom: 0.875rem;
}

.post-title {
  font-family: var(--font-display);
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  display: block;
  margin-bottom: 0.875rem;
  transition: color 0.2s;
}
.post-title:hover { color: var(--accent); }

.post-excerpt {
  font-size: 1.125rem;
  color: var(--ink-light);
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 1.125rem;
  color: var(--ink-muted);
}

.post-meta-divider { width: 3px; height: 3px; background: var(--rule); border-radius: 50%; }

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  margin-top: 1rem;
}
.read-more:hover { gap: 0.6rem; }
.read-more svg { transition: transform 0.2s; }
.read-more:hover svg { transform: translateX(3px); }

/* Post grid */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.post-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  border-radius: 8px;
  border: 1.5px solid transparent;
  padding: 0 1rem 1.25rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0,0,0,0.08);
  border-color: var(--rule);
}
.post-card:hover .post-title { color: var(--accent); }
.post-card:hover .read-more { gap: 0.6rem; }
.post-card:hover .read-more svg { transform: translateX(3px); }

.post-card-image {
  border-radius: 6px 6px 0 0;
  overflow: hidden;
  aspect-ratio: 16/9;
  margin: 0 -1rem 1rem -1rem;
  background: var(--paper-warm);
  position: relative;
}

.post-card-graphic {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  background: linear-gradient(135deg, var(--paper-warm) 0%, var(--rule) 100%);
}

.post-card .post-title {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.post-card .post-excerpt {
  font-size: 1.125rem;
  -webkit-line-clamp: 3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- CTA BAND ---- */
.cta-band {
  background: var(--accent);
  padding: 3.5rem 2rem;
  text-align: center;
}

.cta-band-inner { max-width: 560px; margin: 0 auto; }

.cta-band h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.cta-band p {
  color: rgba(255,255,255,0.8);
  margin-bottom: 2rem;
  font-size: 1rem;
}

.cta-band .btn-white {
  background: var(--white);
  color: var(--accent);
  font-weight: 700;
  padding: 0.875rem 2rem;
}
.cta-band .btn-white:hover { background: var(--paper); }

/* ---- FOOTER ---- */
.site-footer {
  background: var(--ink);
  color: rgba(255,255,255,0.6);
  padding: 3rem 2rem;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
}

.footer-brand .site-logo {
  color: var(--white);
  font-size: 1.125rem;
  display: block;
  margin-bottom: 0.75rem;
}

.footer-brand p {
  font-size: 1.125rem;
  line-height: 1.6;
  max-width: 280px;
}

.footer-heading {
  font-size: 1.125rem;
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links a {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 1.125rem;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--white); }

.footer-bottom {
  max-width: var(--max-width);
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 1.125rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* =============================================
   ARTICLE PAGE STYLES
   ============================================= */

.article-hero {
  background: var(--ink);
  padding: 4rem 2rem 3rem;
  position: relative;
  overflow: hidden;
}

.article-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 100%, rgba(26,107,74,0.3) 0%, transparent 60%);
}

.article-hero-inner {
  max-width: var(--article-width);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.article-hero .post-category { margin-bottom: 1.25rem; }

.article-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--white);
  margin-bottom: 1.25rem;
}

.article-subtitle {
  font-size: 1.125rem;
  color: rgba(255,255,255,0.7);
  line-height: 1.6;
  margin-bottom: 2rem;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 1.125rem;
  color: rgba(255,255,255,0.5);
  flex-wrap: wrap;
}

.article-meta strong { color: rgba(255,255,255,0.85); }

/* Article body */
.article-body {
  padding: 3.5rem 2rem 4rem;
}

.article-body-inner {
  max-width: var(--article-width);
  margin: 0 auto;
  min-width: 0;
  overflow-x: hidden;
  width: 100%;
}

/* Table of contents */
.toc {
  background: var(--accent-pale);
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  padding: 1.5rem 1.75rem;
  margin-bottom: 2.5rem;
  max-width: 100%;
  overflow-x: hidden;
}

.toc-title {
  font-family: var(--font-mono);
  font-size: 1.125rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.875rem;
}

.toc ol {
  padding-left: 1.25rem;
  margin: 0;
}

.toc li {
  font-size: 1.125rem;
  color: var(--ink-light);
  margin-bottom: 0.375rem;
}

.toc a {
  color: var(--ink-light);
  text-decoration: none;
}
.toc a:hover { color: var(--accent); text-decoration: underline; }

/* Article typography */
.article-body-inner h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 3rem 0 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}

.article-body-inner h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  margin: 2rem 0 0.75rem;
}

.article-body-inner p {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--ink-light);
  margin-bottom: 1.25rem;
}

.article-body-inner strong { color: var(--ink); font-weight: 600; }

.article-body-inner ul, .article-body-inner ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.article-body-inner li {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--ink-light);
  margin-bottom: 0.375rem;
}

/* Testimonial example boxes — used within the article */
.example-box {
  border: 1.5px solid var(--rule);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 1.75rem 0;
  background: var(--white);
  position: relative;
}

.example-box-label {
  position: absolute;
  top: -0.65rem;
  left: 1rem;
  background: var(--white);
  padding: 0 0.5rem;
  font-family: var(--font-mono);
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.example-box.good { border-color: var(--accent); }
.example-box.good .example-box-label { color: var(--accent); }

.example-box.bad { border-color: #c9423a; }
.example-box.bad .example-box-label { color: #c9423a; }

/* Testimonial mockups inside article */
.testimonial-demo {
  background: var(--paper-warm);
  border-radius: 8px;
  padding: 2rem;
  margin: 1.75rem 0;
}

.testimonial-demo-label {
  font-family: var(--font-mono);
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 1.25rem;
}

/* Style 1: Quote card */
.t-quote-card {
  background: var(--white);
  border-radius: 6px;
  padding: 1.5rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  max-width: 420px;
}

.t-quote-mark {
  font-family: var(--font-display);
  font-size: 3rem;
  line-height: 0.8;
  color: var(--accent);
  margin-bottom: 0.75rem;
  display: block;
}

.t-quote-text {
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--ink-light);
  font-style: italic;
  margin-bottom: 1rem;
}

.t-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.t-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-bright) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.125rem;
  font-weight: 700;
  flex-shrink: 0;
}

.t-author-info { line-height: 1.3; }
.t-author-name { font-size: 1.125rem; font-weight: 600; color: var(--ink); }
.t-author-title { font-size: 1.125rem; color: var(--ink-muted); }

/* Style 2: Stat strip */
.t-stat-strip {
  background: var(--ink);
  border-radius: 6px;
  padding: 1.5rem 2rem;
  display: flex;
  gap: 2rem;
  align-items: center;
  flex-wrap: wrap;
}

.t-stat {
  text-align: center;
}

.t-stat-number {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  color: var(--accent-bright);
  line-height: 1;
  display: block;
}

.t-stat-label {
  font-size: 1.125rem;
  color: rgba(255,255,255,0.6);
  margin-top: 0.25rem;
}

.t-stat-quote {
  flex: 1;
  min-width: 200px;
  font-style: italic;
  color: rgba(255,255,255,0.8);
  font-size: 1.125rem;
  line-height: 1.6;
  border-left: 2px solid var(--accent);
  padding-left: 1rem;
}

/* Style 3: Sidebar strip */
.t-sidebar-strip {
  border-left: 4px solid var(--accent);
  padding: 1rem 1.25rem;
  background: var(--accent-pale);
  border-radius: 0 6px 6px 0;
}

.t-sidebar-text {
  font-size: 1rem;
  font-style: italic;
  color: var(--ink-light);
  line-height: 1.6;
  margin-bottom: 0.625rem;
}

.t-sidebar-name {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--accent);
}

/* Style 4: Video placeholder */
.t-video-thumb {
  background: var(--ink);
  border-radius: 6px;
  aspect-ratio: 16/9;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.t-video-thumb::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(26,107,74,0.3) 0%, transparent 60%);
}

.t-play-btn {
  width: 48px;
  height: 48px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.t-play-btn svg { margin-left: 3px; }

.t-video-caption {
  font-size: 1.125rem;
  color: rgba(255,255,255,0.7);
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 1rem;
}

/* Callout / Tip box */
.tip-box {
  background: var(--accent-pale);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  margin: 1.75rem 0;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.tip-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.tip-box p {
  margin: 0 !important;
  font-size: 1.125rem !important;
  color: var(--ink) !important;
}

.tip-box strong { color: var(--accent) !important; }

/* Key takeaway */
.key-takeaway {
  border: 2px solid var(--ink);
  border-radius: 6px;
  padding: 1.5rem;
  margin: 2.5rem 0;
}

.key-takeaway-label {
  font-family: var(--font-mono);
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.625rem;
}

.key-takeaway p {
  font-size: 1.0625rem !important;
  font-weight: 500 !important;
  color: var(--ink) !important;
  margin: 0 !important;
  line-height: 1.6 !important;
}

/* Article CTA */
.article-cta {
  background: var(--ink);
  border-radius: 8px;
  padding: 2.5rem;
  margin: 3rem 0 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.article-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 120%, rgba(26,107,74,0.4) 0%, transparent 60%);
}

.article-cta > * { position: relative; z-index: 1; }

.article-cta h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.625rem;
  letter-spacing: -0.02em;
}

.article-cta p {
  color: rgba(255,255,255,0.7) !important;
  margin-bottom: 1.5rem !important;
  font-size: 1.125rem !important;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .post-featured { grid-template-columns: 1fr; }
  .post-featured-image { max-height: 280px; aspect-ratio: 16/7; }
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .t-stat-strip { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 600px) {
  /* Layout */
  .post-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }

  /* Header */
  .header-inner { padding: 0 1rem; }
  .site-nav { gap: 1rem; }
  .site-nav a:not(.nav-cta):not(:last-child) { display: none; }

  /* Hero */
  .hero-title { font-size: 2rem; }
  .site-hero { padding: 3rem 1.25rem 2.5rem; }

  /* Blog section */
  .blog-section { padding: 2.5rem 1.25rem; }
  .post-featured { gap: 1.5rem; margin-bottom: 2rem; padding-bottom: 2rem; }
  .post-featured-image { max-height: 220px; aspect-ratio: 16/7; }
  .post-title { font-size: 1.5rem !important; }
  .post-featured-content .post-title { font-size: 1.5rem !important; }
  .post-card .post-title { font-size: 1.125rem !important; }
  .post-excerpt { font-size: 1.125rem; }
  .post-grid { margin-top: 2rem !important; padding-top: 2rem !important; gap: 1.5rem; }

  /* Topics bar */
  .topics-bar { padding: 0 1.25rem; }

  /* Article */
  .article-title { font-size: 1.875rem; }
  .article-body { padding: 2rem 1.25rem 3rem; }

  /* Footer */
  .footer-bottom { flex-direction: column; gap: 0.375rem; text-align: center; }

  /* Misc */
  .t-stat-strip { flex-direction: column; }
  .section-header { flex-direction: column; gap: 0.5rem; }
}

/* ---- OVERFLOW & MOBILE GRID FIXES ---- */
/* Prevent any element from causing horizontal scroll */
*, *::before, *::after { box-sizing: border-box; }

@media (max-width: 600px) {
  /* Article layout */
  .article-layout { padding: 2rem 1.25rem 3rem !important; gap: 2rem !important; }

  /* Article hero */
  .article-hero { padding: 2.5rem 1.25rem 2rem; }
  .article-title { font-size: 1.75rem !important; }
  .article-subtitle { font-size: 1.125rem; }

  /* Prevent any inline fixed widths from overflowing */
  .cta-ann { min-width: 0 !important; flex-wrap: wrap; }
  .wf-url { max-width: 180px; }

  /* Article body */
  .article-body-inner { overflow-x: hidden; width: 100%; }
  .toc { padding: 1.25rem; }
  .toc ol { padding-left: 1rem; }

  /* Force all multi-col article grids to stack */
  .calc-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .stat-strip { grid-template-columns: 1fr 1fr !important; }
  .score-grid { grid-template-columns: 1fr !important; }
  .format-grid { grid-template-columns: 1fr 1fr !important; }
  .speed-comparison { grid-template-columns: 1fr !important; }
  .compare-grid { grid-template-columns: 1fr !important; }
  .method-grid { grid-template-columns: 1fr !important; }
  .response-grid { grid-template-columns: 1fr !important; }
  .form-compare { grid-template-columns: 1fr !important; }
  .tool-grid { grid-template-columns: 1fr !important; }
  .section-card-header { flex-wrap: wrap; }

  /* Wireframe diagrams */
  .wf-row { flex-wrap: wrap; gap: 0.5rem; }
  .wf-section { flex-wrap: wrap; height: auto !important; }
  .zone { flex-wrap: wrap; height: auto !important; }
  .zone-spec { font-size: 1rem; min-width: 0; }

  /* Chart elements */
  .conv-time, .conv-rate { font-size: 1rem; width: 40px; }
  .bounce-label { font-size: 1rem; width: 90px; }
  .bounce-pct { font-size: 1rem; width: 40px; }
  .size-bar-label, .size-bar-kb { font-size: 1rem; width: auto; }
  .size-bar-row { gap: 0.5rem; }

  /* Tables */
  .size-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .size-table { min-width: 480px; }

  /* Formula box */
  .formula-row { flex-wrap: wrap; }

  /* CTA anatomy */
  .cta-annotation { flex-direction: column; }
}
