/* ============================================================
   Dots Platform — Help center / docs portal
   Uses the design tokens defined in dots.css (--bg, --ink, --accent,
   --radius-*, --font-*, --shadow-*), so light/dark themes come for free.
   ============================================================ */

.docs-page {
  min-height: 60vh;
  color: var(--ink);
  background: var(--bg);
}

/* --------------------------------------------------------- top bar */

.docs-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--glass);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}

.docs-topbar__bar {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 68px;
}

.docs-topbar .dp-logo img {
  height: 26px;
  display: block;
}

.docs-topbar__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
  text-decoration: none;
  padding-left: 20px;
  border-left: 1px solid var(--line-strong);
}

.docs-topbar__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.docs-lang {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.docs-lang a {
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
  transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out);
}

.docs-lang a.is-active {
  background: var(--accent);
  color: #fff;
}

/* --------------------------------------------------------- hero */

.docs-hero {
  padding: clamp(40px, 7vw, 88px) 0 clamp(28px, 4vw, 48px);
  background-image: var(--hero-wash);
  text-align: center;
}

.docs-hero--compact {
  padding: clamp(28px, 4vw, 44px) 0 clamp(16px, 2vw, 28px);
}

.docs-hero__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 4.5vw, 46px);
  line-height: 1.1;
  margin: 0 0 14px;
  color: var(--ink);
}

.docs-hero__lead {
  font-size: clamp(15px, 1.6vw, 18px);
  color: var(--ink-2);
  max-width: 46ch;
  margin: 0 auto 28px;
}

/* --------------------------------------------------------- search */

.docs-search {
  position: relative;
  margin: 0 auto;
  max-width: 640px;
}

.docs-search--md {
  max-width: 560px;
}

.docs-search__field {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  padding: 6px 6px 6px 18px;
  box-shadow: var(--shadow-m);
  transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}

.docs-search__field:focus-within {
  border-color: var(--accent);
  box-shadow: var(--shadow-m), 0 0 0 4px var(--accent-soft);
}

.docs-search__icon {
  width: 20px;
  height: 20px;
  color: var(--ink-3);
  flex: none;
}

/* loading spinner — swaps in for the magnifier while a suggest request runs */
.docs-search__spinner {
  display: none;
  width: 20px;
  height: 20px;
  flex: none;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: docs-spin 0.6s linear infinite;
}

.docs-search.is-loading .docs-search__icon {
  display: none;
}

.docs-search.is-loading .docs-search__spinner {
  display: block;
}

@keyframes docs-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .docs-search__spinner {
    animation-duration: 1.6s;
  }
}

.docs-search__input {
  flex: 1;
  border: 0;
  background: transparent;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink);
  padding: 12px 0;
  outline: none;
  min-width: 0;
}

.docs-search__input::placeholder {
  color: var(--ink-3);
}

.docs-search__submit {
  flex: none;
  border: 0;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  color: #fff;
  background: var(--accent);
  border-radius: var(--radius-pill);
  padding: 11px 22px;
  transition: background 0.2s var(--ease-out), transform 0.1s var(--ease-out);
}

.docs-search__submit:hover {
  background: var(--accent-strong);
}

.docs-search__submit:active {
  transform: translateY(1px);
}

/* suggest dropdown */

.docs-search__suggest {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-l);
  overflow: hidden;
  text-align: left;
  z-index: 30;
}

.docs-suggest__item {
  display: block;
  padding: 12px 18px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: background 0.15s var(--ease-out);
}

.docs-suggest__item:last-child {
  border-bottom: 0;
}

.docs-suggest__item:hover,
.docs-suggest__item.is-active {
  background: var(--bg-sunken);
}

.docs-suggest__title {
  display: block;
  font-weight: 600;
  font-size: 15px;
}

.docs-suggest__excerpt {
  display: block;
  font-size: 13px;
  color: var(--ink-3);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.docs-suggest__empty {
  padding: 14px 18px;
  color: var(--ink-3);
  font-size: 14px;
}

/* --------------------------------------------------------- body sections */

.docs-body {
  padding: clamp(28px, 5vw, 56px) 0 96px;
}

.docs-section {
  margin-bottom: clamp(32px, 5vw, 56px);
}

.docs-section__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(18px, 2.2vw, 24px);
  margin: 0 0 20px;
  color: var(--ink);
}

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

.docs-section__title a:hover {
  color: var(--accent);
}

/* popular cards */

.docs-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.docs-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 22px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  text-decoration: none;
  box-shadow: var(--shadow-s);
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}

.docs-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-m);
  border-color: var(--line-strong);
}

.docs-card__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
  line-height: 1.3;
}

.docs-card__excerpt {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.5;
}

.docs-card__go {
  color: var(--accent);
  font-size: 18px;
  margin-top: auto;
  transition: transform 0.2s var(--ease-out);
}

.docs-card:hover .docs-card__go {
  transform: translateX(4px);
}

/* article lists */

.docs-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.docs-list li {
  padding: 4px 0;
}

.docs-list a {
  color: var(--ink);
  text-decoration: none;
  font-size: 15.5px;
  border-bottom: 1px solid transparent;
  transition: color 0.15s var(--ease-out), border-color 0.15s var(--ease-out);
}

.docs-list a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.docs-list__excerpt {
  display: block;
  font-size: 13.5px;
  color: var(--ink-3);
  margin-top: 2px;
}

.docs-list--columns {
  columns: 3 260px;
  column-gap: 40px;
}

.docs-list--columns li {
  break-inside: avoid;
}

.docs-empty {
  color: var(--ink-2);
  font-size: 16px;
}

/* --------------------------------------------------------- category layout */

.docs-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}

.docs-sidebar {
  position: sticky;
  top: 88px;
}

.docs-sidebar__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  margin: 0 0 14px;
}

.docs-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.docs-sidebar__link {
  display: block;
  padding: 9px 14px;
  border-radius: var(--radius-s);
  color: var(--ink-2);
  text-decoration: none;
  font-size: 14.5px;
  transition: background 0.15s var(--ease-out), color 0.15s var(--ease-out);
}

.docs-sidebar__link:hover {
  background: var(--bg-sunken);
  color: var(--ink);
}

.docs-sidebar__link.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.docs-cat-articles {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.docs-cat-article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 22px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  text-decoration: none;
  box-shadow: var(--shadow-s);
  transition: transform 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out), border-color 0.15s var(--ease-out);
}

.docs-cat-article:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-m);
  border-color: var(--line-strong);
}

.docs-cat-article__main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.docs-cat-article__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
}

.docs-cat-article__excerpt {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.5;
}

/* popularity indicator */

.docs-popularity {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  padding-left: 20px;
  border-left: 1px solid var(--line);
}

.docs-popularity__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
}

.docs-popularity__dots {
  display: inline-flex;
  gap: 4px;
}

.docs-popularity__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-strong);
}

.docs-popularity__dot.is-on {
  background: var(--accent);
}

.docs-card--category .docs-card__meta {
  font-size: 13.5px;
  color: var(--ink-3);
}

@media (max-width: 720px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }

  .docs-sidebar {
    position: static;
  }

  .docs-cat-article {
    flex-direction: column;
    align-items: flex-start;
  }

  .docs-popularity {
    flex-direction: row;
    align-items: center;
    padding-left: 0;
    border-left: 0;
  }
}

/* --------------------------------------------------------- breadcrumb */

.docs-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--ink-3);
  margin-bottom: 22px;
}

.docs-breadcrumb a {
  color: var(--ink-2);
  text-decoration: none;
}

.docs-breadcrumb a:hover {
  color: var(--accent);
}

.docs-breadcrumb__current {
  color: var(--ink-3);
}

/* --------------------------------------------------------- article */

.docs-article-wrap {
  padding-top: clamp(24px, 4vw, 40px);
  padding-bottom: 96px;
}

.docs-article {
  max-width: 760px;
}

.docs-article__header h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1.15;
  margin: 0 0 28px;
  color: var(--ink);
}

.docs-article__header--with-share {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.docs-article__header--with-share h1 {
  flex: 1;
}

.docs-share {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 9px 16px;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  transition: border-color 0.2s var(--ease-out), background 0.2s var(--ease-out), color 0.2s var(--ease-out);
}

.docs-share svg {
  width: 16px;
  height: 16px;
}

.docs-share:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.docs-share.is-copied {
  border-color: var(--accent);
  color: var(--accent);
}

@media (max-width: 640px) {
  .docs-share span {
    display: none;
  }
}

/* rendered article body */

.docs-prose {
  font-size: 16.5px;
  line-height: 1.75;
  color: var(--ink-2);
}

.docs-prose h2,
.docs-prose h3,
.docs-prose h4 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.25;
  margin: 1.8em 0 0.6em;
}

.docs-prose h2 { font-size: 1.5em; }
.docs-prose h3 { font-size: 1.25em; }

.docs-prose p {
  margin: 0 0 1.1em;
}

.docs-prose a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.docs-prose ul,
.docs-prose ol {
  margin: 0 0 1.1em;
  padding-left: 1.4em;
}

.docs-prose li {
  margin: 0.35em 0;
}

.docs-prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-m);
  border: 1px solid var(--line);
  margin: 1.4em 0;
  box-shadow: var(--shadow-s);
}

.docs-prose pre {
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 16px 18px;
  overflow-x: auto;
  font-size: 14px;
}

.docs-prose code {
  background: var(--bg-sunken);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 0.9em;
}

.docs-prose pre code {
  background: none;
  padding: 0;
}

.docs-prose blockquote {
  margin: 1.2em 0;
  padding: 4px 18px;
  border-left: 3px solid var(--accent);
  color: var(--ink-2);
}

.docs-prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2em 0;
  font-size: 15px;
}

.docs-prose th,
.docs-prose td {
  border: 1px solid var(--line);
  padding: 8px 12px;
  text-align: left;
}

/* --------------------------------------------------------- feedback */

.docs-feedback {
  margin: 48px 0 8px;
  padding: 22px 24px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  text-align: center;
}

.docs-feedback__q {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
  margin: 0 0 14px;
}

.docs-feedback__actions {
  display: inline-flex;
  gap: 12px;
}

.docs-feedback__btn {
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  padding: 9px 22px;
  transition: border-color 0.2s var(--ease-out), background 0.2s var(--ease-out), transform 0.1s var(--ease-out);
}

.docs-feedback__btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.docs-feedback__btn:active {
  transform: translateY(1px);
}

.docs-feedback__thanks {
  margin: 4px 0 0;
  color: var(--accent);
  font-weight: 600;
}

.docs-article__back {
  margin-top: 40px;
}

.docs-article__back a {
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 500;
}

.docs-article__back a:hover {
  color: var(--accent);
}

/* --------------------------------------------------------- search results */

.docs-results__count {
  color: var(--ink-2);
  margin: 0 0 24px;
}

.docs-results {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 760px;
}

.docs-result {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.docs-result__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  color: var(--ink);
  text-decoration: none;
}

.docs-result__title:hover {
  color: var(--accent);
}

.docs-result__excerpt {
  margin: 6px 0 0;
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.6;
}

/* --------------------------------------------------------- responsive */

@media (max-width: 640px) {
  .docs-topbar__title {
    display: none;
  }

  .docs-search__submit {
    padding: 11px 16px;
  }

  .docs-list--columns {
    columns: 1;
  }
}
