/* ==========================================================================
   B-Digital Mark blog -- single article.
   Loaded only on articles. Depends on base.css; related cards use cards.css.
   Prose styles target core-block output so anything written in the WordPress
   editor (headings, lists, quotes, tables, images, code, embeds) is styled.
   ========================================================================== */

/* Reading progress */
.bdmb-progress {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 110;
  height: 3px;
  pointer-events: none;
}
.admin-bar .bdmb-progress { top: 32px; }
@media (max-width: 782px) {
  .admin-bar .bdmb-progress { top: 46px; }
}
.bdmb-progress__bar {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--bdmb-orange), var(--bdmb-cyan));
  transform: scaleX(0);
  transform-origin: left;
  will-change: transform;
}

/* Article: the living backdrop shows through the header; the reading area below
   is a solid surface so text never sits on moving light. */
.bdmb-article { --bdmb-container: 1200px; }

.bdmb-article__header {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: min(78svh, 52rem);
  padding: clamp(8rem, 17vh, 10rem) 0 clamp(2.5rem, 6vw, 4rem);
}
/* Melts the backdrop into the solid reading area. */
.bdmb-article__header::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  z-index: 0;
  height: 38%;
  background: linear-gradient(180deg, transparent, var(--bdmb-solid));
  pointer-events: none;
}
.bdmb-article__header-inner {
  position: relative;
  z-index: 1;
  display: grid;
  /* Explicit shrinkable column: an implicit one grows to the headline's and the
     no-wrap breadcrumb's max-content and pushes the page wider than the phone. */
  grid-template-columns: minmax(0, 1fr);
  gap: 1.1rem;
}
.bdmb-article__header-inner > * { max-width: 60rem; }

.bdmb-article__title {
  font-family: var(--bdmb-font-display);
  font-size: clamp(2.8rem, 8vw, 8rem);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  text-wrap: balance;
}
.bdmb-article__content {
  background: var(--bdmb-solid);
  padding-top: clamp(0.5rem, 2vw, 1.5rem);
}
.bdmb-article__meta {
  display: inline-flex;
  flex-wrap: wrap;
  justify-self: start;
  gap: 0.4rem 0.8rem;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--bdmb-glass-line);
  border-radius: 999px;
  background: var(--bdmb-glass);
  -webkit-backdrop-filter: var(--bdmb-blur);
  backdrop-filter: var(--bdmb-blur);
  box-shadow: var(--bdmb-glass-hi);
  font-family: var(--bdmb-font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bdmb-muted);
}

.bdmb-article__figure { margin-bottom: clamp(2rem, 4vw, 3rem); }
.bdmb-article__img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  border: 1px solid var(--bdmb-glass-line);
  border-radius: var(--bdmb-radius);
  box-shadow: var(--bdmb-shadow);
}

/* Layout: reading column + sticky rail (table of contents, quick CTA) */
.bdmb-article__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem clamp(2rem, 5vw, 4.5rem);
  padding-bottom: clamp(3rem, 7vw, 5rem);
}
.bdmb-article__rail {
  order: -1;
  display: grid;
  gap: 1.25rem;
  align-content: start;
}
.bdmb-article__rail:empty { display: none; }

@media (min-width: 1100px) {
  .bdmb-article__layout { grid-template-columns: minmax(0, 46rem) 17rem; }
  .bdmb-article__main { grid-column: 1; grid-row: 1; }
  .bdmb-article__rail {
    order: 0;
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: 6.5rem;
    align-self: start;
  }
}

/* Prose */
.bdmb-prose {
  font-size: clamp(1.0625rem, 0.35vw + 1rem, 1.1875rem);
  line-height: 1.8;
  color: var(--bdmb-text-2);
  overflow-wrap: break-word;
}
.bdmb-prose > * + * { margin-top: 1.4em; }

.bdmb-prose :where(h2) {
  margin-top: 2.2em;
  font-family: var(--bdmb-font-display);
  font-size: clamp(2rem, 3.6vw, 2.6rem);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: 0.015em;
  text-transform: uppercase;
  color: var(--bdmb-text);
  scroll-margin-top: 7rem;
}
.bdmb-prose :where(h3) {
  margin-top: 1.9em;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--bdmb-text);
  scroll-margin-top: 7rem;
}
.bdmb-prose :where(h4) {
  margin-top: 1.7em;
  font-family: var(--bdmb-font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bdmb-orange);
}
.bdmb-prose :where(h2, h3, h4) + * { margin-top: 0.8em; }

.bdmb-prose a {
  color: var(--bdmb-cyan);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  transition: color 0.2s ease;
}
.bdmb-prose a:hover { color: var(--bdmb-orange-2); }
.bdmb-prose :where(strong, b) { font-weight: 600; color: var(--bdmb-text); }

.bdmb-prose :where(ul, ol) { padding-left: 1.5em; }
.bdmb-prose :where(li) + :where(li) { margin-top: 0.5em; }
.bdmb-prose :where(ul) { list-style: none; }
.bdmb-prose :where(ul) > li { position: relative; }
.bdmb-prose :where(ul) > li::before {
  content: '';
  position: absolute;
  left: -1.15em;
  top: 0.78em;
  width: 0.45em;
  height: 0.45em;
  background: var(--bdmb-orange);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.bdmb-prose :where(ol) { list-style: decimal; }
.bdmb-prose :where(ol) > li::marker {
  font-family: var(--bdmb-font-mono);
  font-size: 0.9em;
  color: var(--bdmb-orange);
}

.bdmb-prose :where(blockquote) {
  padding: 1.3rem 1.6rem;
  border: 1px solid var(--bdmb-glass-line);
  border-left: 3px solid var(--bdmb-orange);
  border-radius: 0 18px 18px 0;
  background: linear-gradient(120deg, rgba(255, 140, 0, 0.1), rgba(46, 139, 255, 0.05));
  box-shadow: var(--bdmb-glass-hi);
  font-size: 1.1em;
  color: var(--bdmb-text);
}
.bdmb-prose :where(blockquote) > * + * { margin-top: 0.8em; }
.bdmb-prose :where(cite) {
  display: block;
  font-family: var(--bdmb-font-mono);
  font-size: 0.78rem;
  font-style: normal;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bdmb-muted);
}

.bdmb-prose :where(img) {
  height: auto;
  border: 1px solid var(--bdmb-line);
  border-radius: 16px;
  box-shadow: var(--bdmb-shadow);
}
.bdmb-prose :where(figure) { margin-inline: 0; }
.bdmb-prose :where(figcaption) {
  margin-top: 0.6rem;
  font-family: var(--bdmb-font-mono);
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--bdmb-muted);
}
.bdmb-prose :where(hr, .wp-block-separator) {
  height: 1px;
  margin-block: 2.5em;
  border: 0;
  background: var(--bdmb-line);
}

.bdmb-prose :where(code) {
  padding: 0.15em 0.4em;
  border: 1px solid var(--bdmb-line);
  background: var(--bdmb-surface-2);
  font-family: var(--bdmb-font-mono);
  font-size: 0.88em;
  color: var(--bdmb-text);
}
.bdmb-prose :where(pre) {
  overflow-x: auto;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--bdmb-line);
  background: var(--bdmb-bg-deep);
  font-family: var(--bdmb-font-mono);
  font-size: 0.88rem;
  line-height: 1.7;
}
.bdmb-prose :where(pre) code { padding: 0; border: 0; background: none; }

/* Table cells: core block styles give cells a currentColor border; the extra
   .bdmb-prose table specificity below replaces it with the brand hairline. */
.bdmb-prose :where(.wp-block-table) { overflow-x: auto; }
.bdmb-prose table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--bdmb-line);
  font-size: 0.95em;
}
.bdmb-prose table th {
  padding: 0.75rem 1rem;
  border: 1px solid var(--bdmb-line);
  background: var(--bdmb-surface-2);
  font-family: var(--bdmb-font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-align: left;
  text-transform: uppercase;
  color: var(--bdmb-text);
}
.bdmb-prose table td {
  padding: 0.75rem 1rem;
  border: 1px solid var(--bdmb-line);
}

.bdmb-prose :where(iframe, video, embed) { max-width: 100%; }
.bdmb-prose :where(.wp-block-embed__wrapper) { position: relative; }
.bdmb-prose :where(.wp-block-embed.is-type-video .wp-block-embed__wrapper) { aspect-ratio: 16 / 9; }
.bdmb-prose :where(.wp-block-embed.is-type-video iframe) {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.bdmb-prose :where(.alignwide, .alignfull) { max-width: 100%; }
@media (min-width: 700px) {
  .bdmb-prose :where(.alignleft) { float: left; max-width: 50%; margin: 0.4em 1.5em 1em 0; }
  .bdmb-prose :where(.alignright) { float: right; max-width: 50%; margin: 0.4em 0 1em 1.5em; }
}
.bdmb-prose::after { content: ''; display: table; clear: both; }

/* Table of contents */
.bdmb-toc {
  overflow: hidden;
  border: 1px solid var(--bdmb-glass-line);
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(24, 36, 74, 0.7), rgba(11, 18, 38, 0.8));
  box-shadow: var(--bdmb-glass-hi), var(--bdmb-shadow);
}
.bdmb-toc__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 1rem;
  font-family: var(--bdmb-font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bdmb-orange);
  cursor: pointer;
  list-style: none;
}
.bdmb-toc__summary::-webkit-details-marker { display: none; }
.bdmb-toc__summary::after { content: '+'; font-size: 1.1rem; }
.bdmb-toc[open] > .bdmb-toc__summary::after { content: '\2013'; }

.bdmb-toc__list {
  display: grid;
  gap: 0.1rem;
  max-height: calc(100vh - 16rem);
  padding: 0.25rem 1rem 1rem;
  overflow-y: auto;
  list-style: none;
}
.bdmb-toc__link {
  display: block;
  padding: 0.45rem 0 0.45rem 0.8rem;
  border-left: 2px solid transparent;
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--bdmb-muted);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.bdmb-toc__item--l3 .bdmb-toc__link { padding-left: 1.6rem; font-size: 0.85rem; }
.bdmb-toc__link:hover { color: var(--bdmb-text); }
.bdmb-toc__link.is-active {
  border-left-color: var(--bdmb-orange);
  color: var(--bdmb-text);
}

@media (min-width: 1100px) {
  /* Always open on desktop: the summary becomes a static label. */
  .bdmb-toc__summary { pointer-events: none; cursor: default; }
  .bdmb-toc__summary::after { content: none; }
}

/* Rail call to action (desktop only; mobile gets the closing CTA band) */
.bdmb-rail-cta {
  display: none;
  gap: 0.75rem;
  padding: 1.4rem;
  border: 1px solid rgba(255, 170, 70, 0.28);
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(255, 140, 0, 0.22), rgba(46, 139, 255, 0.1) 80%), var(--bdmb-surface);
  box-shadow: var(--bdmb-glass-hi), var(--bdmb-shadow);
}
@media (min-width: 1100px) {
  .bdmb-rail-cta { display: grid; }
}
.bdmb-rail-cta__kicker {
  font-family: var(--bdmb-font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bdmb-orange);
}
.bdmb-rail-cta__text { font-size: 0.95rem; line-height: 1.55; color: var(--bdmb-text-2); }
.bdmb-rail-cta .bdmb-btn { justify-self: start; padding: 0.7rem 1.4rem; }

/* Author */
.bdmb-author {
  display: grid;
  gap: 0.3rem;
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding: 1.5rem 1.7rem;
  border: 1px solid var(--bdmb-glass-line);
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(24, 36, 74, 0.7), rgba(11, 18, 38, 0.8));
  box-shadow: inset 4px 0 0 var(--bdmb-orange), var(--bdmb-glass-hi), var(--bdmb-shadow);
}
.bdmb-author__label {
  font-family: var(--bdmb-font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bdmb-muted);
}
.bdmb-author__name {
  font-family: var(--bdmb-font-display);
  font-size: 1.9rem;
  letter-spacing: 0.02em;
  line-height: 1.05;
  text-transform: uppercase;
  color: var(--bdmb-text);
}
.bdmb-author__bio { font-size: 0.98rem; line-height: 1.65; color: var(--bdmb-text-2); }

/* Related */
.bdmb-related {
  padding-block: clamp(3rem, 7vw, 5rem);
  background: var(--bdmb-solid);
}
.bdmb-related__title {
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
  font-family: var(--bdmb-font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.015em;
  text-transform: uppercase;
}

/* ==========================================================================
   Article components. Built from core editor blocks plus one CSS class
   (Block > Advanced > Additional CSS class), so new posts can reuse them:
     Group        + bdmb-answer     the short-answer box
     Paragraph    + bdmb-lead       larger opening paragraph
     Ordered List + bdmb-chain      numbered journey / process
     List         + bdmb-checklist  checklist
     Group        + bdmb-faq        wrapper for Details blocks (also feeds FAQ schema)
   ========================================================================== */

.bdmb-prose .bdmb-lead {
  font-size: 1.28em;
  line-height: 1.6;
  color: var(--bdmb-text);
}

.bdmb-prose .bdmb-answer {
  position: relative;
  padding: 1.5rem 1.75rem 1.55rem 1.9rem;
  border: 1px solid rgba(255, 170, 70, 0.3);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255, 140, 0, 0.14), rgba(46, 139, 255, 0.08)), var(--bdmb-surface);
  box-shadow: inset 4px 0 0 var(--bdmb-orange), var(--bdmb-glass-hi), var(--bdmb-shadow);
}
.bdmb-prose .bdmb-answer::before {
  content: 'The short answer';
  display: block;
  margin-bottom: 0.7rem;
  font-family: var(--bdmb-font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bdmb-orange);
}
.bdmb-prose .bdmb-answer > * + * { margin-top: 0.8em; }
.bdmb-prose .bdmb-answer p { color: var(--bdmb-text); font-size: 1.06em; }

/* Journey / process: numbered nodes joined by a blue-to-orange path. */
.bdmb-prose ol.bdmb-chain {
  --bdmb-node: 2.4rem;
  display: grid;
  gap: 1rem;
  padding: 0;
  list-style: none;
  counter-reset: chain;
}
.bdmb-prose ol.bdmb-chain > li {
  --c1: #2e8bff;
  --c2: #ff8c00;
  position: relative;
  margin: 0;
  padding: 1.15rem 1.4rem 1.2rem 4.9rem;
  border: 1px solid var(--bdmb-glass-line);
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(24, 36, 74, 0.62), rgba(11, 18, 38, 0.78));
  box-shadow: var(--bdmb-glass-hi);
  counter-increment: chain;
}
.bdmb-prose ol.bdmb-chain > li + li { margin-top: 0; }
.bdmb-prose ol.bdmb-chain > li::before {
  content: counter(chain, decimal-leading-zero);
  position: absolute;
  left: 1.15rem;
  top: 1.1rem;
  z-index: 1;
  display: grid;
  place-items: center;
  width: var(--bdmb-node);
  height: var(--bdmb-node);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  box-shadow: 0 8px 22px -8px var(--c2);
  font-family: var(--bdmb-font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: #060a16;
}
.bdmb-prose ol.bdmb-chain > li:not(:last-child)::after {
  content: '';
  position: absolute;
  left: calc(1.15rem + var(--bdmb-node) / 2 - 1px);
  top: calc(1.1rem + var(--bdmb-node));
  width: 2px;
  height: calc(100% - 1.3rem + 0.2rem);
  background: linear-gradient(180deg, var(--c1), var(--c2));
  opacity: 0.55;
}
.bdmb-prose ol.bdmb-chain > li > strong:first-child {
  display: block;
  margin-bottom: 0.3rem;
  font-family: var(--bdmb-font-display);
  font-size: 1.55rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.05;
  text-transform: uppercase;
  color: var(--bdmb-text);
}
.bdmb-prose ol.bdmb-chain > li:nth-child(1) { --c1: #2e8bff; --c2: #4aa3ff; }
.bdmb-prose ol.bdmb-chain > li:nth-child(2) { --c1: #4aa3ff; --c2: #58c9ff; }
.bdmb-prose ol.bdmb-chain > li:nth-child(3) { --c1: #58c9ff; --c2: #ffd08a; }
.bdmb-prose ol.bdmb-chain > li:nth-child(4) { --c1: #ffd08a; --c2: #ffb347; }
.bdmb-prose ol.bdmb-chain > li:nth-child(5) { --c1: #ffb347; --c2: #ffa21f; }
.bdmb-prose ol.bdmb-chain > li:nth-child(6) { --c1: #ffa21f; --c2: #ff8c00; }
.bdmb-prose ol.bdmb-chain > li:nth-child(7) { --c1: #ff8c00; --c2: #ff7a00; }
.bdmb-prose ol.bdmb-chain > li:nth-child(8) { --c1: #ff7a00; --c2: #ff7a00; }

.bdmb-prose ul.bdmb-checklist {
  display: grid;
  gap: 0.7rem;
  padding: 0;
  list-style: none;
}
.bdmb-prose ul.bdmb-checklist > li {
  position: relative;
  margin: 0;
  padding: 1rem 1.2rem 1rem 3.4rem;
  border: 1px solid var(--bdmb-glass-line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}
.bdmb-prose ul.bdmb-checklist > li + li { margin-top: 0; }
.bdmb-prose ul.bdmb-checklist > li::before {
  left: 1.05rem;
  top: 1.05rem;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  clip-path: none;
  background: var(--bdmb-orange) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.4l3 3 6-6.4' fill='none' stroke='%23060a16' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 62% no-repeat;
}

.bdmb-prose .bdmb-faq { display: grid; gap: 0.8rem; }
.bdmb-prose .bdmb-faq > * + * { margin-top: 0; }
.bdmb-prose .bdmb-faq details {
  padding: 0 1.4rem;
  border: 1px solid var(--bdmb-glass-line);
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(24, 36, 74, 0.55), rgba(11, 18, 38, 0.72));
  transition: border-color 0.3s ease;
}
.bdmb-prose .bdmb-faq details[open] { border-color: rgba(255, 170, 70, 0.4); }
.bdmb-prose .bdmb-faq summary {
  position: relative;
  min-height: 56px;
  padding: 1.1rem 2.2rem 1.1rem 0;
  list-style: none;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--bdmb-text);
}
.bdmb-prose .bdmb-faq summary::-webkit-details-marker { display: none; }
.bdmb-prose .bdmb-faq summary::after {
  content: '+';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  line-height: 1;
  color: var(--bdmb-orange);
}
.bdmb-prose .bdmb-faq details[open] summary::after { content: '\2013'; }
.bdmb-prose .bdmb-faq details > :not(summary) { margin: 0 0 1.2rem; }

.bdmb-author__role {
  font-family: var(--bdmb-font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bdmb-orange);
}
.bdmb-author__link {
  justify-self: start;
  margin-top: 0.4rem;
  font-family: var(--bdmb-font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bdmb-cyan);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}
.bdmb-author__link:hover { color: var(--bdmb-orange-2); }

@media (max-width: 640px) {
  .bdmb-prose ol.bdmb-chain > li { padding: 1.05rem 1.1rem 1.1rem 4.3rem; }
  .bdmb-prose ol.bdmb-chain > li > strong:first-child { font-size: 1.35rem; }
}

@media (max-width: 640px) {
  /* A two-line byline would look odd as a full pill. */
  .bdmb-article__meta { border-radius: 18px; }
}

/* Tables: one rounded glass panel with row separators only (no crossing grid lines). */
.bdmb-prose .wp-block-table {
  overflow-x: auto;
  border: 1px solid var(--bdmb-glass-line);
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(24, 36, 74, 0.55), rgba(11, 18, 38, 0.75));
  box-shadow: var(--bdmb-glass-hi);
}
.bdmb-prose .wp-block-table table { min-width: 34rem; border: 0; font-size: 0.95em; }
.bdmb-prose .wp-block-table th,
.bdmb-prose .wp-block-table td {
  padding: 0.95rem 1.15rem;
  border: 0;
  border-bottom: 1px solid var(--bdmb-glass-line);
  vertical-align: top;
}
.bdmb-prose .wp-block-table tbody tr:last-child td { border-bottom: 0; }
.bdmb-prose .wp-block-table th {
  background: rgba(255, 255, 255, 0.05);
  border-bottom-color: rgba(255, 170, 70, 0.35);
  color: var(--bdmb-orange);
}
.bdmb-prose .wp-block-table td:first-child { color: var(--bdmb-text); font-weight: 600; }
