/* Detail newsletter inline + playbook series + error page utilities — v1.2.0.0 */
.detail-newsletter-inline {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--sp-6, 1.5rem);
  align-items: center;
  margin: var(--sp-10, 2.5rem) 0 var(--sp-6, 1.5rem);
  padding: var(--sp-6, 1.5rem) var(--sp-8, 2rem);
  border-radius: var(--r-xl, 1rem);
  border: 1px solid var(--clr-border, rgba(0, 0, 0, 0.08));
  background: var(--clr-bg-alt, #fafafa);
}

.detail-newsletter-inline__title {
  font-size: var(--fs-lg, 1.125rem);
  font-weight: var(--fw-bold, 700);
  margin: 0 0 var(--sp-2, 0.5rem);
}

.detail-newsletter-inline__desc {
  margin: 0;
  font-size: var(--fs-sm, 0.875rem);
  color: var(--clr-text-muted);
  max-width: 48ch;
}

.detail-newsletter-inline__form {
  display: flex;
  gap: var(--sp-3, 0.75rem);
  flex-wrap: wrap;
  align-items: center;
}

.detail-newsletter-inline__input {
  min-width: min(100%, 220px);
  padding: var(--sp-3, 0.75rem) var(--sp-4, 1rem);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-md, 0.5rem);
  font-size: var(--fs-sm, 0.875rem);
  background: var(--clr-surface, #fff);
}

.pb-series-nav {
  margin-top: var(--sp-6, 1.5rem);
  padding: var(--sp-5, 1.25rem);
  border-radius: var(--r-lg, 0.75rem);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.pb-series-nav__title {
  font-size: var(--fs-xs, 0.75rem);
  font-weight: var(--fw-bold, 700);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--sp-3, 0.75rem);
  display: flex;
  align-items: center;
  gap: var(--sp-2, 0.5rem);
  opacity: 0.85;
}

.pb-series-nav__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2, 0.5rem);
}

.pb-series-nav__link {
  font-size: var(--fs-sm, 0.875rem);
  color: inherit;
  text-decoration: none;
}

.error-page-actions {
  display: flex;
  gap: var(--sp-4, 1rem);
  justify-content: center;
  flex-wrap: wrap;
}

.btn-ghost-dark {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: var(--sp-4, 1rem) var(--sp-8, 2rem);
  text-decoration: none;
  border-radius: 12px;
  transition:
    background var(--motion-fast, 150ms) var(--ease-standard),
    border-color var(--motion-fast, 150ms) var(--ease-standard);
}

@media (hover: hover) {
  .btn-ghost-dark:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    color: #fff;
  }
}

.footer-cmd-hint {
  margin-top: var(--sp-4, 1rem);
  font-size: var(--fs-xs, 0.75rem);
  color: rgba(255, 255, 255, 0.45);
}

.footer-cmd-hint kbd {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  font-family: var(--ff-mono, monospace);
  font-size: 0.85em;
}

@media (max-width: 767px) {
  .detail-newsletter-inline {
    grid-template-columns: 1fr;
  }
  .detail-newsletter-inline__form {
    width: 100%;
  }
  .detail-newsletter-inline__input,
  .detail-newsletter-inline__btn {
    width: 100%;
  }
}

/* ── Pulse detail excellence (Porter adapters, Mix Mode reading canvas) ── */
.ds-detail-main .za-detail-section {
  font-family: var(--ff-head, 'Sora', sans-serif);
  font-size: clamp(1.35rem, 2.5vw, 1.65rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0f172a !important;
  margin: 2.5rem 0 1rem;
  scroll-margin-top: 6rem;
}

html.theme-midnight .ds-detail-main .za-detail-section,
html.theme-midnight .ds-detail-main h2,
html.theme-midnight .ds-detail-main h3 {
  color: #0f172a !important;
}

.ds-detail-main .blockquote-premium,
.ds-detail-main blockquote {
  margin: 1.75rem 0;
  padding: 1.25rem 1.5rem;
  border-left: 4px solid #3b82f6;
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
  border-radius: 0 12px 12px 0;
  color: #1e293b !important;
  font-size: 1.05rem;
  line-height: 1.65;
}

.ds-detail-main .za-insight,
.ds-detail-main .za-insight--porter {
  margin: 2rem 0;
  padding: 1.25rem 1.35rem;
  border-radius: 14px;
  border: 1px solid rgba(59, 130, 246, 0.2);
  background: rgba(59, 130, 246, 0.06);
  color: #1e293b;
}

.ds-detail-main .za-luxury-table {
  margin: 2rem 0;
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.1);
}

/* Unified light-theme tables — luxury, comparison, generic Porter tables */
.ds-detail-main .za-table-container,
.ds-detail-main .comparison-table-wrapper,
.ds-detail-main .za-table-wrapper {
  margin: 2rem 0;
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
  background: #ffffff;
}

.ds-detail-main .za-luxury-table,
.ds-detail-main .za-comparison-table,
.ds-detail-main .article-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  line-height: 1.55;
  background: #ffffff !important;
}

.ds-detail-main .za-luxury-table thead,
.ds-detail-main .za-comparison-table thead,
.ds-detail-main .article-body table thead {
  display: table-header-group !important;
}

.ds-detail-main .za-luxury-table thead tr,
.ds-detail-main .za-comparison-table thead tr,
.ds-detail-main .article-body table thead tr {
  background: #e2e8f0 !important;
  border-bottom: 2px solid #cbd5e1 !important;
}

.ds-detail-main .za-luxury-table thead th,
.ds-detail-main .za-comparison-table thead th,
.ds-detail-main .article-body table thead th,
.ds-detail-main .article-body table th {
  padding: 0.85rem 1rem !important;
  color: #0f172a !important;
  background: #e2e8f0 !important;
  font-weight: 800 !important;
  font-size: 0.72rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.07em !important;
  border: none !important;
  text-align: left;
}

.ds-detail-main .za-luxury-table tbody,
.ds-detail-main .za-comparison-table tbody,
.ds-detail-main .article-body table tbody {
  display: table-row-group !important;
}

.ds-detail-main .za-luxury-table tbody tr,
.ds-detail-main .za-comparison-table tbody tr,
.ds-detail-main .article-body table tbody tr {
  display: table-row !important;
  background: #ffffff !important;
  border: none !important;
}

.ds-detail-main .za-luxury-table tbody tr:nth-child(even),
.ds-detail-main .za-comparison-table tbody tr:nth-child(even),
.ds-detail-main .article-body table tbody tr:nth-child(even) {
  background: #f8fafc !important;
}

.ds-detail-main .za-luxury-table tbody td,
.ds-detail-main .za-comparison-table tbody td,
.ds-detail-main .article-body table tbody td,
.ds-detail-main .article-body table td {
  display: table-cell !important;
  padding: 0.8rem 1rem !important;
  color: #334155 !important;
  background: transparent !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;
  vertical-align: top;
}

.ds-detail-main .za-luxury-table tbody td:first-child,
.ds-detail-main .za-comparison-table tbody td:first-child,
.ds-detail-main .article-body table tbody td:first-child {
  color: #0f172a !important;
  font-weight: 600 !important;
}

.ds-detail-main .za-luxury-table tbody td:not(:first-child)::before,
.ds-detail-main .za-comparison-table tbody td:not(:first-child)::before {
  display: none !important;
}

@media (max-width: 768px) {
  .ds-detail-main .za-luxury-table thead,
  .ds-detail-main .za-comparison-table thead {
    display: table-header-group !important;
  }
  .ds-detail-main .za-luxury-table tbody,
  .ds-detail-main .za-comparison-table tbody {
    display: table-row-group !important;
  }
}

.ds-detail-main .aeo-citation-anchor {
  font-size: 1.05rem;
  line-height: 1.75;
  color: #334155;
}

.ds-detail-main .za-faq-container {
  margin: 3rem 0;
  padding-top: 2rem;
  border-top: 1px solid rgba(15, 23, 42, 0.1);
}

html.theme-midnight .ds-detail-main .za-faq-accordion summary,
html.theme-midnight .ds-detail-main .za-faq-accordion details summary {
  color: #0f172a !important;
}

html.theme-midnight .ds-detail-main .za-faq-content,
html.theme-midnight .ds-detail-main .za-faq-accordion details p {
  color: #475569 !important;
}

@media (prefers-reduced-motion: reduce) {
  .ds-detail-main .reveal,
  .ds-detail-main .reveal-up {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Playbook / ebook shell parity — light reading canvas inside dark hero shells */
.pb-article.ds-detail-main {
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 120px), #ffffff;
  border-radius: 20px;
  padding: clamp(1.25rem, 3vw, 2rem);
  color: #1e293b;
}

.pb-article.ds-detail-main .article-body h2,
.pb-article.ds-detail-main .article-body h3 {
  color: #0f172a !important;
}

.eb-single-hero + .ds-detail-main {
  margin-top: 0;
}

/* Porter dark comparison tables → readable on light detail canvas (legacy overrides) */
.ds-detail-main .article-body .za-luxury-table tbody tr {
  background: #ffffff !important;
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
}
.ds-detail-main .article-body .za-luxury-table tbody td {
  color: #334155 !important;
  background: #ffffff !important;
}
.ds-detail-main .article-body .za-luxury-table tbody td:first-child {
  background: #f8fafc !important;
  color: #0f172a !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;
}
@media (min-width: 769px) {
  .ds-detail-main .article-body .za-luxury-table thead tr {
    background: #f1f5f9 !important;
    border-bottom: 2px solid rgba(15, 23, 42, 0.12) !important;
  }
  .ds-detail-main .article-body .za-luxury-table thead th {
    color: #0f172a !important;
    background: #f1f5f9 !important;
  }
  .ds-detail-main .article-body .za-luxury-table tbody tr:nth-child(odd),
  .ds-detail-main .article-body .za-luxury-table tbody tr:nth-child(even) {
    background: #ffffff !important;
  }
  .ds-detail-main .article-body .za-luxury-table tbody tr:hover {
    background: #f8fafc !important;
  }
}

.ds-detail-main .za-insight__kicker {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #7c3aed;
  margin: 0 0 0.75rem;
}

.ds-detail-main .za-insight-grid,
.za-callout-content .za-insight-grid {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 0.25rem 0 0;
  padding: 0;
  list-style: none;
}

.ds-detail-main .za-insight-row,
.za-callout-content .za-insight-row {
  display: grid;
  grid-template-columns: minmax(7.5rem, 9.5rem) minmax(0, 1fr);
  gap: 0.65rem 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(99, 102, 241, 0.12);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.ds-detail-main .za-insight-row dt,
.za-callout-content .za-insight-row dt {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6366f1;
  line-height: 1.35;
}

.ds-detail-main .za-insight-row dd,
.za-callout-content .za-insight-row dd {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.6;
  color: #334155;
}

.ds-detail-main .za-insight-list,
.za-callout-content .za-insight-list {
  margin: 0.35rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.ds-detail-main .za-insight-list li,
.za-callout-content .za-insight-list li {
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(99, 102, 241, 0.1);
  font-size: 0.92rem;
  line-height: 1.55;
  color: #334155;
}

.ds-detail-main .za-insight-list__label,
.za-callout-content .za-insight-list__label {
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6366f1;
  margin-bottom: 0.2rem;
}

.za-callout-insight .za-callout-content {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

@media (max-width: 640px) {
  .ds-detail-main .za-insight-row,
  .za-callout-content .za-insight-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
}

/* Premium data tables */
.ds-detail-main .za-table-container {
  position: relative;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.ds-detail-main .za-luxury-table thead th,
.ds-detail-main .za-comparison-table thead th,
.ds-detail-main .article-body table thead th {
  background: linear-gradient(180deg, #e0e7ff 0%, #e2e8f0 100%) !important;
  color: #1e1b4b !important;
  border-bottom: 2px solid #c7d2fe !important;
}

.ds-detail-main .za-luxury-table tbody tr,
.ds-detail-main .za-comparison-table tbody tr,
.ds-detail-main .article-body table tbody tr {
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

@media (hover: hover) {
  .ds-detail-main .za-luxury-table tbody tr:hover,
  .ds-detail-main .za-comparison-table tbody tr:hover,
  .ds-detail-main .article-body table tbody tr:hover {
    background: #eef2ff !important;
    box-shadow: inset 3px 0 0 #6366f1;
  }
}

.ds-detail-main .za-luxury-table tbody td:first-child,
.ds-detail-main .za-comparison-table tbody td:first-child,
.ds-detail-main .article-body table tbody td:first-child {
  font-weight: 700 !important;
  color: #0f172a !important;
  background: rgba(248, 250, 252, 0.9) !important;
}

.ds-detail-main .za-luxury-table tbody td:nth-child(3),
.ds-detail-main .za-comparison-table tbody td:nth-child(3) {
  font-family: var(--ff-mono, 'JetBrains Mono', monospace);
  font-size: 0.82rem;
  color: #4338ca !important;
}

.ds-detail-main h2[id],
.ds-detail-main h3[id],
.ds-detail-main h4[id],
.article-body h2[id],
.article-body h3[id],
.article-body h4[id] {
  scroll-margin-top: clamp(5.5rem, 12vw, 7.5rem);
}

.index-axis .toc-link.active {
  color: #1e40af !important;
  font-weight: 700;
}

.index-axis .toc-link[aria-current="true"] {
  color: #1e40af !important;
}

/* Detail images — editorial scale, not full-bleed giants */
.ds-detail-main {
  --ds-diagram-showcase-max: min(680px, 100%);
}

.ds-detail-main figure.md-image,
.ds-detail-main .md-image:where(figure, div),
.ds-detail-main figure.md-image-showcase {
  max-width: var(--ds-diagram-showcase-max);
  margin: 1.75rem auto;
}

.ds-detail-main figure.md-image--wide,
.ds-detail-main figure.md-image--landscape {
  --ds-diagram-showcase-max: min(760px, 100%);
}

.ds-detail-main figure.md-image--square:not(.md-image--wide) {
  --ds-diagram-showcase-max: min(520px, 100%);
}

.ds-detail-main .md-image-media img,
.ds-detail-main figure.md-image img,
.ds-detail-main .article-body img:not(.pb-practitioner-avatar):not(.za-author-avatar):not([width="48"]) {
  max-height: min(400px, 52vh);
  width: auto;
  max-width: 100%;
  margin-inline: auto;
  object-fit: contain;
}

.ds-detail-main .article-body > img,
.ds-detail-main .za-p-rich > img {
  display: block;
  max-width: min(680px, 100%);
  max-height: min(400px, 52vh);
  margin: 1.75rem auto;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}
