/* NBC v7.548 · Blog article editorial axis restoration
   Scope: 19 article pages only.
   Goal: one shared left edge; width changes extend to the right instead of re-centering. */
@layer nbc.knowledge {
  body.page-article[data-knowledge-system="v7540"] {
    --blog7548-reading: 940px;
    --blog7548-evidence: 1180px;
  }

  /* The outer shell already owns the site-wide left edge. Child rails must not re-center. */
  body.page-article[data-knowledge-system="v7540"] .ep-article-content {
    justify-items: start !important;
  }

  body.page-article[data-knowledge-system="v7540"] .ep-article-content > :is(
    .ep-executive-answer,
    .ep-body,
    .article-reading-next,
    .article-knowledge-container
  ) {
    width: min(100%, var(--blog7548-reading)) !important;
    max-width: var(--blog7548-reading) !important;
    margin-left: 0 !important;
    margin-right: auto !important;
    justify-self: start !important;
  }

  body.page-article[data-knowledge-system="v7540"] .ep-article-content > :is(
    .ep-decision-ledger,
    .article-diagnostic-context,
    .dg5-guide-bridge,
    .ep-next-reading,
    .p3-signature,
    .ep-conclusion
  ) {
    width: min(100%, var(--blog7548-evidence)) !important;
    max-width: var(--blog7548-evidence) !important;
    margin-left: 0 !important;
    margin-right: auto !important;
    justify-self: start !important;
  }

  /* The article grid owns vertical rhythm. Historical child margins used to stack on top
     of the grid gap and create 144–259px holes between otherwise related modules. */
  body.page-article[data-knowledge-system="v7540"] .ep-article-content > :is(
    .ep-executive-answer,
    .ep-prologue,
    .ep-practice-scenario,
    .ep-body,
    .ep-decision-ledger,
    .article-reading-next,
    .article-knowledge-container,
    .article-regional-context,
    .nbc-baro-entry,
    .contextual-pathway,
    .case-inline-reference-v7357,
    .article-diagnostic-context,
    .p3-signature,
    .ep-next-reading,
    .ep-conclusion
  ) {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }

  /* Editorial supporting modules share the same origin instead of creating new centered axes. */
  body.page-article[data-knowledge-system="v7540"] .ep-article-content > :is(
    .ep-prologue,
    .ep-practice-scenario.erp-journey-scope,
    .article-regional-context,
    .case-inline-reference-v7357,
    .nbc-baro-entry,
    .contextual-pathway,
    .ep-journey
  ) {
    margin-left: 0 !important;
    margin-right: auto !important;
    justify-self: start !important;
  }

  body.page-article[data-knowledge-system="v7540"] .ep-article-content > :is(
    .ep-practice-scenario.erp-journey-scope,
    .article-regional-context,
    .case-inline-reference-v7357,
    .nbc-baro-entry,
    .contextual-pathway,
    .ep-journey
  ) {
    width: min(100%, var(--blog7548-reading)) !important;
    max-width: var(--blog7548-reading) !important;
  }

  /* v7.540 returned the article canvas to dark, but several Paper-era ink values remained.
     Restore readable dark-surface links, labels and evidence copy without changing hierarchy. */
  body.page-article[data-knowledge-system="v7540"] .ep-article-layout a:not(.btn):not([class*="button"]) {
    color: rgba(158, 224, 177, .88) !important;
    text-decoration-color: rgba(158, 224, 177, .34) !important;
  }
  body.page-article[data-knowledge-system="v7540"] .ep-article-layout a:not(.btn):not([class*="button"]):hover {
    color: #b8ebc5 !important;
    text-decoration-color: rgba(184, 235, 197, .62) !important;
  }
  body.page-article[data-knowledge-system="v7540"] :is(
    .ep-answer-triad .mono,
    .as-conclusion-copy > .mono,
    .ep-authority-note > .mono,
    .source-note > .mono,
    .ep-conclusion .dg5-guide-bridge__eyebrow
  ) {
    color: rgba(158, 224, 177, .82) !important;
    -webkit-text-fill-color: currentColor !important;
  }
  body.page-article[data-knowledge-system="v7540"] :is(
    .hinweis,
    .ep-conclusion-list li > span,
    .ep-conclusion .dg5-guide-bridge__meta span
  ) {
    color: rgba(225, 237, 228, .76) !important;
    -webkit-text-fill-color: currentColor !important;
  }
  body.page-article[data-knowledge-system="v7540"] .article-reading-next__links a > span {
    color: rgba(158, 224, 177, .82) !important;
    -webkit-text-fill-color: currentColor !important;
  }

  /* Desktop evidence tables need a stable semantic column contract.
     The legacy auto layout could squeeze the proof-field column enough to split
     words such as “Geschäftsvorfälle” or “Anwendung” mid-word. */
  @media (min-width: 761px) {
    body.page-article[data-knowledge-system="v7540"] .ep-decision-table[data-as-columns="4"] {
      table-layout: fixed !important;
    }
    body.page-article[data-knowledge-system="v7540"] .ep-decision-table[data-as-columns="4"] :is(th, td):nth-child(1) {
      width: 14% !important;
    }
    body.page-article[data-knowledge-system="v7540"] .ep-decision-table[data-as-columns="4"] :is(th, td):nth-child(2) {
      width: 34% !important;
    }
    body.page-article[data-knowledge-system="v7540"] .ep-decision-table[data-as-columns="4"] :is(th, td):nth-child(3) {
      width: 28% !important;
    }
    body.page-article[data-knowledge-system="v7540"] .ep-decision-table[data-as-columns="4"] :is(th, td):nth-child(4) {
      width: 24% !important;
    }
    body.page-article[data-knowledge-system="v7540"] .ep-decision-table[data-as-columns="4"] :is(th, td):first-child {
      overflow-wrap: normal !important;
      word-break: normal !important;
      hyphens: none !important;
    }
  }

  @media (max-width: 760px) {
    /* Header / hero / article / footer all use the same 20px outside gutter. */
    body.page-article[data-knowledge-system="v7540"] .ep-article-layout {
      width: calc(100% - 40px) !important;
      max-width: none !important;
      margin-inline: auto !important;
    }

    /* v7365 compressed the hero to 46px and pushed the eyebrow under the fixed nav. */
    body.page-article.page-template-article .article-premium .ep-hero {
      padding-top: calc(var(--m7-header-h, 64px) + env(safe-area-inset-top, 0px) + 28px) !important;
      padding-bottom: 40px !important;
    }

    body.page-article[data-knowledge-system="v7540"] .ep-article-content > :is(
      .ep-executive-answer,
      .ep-body,
      .article-reading-next,
      .article-knowledge-container,
      .ep-decision-ledger,
      .article-diagnostic-context,
      .dg5-guide-bridge,
      .ep-next-reading,
      .p3-signature,
      .ep-conclusion,
      .ep-prologue,
      .ep-practice-scenario.erp-journey-scope,
      .article-regional-context,
      .case-inline-reference-v7357,
      .nbc-baro-entry,
      .contextual-pathway,
      .ep-journey
    ) {
      width: 100% !important;
      max-width: 100% !important;
      margin-left: 0 !important;
      margin-right: 0 !important;
      justify-self: stretch !important;
    }

    /* The mobile TOC was the only centered 223px island in a 350px article rail. */
    body.page-template-article[data-v7359-p3="true"] .p3-mobile-toc {
      width: 100% !important;
      max-width: none !important;
      margin: 0 !important;
      justify-self: stretch !important;
    }

    /* Metadata becomes three deliberate lines instead of orphaned separator dots. */
    body.page-article .nbc-hero-proof {
      display: grid !important;
      grid-template-columns: minmax(0, 1fr) !important;
      gap: 5px !important;
      margin-top: 18px !important;
      padding-top: 12px !important;
    }
    body.page-article .nbc-hero-proof > span {
      display: block !important;
      width: 100% !important;
    }
    body.page-article .nbc-hero-proof > span::before {
      content: none !important;
      display: none !important;
    }

    /* Closed context must read as an interactive disclosure, not loose body copy. */
    body.page-article .as-article-context {
      margin-top: 12px !important;
      border-top: 1px solid rgba(181,221,191,.18) !important;
    }
    body.page-article .as-article-context > summary {
      min-height: 48px !important;
      padding: 10px 0 0 !important;
      display: flex !important;
      align-items: center !important;
      justify-content: space-between !important;
      gap: 16px !important;
      list-style: none !important;
      cursor: pointer !important;
    }
    body.page-article .as-article-context > summary::-webkit-details-marker { display: none !important; }
    body.page-article .as-article-context > summary::after {
      content: "+" !important;
      flex: 0 0 auto !important;
      color: var(--ep-green, #78d895) !important;
      font-size: 20px !important;
      font-weight: 400 !important;
      line-height: 1 !important;
      transition: transform .18s ease !important;
    }
    body.page-article .as-article-context[open] > summary::after {
      transform: rotate(45deg) !important;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    body.page-article .as-article-context > summary::after { transition: none !important; }
  }
}
