/* =============================================================
   blog-detail.css — Blog / Case Study detail page styles
   Base: 19px → scaled via global.css media queries
   Reuses: .container from global.css. Contact section + header/footer
           are NOT styled here — they come from the shared includes.

   NOTE: .bl-toggle / .bl-tag-amber / .bl-tag-blue / .bl-card / .bl-grid
   etc. are copied 1:1 from the blog listing + case studies stylesheets
   so the reading-mode switch and the "Related Blogs" cards look and
   behave exactly the same as those pages. New page-specific pieces use
   the bd- prefix (article header, hero image, TOC, sidebar).
   ============================================================= */

/* ── 1. Local tokens ──────────────────────────────────────────── */
.bd-article-header {
  --bd-badge-amber-bg: rgba(248, 153, 35, 0.16);
  --bd-badge-blue-bg: #ddeeff;
  --bd-badge-green-bg: rgba(125, 255, 118, 0.16);
  --bd-badge-grey-bg: #e8e8e8;
}

/* ── 2. Reused: reading-mode toggle (from blog.css) ─────────────── */

.bl-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 1.053rem;
}

.bl-toggle {
  position: relative;
  display: inline-block;
  width: 3.158rem;
  height: 1.684rem;
}

.bl-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.bl-toggle-slider {
  position: absolute;
  inset: 0;
  background: #cfd4e6;
  border-radius: 1.684rem;
  cursor: pointer;
  transition: 0.2s;
}

.bl-toggle-slider::before {
  content: "";
  position: absolute;
  height: 1.368rem;
  width: 1.368rem;
  left: 0.158rem;
  top: 0.158rem;
  background: var(--bg-white);
  border-radius: 50%;
  transition: 0.2s;
}

.bl-toggle input:checked+.bl-toggle-slider {
  background: var(--primary-blue);
}

.bl-toggle input:checked+.bl-toggle-slider::before {
  transform: translateX(1.474rem);
}

/* body.bd-reading-mode .bd-content p {
  font-size: 1.15rem;
  line-height: 1.85;
} */



/* ── 4. Article header ────────────────────────────────────────── */

.bd-article-header {
  padding: 9.474rem 0 2.947rem;
  /* background: var(--bg-white); */
}

.bd-article-header-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.bd-article-heading {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 56.421rem;
  /* ~1072px / 19 */
}

.bd-article-title {
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: 3.75rem;
  /* 60px / 19 */
  line-height: 3.684rem;
  /* 70px / 19 */
  color: var(--base-dark);
}

.bd-tag-row {
  display: flex;
  align-items: center;
  gap: 0.579rem;
  flex-wrap: wrap;
}

.bd-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* height: 1.895rem; */
  /* 36px */
  padding: 0.211rem 0.526rem;
  border-radius: 0.211rem;
  font-family: var(--font-primary);
  font-size: 0.737rem;
  color: var(--base-dark);
  white-space: nowrap;
}

/* ── 3. Reused: badge/tag colors (from blog.css) ────────────────── */

.bl-tag-amber {
  background: rgba(248, 153, 35, 0.16);
}

.bl-tag-blue {
  background: var(--bl-badge-blue-bg);
  color: #000;
}

.bl-tag-grey,
.bl-tag-gray {
  background: #D9D9D9;
  color: #000;
}

.bl-tag-purple {
  color: #000;
}


.bd-tag-green {
  background: var(--bd-badge-green-bg);
}

.bd-meta-row {
  display: flex;
  align-items: center;
  gap: 1.789rem;
  font-family: var(--font-primary);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.363rem;
  color: var(--text-sub);
  flex-wrap: wrap;
}

[dir="rtl"] .bd-meta-row svg {
  transform: scale(1, -1) rotate(180deg);
}

/* Share / reading-mode toolbar */
.bd-share-toolbar {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1.263rem;
  flex-shrink: 0;
}

.bd-icon-stack {
  display: flex;
  flex-direction: column;
  gap: 0.842rem;
}

.bd-icon-circle {
  width: 2.737rem;
  /* 52px */
  height: 2.737rem;
  border-radius: 50%;
  background: var(--bg-white);
  border: 0.065rem solid #d2d2d2;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--base-dark);
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.2s, background 0.2s, color 0.2s;
}

.bd-icon-circle svg {
  width: 1.5rem;
  height: 1.5rem;
  /* flex-shrink: 0; */
}

.bd-icon-circle:hover {
  box-shadow: 0 4px 12px rgba(8, 75, 129, 0.12);
  transform: translateY(-1px);
}

.bd-icon-circle.saved {
  background: var(--primary-blue);
  color: var(--bg-white);
  border-color: var(--primary-blue);
}

.bd-icon-circle.active {
  background: rgba(0, 141, 255, 0.12);
  color: var(--primary-blue);
  border-color: var(--primary-blue);
}

/* ── 5. Hero image ────────────────────────────────────────────── */

.bd-hero-image {
  width: 100%;
  aspect-ratio: 1615 / 583;
  border-radius: 2.895rem;
  /* 55px */
  overflow: hidden;
  margin-bottom: 3.474rem;
}

.bd-hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── 6. Three-column layout (TOC / content / sidebar) ───────────── */

.bd-layout {
  display: grid;
  /* grid-template-columns: 15.579rem minmax(0, 42.316rem) 13.789rem; */
  grid-template-columns: 15.579rem minmax(0, 1fr);
  gap: 2.947rem;
  align-items: start;
  padding-bottom: 3.158rem;
}

.cd-layout {
  grid-template-columns: 15.579rem minmax(0, 42.316rem) 13.789rem;
}

/* Table of Contents */
.bd-toc-sidebar {
  position: sticky;
  top: 6.5rem;
  align-self: start;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 1.789rem;
}

.bd-toc-heading {
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--base-dark);
}

.bd-progress-block {
  display: flex;
  flex-direction: column;
  gap: 0.789rem;
}

.bd-progress-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-primary);
  font-size: 1.125rem;
  color: var(--base-dark);
}

.bd-progress-label-row span:last-child {
  color: var(--text-sub);
}

.bd-progress-track {
  background: #e0f1ff;
  height: 0.737rem;
  border-radius: 0.526rem;
  overflow: hidden;
}

.bd-progress-fill {
  background: #008dff;
  height: 100%;
  width: 0%;
  border-radius: 0.526rem;
  transition: width 0.15s ease-out;
}

.bd-toc-search {
  display: flex;
  align-items: center;
  gap: 0.526rem;
  height: 2.526rem;
  /* 48px */
  border: 0.053rem solid #dedede;
  border-radius: 1.158rem;
  padding: 0 0.842rem;
  color: var(--text-sub);
}

.bd-toc-search input {
  flex: 1;
  font-family: var(--font-primary);
  font-weight: 300;
  font-size: 0.947rem;
  color: var(--base-dark);
  background: transparent;
}

.bd-toc-list {
  display: flex;
  flex-direction: column;
  gap: 0.789rem;
  max-height: 57vh;
  overflow-y: auto;
}

.bd-toc-link {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  font-family: var(--font-primary);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.363rem;
  color: var(--text-sub);
  transition: color 0.2s, font-weight 0.2s, opacity 0.2s;
  text-decoration: none;
}

.bd-toc-link::before {
  content: "";
  display: inline-block;
  flex-shrink: 0;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
  transform: translateY(-0.15rem);
}

.bd-toc-link:hover {
  color: var(--primary-blue, #008dff);
}

.bd-toc-link:hover::before {
  transform: scale(1.2);
}

.bd-toc-link.active {
  color: var(--primary-blue, #008dff);
  font-weight: 600;
  opacity: 1;
}

.bd-toc-link.active::before {
  transform: scale(1.3);
  background-color: var(--primary-blue, #008dff);
}

.bd-toc-link.bd-toc-level-2.active::before {
  border-color: var(--primary-blue, #008dff);
  background-color: var(--primary-blue, #008dff);
}

/* Article body */
.bd-content {
  display: flex;
  flex-direction: column;
  font-size: 1rem;
  color: var(--blog-content-color);
  max-width: 100%;
  overflow-x: hidden;
  overflow-wrap: break-word;
  word-break: break-word;
}

.bd-content * {
  font-family: var(--font-primary);
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
}

.bd-content img,
.bd-content figure,
.bd-content iframe,
.bd-content video,
.bd-content embed,
.bd-content object {
  max-width: 100% !important;
  height: auto !important;
}

.bd-content table {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.bd-content pre,
.bd-content code {
  max-width: 100% !important;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: break-word;
}

body.dark-theme .bd-content,
body.dark-theme .bd-content *,
body.dark-theme .bd-content p,
body.dark-theme .bd-content h1,
body.dark-theme .bd-content h2,
body.dark-theme .bd-content h3,
body.dark-theme .bd-content h4,
body.dark-theme .bd-content h5,
body.dark-theme .bd-content h6,
body.dark-theme .bd-content li,
body.dark-theme .bd-content span,
body.dark-theme .bd-content div {
  color: var(--blog-content-color) !important;
}

.bd-content-section {
  padding: 1.053rem 0;
  border-bottom: 0.053rem solid #eee;
}

.bd-content-section:last-child {
  border-bottom: none;
}

.bd-content-section h2 {
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 1.263rem;
  /* 24px */
  line-height: 1.642rem;
  color: var(--blog-content-color);
  margin-bottom: 1rem;
}

.bd-content-section p {
  font-family: var(--font-primary);
  font-weight: 300;
  font-size: 1.053rem;
  /* 20px */
  line-height: 1.579rem;
  color: var(--blog-content-color);
  margin-top: 1.579rem;
}

.bd-content-section p:first-of-type {
  margin-top: 0;
}

.bd-inline-link {
  color: #013ad6;
  text-decoration: underline;
}

/* ── Font size variations for article content ── */
.bd-content.bd-font-medium,
.bd-content.bd-font-medium p,
.bd-content.bd-font-medium span,
.bd-content.bd-font-medium div,
.bd-content.bd-font-medium li {
  font-size: 1.18rem !important;
  line-height: 1.82rem !important;
}
.bd-content.bd-font-medium h1,
.bd-content.bd-font-medium h2,
.bd-content.bd-font-medium h3,
.bd-content.bd-font-medium h4 {
  font-size: 1.45rem !important;
  line-height: 1.9rem !important;
}

.bd-content.bd-font-large,
.bd-content.bd-font-large p,
.bd-content.bd-font-large span,
.bd-content.bd-font-large div,
.bd-content.bd-font-large li {
  font-size: 1.32rem !important;
  line-height: 2.05rem !important;
}
.bd-content.bd-font-large h1,
.bd-content.bd-font-large h2,
.bd-content.bd-font-large h3,
.bd-content.bd-font-large h4 {
  font-size: 1.65rem !important;
  line-height: 2.15rem !important;
}

/* You May Also Like sidebar */
.bd-related-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.579rem;
  position: sticky;
  top: 6.5rem;
}

.bd-related-heading {
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: 1.579rem;
  /* 30px */
  line-height: 2.353rem;
  color: var(--base-dark);
}

.bd-related-list {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.bd-related-item {
  display: flex;
  gap: 0.895rem;
  align-items: flex-start;
  padding: 1.158rem 0;
  border-bottom: 0.053rem solid #013ad6;
}

.bd-related-item-last {
  border-bottom: none;
}

.bd-related-num {
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 0.842rem;
  color: var(--button-primary-blue);
  flex-shrink: 0;
}

.bd-related-link {
  font-family: var(--font-primary);
  font-weight: 300;
  font-size: 0.885rem;
  line-height: 1.363rem;
  color: var(--blog-content-color);
  transition: color 0.2s;
}

.bd-related-link:hover {
  color: #008dff;
}

/* ── 7. Related Blogs (reuses .bl-grid / .bl-card from the blog listing / case studies pages) ── */

.bd-related-blogs {
  padding: 1.579rem 1rem 4rem;
}

.bd-section-title {
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: 1.649rem;
  /* 31.32px */
  color: var(--base-dark);
  margin-bottom: 2.368rem;
}

.bd-related-grid {
  padding: 0;
}

.bd-related-tags {
  display: flex;
  align-items: center;
  gap: 0.526rem;
  flex-wrap: wrap;
  margin-bottom: 0.316rem;
}

/* Table of Contents hierarchy levels & point symbols */
.bd-toc-link.bd-toc-level-1 {
  font-weight: 500;
  padding-inline-start: 0;
}

.bd-toc-link.bd-toc-level-1::before {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background-color: var(--primary-blue, #008dff);
}

.bd-toc-link.bd-toc-level-2 {
  font-weight: 400;
  padding-inline-start: 1.15rem;
}

.bd-toc-link.bd-toc-level-2::before {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  border: 1.5px solid var(--primary-blue, #008dff);
  background-color: transparent;
}

.bd-toc-link.bd-toc-level-3 {
  font-weight: 300;
  padding-inline-start: 2rem;
  opacity: 0.9;
}

.bd-toc-link.bd-toc-level-3::before {
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 1px;
  background-color: var(--text-sub, #667085);
}

.bd-toc-link.bd-toc-level-4 {
  font-weight: 300;
  padding-inline-start: 2.75rem;
  opacity: 0.8;
}

.bd-toc-link.bd-toc-level-4::before {
  width: 0.45rem;
  height: 0.125rem;
  border-radius: 1px;
  background-color: var(--text-sub, #667085);
}

/* ── 8. Responsive ────────────────────────────────────────────── */


.pd-pills {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  position: relative;
  padding: 0;
  margin: 0;
}

.pd-pills li {
  --border: 1px solid var(--base-dark);
  border: var(--border);
  padding: .6666666667rem 1rem;
  display: block;
  border-radius: 2.7777777778rem;
  margin-right: 0.625rem;
  margin-bottom: 0.625rem;
  text-decoration: none;
  font-weight: 400;
  font-size: 0.875rem;
  transition: all .3s ease-in-out;
  line-height: 1;
  color: var(--text-sub);
  max-width: 100%;
  word-break: break-word;
  overflow-wrap: break-word;
}

.pd-layout {
  display: grid;
  grid-template-columns: 17.579rem minmax(0, 1fr);
  gap: 2.947rem;
  align-items: start;
  padding-bottom: 3.158rem;
  padding-right: 2rem;
}


@media (max-width: 1440px) {
  .bd-toc-list {
    max-height: 50vh;
  }
}

@media (max-width: 1200px) {
  .bd-layout {
    grid-template-columns: 17rem minmax(0, 1fr);
  }

  .bd-related-sidebar {
    grid-column: 1 / -1;
    position: static;
    order: 3;
  }
}

@media (max-width: 900px) {
  .bd-article-header-inner {
    flex-direction: column;
  }

  .bd-share-toolbar {
    align-items: flex-start;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .bd-layout {
    grid-template-columns: 1fr;
  }

  .bd-toc-sidebar {
    display: none;
  }

  .bd-content {
    order: 1;
  }

  .bd-related-sidebar {
    order: 3;
  }

  .bd-related-grid {
    grid-template-columns: 1fr;
  }

  .bd-icon-stack {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .pd-layout {
    grid-template-columns: 1fr;
    padding-right: 1rem;
  }
}

@media (max-width: 768px) {
  .bd-article-header {
    padding-top: 7.5rem;
  }

  .bd-article-title {
    font-size: 2rem;
    line-height: 2.4rem;
  }

  .bd-hero-image {
    border-radius: 1rem;
  }
}

