/* ==========================================================================
   Stacklar doc article — monochrome (black hero, white reading column)
   Uses the --wd-docs-* tokens and the hero band from docs.css.
   ========================================================================== */

body.page-template-page-wd-form-document,
body.wd-form-document-post,
body.single-document,
body.single-wd_form_document {
  margin: 0;
  background: #0a0a0a;
}

.wd-document-page {
  min-height: 100vh;
}

/* Hero -------------------------------------------------------------------- */

.wd-document-hero {
  padding: clamp(56px, 7vw, 88px) 0 clamp(56px, 6vw, 72px);
}

.wd-document-hero-inner {
  position: relative;
  z-index: 1;
}

.wd-document-hero-inner > * {
  max-width: 860px;
}

.wd-document-back {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 36px;
  padding: 8px 14px;
  border: 1px solid var(--wd-docs-hero-line);
  border-radius: 999px;
  color: var(--wd-docs-hero-ink-soft);
  font-size: 13.5px;
  font-weight: 500;
  transition:
    color 0.2s ease,
    border-color 0.2s ease;
}

.wd-document-back:hover,
.wd-document-back:focus-visible {
  border-color: rgba(255, 255, 255, 0.5);
  color: var(--wd-docs-hero-ink);
}

.wd-document-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  color: var(--wd-docs-hero-muted);
  font-family: var(--wd-docs-font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wd-document-eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
}

.wd-document-hero h1 {
  margin: 0;
  color: var(--wd-docs-hero-ink);
  font-size: clamp(36px, 4.6vw, 56px);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.wd-document-summary {
  max-width: 720px;
  margin: 22px 0 0;
  color: var(--wd-docs-hero-ink-soft);
  font-size: 18px;
  line-height: 1.65;
}

.wd-document-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.wd-document-meta span {
  padding: 7px 12px;
  border: 1px solid var(--wd-docs-hero-line);
  border-radius: 999px;
  color: var(--wd-docs-hero-muted);
  font-family: var(--wd-docs-font-mono);
  font-size: 12px;
}

/* Reading layout ---------------------------------------------------------- */

.wd-document-shell {
  display: grid;
  grid-template-columns: minmax(0, 760px) 260px;
  justify-content: space-between;
  align-items: start;
  gap: 64px;
  padding: clamp(56px, 7vw, 80px) 0 clamp(96px, 10vw, 128px);
}

.wd-document-content {
  min-width: 0;
}

.wd-document-featured-image {
  margin: 0 0 40px;
  overflow: hidden;
  border: 1px solid var(--wd-docs-line);
  border-radius: var(--wd-docs-radius-lg);
  background: var(--wd-docs-surface-soft);
}

.wd-document-featured-image img {
  display: block;
  width: 100%;
  height: auto;
}

/* Prose */

.wd-document-prose {
  color: var(--wd-docs-ink-soft);
  font-size: 17px;
  line-height: 1.75;
}

.wd-document-prose > *:first-child {
  margin-top: 0;
}

.wd-document-prose > *:last-child {
  margin-bottom: 0;
}

.wd-document-prose p,
.wd-document-prose ul,
.wd-document-prose ol,
.wd-document-prose blockquote,
.wd-document-prose pre,
.wd-document-prose table {
  margin: 0 0 24px;
}

.wd-document-prose h2,
.wd-document-prose h3,
.wd-document-prose h4 {
  scroll-margin-top: calc(var(--wd-form-global-header-offset, 86px) + 28px);
  color: var(--wd-docs-ink);
  font-weight: 600;
  line-height: 1.2;
  text-wrap: balance;
}

.wd-document-prose h2 {
  margin: 56px 0 16px;
  font-size: 28px;
  letter-spacing: -0.03em;
}

.wd-document-prose h3 {
  margin: 36px 0 12px;
  font-size: 21px;
  letter-spacing: -0.02em;
}

.wd-document-prose h4 {
  margin: 28px 0 10px;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.wd-document-prose strong {
  color: var(--wd-docs-ink);
  font-weight: 600;
}

.wd-document-prose a {
  color: var(--wd-docs-ink);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: rgba(10, 10, 10, 0.35);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s ease;
}

.wd-document-prose a:hover {
  text-decoration-color: currentColor;
}

.wd-document-prose ul,
.wd-document-prose ol {
  padding-left: 1.35em;
}

.wd-document-prose li + li {
  margin-top: 8px;
}

.wd-document-prose li::marker {
  color: var(--wd-docs-muted);
}

.wd-document-prose blockquote {
  padding: 16px 20px;
  border-left: 2px solid var(--wd-docs-ink);
  border-radius: 0 12px 12px 0;
  color: var(--wd-docs-ink);
  background: var(--wd-docs-surface-soft);
}

.wd-document-prose blockquote > :last-child {
  margin-bottom: 0;
}

.wd-document-prose code {
  padding: 2px 6px;
  border: 1px solid var(--wd-docs-line);
  border-radius: 6px;
  color: var(--wd-docs-ink);
  background: #f3f3f3;
  font-family: var(--wd-docs-font-mono);
  font-size: 0.86em;
}

.wd-document-prose pre {
  overflow-x: auto;
  padding: 18px 20px;
  border-radius: var(--wd-docs-radius-md);
  color: #f2f2f2;
  background: #0a0a0a;
  font-size: 14px;
  line-height: 1.65;
}

.wd-document-prose pre code {
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font-size: inherit;
}

.wd-document-prose table {
  width: 100%;
  border: 1px solid var(--wd-docs-line);
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--wd-docs-radius-md);
  overflow: hidden;
  font-size: 15px;
}

.wd-document-prose th,
.wd-document-prose td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--wd-docs-line);
  text-align: left;
  vertical-align: top;
}

.wd-document-prose tr:last-child > :is(td, th) {
  border-bottom: 0;
}

.wd-document-prose th {
  color: var(--wd-docs-ink);
  background: var(--wd-docs-surface-soft);
  font-weight: 600;
}

.wd-document-prose .wd-doc-location {
  margin-bottom: 18px;
  color: var(--wd-docs-muted);
}

.wd-document-prose .wd-doc-location code {
  color: var(--wd-docs-ink);
}

/* FAQ accordion */

.wd-document-prose .wd-document-faq-accordion {
  display: grid;
  gap: 10px;
  margin: 12px 0 32px;
}

.wd-document-prose .wd-document-faq-item {
  overflow: hidden;
  border: 1px solid var(--wd-docs-line);
  border-radius: 12px;
  background: #ffffff;
  transition: border-color 0.2s ease;
}

.wd-document-prose .wd-document-faq-item[open] {
  border-color: var(--wd-docs-ink);
}

.wd-document-prose .wd-document-faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 56px;
  padding: 15px 18px;
  color: var(--wd-docs-ink);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
  list-style: none;
  cursor: pointer;
}

.wd-document-prose .wd-document-faq-item summary::-webkit-details-marker {
  display: none;
}

.wd-document-prose .wd-document-faq-item summary:hover,
.wd-document-prose .wd-document-faq-item summary:focus-visible {
  background: var(--wd-docs-surface-soft);
}

.wd-document-prose .wd-document-faq-question {
  min-width: 0;
}

.wd-document-prose .wd-document-faq-toggle {
  position: relative;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border: 1px solid var(--wd-docs-line);
  border-radius: 999px;
  transition:
    background 0.2s ease,
    border-color 0.2s ease;
}

.wd-document-prose .wd-document-faq-toggle::before,
.wd-document-prose .wd-document-faq-toggle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 1.5px;
  border-radius: 999px;
  background: var(--wd-docs-ink);
  transform: translate(-50%, -50%);
}

.wd-document-prose .wd-document-faq-toggle::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.wd-document-prose .wd-document-faq-item[open] .wd-document-faq-toggle {
  border-color: var(--wd-docs-ink);
  background: var(--wd-docs-ink);
}

.wd-document-prose .wd-document-faq-item[open] .wd-document-faq-toggle::before {
  background: #ffffff;
}

.wd-document-prose .wd-document-faq-item[open] .wd-document-faq-toggle::after {
  opacity: 0;
}

.wd-document-prose .wd-document-faq-answer {
  padding: 16px 18px 18px;
  border-top: 1px solid var(--wd-docs-line);
  color: var(--wd-docs-ink-soft);
}

.wd-document-prose .wd-document-faq-answer p {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.7;
}

/* Screenshots & figures */

.wd-document-prose :is(.wd-doc-screenshot, .wd-form-doc-step-image),
.wd-document-prose .wd-form-doc-images figure {
  overflow: hidden;
  border: 1px solid var(--wd-docs-line);
  border-radius: var(--wd-docs-radius-md);
  background: var(--wd-docs-surface-soft);
}

.wd-document-prose :is(.wd-doc-screenshot, .wd-form-doc-step-image) {
  margin: 28px 0 36px;
}

.wd-document-prose :is(.wd-doc-screenshot, .wd-form-doc-step-image, .wd-form-doc-images) img {
  display: block;
  width: 100%;
  height: auto;
}

.wd-document-prose .wd-doc-screenshot-trigger,
.wd-document-prose .wd-doc-screenshot-link {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: inherit;
  cursor: zoom-in;
}

.wd-document-prose .wd-doc-screenshot-trigger:focus-visible,
.wd-document-prose .wd-doc-screenshot-link:focus-visible {
  outline: 2px solid var(--wd-docs-ink);
  outline-offset: -2px;
}

.wd-document-prose :is(.wd-doc-screenshot, .wd-form-doc-step-image, .wd-form-doc-images figure) figcaption {
  margin: 0;
  padding: 10px 14px;
  border-top: 1px solid var(--wd-docs-line);
  color: var(--wd-docs-muted);
  background: #ffffff;
  font-size: 13px;
  line-height: 1.5;
}

.wd-document-prose .wd-form-doc-images {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  margin: 28px 0 36px;
}

.wd-document-prose .wd-form-doc-images--portrait {
  grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 300px));
  align-items: start;
  justify-content: center;
}

.wd-document-prose .wd-form-doc-images figure {
  min-width: 0;
  margin: 0;
}

.wd-document-prose .wd-form-doc-images figcaption {
  padding: 9px 11px;
  font-size: 12px;
}

.wd-document-prose .wd-doc-video {
  overflow: hidden;
  margin: 20px 0 36px;
  border: 1px solid var(--wd-docs-line);
  border-radius: var(--wd-docs-radius-md);
  background: #0a0a0a;
}

.wd-document-prose .wd-doc-video video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  background: #0a0a0a;
}

/* Lightbox (stays dark) */

html.wd-doc-lightbox-open,
html.wd-doc-lightbox-open body {
  overflow: hidden;
}

.wd-doc-lightbox {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: clamp(14px, 3vw, 34px);
  overflow: hidden;
  border: 0;
  color: #ffffff;
  background: rgba(10, 10, 10, 0.96);
}

.wd-doc-lightbox::backdrop {
  background: rgba(10, 10, 10, 0.96);
}

.wd-doc-lightbox[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
}

.wd-doc-lightbox-close {
  display: inline-grid;
  justify-self: end;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  color: #ffffff;
  background: transparent;
  font: inherit;
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.wd-doc-lightbox-close:hover {
  color: #0a0a0a;
  background: #ffffff;
}

.wd-doc-lightbox-close:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

.wd-doc-lightbox-figure {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  place-items: center;
  min-width: 0;
  min-height: 0;
  margin: 0;
}

.wd-doc-lightbox-image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: #ffffff;
  object-fit: contain;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.wd-doc-lightbox-caption {
  max-width: 900px;
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  line-height: 1.55;
  text-align: center;
}

.wd-doc-lightbox-caption:empty {
  display: none;
}

.wd-document-page-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 36px;
}

/* Sidebar */

.wd-document-sidebar {
  position: sticky;
  top: calc(var(--wd-form-global-header-offset, 86px) + 28px);
  display: grid;
  gap: 16px;
}

.wd-document-sidebar-section {
  padding: 20px;
  border: 1px solid var(--wd-docs-line);
  border-radius: var(--wd-docs-radius-lg);
  background: #ffffff;
}

.wd-document-sidebar-section p {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  color: var(--wd-docs-muted);
  font-family: var(--wd-docs-font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wd-document-sidebar-section p::before {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
}

.wd-document-sidebar-section a,
.wd-document-sidebar-section span,
.wd-document-sidebar-section strong {
  display: block;
  color: var(--wd-docs-ink-soft);
  font-size: 14px;
  line-height: 1.5;
}

.wd-document-sidebar-section a {
  padding: 7px 0;
  transition: color 0.2s ease;
}

.wd-document-sidebar-section a:hover,
.wd-document-sidebar-section a:focus-visible {
  color: var(--wd-docs-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.wd-document-sidebar-section strong {
  margin-top: 4px;
  color: var(--wd-docs-ink);
  font-weight: 600;
}

.wd-document-toc nav {
  display: grid;
  gap: 0;
  border-left: 1px solid var(--wd-docs-line);
}

.wd-document-toc-link {
  margin-left: -1px;
  padding: 6px 0 6px 14px !important;
  border-left: 1px solid transparent;
}

.wd-document-toc-link:hover {
  border-left-color: var(--wd-docs-ink);
}

.wd-document-toc-level-3 {
  padding-left: 26px !important;
  font-size: 13.5px !important;
}

.wd-document-toc-level-4 {
  padding-left: 38px !important;
  font-size: 13px !important;
}

/* Responsive -------------------------------------------------------------- */

@media (max-width: 1100px) {
  .wd-document-shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }

  .wd-document-sidebar {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .wd-document-sidebar {
    grid-template-columns: minmax(0, 1fr);
  }

  .wd-document-summary {
    font-size: 16px;
  }

  .wd-document-prose {
    font-size: 16px;
  }

  .wd-document-prose h2 {
    margin-top: 44px;
    font-size: 24px;
  }

  .wd-document-prose h3 {
    font-size: 19px;
  }

  .wd-document-prose table {
    display: block;
    overflow-x: auto;
  }

  .wd-document-prose .wd-document-faq-item summary {
    min-height: 52px;
    padding: 14px;
    font-size: 15px;
  }

  .wd-document-prose .wd-document-faq-answer {
    padding: 14px;
  }
}

@media (max-width: 430px) {
  .wd-document-back {
    margin-bottom: 28px;
  }

  .wd-document-meta {
    display: grid;
  }
}
