/* ==========================================================================
   Hyperbeans Blog Detail Layout Styles (Genomebeans-inspired Premium Aesthetic)
   ========================================================================== */

/* Main Container & Layout */
.hb-blog-post-wrapper {
  max-width: 1356px; /* Matches --default-container of parent theme exactly */
  margin: 0 auto;
  padding: 40px 2rem; /* Matches standard .container horizontal padding (32px) exactly */
  font-family: 'Nunito', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #334155;
  line-height: 1.8;
  box-sizing: border-box;
}

/* Breadcrumbs */
.hb-blog-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hb-blog-breadcrumbs a {
  color: var(--first-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

.hb-blog-breadcrumbs a:hover {
  color: var(--second-color);
}

.hb-breadcrumb-separator {
  color: #94a3b8;
}

/* Post Header */
.hb-blog-post-header {
  margin-bottom: 40px;
  max-width: 1100px; /* Expanded for elegant alignment on wider screens */
}

.hb-blog-post-title {
  font-size: 42px;
  font-weight: 800;
  color: var(--second-color);
  line-height: 1.25;
  margin: 0 0 20px 0;
  letter-spacing: -0.5px;
}

.hb-blog-post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 15px;
  color: #64748b;
}

.hb-blog-meta-author {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hb-meta-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e2e8f0;
}

.hb-author-name {
  color: var(--second-color);
  font-weight: 700;
}

.hb-meta-divider {
  color: #cbd5e1;
}

/* Featured Image */
.hb-blog-post-featured-image-container {
  margin-bottom: 50px;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(21, 35, 69, 0.08);
}

.hb-blog-post-featured-image {
  width: 100%;
  height: auto;
  max-height: 650px;
  object-fit: cover;
  display: block;
}

/* Two Column Layout Grid */
.hb-blog-post-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 60px;
  align-items: stretch; /* Stretch columns to match parent height, enabling sticky child */
}

/* Left Column: Sticky Table of Contents Container */
.hb-blog-toc-sidebar {
  padding-right: 15px;
}

.hb-blog-toc-sticky {
  position: sticky;
  top: 20px; /* Header is no longer fixed, so a small offset is enough */
  border-right: 1px solid #f1f5f9;
  padding-right: 20px;
}

.hb-blog-toc-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 800;
  color: #94a3b8;
  margin: 0 0 20px 0;
}

.hb-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hb-toc-item {
  line-height: 1.4;
}

.hb-toc-item-h3 {
  padding-left: 12px;
}

.hb-toc-link {
  display: block;
  font-size: 15px;
  color: #64748b;
  text-decoration: none;
  font-weight: 500;
  border-left: 2px solid transparent;
  padding-left: 12px;
  transition: all 0.25s ease;
}

.hb-toc-link:hover {
  color: var(--second-color);
  border-left-color: #cbd5e1;
}

.hb-toc-link.is-active {
  color: var(--second-color);
  font-weight: 700;
  border-left-color: var(--first-color);
}

/* Right Column: Blog Content Area */
.hb-blog-content-area {
  max-width: 800px;
  min-width: 0; /* Prevents flex/grid overflow issues */
}

/* Main Post Body Resetting & Formatting */
.hb-blog-post-body {
  font-size: 18px;
  line-height: 1.85;
  color: #334155;
  margin-bottom: 60px;
}

/* Blanket non-italicization overrides for body content (except explicit formatting) */
html body .hb-blog-post-body p,
html body .hb-blog-post-body span,
html body .hb-blog-post-body li,
html body .hb-blog-post-body div {
  font-style: normal;
}

html body .hb-blog-post-body em,
html body .hb-blog-post-body i {
  font-style: italic;
}

/* Post Body Headings spacing */
.hb-blog-post-body h2 {
  font-size: 30px;
  font-weight: 800;
  color: var(--second-color);
  margin: 45px 0 20px 0;
  line-height: 1.3;
  scroll-margin-top: 20px; /* Header is no longer fixed */
}

.hb-blog-post-body h3 {
  font-size: 24px;
  font-weight: 700;
  color: var(--second-color);
  margin: 35px 0 15px 0;
  line-height: 1.4;
  scroll-margin-top: 20px;
}

.hb-blog-post-body p {
  margin: 0 0 24px 0;
}

.hb-blog-post-body ul,
.hb-blog-post-body ol {
  margin: 0 0 28px 0;
  padding-left: 24px;
}

.hb-blog-post-body li {
  margin-bottom: 10px;
}

.hb-blog-post-body blockquote {
  border-left: 4px solid var(--first-color);
  padding: 10px 24px;
  margin: 30px 0;
  background-color: #f8fafc;
  border-radius: 0 8px 8px 0;
  color: #475569;
}

.hb-blog-post-body blockquote p {
  margin: 0;
  font-size: 19px;
  font-weight: 500;
}

.hb-blog-post-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 30px auto;
  display: block;
}

/* Premium Call to Action & Form Section */
.hb-blog-cta-section {
  margin-top: 60px;
  border-top: 1px solid #e2e8f0;
  padding-top: 50px;
}

.hb-blog-cta-card {
  background-color: var(--second-color);
  border-radius: 20px;
  padding: 45px;
  color: #ffffff;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  box-shadow: 0 15px 35px rgba(21, 35, 69, 0.15);
  position: relative;
  overflow: hidden;
}

/* Grid background accent */
.hb-blog-cta-card::before {
  content: "";
  position: absolute;
  top: -100px;
  right: -100px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(122, 193, 67, 0.15) 0%, rgba(21, 35, 69, 0) 70%);
  pointer-events: none;
}

.hb-blog-cta-content {
  position: relative;
  z-index: 2;
}

.hb-blog-cta-title {
  font-size: 32px;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 15px 0;
  line-height: 1.2;
}

.hb-blog-cta-subtitle {
  font-size: 16px;
  color: #cbd5e1;
  margin: 0;
  line-height: 1.6;
}

.hb-blog-cta-form-container {
  position: relative;
  z-index: 2;
}

/* Placeholder and General Form styling rules */
.hb-form-group {
  margin-bottom: 16px;
}

.hb-form-input {
  width: 100%;
  padding: 14px 18px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background-color: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.hb-form-input::placeholder {
  color: #94a3b8;
}

.hb-form-input:focus {
  border-color: var(--first-color);
  background-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(122, 193, 67, 0.2);
}

.hb-form-submit-btn {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 8px;
  background-color: var(--first-color);
  color: #ffffff;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(122, 193, 67, 0.3);
}

.hb-form-submit-btn:hover {
  background-color: #6bb03b;
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(122, 193, 67, 0.4);
}

.hb-form-submit-btn:active {
  transform: translateY(0);
}

/* HubSpot Native Form styling overrides inside Navy CTA Card */
.hb-blog-cta-form-container form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.hb-blog-cta-form-container label {
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 5px;
  display: inline-block;
}

.hb-blog-cta-form-container input[type="text"],
.hb-blog-cta-form-container input[type="email"],
.hb-blog-cta-form-container input[type="tel"],
.hb-blog-cta-form-container select,
.hb-blog-cta-form-container textarea {
  width: 100% !important;
  padding: 14px 18px !important;
  border-radius: 8px !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  background-color: rgba(255, 255, 255, 0.05) !important;
  color: #ffffff !important;
  font-size: 15px !important;
  font-family: inherit !important;
  outline: none !important;
  transition: all 0.3s ease !important;
  box-sizing: border-box !important;
}

.hb-blog-cta-form-container input:focus,
.hb-blog-cta-form-container select:focus,
.hb-blog-cta-form-container textarea:focus {
  border-color: var(--first-color) !important;
  background-color: rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 0 0 3px rgba(122, 193, 67, 0.2) !important;
}

.hb-blog-cta-form-container input[type="submit"],
.hb-blog-cta-form-container button[type="submit"],
.hb-blog-cta-form-container .hs-button {
  width: 100% !important;
  padding: 15px !important;
  border: none !important;
  border-radius: 8px !important;
  background-color: var(--first-color) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  font-size: 16px !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 4px 12px rgba(122, 193, 67, 0.3) !important;
}

.hb-blog-cta-form-container input[type="submit"]:hover,
.hb-blog-cta-form-container button[type="submit"]:hover,
.hb-blog-cta-form-container .hs-button:hover {
  background-color: var(--first-color)
  box-shadow: 0 6px 15px rgba(122, 193, 67, 0.4) !important;
}

/* Responsiveness */
@media (max-width: 991px) {
  .hb-blog-post-wrapper {
    padding: 40px 1rem; /* Matches responsive tablet/mobile padding (16px) */
  }

  .footer-bottom__base.hs-blog-post #main-content.main-content-offset,
  .footer-bottom__base.hs-blog-post .main-content-offset {
    padding: 40px 0;
  }

  .hb-blog-post-title {
    font-size: 34px;
  }
  
  .hb-blog-post-container {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  
  .hb-blog-toc-sidebar {
    display: none; /* Hide TOC on mobile tablets to ensure text is clean */
  }
  
  .hb-blog-cta-card {
    grid-template-columns: 1fr;
    padding: 30px;
    gap: 30px;
  }
}

@media (max-width: 767px) {
  .hb-blog-post-wrapper {
    padding: 25px 15px;
  }

  .hb-blog-post-title {
    font-size: 28px;
  }
  
  .hb-blog-post-body {
    font-size: 16px;
  }
}

/* ==========================================================================
   Related Blogs Section & Card Styling
   ========================================================================== */

.hb-blog-related-section {
  margin-top: 80px;
  border-top: 1px solid #e2e8f0;
  padding-top: 60px;
}

.hb-related-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--second-color);
  margin-bottom: 35px;
  text-align: left;
  letter-spacing: -0.5px;
}

.hb-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

/* Related Card Specific Overrides */
.hb-card {
  background-color: #ffffff;
  border-radius: 12px; /* Identical to blog listing cards */
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(21, 35, 69, 0.04);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  border: 1px solid #f1f5f9;
  display: flex;
  flex-direction: column;
}

.hb-card-wrapper-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.hb-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(21, 35, 69, 0.08);
  border-color: rgba(122, 193, 67, 0.15);
}

.hb-card-image-container {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background-color: #f8fafc;
  position: relative;
  border-bottom: 2px solid #f1f5f9;
}

.hb-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.hb-card:hover .hb-card-img {
  transform: scale(1.04);
}

.hb-card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.hb-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.hb-card-bullet {
  color: var(--first-color);
  font-weight: bold;
}

.hb-card-category {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--first-color);
}

.hb-card-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--second-color);
  margin: 0 0 16px 0;
  line-height: 1.4;
  transition: color 0.2s ease;
}

.hb-card:hover .hb-card-title {
  color: var(--first-color);
}

.hb-card-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid #f8fafc;
}

.hb-card-read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--second-color);
  transition: all 0.25s ease;
}

.hb-card:hover .hb-card-read-more {
  color: var(--first-color);
}

.hb-read-more-arrow {
  width: 16px;
  height: 16px;
  transition: transform 0.25s ease;
  fill: none;
}

.hb-card:hover .hb-read-more-arrow {
  transform: translateX(4px);
}

.hb-card-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--second-color) 0%, #1e2d54 100%);
}

.hb-fallback-logo {
  width: 48px;
  height: 48px;
}

@media (max-width: 991px) {
  .hb-related-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (max-width: 767px) {
  .hb-blog-related-section {
    margin-top: 60px;
    padding-top: 40px;
  }
  
  .hb-related-grid {
    grid-template-columns: 1fr;
    gap: 25px;
  }
}

/* ==========================================================================
   Aggressive Parent Theme Overrides & Global Resets
   ========================================================================== */

/* 1. Unshackle page container width from parent theme constraints */
.footer-bottom__base.hs-blog-post #main-content.main-content-offset,
.footer-bottom__base.hs-blog-post .main-content-offset {
  max-width: 100% !important; /* Unleash main, let child wrapper handle container sizing */
  width: 100% !important;
  margin: 0 auto !important;
  padding: 40px 0 !important; /* Zero horizontal padding on main wrapper */
  box-sizing: border-box !important;
}

/* 2. Absolute Italics Obliteration Reset for text & links (defeating higher specificity selectors) */
html body .hb-blog-post-coded-wrapper .hb-blog-post-wrapper .hb-blog-post-meta,
html body .hb-blog-post-coded-wrapper .hb-blog-post-wrapper .hb-blog-post-meta *,
html body .hb-blog-post-coded-wrapper .hb-blog-post-wrapper a,
html body .hb-blog-post-coded-wrapper .hb-blog-post-wrapper span,
html body .hb-blog-post-coded-wrapper .hb-blog-post-wrapper p,
html body .hb-blog-post-coded-wrapper .hb-blog-post-wrapper li,
html body .hb-blog-post-coded-wrapper .hb-blog-post-wrapper div,
html body .hb-blog-post-coded-wrapper .hb-blog-post-wrapper blockquote p,
html body .hb-blog-post-coded-wrapper .hb-blog-post-body p,
html body .hb-blog-post-coded-wrapper .hb-blog-post-body span,
html body .hb-blog-post-coded-wrapper .hb-blog-post-body li,
html body .hb-blog-post-coded-wrapper .hb-blog-post-body a,
html body .hb-blog-post-coded-wrapper .hb-blog-post-body div {
  font-style: normal !important;
}

/* Re-allow explicit markdown italics formatting */
html body .hb-blog-post-coded-wrapper .hb-blog-post-body em,
html body .hb-blog-post-coded-wrapper .hb-blog-post-body i,
html body .hb-blog-post-coded-wrapper .hb-blog-post-body em *,
html body .hb-blog-post-coded-wrapper .hb-blog-post-body i * {
  font-style: italic !important;
}

/* 3. Completely erase list pseudo-bullets added by parent theme to Table of Contents */
.hb-toc-list li::before,
.hb-toc-list li::after,
.hb-toc-item::before,
.hb-toc-item::after,
.hb-blog-toc-nav ul li::before,
.hb-blog-toc-nav ul li::after {
  content: none !important;
  display: none !important;
}

/* 4. Elegant typography touch-ups matching Genomebeans */
.hb-blog-post-body h2 {
  font-family: 'Nunito', 'Inter', -apple-system, sans-serif !important;
  font-weight: 800 !important;
  letter-spacing: -0.5px !important;
  font-style: normal !important;
}

.hb-blog-post-body h3 {
  font-family: 'Nunito', 'Inter', -apple-system, sans-serif !important;
  font-weight: 700 !important;
  font-style: normal !important;
}

/* 5. Disable overflow restrictions on parent wrappers to unlock position: sticky */
html body,
.footer-bottom__base,
.footer-bottom__shift,
.body-container,
.body-container-wrapper,
.hb-blog-post-coded-wrapper,
.hb-blog-post-wrapper,
.hb-blog-post-container,
#main-content {
  overflow: visible !important;
  overflow-x: visible !important;
}

/* Split Hero/Header Layout */
.hb-blog-post-hero {
  padding: 40px 0 50px 0;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 50px;
}
.hb-blog-post-hero-container {
  display: grid;
  grid-template-columns: 50% 50%;
  gap: 50px;
  align-items: center;
}
.hb-blog-post-hero-left {
  display: flex;
  flex-direction: column;
}
.hb-blog-post-hero-right {
  display: flex;
  justify-content: center;
  align-items: center;
}
.hb-blog-post-hero-right .hb-blog-post-featured-image-container {
  margin-bottom: 0 !important;
  width: 100%;
}

/* Responsiveness */
@media (max-width: 991px) {
  .hb-blog-post-hero-container {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .hb-blog-post-hero {
    padding: 20px 0 30px 0;
    margin-bottom: 30px;
  }
}

/* Restore Standard List Bullets inside Blog Post Body */
.hb-blog-post-body ul {
  list-style-type: disc !important;
  padding-left: 24px !important;
  margin-bottom: 24px !important;
}
.hb-blog-post-body li {
  display: list-item !important;
  list-style-type: disc !important;
  margin-bottom: 8px !important;
}




