/* ==========================================================================
   Stacklar docs hub — monochrome (black hero, white body)
   Tokens below are shared with document.css (doc articles).
   ========================================================================== */

body.page-template-page-wd-form-docs,
body.tax-wd_document_module,
body.wd-form-docs-archive,
body.post-type-archive-document,
body.post-type-archive-wd_form_document {
  margin: 0;
  background: #0a0a0a;
}

.wd-docs-page {
  --wd-docs-bg: #ffffff;
  --wd-docs-surface: #ffffff;
  --wd-docs-surface-soft: #fafafa;
  --wd-docs-ink: #0a0a0a;
  --wd-docs-ink-soft: #2b2b2b;
  --wd-docs-muted: #6b6b6b;
  --wd-docs-line: #e4e4e4;
  --wd-docs-line-strong: #0a0a0a;
  --wd-docs-hero-ink: #ffffff;
  --wd-docs-hero-ink-soft: rgba(255, 255, 255, 0.68);
  --wd-docs-hero-muted: rgba(255, 255, 255, 0.52);
  --wd-docs-hero-line: rgba(255, 255, 255, 0.14);
  --wd-docs-radius-xl: 24px;
  --wd-docs-radius-lg: 18px;
  --wd-docs-radius-md: 14px;
  --wd-docs-content: 1180px;
  --wd-docs-font-sans: "Inter", ui-sans-serif, system-ui, -apple-system,
    "Segoe UI", sans-serif;
  --wd-docs-font-mono: ui-monospace, "SFMono-Regular", "SF Mono", Menlo,
    Consolas, monospace;
  --wd-docs-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  overflow-x: clip;
  color: var(--wd-docs-ink);
  background: var(--wd-docs-bg);
  font-family: var(--wd-docs-font-sans);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.wd-docs-page *,
.wd-docs-page *::before,
.wd-docs-page *::after {
  box-sizing: border-box;
}

.wd-docs-page a {
  color: inherit;
  text-decoration: none;
}

.wd-docs-page :focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.wd-docs-container {
  width: min(calc(100% - 40px), var(--wd-docs-content));
  margin: 0 auto;
}

/* Black hero band (shared with the article hero in document.css) -------- */

.wd-docs-hero,
.wd-document-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: var(--wd-docs-hero-ink);
  background: #0a0a0a;
}

.wd-docs-hero::before,
.wd-document-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(
    ellipse 75% 80% at 50% 20%,
    #000 20%,
    transparent 75%
  );
  mask-image: radial-gradient(
    ellipse 75% 80% at 50% 20%,
    #000 20%,
    transparent 75%
  );
}

.wd-docs-hero::after,
.wd-document-hero::after {
  content: "";
  position: absolute;
  top: -30%;
  left: 50%;
  z-index: -1;
  width: 80%;
  height: 120%;
  background: radial-gradient(
    closest-side,
    rgba(255, 255, 255, 0.08),
    transparent
  );
  transform: translateX(-50%);
  pointer-events: none;
}

.wd-docs-hero {
  padding: clamp(72px, 9vw, 112px) 0 clamp(64px, 7vw, 88px);
}

.wd-docs-hero-copy {
  position: relative;
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
}

.wd-docs-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  margin: 0 auto 26px;
  padding: 7px 14px 7px 10px;
  border: 1px solid var(--wd-docs-hero-line);
  border-radius: 999px;
  color: var(--wd-docs-hero-ink-soft);
  background: rgba(255, 255, 255, 0.04);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
}

.wd-docs-eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.12);
}

.wd-docs-hero h1 {
  margin: 0;
  color: var(--wd-docs-hero-ink);
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.wd-docs-hero p {
  max-width: 680px;
  margin: 24px auto 0;
  color: var(--wd-docs-hero-ink-soft);
  font-size: 18px;
  line-height: 1.65;
}

/* Search (optional in the template) */

.wd-docs-search {
  position: relative;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  width: min(720px, 100%);
  min-height: 64px;
  margin: 36px auto 0;
  border: 1px solid var(--wd-docs-hero-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

.wd-docs-search:focus-within {
  border-color: rgba(255, 255, 255, 0.5);
}

.wd-docs-search-icon {
  position: relative;
  justify-self: end;
  width: 18px;
  height: 18px;
  border: 2px solid var(--wd-docs-hero-ink-soft);
  border-radius: 999px;
}

.wd-docs-search-icon::after {
  content: "";
  position: absolute;
  right: -6px;
  bottom: -5px;
  width: 8px;
  height: 2px;
  border-radius: 999px;
  background: var(--wd-docs-hero-ink-soft);
  transform: rotate(45deg);
}

.wd-docs-search input {
  width: 100%;
  min-width: 0;
  padding: 0 16px;
  border: 0;
  outline: 0;
  color: var(--wd-docs-hero-ink);
  background: transparent;
  font: inherit;
  font-size: 16px;
}

.wd-docs-search input::placeholder {
  color: var(--wd-docs-hero-muted);
}

.wd-docs-search button {
  margin-right: 8px;
  padding: 12px 20px;
  border: 0;
  border-radius: 999px;
  color: #0a0a0a;
  background: #ffffff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

/* White body ------------------------------------------------------------- */

.wd-docs-layout {
  padding: clamp(56px, 7vw, 88px) 0 clamp(96px, 10vw, 136px);
  background: var(--wd-docs-bg);
}

.wd-docs-layout-grid {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  align-items: start;
  gap: 40px;
}

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

.wd-docs-sidebar-card {
  padding: 10px;
  border: 1px solid var(--wd-docs-line);
  border-radius: var(--wd-docs-radius-lg);
  background: var(--wd-docs-surface);
}

.wd-docs-sidebar nav {
  display: grid;
  gap: 2px;
}

.wd-docs-sidebar nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  color: var(--wd-docs-ink-soft);
  font-size: 14px;
  line-height: 1.35;
  transition:
    color 0.2s ease,
    background 0.2s ease;
}

.wd-docs-sidebar nav a:hover,
.wd-docs-sidebar nav a:focus-visible {
  color: var(--wd-docs-ink);
  background: #f3f3f3;
}

.wd-docs-sidebar nav a.is-current {
  color: #ffffff;
  background: #0a0a0a;
}

.wd-docs-sidebar nav em {
  flex: 0 0 auto;
  min-width: 26px;
  color: var(--wd-docs-muted);
  font-family: var(--wd-docs-font-mono);
  font-size: 11.5px;
  font-style: normal;
  text-align: right;
}

.wd-docs-sidebar nav a.is-current em {
  color: rgba(255, 255, 255, 0.65);
}

.wd-docs-help-card h2 {
  margin: 0;
  color: var(--wd-docs-ink);
  font-size: 15px;
  font-weight: 600;
}

.wd-docs-help-card ul {
  display: grid;
  gap: 8px;
  margin: 14px 0 18px;
  padding: 0;
  list-style: none;
}

.wd-docs-help-card li {
  color: var(--wd-docs-muted);
  font-size: 14px;
  line-height: 1.6;
}

.wd-docs-support-link {
  display: inline-flex;
  justify-content: center;
  width: 100%;
  padding: 12px 16px;
  border-radius: 999px;
  color: #ffffff;
  background: #0a0a0a;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s ease;
}

.wd-docs-support-link:hover {
  background: #2a2a2a;
}

.wd-docs-main {
  min-width: 0;
}

/* Cards: invert to black on hover, like the landing feature table. */

.wd-docs-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.wd-docs-card {
  --card-fg: #0a0a0a;
  --card-fg-2: #3f3f3f;
  --card-fg-3: #6b6b6b;
  --card-line: #e4e4e4;
  --card-bg: #ffffff;
  position: relative;
  min-height: 248px;
  overflow: hidden;
  border: 1px solid var(--wd-docs-line);
  border-radius: var(--wd-docs-radius-lg);
  color: var(--card-fg);
  background: var(--card-bg);
  transition:
    background 0.3s ease,
    border-color 0.3s ease,
    color 0.3s ease,
    transform 0.3s var(--wd-docs-ease);
}

.wd-docs-card:hover,
.wd-docs-card:focus-within {
  --card-fg: #ffffff;
  --card-fg-2: rgba(255, 255, 255, 0.72);
  --card-fg-3: rgba(255, 255, 255, 0.52);
  --card-line: rgba(255, 255, 255, 0.24);
  --card-bg: #0a0a0a;
  border-color: #0a0a0a;
  transform: translateY(-3px);
}

.wd-docs-card[hidden] {
  display: none;
}

.wd-docs-card-link {
  position: relative;
  display: grid;
  align-content: start;
  min-height: inherit;
  padding: 26px;
}

.wd-docs-card-icon {
  position: relative;
  width: 44px;
  height: 44px;
  border: 1px solid var(--card-line);
  border-radius: 12px;
  transition: border-color 0.3s ease;
}

.wd-docs-card-icon::before,
.wd-docs-card-icon::after {
  content: "";
  position: absolute;
  left: 13px;
  height: 1.5px;
  border-radius: 999px;
  background: var(--card-fg);
}

.wd-docs-card-icon::before {
  top: 16px;
  width: 16px;
}

.wd-docs-card-icon::after {
  top: 24px;
  width: 10px;
}

.wd-docs-card-arrow {
  position: absolute;
  top: 26px;
  right: 26px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--card-line);
  border-radius: 999px;
  transition:
    border-color 0.3s ease,
    background 0.3s ease;
}

.wd-docs-card-arrow::before {
  content: "→";
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: var(--card-fg);
  font-size: 16px;
  transition: transform 0.3s var(--wd-docs-ease);
}

.wd-docs-card:hover .wd-docs-card-arrow {
  border-color: #ffffff;
  background: #ffffff;
}

.wd-docs-card:hover .wd-docs-card-arrow::before {
  color: #0a0a0a;
  transform: translateX(2px);
}

.wd-docs-card-count {
  margin-top: 24px;
  color: var(--card-fg-3);
  font-family: var(--wd-docs-font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wd-docs-card h3 {
  margin: 10px 0 0;
  color: var(--card-fg);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.wd-docs-card p {
  margin: 12px 0 0;
  color: var(--card-fg-2);
  font-size: 14.5px;
  line-height: 1.6;
}

.wd-docs-article-card h3 {
  margin-top: 28px;
}

/* Pagination & empty state */

.wd-docs-pagination {
  margin-top: 32px;
}

.wd-docs-pagination .page-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.wd-docs-pagination a,
.wd-docs-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--wd-docs-line);
  border-radius: 999px;
  color: var(--wd-docs-ink);
  background: #ffffff;
  font-size: 14px;
  font-weight: 600;
  transition: border-color 0.2s ease;
}

.wd-docs-pagination a:hover {
  border-color: #0a0a0a;
}

.wd-docs-pagination .current {
  border-color: #0a0a0a;
  color: #ffffff;
  background: #0a0a0a;
}

.wd-docs-empty {
  margin-top: 16px;
  padding: 48px 32px;
  border: 1px dashed #cfcfcf;
  border-radius: var(--wd-docs-radius-lg);
  background: var(--wd-docs-surface-soft);
  text-align: center;
}

.wd-docs-empty[hidden] {
  display: none;
}

.wd-docs-empty h2 {
  margin: 0;
  color: var(--wd-docs-ink);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.wd-docs-empty p {
  max-width: 560px;
  margin: 12px auto 0;
  color: var(--wd-docs-muted);
  font-size: 15px;
  line-height: 1.65;
}

@media (prefers-reduced-motion: reduce) {
  .wd-docs-page *,
  .wd-docs-page *::before,
  .wd-docs-page *::after {
    transition: none !important;
  }
}

@media (max-width: 1100px) {
  .wd-docs-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .wd-docs-layout-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .wd-docs-sidebar {
    position: static;
  }

  .wd-docs-sidebar nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 8px;
  }
}

@media (max-width: 720px) {
  .wd-docs-container {
    width: min(calc(100% - 32px), var(--wd-docs-content));
  }

  .wd-docs-hero p {
    font-size: 16px;
  }

  .wd-docs-search {
    grid-template-columns: 44px minmax(0, 1fr);
    min-height: 56px;
    border-radius: 22px;
  }

  .wd-docs-search button {
    grid-column: 1 / -1;
    justify-self: stretch;
    margin: 0 8px 8px;
  }

  .wd-docs-sidebar nav {
    grid-template-columns: minmax(0, 1fr);
  }

  .wd-docs-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .wd-docs-card {
    min-height: 0;
  }
}

@media (max-width: 430px) {
  .wd-docs-card-link {
    padding: 22px;
  }

  .wd-docs-card-arrow {
    top: 22px;
    right: 22px;
  }

  .wd-docs-card h3 {
    font-size: 20px;
  }
}
