/*======= Single Docs Page Polish (BetterDocs) =======
 * Loaded only on single "docs" posts. Scoped under body.single-docs.
 */

/* ---- Article title ---- */
body.single-docs .betterdocs-entry-header .betterdocs-entry-title {
  font-size: 32px !important;
  line-height: 1.25;
  font-weight: 600;
  text-transform: none !important;
  color: #1d2939;
  margin-bottom: 8px;
}
body.single-docs .betterdocs-entry-header .reading-time {
  margin-bottom: 8px;
  font-size: 14px;
  color: #667085;
}

/* ---- Reading typography ---- */
body.single-docs .betterdocs-entry-content {
  font-size: 16px;
  line-height: 1.75;
  color: #374151;
}
body.single-docs .betterdocs-entry-content p {
  margin: 0 0 16px;
}
body.single-docs .betterdocs-entry-content strong,
body.single-docs .betterdocs-entry-content b {
  color: #111827;
  font-weight: 600;
}
body.single-docs .betterdocs-entry-content a {
  text-underline-offset: 3px;
}

/* ---- Headings: clear hierarchy and consistent rhythm ---- */
body.single-docs .betterdocs-entry-content h1,
body.single-docs .betterdocs-entry-content h2 {
  margin: 48px 0 14px;
  padding-top: 32px;
  border-top: 1px solid #eaecf0;
  font-size: 24px !important;
  font-weight: 600;
  line-height: 1.35;
  color: #1d2939;
}
body.single-docs .betterdocs-entry-content > h1:first-child,
body.single-docs .betterdocs-entry-content > h2:first-child {
  margin-top: 8px;
  padding-top: 0;
  border-top: 0;
}
body.single-docs .betterdocs-entry-content h3 {
  margin: 32px 0 10px;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.4;
  color: #1d2939;
}
body.single-docs .betterdocs-entry-content h4 {
  margin: 24px 0 8px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  color: #1d2939;
}

/* ---- Lists ---- */
/* The theme reset sets list-style: none, so markers are declared explicitly */
body.single-docs .betterdocs-entry-content ul,
body.single-docs .betterdocs-entry-content ol {
  margin: 0 0 18px;
  padding-left: 36px;
  list-style-position: outside;
}
body.single-docs .betterdocs-entry-content ul {
  list-style-type: disc;
}
body.single-docs .betterdocs-entry-content ol {
  list-style-type: decimal;
}
body.single-docs .betterdocs-entry-content ul ul {
  list-style-type: circle;
}
body.single-docs .betterdocs-entry-content li {
  display: list-item;
  margin: 0 0 6px;
  padding-left: 4px;
}
/* Disable the .prose pseudo-element bullets/counters: native markers are used instead */
body.single-docs .betterdocs-entry-content ul > li::before,
body.single-docs .betterdocs-entry-content ol > li::before {
  content: none !important;
  display: none !important;
}
body.single-docs .betterdocs-entry-content li::marker {
  color: inherit;
}
body.single-docs .betterdocs-entry-content li > ul,
body.single-docs .betterdocs-entry-content li > ol {
  margin: 6px 0 0;
}

/* ---- Images / figures ---- */
body.single-docs .betterdocs-entry-content figure,
body.single-docs .betterdocs-entry-content .wp-block-image {
  margin: 24px 0 28px;
}
body.single-docs .betterdocs-entry-content img {
  max-width: 100%;
  height: auto;
  border: 1px solid #eaecf0;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.08);
}
body.single-docs .betterdocs-entry-content p > img {
  display: block;
  margin: 8px 0;
}
body.single-docs .betterdocs-entry-content figcaption {
  margin-top: 10px;
  font-size: 13px;
  color: #667085;
  text-align: center;
}
/* Remove stray empty paragraphs / spacers between blocks */
body.single-docs .betterdocs-entry-content p:empty,
body.single-docs .betterdocs-entry-content .wp-block-spacer {
  display: none;
}

/* ---- Tables, code, quotes ---- */
body.single-docs .betterdocs-entry-content table {
  width: 100%;
  margin: 20px 0 24px;
  border-collapse: collapse;
  font-size: 15px;
}
body.single-docs .betterdocs-entry-content th,
body.single-docs .betterdocs-entry-content td {
  padding: 10px 12px;
  border: 1px solid #eaecf0;
  text-align: left;
}
body.single-docs .betterdocs-entry-content th {
  background: #f9fafb;
  font-weight: 600;
}
body.single-docs .betterdocs-entry-content :not(pre) > code {
  padding: 2px 6px;
  border-radius: 4px;
  background: #f2f4f7;
  font-size: 0.9em;
}
body.single-docs .betterdocs-entry-content blockquote {
  margin: 20px 0;
  padding: 14px 18px;
  border: 1px solid #d1f5e0;
  background: #f6fef9;
  border-radius: 10px;
}
body.single-docs .betterdocs-entry-content blockquote p:last-child {
  margin-bottom: 0;
}

/* ---- Top area: tighter search band and breadcrumb ---- */
body.single-docs .betterdocs-single-wrapper .betterdocs-breadcrumb {
  margin-bottom: 0;
}

/* ---- Right sidebar: sticky, lighter table of contents ---- */
body.single-docs #betterdocs-sidebar-right .betterdocs-toc .toc-title {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #667085;
}
body.single-docs #betterdocs-sidebar-right .betterdocs-toc .toc-list a {
  display: block;
  padding: 5px 0;
  font-size: 14px;
  line-height: 1.45;
  color: #475467;
}
body.single-docs #betterdocs-sidebar-right .betterdocs-toc .toc-list a:hover,
body.single-docs #betterdocs-sidebar-right .betterdocs-toc .toc-list a.active,
body.single-docs #betterdocs-sidebar-right .betterdocs-toc .toc-list a.betterdocs-toc-current {
  color: #0b8a43;
}
body.single-docs #betterdocs-sidebar-right .betterdocs-toc .betterdocs-toc-list-level-2 {
  margin-left: 12px;
}

/* ---- Left sidebar: clean category navigation ---- */
body.single-docs #betterdocs-full-sidebar-left {
  position: sticky;
  top: 24px;
  align-self: flex-start;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  border: 1px solid #eaecf0;
  border-radius: 12px;
  background: #fff;
  box-shadow: none;
  scrollbar-width: thin;
}
body.single-docs #betterdocs-full-sidebar-left .betterdocs-single-category-wrapper {
  margin: 0;
  box-shadow: none;
  border: 0;
  border-bottom: 1px solid #f2f4f7;
}
body.single-docs #betterdocs-full-sidebar-left .betterdocs-single-category-wrapper:last-child {
  border-bottom: 0;
}
body.single-docs #betterdocs-full-sidebar-left .betterdocs-category-header {
  padding: 14px 16px;
  border: 0;
  background: transparent;
}
body.single-docs #betterdocs-full-sidebar-left .betterdocs-single-category-wrapper.active .betterdocs-category-header {
  background: #f6fef9;
}
body.single-docs #betterdocs-full-sidebar-left .betterdocs-category-title {
  font-size: 15px !important;
  font-weight: 600;
  line-height: 1.4;
  color: #1d2939 !important;
}
body.single-docs #betterdocs-full-sidebar-left .betterdocs-body {
  padding: 4px 8px 10px;
}
body.single-docs #betterdocs-full-sidebar-left .betterdocs-articles-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
body.single-docs #betterdocs-full-sidebar-left .betterdocs-articles-list li {
  position: relative;
  margin: 0 0 2px;
  padding: 0;
}
/* Drop the per-article icons: they add noise and misalign with wrapped titles */
body.single-docs #betterdocs-full-sidebar-left .betterdocs-articles-list li > svg {
  display: none;
}
body.single-docs #betterdocs-full-sidebar-left .betterdocs-articles-list li a {
  display: block;
  margin: 0 !important;
  padding: 8px 12px !important;
  border-radius: 8px;
  font-size: 14px !important;
  line-height: 1.45;
  color: #475467 !important;
  transition: background 0.15s, color 0.15s;
}
body.single-docs #betterdocs-full-sidebar-left .betterdocs-articles-list li a:hover {
  background: #f9fafb !important;
  color: #1d2939 !important;
}
body.single-docs #betterdocs-full-sidebar-left .betterdocs-articles-list li a.active {
  background: #e8fff4 !important;
  color: #0b8a43 !important;
  font-weight: 500;
}

/* ---- Article footer: reactions, share, feedback ---- */
body.single-docs .betterdocs-entry-footer {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid #eaecf0;
}
body.single-docs .betterdocs-entry-footer .betterdocs-article-reactions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 20px;
  padding: 14px 18px;
  border: 1px solid #eaecf0;
  border-radius: 10px;
  background: #f9fafb;
}
body.single-docs .betterdocs-entry-footer .betterdocs-reactions-title-tag {
  margin: 0;
  padding: 0;
  font-size: 15px;
  font-weight: 500;
  color: #344054;
}
body.single-docs .betterdocs-entry-footer .betterdocs-social-share {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
}
body.single-docs .betterdocs-entry-footer .betterdocs-social-share-title-tag {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: #667085;
}
body.single-docs .betterdocs-entry-footer .betterdocs-social-share-links {
  display: flex;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
body.single-docs .betterdocs-entry-footer .betterdocs-social-share-links li {
  margin: 0 !important;
  padding: 0 !important;
}
body.single-docs .betterdocs-entry-footer .betterdocs-social-share-links img {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
body.single-docs .betterdocs-entry-footer .feedback-update-form {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}
body.single-docs .betterdocs-entry-footer .feedback-form-link {
  text-decoration: none;
}
body.single-docs .betterdocs-entry-footer .feedback-form-link:hover {
  text-decoration: underline;
}

/* ---- Previous / next navigation as cards ---- */
body.single-docs .docs-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 32px 0 0;
}
body.single-docs .docs-navigation a {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid #eaecf0;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  color: #344054;
  transition: border-color 0.15s, box-shadow 0.15s;
}
body.single-docs .docs-navigation a[rel="next"] {
  justify-content: flex-end;
  text-align: right;
}
body.single-docs .docs-navigation a:hover {
  border-color: #1ac266;
  box-shadow: 0 2px 8px rgba(16, 24, 40, 0.06);
}

/* ---- Comment form ---- */
body.single-docs #comments.comments-area {
  margin-top: 40px;
  padding: 28px;
  border: 1px solid #eaecf0;
  border-radius: 12px;
  background: #f9fafb;
}
body.single-docs #comments .comment-reply-title {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 600;
  color: #1d2939;
}
body.single-docs #comments .comment-notes {
  margin: 0 0 18px;
  font-size: 13px;
  color: #667085;
}
body.single-docs #comments .comment-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}
body.single-docs #comments .comment-form > * {
  min-width: 0;
}
body.single-docs #comments .comment-form > p {
  margin: 0;
}
body.single-docs #comments .comment-form .comment-notes,
body.single-docs #comments .comment-form-comment,
body.single-docs #comments .comment-form-url,
body.single-docs #comments .comment-form-cookies-consent,
body.single-docs #comments .form-submit,
body.single-docs #comments .comment-form > :has(.cf-turnstile),
body.single-docs #comments .comment-form > .cf-turnstile {
  grid-column: 1 / -1;
}
/* Cloudflare Turnstile renders a fixed 300px iframe: never let it widen the form */
body.single-docs #comments .comment-form > :has(.cf-turnstile),
body.single-docs #comments .comment-form > .cf-turnstile {
  max-width: 100%;
  overflow: hidden;
}
body.single-docs #comments .cf-turnstile {
  margin: 0 !important;
}
body.single-docs #comments .cf-turnstile iframe {
  max-width: 100%;
}
body.single-docs #comments label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
  color: #344054;
}
body.single-docs #comments .required {
  color: #d92d20;
}
body.single-docs #comments input[type="text"],
body.single-docs #comments input[type="email"],
body.single-docs #comments input[type="url"],
body.single-docs #comments textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #fff;
  font-size: 15px;
  color: #1d2939;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  transition: border-color 0.15s, box-shadow 0.15s;
}
body.single-docs #comments textarea {
  min-height: 130px;
  resize: vertical;
}
body.single-docs #comments input:focus,
body.single-docs #comments textarea:focus {
  outline: 0;
  border-color: #1ac266;
  box-shadow: 0 0 0 3px rgba(26, 194, 102, 0.18);
}
body.single-docs #comments .comment-form-cookies-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
body.single-docs #comments .comment-form-cookies-consent input {
  position: static;
  flex: 0 0 auto;
  width: auto;
  margin: 3px 0 0;
  accent-color: #1ac266;
}
body.single-docs #comments .comment-form-cookies-consent label {
  margin: 0;
  padding: 0;
  display: inline;
  font-size: 13px;
  font-weight: 400;
  color: #667085;
}
body.single-docs #comments .form-submit .submit {
  padding: 10px 22px;
  border: 0;
  border-radius: 8px;
  background: #1ac266;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}
body.single-docs #comments .form-submit .submit:hover {
  background: #14a556;
}

/* ---- Prevent horizontal overflow: let grid/flex children shrink ---- */
body.single-docs .betterdocs-content-wrapper > *,
body.single-docs #betterdocs-single-main,
body.single-docs .betterdocs-content-inner-area,
body.single-docs .betterdocs-entry-content {
  min-width: 0;
  max-width: 100%;
}
body.single-docs .betterdocs-entry-content {
  overflow-wrap: anywhere;
}
body.single-docs .betterdocs-entry-content pre {
  max-width: 100%;
  overflow-x: auto;
}

/* ---- Mobile ---- */
@media screen and (max-width: 767px) {
  body.single-docs .betterdocs-entry-header .betterdocs-entry-title {
    font-size: 26px !important;
  }
  body.single-docs .betterdocs-entry-content h1,
  body.single-docs .betterdocs-entry-content h2 {
    margin-top: 36px;
    padding-top: 24px;
    font-size: 21px !important;
  }
  body.single-docs .betterdocs-entry-content h3 {
    font-size: 18px;
  }
  body.single-docs .betterdocs-entry-content table {
    display: block;
    overflow-x: auto;
  }
  body.single-docs #comments.comments-area {
    padding: 18px;
  }
  body.single-docs #comments .comment-form,
  body.single-docs .docs-navigation {
    grid-template-columns: minmax(0, 1fr);
  }
  body.single-docs .betterdocs-entry-footer .betterdocs-article-reactions,
  body.single-docs .betterdocs-entry-footer .feedback-update-form {
    flex-wrap: wrap;
  }
}

/* BetterDocs sets width: 112% and a 12-column placement on the content area,
   which pushes the page wider than the screen on phones. */
@media screen and (max-width: 767px) {
  body.single-docs .betterdocs-wrapper.betterdocs-single-wrapper .betterdocs-content-wrapper {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  body.single-docs .betterdocs-wrapper.betterdocs-single-wrapper .betterdocs-content-wrapper .betterdocs-content-area {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    max-width: 100%;
  }
  body.single-docs .betterdocs-wrapper.betterdocs-single-wrapper .betterdocs-content-wrapper .betterdocs-content-area .betterdocs-content-inner-area {
    width: 100% !important;
  }
}