/* ==========================================================================
   BLOG ARTICLE STYLESHEET
   Loaded after style.css on long-form article pages only.
   Extracted from the perimenopause article so the sleep/snoring series
   shares one set of styles rather than duplicating a <style> block per page.
   ========================================================================== */

/* ── Article body ── */
.blog-body {
  font-size: var(--text-lg);
  line-height: 1.8;
  color: var(--c-text);
}
.blog-body h2 {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  color: var(--c-primary);
  margin: var(--space-12) 0 var(--space-4);
  padding-top: var(--space-4);
  border-top: 2px solid var(--c-accent-light);
}
.blog-body h3 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--c-primary);
  margin: var(--space-8) 0 var(--space-3);
}
.blog-body p { margin-bottom: var(--space-5); }
.blog-body ul,
.blog-body ol { margin: 0 0 var(--space-6) var(--space-6); }
.blog-body li { margin-bottom: var(--space-3); line-height: 1.75; }
.blog-body a { color: var(--c-accent); text-decoration: underline; text-underline-offset: 3px; }
.blog-body a:hover { color: var(--c-primary); }
.blog-body img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--border-radius);
  margin: var(--space-8) 0;
}
.blog-body figure { margin: var(--space-8) 0; }
.blog-body figure img { margin: 0 0 var(--space-3); }
.blog-body figcaption {
  font-size: var(--text-sm);
  color: var(--c-text-light);
  line-height: 1.6;
  text-align: center;
}

/* ── AI / key-points summary box (top of article) ── */
.ai-summary {
  background: var(--c-surface-alt);
  border: 1px solid var(--c-border);
  border-left: 4px solid var(--c-primary);
  border-radius: 0 var(--border-radius-lg) var(--border-radius-lg) 0;
  padding: var(--space-8);
  margin: 0 0 var(--space-10);
}
.ai-summary__label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-primary);
  margin-bottom: var(--space-4);
}
.ai-summary p {
  font-size: var(--text-base);
  line-height: 1.75;
  color: var(--c-text);
  margin-bottom: var(--space-4);
}
.ai-summary ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ai-summary li {
  position: relative;
  padding-left: var(--space-6);
  margin-bottom: var(--space-3);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--c-text-muted);
}
.ai-summary li:last-child { margin-bottom: 0; }
.ai-summary li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c-accent);
}
.ai-summary li strong { color: var(--c-primary); font-weight: 600; }

/* ── Callout boxes ── */
.blog-body .callout {
  border-left: 4px solid var(--c-accent);
  background: var(--c-accent-light);
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
  padding: var(--space-8);
  margin: var(--space-8) 0;
}
.blog-body .callout--insight {
  border-left-color: var(--c-primary);
  background: var(--c-surface-alt);
}
.blog-body .callout--warning {
  border-left-color: var(--c-error);
  background: #FDF3F3;
}
.callout__label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-accent);
  margin-bottom: var(--space-2);
}
.callout--insight .callout__label { color: var(--c-primary); }
.callout--warning .callout__label { color: var(--c-error); }
.blog-body .callout p { margin-bottom: var(--space-3); font-size: var(--text-base); line-height: 1.7; }
.blog-body .callout p:last-child { margin-bottom: 0; }
.blog-body .callout ul { margin-bottom: 0; }
.blog-body .callout li { font-size: var(--text-base); }
.blog-body .callout strong { color: var(--c-primary); }

/* ── Comparison table (snoring vs OSA, sleep study options, DVLA groups) ── */
.compare-table-wrap { overflow-x: auto; margin: var(--space-8) 0; }
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-base);
  min-width: 480px;
}
.compare-table th,
.compare-table td {
  text-align: left;
  padding: var(--space-4);
  border-bottom: 1px solid var(--c-border);
  vertical-align: top;
  line-height: 1.6;
}
.compare-table thead th {
  font-family: var(--font-display);
  font-size: var(--text-base);
  color: #fff;
  background: var(--c-primary);
  border-bottom: none;
}
.compare-table thead th:first-child { border-radius: var(--border-radius) 0 0 0; }
.compare-table thead th:last-child { border-radius: 0 var(--border-radius) 0 0; }
.compare-table tbody th {
  font-weight: 600;
  color: var(--c-primary);
  background: var(--c-surface-alt);
  width: 30%;
}
.compare-table tbody tr:last-child th,
.compare-table tbody tr:last-child td { border-bottom: none; }

/* ── Numbered step / treatment ladder ── */
.step-list { list-style: none; counter-reset: step; padding: 0; margin: var(--space-8) 0; }
.step-list > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 var(--space-8) var(--space-16);
  margin: 0;
}
.step-list > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--c-primary);
  color: #fff;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.step-list > li::after {
  content: '';
  position: absolute;
  left: 21px;
  top: 52px;
  bottom: 8px;
  width: 2px;
  background: var(--c-border);
}
.step-list > li:last-child { padding-bottom: 0; }
.step-list > li:last-child::after { display: none; }
.step-list h3 { margin-top: 0; margin-bottom: var(--space-2); }
.step-list p { font-size: var(--text-base); margin-bottom: var(--space-3); }
.step-list p:last-child { margin-bottom: 0; }

/* ── Symptom / option grid ── */
.symptom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-3);
  margin: var(--space-6) 0;
}
.symptom-item {
  background: var(--c-primary);
  border-radius: var(--border-radius);
  padding: var(--space-6);
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
}
.symptom-item__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-accent);
  flex-shrink: 0;
  margin-top: 8px;
}
.symptom-item__text { font-size: var(--text-sm); line-height: 1.55; color: rgba(255,255,255,0.85); }
.symptom-item__text strong { display: block; font-size: var(--text-base); font-weight: 500; color: #fff; margin-bottom: 2px; }

/* ── Stat row ── */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-4);
  margin: var(--space-8) 0;
}
.stat-box {
  background: var(--c-primary);
  color: var(--c-text-on-dark);
  border-radius: var(--border-radius-lg);
  padding: var(--space-8) var(--space-6);
  text-align: center;
}
.stat-box__number {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 500;
  color: var(--c-accent);
  line-height: 1;
  margin-bottom: var(--space-2);
}
.stat-box__label { font-size: var(--text-sm); color: rgba(255,255,255,0.75); line-height: 1.4; }

/* ── FAQ (details/summary) ── */
.faq-section { margin-top: var(--space-16); }
.faq-section h2 {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  color: var(--c-primary);
  margin-bottom: var(--space-8);
  border-top: none;
  padding-top: 0;
}
.blog-body details.faq-item {
  border-bottom: 1px solid var(--c-border);
  border-top: none;
  padding: var(--space-6) 0;
  margin: 0;
  background: none;
}
.blog-body details.faq-item:first-of-type { border-top: 1px solid var(--c-border); }
.blog-body summary.faq-question {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--c-primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
  list-style: none;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  user-select: none;
}
.blog-body summary.faq-question::-webkit-details-marker { display: none; }
.blog-body summary.faq-question::after {
  content: '+';
  font-size: var(--text-2xl);
  font-weight: 300;
  color: var(--c-accent);
  flex-shrink: 0;
  line-height: 1.2;
}
.blog-body details[open] > summary.faq-question::after { content: '\2212'; }
.blog-body .faq-answer {
  font-size: var(--text-base);
  line-height: 1.75;
  color: var(--c-text-muted);
  margin-top: var(--space-4);
  padding: 0 var(--space-8) 0 0;
  max-height: none;
  overflow: visible;
}
.blog-body .faq-answer p { margin-bottom: var(--space-3); font-size: var(--text-base); }
.blog-body .faq-answer p:last-child { margin-bottom: 0; }

/* ── Sidebar ── */
.blog-sidebar { position: sticky; top: 96px; }
.sidebar-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--border-radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  box-shadow: var(--shadow);
}
.sidebar-card__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--c-primary);
  margin-bottom: var(--space-4);
}
.sidebar-card p { font-size: var(--text-sm); color: var(--c-text-muted); line-height: 1.65; margin-bottom: var(--space-4); }
.sidebar-card .btn { width: 100%; text-align: center; justify-content: center; }
.sidebar-creds { list-style: none; padding: 0; margin: 0; }
.sidebar-creds li {
  font-size: var(--text-sm);
  color: var(--c-text-muted);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--c-border-light);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.sidebar-creds li:last-child { border-bottom: none; }
.sidebar-creds li::before { content: '\2713'; color: var(--c-accent); font-weight: 600; font-size: var(--text-sm); flex-shrink: 0; }

.toc { list-style: none; padding: 0; margin: 0; }
.toc li { padding: var(--space-2) 0; border-bottom: 1px solid var(--c-border-light); }
.toc li:last-child { border-bottom: none; }
.toc a { font-size: var(--text-sm); color: var(--c-text-muted); text-decoration: none; display: block; padding: var(--space-1) 0; }
.toc a:hover { color: var(--c-accent); }
.toc-title { font-size: var(--text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--c-text-light); margin-bottom: var(--space-3); }

/* ── Related links ── */
.related-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--c-border-light);
  text-decoration: none;
  color: var(--c-text);
  transition: color var(--transition);
  font-size: var(--text-sm);
}
.related-link:last-child { border-bottom: none; }
.related-link:hover { color: var(--c-accent); }
.related-link::before { content: '\2192'; color: var(--c-accent); flex-shrink: 0; }

/* Inline "read next" strip inside the article */
.read-next {
  border: 1px solid var(--c-border);
  border-radius: var(--border-radius-lg);
  padding: var(--space-6);
  margin: var(--space-8) 0;
  background: var(--c-surface-warm);
}
.read-next__label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-text-light);
  margin-bottom: var(--space-3);
}
.read-next a { display: block; }

/* ── In-article CTA banner ── */
.article-cta {
  background: var(--c-primary);
  border-radius: var(--border-radius-lg);
  padding: var(--space-10) var(--space-8);
  text-align: center;
  color: var(--c-text-on-dark);
  margin-top: var(--space-12);
}
.article-cta h2 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  margin-bottom: var(--space-4);
  color: #fff;
  border: none;
  padding: 0;
}
.article-cta p { color: rgba(255,255,255,0.8); margin-bottom: var(--space-6); font-size: var(--text-base); }
.article-cta .btn { margin: var(--space-2); }
/* .blog-body a has higher specificity than .btn--primary */
.article-cta a.btn--primary { color: #fff; text-decoration: none; }
.article-cta a.btn--outline { color: rgba(255,255,255,0.9); text-decoration: none; }

/* ── Breadcrumb ── */
.breadcrumb { padding: var(--space-4) 0; border-bottom: 1px solid var(--c-border-light); }
.breadcrumb ol { list-style: none; padding: 0; margin: 0; display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }
.breadcrumb li { font-size: var(--text-sm); color: var(--c-text-light); }
.breadcrumb li + li::before { content: '/'; margin-right: var(--space-2); }
.breadcrumb a { color: var(--c-text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--c-accent); }
.breadcrumb li:last-child { color: var(--c-text); }

/* ── Float image — full width on mobile, 2/3 float-right on desktop ── */
.blog-img-float {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--border-radius);
  margin: var(--space-6) 0;
}
@media (min-width: 1024px) {
  .blog-img-float {
    float: right;
    width: 60%;
    margin: 0 0 var(--space-6) var(--space-8);
  }
}
.clearfix::after { content: ''; display: table; clear: both; }

/* ── Source list ── */
.sources { margin-top: var(--space-12); padding-top: var(--space-6); border-top: 1px solid var(--c-border); }
.sources h2 { font-size: var(--text-xl); border-top: none; padding-top: 0; margin-top: 0; }
.sources ol { margin-left: var(--space-6); }
.sources li { font-size: var(--text-sm); color: var(--c-text-light); line-height: 1.6; margin-bottom: var(--space-2); }
.sources a { color: var(--c-text-muted); }
