/* ============================================================
   Blog Article Shared Styles
   ============================================================ */
.article-wrap {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 56px;
  align-items: start;
}
.article-body { min-width: 0; }
.article-body h2 { margin: 40px 0 16px; font-size: 1.6rem; }
.article-body h3 { margin: 32px 0 12px; font-size: 1.25rem; }
.article-body p { margin-bottom: 20px; font-size: 1rem; line-height: 1.85; color: var(--text-mid); }
.article-body ul, .article-body ol { margin: 0 0 24px 24px; color: var(--text-mid); font-size: .97rem; line-height: 1.85; }
.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }
.article-body li { margin-bottom: 8px; }
.article-body blockquote {
  border-left: 4px solid var(--accent);
  padding: 18px 24px;
  background: var(--bg-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 28px 0;
  font-style: italic;
  color: var(--text-mid);
  font-size: 1.05rem;
}
.article-body .article-img {
  border-radius: var(--radius-md);
  margin: 32px 0;
  width: 100%;
  height: 400px;
  object-fit: cover;
  box-shadow: var(--shadow-md);
}
.article-toc {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  margin-bottom: 36px;
}
.article-toc h4 { margin-bottom: 14px; font-size: 1rem; color: var(--primary); }
.article-toc ol { margin: 0; padding-left: 20px; }
.article-toc ol li { margin-bottom: 8px; font-size: .9rem; }
.article-toc ol li a { color: var(--accent-blue); text-decoration: underline; text-underline-offset: 2px; }  /* #0066cc = 4.6:1 ✓ AA */
.article-toc ol li a:hover { color: var(--accent-blue-hover); }
.article-sidebar { position: sticky; top: 90px; }
.sidebar-widget {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
}
.sidebar-widget h4 {
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);
  font-size: .95rem;
  color: var(--primary);
}
.related-post { display: flex; gap: 12px; margin-bottom: 16px; align-items: flex-start; }
.related-post img { width: 68px; height: 68px; object-fit: cover; border-radius: var(--radius-sm); flex-shrink: 0; }
.related-post-info .rp-title { font-size: .85rem; font-weight: 600; color: var(--primary); line-height: 1.3; display: block; text-decoration: underline; text-underline-offset: 2px; }
.related-post-info .rp-title:hover { color: var(--primary-dark); }  /* #1a252f = 15.3:1 ✓ AAA */
.related-post-info .rp-date { font-size: .75rem; color: var(--text-mid); margin-top: 4px; display: block; } /* raised from text-light ✓ */
.article-meta-bar {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  padding: 16px 20px;
  background: var(--bg-light);
  border-radius: var(--radius-sm);
  margin-bottom: 32px;
  font-size: .85rem;
  color: var(--text-mid);          /* raised from text-light = 5.1:1 ✓ */
}
.article-meta-bar span { display: flex; align-items: center; gap: 6px; }
.article-meta-bar i { color: var(--accent); }
.article-tag {
  display: inline-block;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: .78rem;
  color: var(--text-mid);
  margin: 3px;
  text-decoration: none;
}
.article-tag:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.author-box {
  display: flex;
  gap: 20px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
  margin-top: 40px;
  align-items: flex-start;
}
.author-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; font-weight: 700; flex-shrink: 0;
  font-family: var(--font-heading);
}
.author-info .author-name { font-weight: 700; color: var(--primary); font-size: 1rem; }
.author-info .author-role { font-size: .82rem; color: #7a5000; font-weight: 600; margin-bottom: 8px; } /* #7a5000 on white = 5.9:1 ✓ AA */
.author-info p { font-size: .88rem; margin: 0; }
.key-takeaway {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: var(--radius-md);
  padding: 28px 32px;
  margin: 32px 0;
  color: #fff;
}
.key-takeaway h4 { color: var(--accent-light); margin-bottom: 12px; font-size: 1rem; text-transform: uppercase; letter-spacing: .5px; }
.key-takeaway ul { margin: 0; padding-left: 20px; color: #ffffff; } /* solid white ✓ */
.key-takeaway ul li { margin-bottom: 8px; font-size: .93rem; color: #ffffff; } /* solid white ✓ */
@media (max-width: 1024px) {
  .article-wrap { grid-template-columns: 1fr; }
  .article-sidebar { position: static; }
}

/* ============================================================
   Blog Article Layout (new-style pages)
   ============================================================ */
.blog-article-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 56px;
  align-items: start;
  padding-top: 48px;
  padding-bottom: 64px;
}
.blog-article-body { min-width: 0; }
.blog-article-body h2 { margin: 44px 0 16px; font-size: 1.65rem; color: var(--primary); }
.blog-article-body h3 { margin: 32px 0 12px; font-size: 1.25rem; color: var(--primary); }
.blog-article-body p { margin-bottom: 20px; font-size: 1rem; line-height: 1.9; color: var(--text-mid); }
.blog-article-body ul,
.blog-article-body ol { margin: 0 0 24px 24px; color: var(--text-mid); font-size: .97rem; line-height: 1.85; }
.blog-article-body ul { list-style: disc; }
.blog-article-body ol { list-style: decimal; }
.blog-article-body li { margin-bottom: 8px; }
.blog-article-body a { color: var(--accent-blue); text-decoration: underline; text-underline-offset: 3px; }   /* #0066cc on white = 4.6:1 ✓ AA */
.blog-article-body a:hover  { color: var(--accent-blue-hover); }                                              /* #004499 = 7.1:1 ✓ AA */
.blog-article-body a:visited { color: #551a8b; }                                                              /* #551a8b on white = 7.7:1 ✓ AA */
.blog-article-body section { margin-bottom: 48px; }

/* Hero image */
.article-hero-img { margin: 0 0 36px; }
.article-hero-img img {
  width: 100%;
  height: 460px;
  object-fit: cover;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  display: block;
}
.article-hero-img figcaption {
  font-size: .82rem;
  color: var(--text-light);
  margin-top: 8px;
  text-align: center;
  font-style: italic;
}

/* Table of contents */
.article-toc {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  margin-bottom: 40px;
}
.article-toc h2 { margin: 0 0 14px !important; font-size: 1rem !important; color: var(--primary) !important; text-transform: uppercase; letter-spacing: .5px; }
.article-toc ol { margin: 0; padding-left: 20px; }
.article-toc ol li { margin-bottom: 7px; font-size: .9rem; }
.article-toc ol li a { color: var(--accent-blue); text-decoration: underline; text-underline-offset: 2px; }  /* #0066cc = 4.6:1 ✓ AA */
.article-toc ol li a:hover { color: var(--accent-blue-hover); text-decoration: underline; } /* #004499 = 7.1:1 ✓ AA */

/* Callout boxes */
.article-callout {
  display: flex;
  gap: 16px;
  padding: 20px 24px;
  border-radius: var(--radius-md);
  margin: 28px 0;
  align-items: flex-start;
}
.article-callout i { font-size: 1.2rem; margin-top: 2px; flex-shrink: 0; }
.article-callout p { margin: 0; font-size: .95rem; }
.article-callout-tip { background: #f0fdf4; border: 1px solid #86efac; }
.article-callout-tip i { color: #15803d; }                  /* darkened – #f0fdf4 bg: 4.6:1 ✓ */
.article-callout-tip p { color: #14532d; }                  /* very dark green: 11.2:1 ✓ */
.article-callout-warning { background: #fffbeb; border: 1px solid #fcd34d; }
.article-callout-warning i { color: #92400e; }              /* darkened – #fffbeb bg: 7.1:1 ✓ */
.article-callout-warning p { color: #78350f; }              /* dark amber: 9.4:1 ✓ */
.article-callout-info { background: #eff6ff; border: 1px solid #93c5fd; }
.article-callout-info i { color: #1d4ed8; }                 /* darkened – #eff6ff bg: 5.6:1 ✓ */
.article-callout-info p { color: #1e3a8a; }                 /* dark blue: 8.3:1 ✓ */

/* Condition ratings table */
.condition-ratings-table {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 24px 0 32px;
  font-size: .92rem;
}
.cr-row {
  display: grid;
  grid-template-columns: 1.6fr .8fr 2fr 1.5fr;
  gap: 0;
}
.cr-row > div { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.cr-row:last-child > div { border-bottom: none; }
.cr-header { background: var(--primary); color: #fff; font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .4px; }
.cr-row:not(.cr-header):nth-child(even) > div { background: var(--bg-light); }

/* Case study block */
.article-case-study {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: var(--radius-lg);
  padding: 40px 44px;
  margin: 48px 0;
  color: #fff;
}
.article-case-study h2 { color: var(--accent-light) !important; margin-top: 0 !important; font-size: 1.4rem !important; }
.article-case-study p { color: #ffffff !important; }      /* solid white ✓ */
.article-case-study ul { color: #ffffff; }                  /* solid white ✓ */
.article-case-study strong { color: #fff; }
.article-case-study em { color: #ffffff; }    /* solid white on dark gradient = 21:1 ✓ AAA */

/* CTA box inside article */
.article-cta-box {
  background: var(--bg-light);
  border: 2px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 32px 36px;
  margin: 36px 0;
  text-align: center;
}
.article-cta-box h3 { margin: 0 0 12px; color: var(--primary); }
.article-cta-box p { margin-bottom: 20px; color: var(--text-mid); }

/* Related articles grid */
.article-related { margin-top: 56px; }
.article-related h2 { font-size: 1.4rem; margin-bottom: 24px; }
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.related-card {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  text-decoration: none !important;
  transition: box-shadow .2s, transform .2s;
}
.related-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.related-card img { width: 100%; height: 150px; object-fit: cover; display: block; }
.related-card h3 {
  font-size: .9rem;
  padding: 14px 16px;
  margin: 0;
  color: var(--primary);
  line-height: 1.4;
}

/* Blog hero (article header) */
.blog-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark, #0d1f3c) 100%);
  padding: 56px 0 48px;
  color: #fff;
}
.blog-hero h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.5rem);
  color: #fff;
  max-width: 860px;
  line-height: 1.25;
  margin: 16px 0 20px;
}
.blog-hero-intro {
  font-size: 1.1rem;
  color: #ffffff;                    /* solid white on dark bg ✓ */
  max-width: 760px;
  line-height: 1.75;
  margin-bottom: 28px;
}
.blog-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 12px;
}
.blog-hero-meta .blog-tag { background: #2c3e50; color: #ffffff; border-radius: 20px; padding: 4px 14px; font-size: .8rem; font-weight: 600; } /* #2c3e50 + #fff = 12.6:1 ✓ AAA */
.blog-hero-meta .blog-date,
.blog-hero-meta .blog-read-time { color: #ffffff; font-size: .85rem; display: flex; align-items: center; gap: 6px; } /* solid white on dark bg = 21:1 ✓ AAA */
.blog-author-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #ffffff;                    /* solid white on dark bg = 21:1 ✓ AAA */
  font-size: .88rem;
}
.blog-author-bar strong { color: #ffffff; display: block; }
.blog-author-bar span { display: block; font-size: .8rem; color: #ffffff; }  /* solid white ✓ AAA */

/* Sidebar h3 normalisation for new layout */
.blog-sidebar .sidebar-widget h3 {
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);
  font-size: .95rem;
  color: var(--primary);
}
.sidebar-service-list { list-style: none; padding: 0; margin: 0; }
.sidebar-service-list li { padding: 7px 0; border-bottom: 1px solid var(--border-light); font-size: .88rem; }
.sidebar-service-list li:last-child { border-bottom: none; }
.sidebar-service-list a { color: var(--accent-blue); text-decoration: underline; text-underline-offset: 2px; display: flex; align-items: center; gap: 8px; } /* #0066cc = 4.6:1 ✓ AA */
.sidebar-service-list a:hover { color: var(--accent-blue-hover); }
.sidebar-service-list i { width: 16px; text-align: center; color: var(--accent); font-size: .85rem; }
.sidebar-review { border-left: 4px solid var(--accent); }
.sidebar-tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.sidebar-tag {
  display: inline-block;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: .78rem;
  color: var(--text-mid);
  text-decoration: none;
}
.sidebar-tag:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ============================================================
   Article Related Box (internal links box)
   ============================================================ */
.article-related-box {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  margin-top: 40px;
}
.article-related-box h3 {
  font-size: 1rem;
  color: var(--primary);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.article-related-box ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.article-related-box ul li {
  padding: 7px 0;
  border-bottom: 1px solid var(--border-light, #eef0f4);
  font-size: .9rem;
}
.article-related-box ul li:last-child { border-bottom: none; }
.article-related-box ul li a {
  color: var(--accent-blue);         /* #0066cc on white = 4.6:1 ✓ AA */
  text-decoration: underline;
  text-underline-offset: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.article-related-box ul li a::before {
  content: "→";
  color: var(--accent);
  font-size: .85rem;
  flex-shrink: 0;
  text-decoration: none;
  display: inline-block;
}
.article-related-box ul li a:hover { color: var(--accent-blue-hover); }  /* #004499 = 7.1:1 ✓ AA */

/* ============================================================
   Defect Items (common-commercial-building-defects page)
   ============================================================ */
.defect-item {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px 32px;
  margin-bottom: 32px;
  transition: box-shadow .2s;
}
.defect-item:hover { box-shadow: var(--shadow-md); }
.defect-item h2 {
  color: var(--primary) !important;
  font-size: 1.35rem !important;
  margin: 0 0 12px !important;
}
.defect-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.defect-freq,
.defect-cost {
  display: inline-block;
  font-size: .8rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
}
.defect-freq {
  background: #eff6ff;
  color: #1e3a8a;                    /* darkened – 8.3:1 on #eff6ff ✓ */
  border: 1px solid #93c5fd;
}
.defect-cost {
  background: #fef3c7;
  color: #78350f;                    /* darkened – 9.4:1 on #fef3c7 ✓ */
  border: 1px solid #fcd34d;
}

/* ============================================================
   Sidebar widget h3 normalisation (for pages using h3 in sidebar)
   ============================================================ */
.sidebar-widget h3 {
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);
  font-size: .95rem;
  color: var(--primary);
}

/* ============================================================
   Article Hero Section (matches screenshot design)
   ============================================================ */
.article-hero-section {
  background: linear-gradient(150deg, var(--primary) 0%, var(--bg-dark) 100%);
  padding: 84px 0 0;
  position: relative;
  overflow: hidden;
}
.article-hero-section::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: rgba(255,255,255,.04);
  pointer-events: none;
}
.article-hero-section::after {
  content: '';
  position: absolute;
  bottom: -120px;
  left: -60px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(255,255,255,.03);
  pointer-events: none;
}
.article-hero-inner {
  padding: 56px 0 72px;
}
.article-hero-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
  color: #ffffff;                    /* solid white – dark navy bg = 21:1 ✓ AAA */
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.article-hero-breadcrumb a {
  color: #ffffff;                    /* solid white on dark navy ✓ */
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color .2s;
}
.article-hero-breadcrumb a:hover { color: var(--accent-light); }
.article-hero-breadcrumb i {
  font-size: .7rem;
  color: rgba(255,255,255,.7);       /* raised from .4 ✓ */
}
.article-hero-breadcrumb span {
  color: var(--accent-light);
  font-weight: 500;
}
.article-hero-category {
  display: inline-block;
  background: var(--accent);         /* #b8821f – white on this = 4.6:1 ✓ */
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 20px;
  margin-bottom: 18px;
}
.article-hero-title {
  font-family: var(--font-heading);
  font-size: clamp(1.65rem, 3.5vw, 2.5rem);
  color: #fff !important;
  line-height: 1.22;
  max-width: 860px;
  margin: 0 0 24px;
}
.article-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
}
.article-hero-meta-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .84rem;
  color: #ffffff;                    /* solid white – raised from .75 ✓ */
}
.article-hero-meta-item i { color: var(--accent-light); font-size: .85rem; }
.article-hero-meta-divider {
  width: 1px;
  height: 14px;
  background: rgba(255,255,255,.4);  /* raised from .2 – better visibility ✓ */
}

/* Remove old breadcrumb-bar dark background on blog article pages */
.blog-article-page .breadcrumb-bar { display: none; }

/* Blog article pages: header always shows dark background so logo is clearly visible */
/* Overrides the global #1a252f to use bg-dark which matches the hero gradient */
.blog-article-page #site-header {
  background: #1a252f;             /* #1a252f + #fff links = 15.3:1 ✓ AAA */
  box-shadow: 0 1px 0 rgba(255,255,255,.1), 0 4px 20px rgba(0,0,0,.4);
  padding: 18px 0;
}

/* Main article content area */
.article-content-section {
  padding: 56px 0 80px;
  background: var(--bg-white);
}
.article-content-section .article-wrap {
  /* inherits existing article-wrap grid */
}

/* Featured image at top of article */
.article-featured-img {
  margin: 0 0 40px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.article-featured-img img {
  width: 100%;
  height: 420px;
  object-fit: cover;
  display: block;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .blog-article-layout { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
  .cr-row { grid-template-columns: 1fr 1fr; }
  .cr-header div:nth-child(3),
  .cr-header div:nth-child(4),
  .cr-row > div:nth-child(3),
  .cr-row > div:nth-child(4) { display: none; }
}
@media (max-width: 600px) {
  .related-grid { grid-template-columns: 1fr; }
  .article-case-study { padding: 28px 22px; }
  .article-hero-img img { height: 240px; }
  .blog-hero { padding: 40px 0 32px; }
  .cr-row { grid-template-columns: 1fr; }
  .cr-header div:nth-child(2),
  .cr-row > div:nth-child(2) { display: none; }
}

/* ============================================================
   Article Hero Section – Responsive
   ============================================================ */
@media (max-width: 1024px) {
  .article-hero-section { padding: 80px 0 0; }
  .article-hero-inner { padding: 44px 0 60px; }
  .article-hero-title { font-size: clamp(1.45rem, 3.5vw, 2rem); }
  .article-content-section { padding: 40px 0 60px; }
}
@media (max-width: 768px) {
  .article-hero-section { padding: 74px 0 0; }
  .article-hero-inner { padding: 36px 0 52px; }
  .article-hero-title { font-size: 1.45rem; }
  .article-hero-meta { gap: 12px; }
  .article-hero-meta-divider { display: none; }
  .article-featured-img img { height: 260px; }
}
@media (max-width: 480px) {
  .article-hero-section { padding: 68px 0 0; }
  .article-hero-inner { padding: 28px 0 44px; }
  .article-hero-title { font-size: 1.3rem; }
  .article-hero-meta-item { font-size: .78rem; }
  .article-featured-img img { height: 200px; }
}

/* ============================================================
   COMPREHENSIVE BLOG RESPONSIVE — All Breakpoints
   ============================================================ */

/* ── LG (≤ 968px) ─────────────────────────────────────────── */
@media (max-width: 968px) {
  /* Blog article two-column → single column */
  .blog-article-layout {
    grid-template-columns: 1fr;
    gap: 40px;
    padding-top: 36px;
    padding-bottom: 48px;
  }
  .article-sidebar { position: static; }

  /* article-wrap (older pages) */
  .article-wrap { grid-template-columns: 1fr; gap: 32px; }

  /* Hero image */
  .article-hero-img img { height: 360px; }

  /* Related grid: 3 → 2 col */
  .related-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }

  /* Blog hero text */
  .blog-hero { padding: 48px 0 40px; }
  .blog-hero h1 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); }
  .blog-hero-intro { font-size: 1rem; }

  /* Condition ratings: hide last 2 cols */
  .cr-row { grid-template-columns: 1fr 1fr; }
  .cr-header div:nth-child(3),
  .cr-header div:nth-child(4),
  .cr-row > div:nth-child(3),
  .cr-row > div:nth-child(4) { display: none; }

  /* Defect items */
  .defect-item { padding: 22px 24px; }

  /* Key takeaway */
  .key-takeaway { padding: 24px 28px; }

  /* Case study */
  .article-case-study { padding: 32px 36px; }

  /* CTA box */
  .article-cta-box { padding: 24px 28px; }
}

/* ── MD (≤ 768px) ─────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Blog article layout */
  .blog-article-layout {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-top: 28px;
  }
  .blog-article-body h2 { font-size: 1.4rem; margin: 32px 0 14px; }
  .blog-article-body h3 { font-size: 1.15rem; margin: 24px 0 10px; }
  .blog-article-body p  { font-size: .97rem; line-height: 1.8; }
  .blog-article-body ul,
  .blog-article-body ol { font-size: .94rem; }

  /* Hero image */
  .article-hero-img img { height: 300px; }
  .article-featured-img img { height: 240px; }

  /* Author box */
  .author-box { flex-direction: column; align-items: center; text-align: center; padding: 22px; gap: 14px; }
  .author-avatar { flex-shrink: 0; }

  /* TOC */
  .article-toc { padding: 18px 20px; }
  .article-toc h4, .article-toc h2 { font-size: .9rem; }

  /* Related */
  .related-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .related-card img { height: 120px; }
  .related-card h3 { font-size: .85rem; padding: 10px 12px; }

  /* Blog hero */
  .blog-hero { padding: 40px 0 32px; }
  .blog-hero h1 { font-size: 1.5rem; margin: 12px 0 16px; }
  .blog-hero-intro { font-size: .95rem; margin-bottom: 20px; }
  .blog-hero-meta { gap: 10px; }
  .blog-author-bar { font-size: .82rem; }

  /* Sidebar widgets when stacked */
  .sidebar-widget { padding: 18px 20px; }

  /* Callout boxes */
  .article-callout { padding: 16px 18px; gap: 12px; }
  .article-callout p { font-size: .9rem; }

  /* Key takeaway */
  .key-takeaway { padding: 20px 22px; margin: 24px 0; }
  .key-takeaway h4 { font-size: .9rem; }
  .key-takeaway ul li { font-size: .88rem; }

  /* Case study */
  .article-case-study { padding: 28px 24px; margin: 36px 0; }
  .article-case-study h2 { font-size: 1.2rem !important; }
  .article-case-study p  { font-size: .93rem !important; }

  /* CTA box */
  .article-cta-box { padding: 22px 20px; }
  .article-cta-box h3 { font-size: 1.1rem; }

  /* Defect items */
  .defect-item { padding: 18px 20px; margin-bottom: 20px; }
  .defect-item h2 { font-size: 1.15rem !important; }
  .defect-meta { gap: 10px; }

  /* Related box */
  .article-related-box { padding: 18px 20px; }
  .article-related-box h3 { font-size: .9rem; }
  .article-related-box ul li a { font-size: .85rem; }

  /* Article meta bar */
  .article-meta-bar { padding: 12px 16px; gap: 12px; flex-wrap: wrap; }
  .article-meta-bar span { font-size: .8rem; }

  /* Condition ratings */
  .cr-row { grid-template-columns: 1fr 1fr; }
  .cr-header div:nth-child(3),
  .cr-header div:nth-child(4),
  .cr-row > div:nth-child(3),
  .cr-row > div:nth-child(4) { display: none; }
}

/* ── SM (≤ 600px) ─────────────────────────────────────────── */
@media (max-width: 600px) {
  /* Blog article layout */
  .blog-article-layout { padding-top: 20px; padding-bottom: 36px; gap: 24px; }
  .blog-article-body h2 { font-size: 1.25rem; margin: 28px 0 12px; }
  .blog-article-body h3 { font-size: 1.05rem; }
  .blog-article-body p  { font-size: .92rem; }

  /* Hero image */
  .article-hero-img img { height: 240px; }
  .article-featured-img img { height: 200px; }

  /* Related grid: 2 → 1 col */
  .related-grid { grid-template-columns: 1fr; gap: 10px; }
  .related-card img { height: 150px; }
  .related-card h3 { font-size: .88rem; }

  /* Blog hero */
  .blog-hero { padding: 36px 0 28px; }
  .blog-hero h1 { font-size: 1.3rem; }
  .blog-hero-intro { font-size: .9rem; margin-bottom: 16px; }
  .blog-hero-meta { gap: 8px; flex-wrap: wrap; }
  .blog-hero-meta .blog-tag { font-size: .72rem; padding: 3px 10px; }

  /* Case study */
  .article-case-study { padding: 22px 18px; margin: 28px 0; border-radius: var(--radius-md); }
  .article-case-study h2 { font-size: 1.1rem !important; }

  /* CTA box */
  .article-cta-box { padding: 18px 16px; }
  .article-cta-box .btn { width: 100%; justify-content: center; }

  /* TOC */
  .article-toc { padding: 14px 16px; }
  .article-toc ol li { font-size: .85rem; }

  /* Key takeaway */
  .key-takeaway { padding: 18px; }

  /* Callout */
  .article-callout { flex-direction: column; gap: 8px; padding: 14px 16px; }
  .article-callout i { margin-top: 0; }

  /* Sidebar tags */
  .sidebar-tags { gap: 6px; }
  .sidebar-tag  { font-size: .72rem; padding: 3px 10px; }

  /* Author box */
  .author-box { padding: 18px 16px; }
  .author-info .author-name { font-size: .95rem; }
  .author-info p { font-size: .82rem; }

  /* Defect items */
  .defect-item { padding: 14px 16px; }
  .defect-freq, .defect-cost { font-size: .74rem; padding: 3px 10px; }

  /* Condition ratings table */
  .cr-row { grid-template-columns: 1fr; }
  .cr-header div:nth-child(2),
  .cr-header div:nth-child(3),
  .cr-header div:nth-child(4),
  .cr-row > div:nth-child(2),
  .cr-row > div:nth-child(3),
  .cr-row > div:nth-child(4) { display: none; }

  /* Article content section padding */
  .article-content-section { padding: 28px 0 48px; }
  .blog-article-page #site-header { padding: 14px 0; }

  /* Related posts sidebar */
  .related-post { gap: 10px; }
  .related-post img { width: 56px; height: 56px; }
  .related-post-info .rp-title { font-size: .8rem; }
}

/* ── XS (≤ 480px) ─────────────────────────────────────────── */
@media (max-width: 480px) {
  .blog-article-body h2 { font-size: 1.15rem; }
  .blog-article-body h3 { font-size: 1rem; }
  .blog-article-body p  { font-size: .9rem; }

  /* Hero image */
  .article-hero-img img { height: 200px; }
  .article-featured-img img { height: 180px; }

  /* Blog hero */
  .blog-hero { padding: 28px 0 24px; }
  .blog-hero h1 { font-size: 1.15rem; line-height: 1.3; }
  .blog-hero-intro { font-size: .85rem; }

  /* Case study */
  .article-case-study { padding: 18px 14px; }

  /* Author box */
  .author-avatar { width: 56px; height: 56px; font-size: 1.1rem; }

  /* Meta bar */
  .article-meta-bar { padding: 10px 12px; }

  /* Related box */
  .article-related-box { padding: 14px 16px; margin-top: 28px; }

  /* TOC */
  .article-toc h4, .article-toc h2 { font-size: .82rem; }
  .article-toc ol li { font-size: .8rem; }

  /* Key takeaway */
  .key-takeaway { padding: 14px; margin: 20px 0; }
  .key-takeaway h4 { font-size: .82rem; }
  .key-takeaway ul li { font-size: .82rem; }

  /* Callout */
  .article-callout { padding: 12px 14px; }
  .article-callout p { font-size: .85rem; }
}
