/* ---------- Docs layout (About / Showcase / Tutorial) ---------- */
.docs-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  gap: var(--space-5);
  align-items: start;
  padding-top: var(--space-5);
  padding-bottom: var(--space-5);
}

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

.docs-layout--single .docs-content {
  padding-left: 0;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Floating table of contents (About / Showcase / Tutorial) ---------- */
.docs-toc-float {
  display: none;
}

@media (min-width: 1200px) {
  .docs-toc-float {
    display: block;
    position: fixed;
    top: calc(76px + var(--space-4) + var(--space-3));
    left: calc(max(0px, (100vw - 1440px) / 2) + 2rem);
    width: 212px;
    max-height: calc(100vh - 76px - var(--space-4) - var(--space-3) - var(--space-2));
    overflow-y: auto;
  }
}

.docs-toc-float-list {
  position: relative;
  list-style: none;
  margin: 0;
  padding-left: 0.75rem;
  display: flex;
  flex-direction: column;
}

.docs-toc-float-list a {
  display: block;
  padding: 5px 0;
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.01em;
  color: var(--color-text-muted);
  transition: color 0.15s ease;
}

.docs-toc-float-list a:hover {
  color: rgba(26, 26, 26, 0.7);
}

.docs-toc-float-list a.is-active {
  color: #1a1a1a;
  font-weight: 500;
}

.docs-toc-float-list a.is-active:hover {
  color: #1a1a1a;
}

.docs-toc-float-list a.docs-toc-sub {
  padding-left: 14px;
}

.docs-content {
  min-width: 0;
  padding-left: var(--space-3);
}

.docs-content h1 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 600;
  scroll-margin-top: calc(76px + var(--space-3));
}

.docs-content h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-top: 4rem;
  scroll-margin-top: calc(76px + var(--space-3));
}

.docs-content h2:first-of-type {
  margin-top: 2rem;
}

.docs-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 2.5rem;
  scroll-margin-top: calc(76px + var(--space-3));
}

.docs-content h4 {
  font-size: 1.02rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-top: 2rem;
}

.docs-content h2 + h3 {
  margin-top: 1.5rem;
}

.docs-content p {
  max-width: 640px;
  margin-top: var(--space-3);
  font-size: 1.05rem;
  font-weight: 300;
  line-height: 1.8;
  letter-spacing: 0.01em;
  color: var(--color-text);
}

.docs-content h2 + p,
.docs-content h3 + p {
  margin-top: var(--space-2);
}

.docs-content ul {
  max-width: 640px;
  margin: 1.25rem 0 0;
  padding-left: 0;
  list-style: none;
}

.docs-content li {
  position: relative;
  padding-left: 1.4rem;
  font-size: 1.02rem;
  font-weight: 300;
  line-height: 1.8;
  color: var(--color-text);
}

.docs-content li::before {
  content: '\2022';
  position: absolute;
  left: 0.1rem;
  top: 0.15em;
  font-size: 1.4em;
  line-height: 1;
  color: #cccccc;
}

.docs-content li + li {
  margin-top: 0.4rem;
}

.docs-content li strong {
  font-weight: 500;
  color: var(--color-text);
}

.docs-content p strong {
  font-weight: 500;
}

.docs-content p code,
.docs-content li code,
.docs-content blockquote code {
  background: rgba(0, 0, 0, 0.04);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 400;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
}

.docs-content figure {
  max-width: 640px;
  margin: var(--space-2) 0 0;
}

.docs-content ul + figure {
  margin-top: 1.25rem;
}

.docs-content blockquote {
  max-width: 640px;
  margin: var(--space-3) 0 0;
  padding: 0 0 0 1rem;
  border-left: 4px solid #cdcdcd;
}

.docs-content blockquote p {
  margin-top: 0;
  color: var(--color-text-muted);
}

.docs-content p a,
.docs-content li a,
.docs-content blockquote a {
  color: var(--color-link);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}

.docs-content p a:hover,
.docs-content li a:hover,
.docs-content blockquote a:hover {
  color: #aaaaaa;
}

.docs-content figure img,
.docs-content figure video {
  width: 100%;
  display: block;
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.hero-media {
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.media-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--color-surface);
  border: 1px dashed var(--color-border);
  border-radius: 10px;
}

.docs-content figcaption {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.45;
  color: var(--color-text-muted);
}

.docs-content figcaption a {
  color: var(--color-link);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}

.docs-content figcaption a:hover {
  color: #aaaaaa;
}

.docs-content figcaption.caption-text {
  font-size: 0.9rem;
  font-weight: 300;
  line-height: 1.8;
  color: var(--color-text);
}

@media (max-width: 960px) {
  .docs-layout {
    display: block;
    padding-top: var(--space-4);
    padding-bottom: var(--space-4);
  }

  .docs-content {
    padding-left: 0;
  }
}
