/* ==========================================================================
   Radical Scientific - Microscope Blog UI Stylesheet (Upgraded & Corrected)
   Highly visual, premium, responsive, and optimized for low-res images.
   ========================================================================== */

:root {
  --primary: #0b3b6f;         /* Elegant Deep Blue */
  --primary-rgb: 11, 59, 111;
  --accent: #df1817;          /* Brand Crimson Red */
  --accent-soft: #fef2f2;
  --success: #10b981;
  --success-soft: #ecfdf5;
  --text-main: #334155;       /* Slate 700 for optimal reading contrast */
  --text-dark: #0f172a;       /* Slate 900 for headings */
  --text-muted: #64748b;      /* Slate 500 */
  --bg-soft: #f0f5fb;         /* Clearly blue-tinted soft background */
  --bg-gradient: linear-gradient(135deg, #e8f1fb 0%, #f7faff 100%);
  --border-light: #d1dce9;    /* Solid, clearly visible border */
  --border-focus: #8aabcc;    /* Strong focus border */
  --shadow-sm: 0 2px 8px rgba(11, 59, 111, 0.10), 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 6px 20px rgba(11, 59, 111, 0.12), 0 3px 8px rgba(0,0,0,0.07);
  --shadow-lg: 0 14px 36px rgba(11, 59, 111, 0.16), 0 6px 14px rgba(0,0,0,0.09);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
}

/* Base resets & typography */
.site-content {
  padding: 40px 16px 60px;
  max-width: 1200px;
  margin: 0 auto 0; /* Reset bottom margin to keep content close to footer */
  font-family: Arial, sans-serif;
  color: var(--text-main);
  line-height: 1.7;
}

/* Breadcrumbs */
.breadcrumb-wrap {
  margin-bottom: 24px;
}
.breadcrumb {
  background: transparent;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  list-style: none;
}
.breadcrumb li {
  display: inline-flex;
  align-items: center;
}
.breadcrumb li a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}
.breadcrumb li a:hover {
  color: var(--accent);
}
.breadcrumb li + li::before {
  content: "/";
  padding: 0 8px;
  color: var(--text-muted);
}
.breadcrumb li.active {
  color: var(--text-muted);
}

/* Desktop Two-Column Grid */
.article-layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 40px;
  align-items: start;
}

/* Article Area */
article {
  max-width: 780px; /* Perfect reading width for long paragraphs */
}

/* Article Hero Header */
.article-header {
  margin-bottom: 32px;
  background: var(--bg-gradient);
  border: 2px solid #b8cfe6;
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: row;
  gap: 24px;
  align-items: center;
}
.article-header-content {
  flex: 1;
}
.article-header .badge-tag {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 4px 10px;
  border-radius: 50px;
  margin-bottom: 12px;
}
.article-header h1 {
  font-family: 'Oswald', sans-serif;
  font-size: 28px;
  line-height: 1.3;
  margin: 0 0 14px;
  color: var(--primary);
  font-weight: 600;
  text-transform: none;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--text-muted);
  font-size: 13px;
  align-items: center;
}
.article-meta span {
  display: inline-flex;
  align-items: center;
}
.article-meta .author::before {
  content: "✍";
  margin-right: 6px;
}
.article-meta .date::before {
  content: "📅";
  margin-right: 6px;
}

/* Floating Sharp Image Frame (Prevents stretch and blur) */
.hero-image-frame {
  flex-shrink: 0;
  width: 200px;
  height: 200px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}
.hero-image-frame img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-sm);
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* Main typography & headers */
section {
  margin-bottom: 36px;
}
section h2 {
  font-family: 'Oswald', sans-serif;
  color: var(--primary);
  font-size: 22px;
  margin: 32px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border-light);
  text-transform: uppercase;
}
section h3 {
  font-family: 'Oswald', sans-serif;
  color: var(--text-dark);
  font-size: 17px;
  margin: 22px 0 10px;
  text-transform: none;
  font-weight: 500;
}
section p {
  margin-bottom: 18px;
}

/* Callout Highlights */
.callout-box {
  padding: 18px 20px;
  border-radius: var(--radius-md);
  margin: 24px 0;
  font-size: 14.5px;
  border: 1px solid;
}
.callout-tip {
  background: #eef6ff;
  border-color: #b8d4f0;
  border-left: 5px solid var(--primary);
  box-shadow: 0 3px 10px rgba(11, 59, 111, 0.09);
}
.callout-tip strong {
  color: var(--primary);
}
.callout-warning {
  background: #fff5f5;
  border-color: #f5b8b8;
  border-left: 5px solid var(--accent);
  box-shadow: 0 3px 10px rgba(223, 24, 23, 0.07);
}

/* Standard Inline Image Frame */
.image-frame {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #ffffff;
  border: 2px solid #c8d9ec;
  border-radius: var(--radius-md);
  padding: 18px;
  margin: 28px auto;
  max-width: 480px;
  box-shadow: 0 4px 16px rgba(11, 59, 111, 0.12), 0 1px 4px rgba(0,0,0,0.06);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}
.image-frame:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(11, 59, 111, 0.18), 0 4px 10px rgba(0,0,0,0.08);
  border-color: #8aabcc;
}
.image-frame img {
  max-width: 100%;
  max-height: 260px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: #f0f5fb;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}
.image-frame figcaption {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.4;
  font-style: italic;
  border-top: 1px solid #e2eaf3;
  padding-top: 10px;
  width: 100%;
}

/* Checklist Cards Grid */
.checklist-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.checklist-card {
  background: #ffffff;
  border: 2px solid #c8d9ec;
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: 0 3px 10px rgba(11, 59, 111, 0.10), 0 1px 3px rgba(0,0,0,0.05);
  display: flex;
  gap: 14px;
  align-items: flex-start;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.checklist-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(11, 59, 111, 0.15), 0 3px 8px rgba(0,0,0,0.07);
  border-color: #6496be;
  background: #f7fbff;
}
.checklist-number {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background: var(--primary);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.checklist-content h4 {
  font-family: Arial, sans-serif;
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 6px 0;
  color: var(--text-dark);
}
.checklist-content p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* Premium Comparison Table */
.table-container {
  overflow-x: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  margin: 28px 0;
}
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
  background: #ffffff;
}
.comparison-table th {
  background: var(--primary);
  color: #ffffff;
  font-family: 'Oswald', sans-serif;
  font-weight: 500;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.5px;
  padding: 14px 16px;
}
.comparison-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.comparison-table tr:last-child td {
  border-bottom: none;
}
.comparison-table tr:nth-child(even) td {
  background: var(--bg-soft);
}
.comparison-table tr:hover td {
  background: #f1f5f9;
}
.table-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  text-transform: uppercase;
}
.badge-blue {
  background: #e0f2fe;
  color: var(--primary);
}
.badge-red {
  background: var(--accent-soft);
  color: var(--accent);
}
.badge-green {
  background: var(--success-soft);
  color: var(--success);
}

/* Interactive Image Gallery Grid */
.blog-gallery {
  margin-top: 40px;
  margin-bottom: 8px;
  border-top: 1px solid var(--border-light);
  padding-top: 32px;
}
.blog-gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.blog-gallery-item {
  margin: 0;
}

/* Sidebar Columns styling */
.blog-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;  /* clear visible gap between sidebar cards */
}

/* Table of Contents Card — NOT sticky to avoid overlap with cards below */
.toc {
  position: static;  /* removed sticky: was causing TOC to overlap sibling cards on scroll */
  background: #f0f6ff;
  border: 2px solid #b8cfe6;
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: 0 4px 18px rgba(11, 59, 111, 0.13), 0 2px 6px rgba(0,0,0,0.06);
  margin-bottom: 0;  /* gap on parent handles separation */
}
.toc h2 {
  font-family: 'Oswald', sans-serif;
  font-size: 15px;
  color: var(--primary);
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border-light);
  text-transform: uppercase;
}
.toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toc ul li {
  position: relative;
  padding-left: 14px;
  font-size: 13.5px;
}
.toc ul li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: bold;
}
.toc ul li a {
  color: var(--text-main);
  text-decoration: none;
  transition: all 0.2s ease;
}
.toc ul li a:hover {
  color: var(--accent);
  padding-left: 4px;
}

/* Sidebar Callouts */
.sidebar-card {
  background: #f0f6ff;
  border: 2px solid #c0d5ea;
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: 0 3px 12px rgba(11, 59, 111, 0.10), 0 1px 4px rgba(0,0,0,0.05);
  /* No margin-bottom needed: parent gap handles separation cleanly */
}
.sidebar-card h3 {
  font-family: 'Oswald', sans-serif;
  font-size: 15px;
  color: var(--text-dark);
  margin: 0 0 10px;
  text-transform: uppercase;
}
.sidebar-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 12px;
}
.sidebar-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.sidebar-link:hover {
  color: var(--accent);
}

/* Article CTA boxes & Footer */
.article-footer {
  margin-top: 40px;
  border-top: 1px solid var(--border-light);
  padding-top: 32px;
}
.cta-box {
  background: linear-gradient(180deg, #f7fbff 0%, #eef6ff 100%);
  border: 1px solid #dbe8f7;
  border-left: 4px solid var(--primary);
  padding: 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}
.cta-box h3 {
  font-family: 'Oswald', sans-serif;
  font-size: 18px;
  color: var(--primary);
  margin: 0 0 8px;
  text-transform: uppercase;
}
.cta-box p {
  font-size: 14px;
  color: var(--text-main);
  margin-bottom: 18px;
}
.cta-box-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #ffffff !important;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 18px;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  border: none;
}
.btn:hover {
  background: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.author-box {
  background: #1e293b;
  color: #f1f5f9;
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 24px;
  font-size: 13.5px;
  line-height: 1.6;
}
.author-box strong {
  color: #ffffff;
}
.author-box a {
  color: #38bdf8;
  text-decoration: none;
}
.author-box a:hover {
  text-decoration: underline;
}

/* FAQ Accordion structure */
.faq-section {
  background: var(--bg-soft);
  padding: 28px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  margin-top: 36px;
}
.faq-item {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-light);
}
.faq-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.faq-item h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0 0 6px;
}
.faq-item p {
  font-size: 13.5px;
  color: var(--text-main);
  margin: 0;
  line-height: 1.6;
}

/* ==========================================================================
   BLOG-ONLY GLOBAL FOOTER WHITE SPACING FIXES
   ========================================================================== */

/* 1. Prevent main content container from pushing footer down with margins */
.site-content {
  margin-bottom: 0 !important;
}

/* 2. Override general section margin specifically for footer bottom to pull copyright up */
section#bottom {
  margin-bottom: 0 !important;
  margin-top: 0 !important;
}

/* 3. Style site footer layout overrides to ensure smooth alignment on this page */
.footer-disclaimer-wrap {
  margin-top: 0 !important;
  padding: 24px 15px 12px !important;
}
.premium-footer {
  padding: 40px 0 20px !important;
}
#footer.premium-bottom {
  padding: 12px 0 !important;
  border-top: none !important;
}

/* Responsive Overrides */
@media (max-width: 992px) {
  .article-layout-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  /* On tablet, sidebar cards go side by side in a 2-col grid */
  .blog-sidebar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }
  /* .toc position is already static — no override needed */
  .article-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 24px;
  }
  .hero-image-frame {
    width: 100%;
    height: 180px;
  }
}

@media (max-width: 768px) {
  .site-content {
    padding: 24px 12px;
  }
  .article-header h1 {
    font-size: 22px;
  }
  .blog-sidebar {
    grid-template-columns: 1fr;
  }
  .checklist-grid {
    grid-template-columns: 1fr;
  }
  .blog-gallery-grid {
    grid-template-columns: 1fr;
  }
  .comparison-table {
    font-size: 12px;
  }
  .comparison-table th, .comparison-table td {
    padding: 10px 12px;
  }
}
