/* ==========================================================================
   Documentation — light editorial layout
   ========================================================================== */

.docs-page {
  background: var(--surface);
}

.docs-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(252, 251, 247, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.docs-header__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 70px;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 32px;
}

.docs-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.docs-header__brand img {
  width: 132px;
}

.docs-header__badge {
  padding: 3px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.docs-search {
  position: relative;
  width: min(280px, 26vw);
  margin-left: 18px;
}

.docs-search svg {
  position: absolute;
  top: 50%;
  left: 13px;
  color: var(--muted-2);
  transform: translateY(-50%);
  pointer-events: none;
}

.docs-search input {
  width: 100%;
  height: 38px;
  padding: 0 14px 0 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.82rem;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}

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

.docs-search input:focus {
  outline: none;
  border-color: var(--ink);
  background: #fff;
}

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

.docs-header__link {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.docs-header__link:hover {
  color: var(--ink);
}

.docs-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.docs-shell {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  gap: 64px;
  max-width: var(--container);
  margin-inline: auto;
  padding: 48px 32px 100px;
}

.docs-sidebar {
  align-self: start;
  position: sticky;
  top: 94px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.docs-sidebar__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.docs-sidebar__close {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.docs-sidebar__search {
  display: none;
  margin: 14px 0 0;
}

.docs-nav {
  padding-top: 10px;
}

.docs-nav__group + .docs-nav__group {
  margin-top: 26px;
}

.docs-nav__group h2 {
  margin: 0 0 8px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.docs-nav__link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}

.docs-nav__link:hover {
  background: var(--paper);
  color: var(--ink);
}

.docs-nav__link.is-active {
  background: var(--lime);
  color: var(--ink);
  font-weight: 500;
}

.docs-nav__link.is-active::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink);
}

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

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

.docs-article__head {
  margin-bottom: 34px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.docs-breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 16px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

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

.docs-breadcrumb span[aria-hidden] {
  color: var(--line-strong);
}

.docs-article h1 {
  margin: 0;
  font-size: clamp(2.1rem, 3.6vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.045em;
}

.doc-content {
  color: var(--ink-2);
  font-size: 1rem;
  line-height: 1.9;
}

.doc-content > p {
  margin-bottom: 1.2rem;
}

.doc-content a {
  color: var(--cobalt);
  text-decoration: underline;
  text-decoration-color: rgba(36, 69, 255, 0.3);
  text-underline-offset: 3px;
}

.doc-content a:hover {
  text-decoration-color: currentColor;
}

.doc-content img {
  width: 100%;
  margin: 1.6rem 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(17, 20, 15, 0.05);
}

.doc-content img + img {
  margin-top: 1rem;
}

.doc-content .callout {
  position: relative;
  margin: 1.8rem 0;
  padding: 18px 20px 18px 48px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink-2);
  font-size: 0.9rem;
  line-height: 1.8;
}

.doc-content .callout::before {
  content: 'i';
  position: absolute;
  top: 18px;
  left: 18px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--lime);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 0.75rem;
  font-style: italic;
  line-height: 1;
}

.doc-content .steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 1.4rem 0 1.8rem;
  list-style: none;
}

.doc-content .steps li {
  display: flex;
  align-items: center;
  min-height: 54px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.5;
  transition: background-color 0.15s var(--ease);
}

.doc-content .steps li:hover {
  background: var(--lime);
}

.doc-content .steps a {
  color: inherit;
  text-decoration: none;
}

.doc-content .release {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 20px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.doc-content .release:first-of-type {
  border-top: 1px solid var(--line);
}

.doc-content .release time {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  line-height: 1.9;
}

.doc-content .release p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.7;
}

.doc-content strong {
  color: var(--ink);
}

.doc-content h2,
.doc-content h3 {
  margin: 2rem 0 0.8rem;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
}

.doc-content ul {
  margin: 1rem 0;
  padding-left: 0;
  list-style: none;
}

.doc-content ul li {
  position: relative;
  padding-left: 16px;
  margin-bottom: 6px;
}

.doc-content ul li::before {
  content: '';
  position: absolute;
  top: 0.72em;
  left: 0;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--cobalt);
}

.docs-pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 56px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.docs-pager a {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.docs-pager a:hover {
  border-color: var(--ink);
  background: var(--paper);
}

.docs-pager a:last-child {
  text-align: right;
}

.docs-pager span {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.docs-pager strong {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 500;
}

.docs-backdrop {
  display: none;
}

@media (max-width: 1023px) {
  .docs-header__inner {
    height: 64px;
    padding-inline: 20px;
    gap: 12px;
  }

  .docs-header__brand img {
    width: 120px;
  }

  .docs-header__badge {
    display: none;
  }

  .docs-search {
    display: none;
  }

  .docs-header__actions .docs-header__link {
    display: none;
  }

  .docs-header__actions .btn {
    min-height: 36px;
    padding-inline: 0.9rem;
    font-size: 0.8rem;
  }

  .docs-menu-toggle {
    display: inline-flex;
    margin-left: auto;
    order: 3;
  }

  .docs-header__actions {
    margin-left: 0;
    order: 2;
  }

  .docs-shell {
    grid-template-columns: 1fr;
    padding: 32px 20px 72px;
  }

  .docs-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1200;
    width: min(86vw, 340px);
    max-height: none;
    padding: 20px 20px 40px;
    background: var(--surface);
    border-right: 1px solid var(--line);
    transform: translateX(-102%);
    transition: transform 0.32s var(--ease);
    overflow-y: auto;
  }

  .docs-sidebar.is-open {
    transform: translateX(0);
  }

  .docs-sidebar__close {
    display: inline-flex;
  }

  .docs-sidebar__search {
    display: block;
  }

  .docs-sidebar__search .docs-search {
    display: block;
    width: 100%;
    margin-left: 0;
  }

  .docs-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1150;
    display: block;
    background: rgba(17, 20, 15, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s var(--ease), visibility 0.25s;
  }

  .docs-backdrop.is-open {
    opacity: 1;
    visibility: visible;
  }
}

@media (max-width: 767px) {
  .docs-header__brand img {
    width: 110px;
  }

  .docs-header__actions .btn svg {
    display: none;
  }

  .docs-article {
    max-width: none;
  }

  .docs-article__head {
    margin-bottom: 26px;
    padding-bottom: 20px;
  }

  .doc-content {
    font-size: 0.96rem;
    line-height: 1.85;
  }

  .doc-content .steps {
    grid-template-columns: 1fr;
  }

  .doc-content .release {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .doc-content .release time {
    line-height: 1.6;
  }

  .docs-pager {
    grid-template-columns: 1fr;
    margin-top: 40px;
  }

  .docs-pager a:last-child {
    text-align: left;
  }
}
