/* =========================
   Xpather – DOCS PAGES
   Article typography & layout
   ========================= */

/* Header: breadcrumb + theme toggle in one row */
.docs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) 0;
}

/* Breadcrumb nav */
.docs-nav {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.docs-nav a {
  color: var(--text-muted);
  text-decoration: none;
}

.docs-nav a:hover {
  color: var(--text-main);
}

.docs-nav__home {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
}

.docs-nav__sep {
  color: var(--text-subtle);
}

/* Article */
.docs-article {
  max-width: 720px;
  margin: 0 auto;
  padding-bottom: var(--space-6);
}

.docs-article h1 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: var(--fw-bold);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-3);
}

.docs-article .docs-lead {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0 0 var(--space-6);
}

.docs-article h2 {
  font-size: var(--fs-xl);
  font-weight: var(--fw-semibold);
  line-height: 1.25;
  margin: var(--space-6) 0 var(--space-3);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
}

.docs-article h2:first-of-type {
  border-top: none;
  padding-top: 0;
}

.docs-article p {
  font-size: var(--fs-md);
  line-height: 1.7;
  margin: 0 0 var(--space-4);
}

.docs-article ul,
.docs-article ol {
  margin: 0 0 var(--space-4);
  padding-left: 1.5em;
}

.docs-article li {
  font-size: var(--fs-md);
  line-height: 1.7;
  margin-bottom: var(--space-2);
}

.docs-article li strong {
  font-weight: var(--fw-semibold);
}

/* Inline code */
.docs-article code {
  font-family: ui-monospace, "Cascadia Code", "Fira Code", monospace;
  font-size: 0.88em;
  background: var(--bg-soft);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 0.15em 0.4em;
  word-break: break-word;
}

/* Tables — scrollable on mobile */
.docs-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 0 var(--space-4);
}

.docs-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 var(--space-4);
  font-size: var(--fs-sm);
  min-width: 480px;
}

.docs-article th,
.docs-article td {
  text-align: left;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}

.docs-article th {
  font-weight: var(--fw-semibold);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Links */
.docs-article a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.docs-article a:hover {
  color: var(--primary-hover);
}

/* Horizontal rule */
.docs-article hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: var(--space-6) 0;
}

/* Related links at bottom */
.docs-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.docs-links a {
  text-decoration: none;
}

/* =========================
   Mobile
   ========================= */
@media (max-width: 480px) {
  .docs-article h1 {
    font-size: 1.5rem;
  }

  .docs-article table {
    font-size: var(--fs-xs);
  }

  .docs-article th,
  .docs-article td {
    padding: var(--space-1) var(--space-2);
  }
}
