/*
  The documentation, on top of support.css: the index cards, search, the collapsible section list,
  breadcrumbs, screenshots, version badges and the previous/next pager.

  Like the rest of the site it names no colour, size scale or font: every value is a role token.
*/

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

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

.docs-search { position: relative; max-width: 40rem; margin: 0 0 var(--space-24); }

.docs-search input {
  width: 100%;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-8);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.docs-search input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.docs-results {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  margin-top: var(--space-4);
  max-height: 24rem;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-8);
  background: var(--bg);
  box-shadow: 0 6px 24px rgb(0 0 0 / 0.18);
}

.docs-results[hidden] { display: none; }

.docs-results a {
  display: block;
  padding: var(--space-8) var(--space-12);
  border-bottom: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
}

.docs-results a:last-child { border-bottom: 0; }
.docs-results a[aria-selected="true"],
.docs-results a:hover { background: var(--accent-dim); }
.docs-results .title { display: block; font-weight: 600; color: var(--text-strong); }
.docs-results .where { color: var(--text-dim); font-size: 0.8rem; }
.docs-results .snippet { display: block; color: var(--text-dim); font-size: 0.88rem; }
.docs-results mark { background: var(--accent-dim); color: inherit; border-radius: 2px; }
.docs-results .none { padding: var(--space-12); color: var(--text-dim); }

/* ---------- index ---------- */

.docs-home { max-width: 1100px; margin: 0 auto; padding-bottom: var(--space-48); }

.docs-sections {
  display: grid;
  gap: var(--space-24);
  grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
}

.docs-card {
  padding: var(--space-16) var(--space-20);
  border: 1px solid var(--border);
  border-radius: var(--radius-12);
}

.docs-card h2 { margin: 0 0 var(--space-8); font-size: 1.1rem; }
.docs-card .doc-list li { padding: var(--space-8) 0; }
.docs-card .doc-list li:last-child { border-bottom: 0; }
.docs-card .doc-summary { font-size: 0.88rem; }

.docs-az { margin-top: var(--space-48); }
.docs-az ul { columns: 18rem; column-gap: var(--space-32); list-style: none; margin: 0; padding: 0; }
.docs-az li { break-inside: avoid; padding: 0.2rem 0; }
.docs-az .doc-summary { display: inline; margin-left: var(--space-4); font-size: 0.82rem; }

/* ---------- a topic ---------- */

.docs-nav details { margin: 0 0 var(--space-4); }
.docs-nav summary {
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}
.docs-nav details[open] summary { color: var(--text-strong); }

.crumbs { font-size: 0.85rem; color: var(--text-dim); margin-bottom: var(--space-12); }
.crumbs a { color: var(--text-dim); }

.doc .docs-search { margin-bottom: var(--space-16); }

.doc-meta { display: flex; flex-wrap: wrap; gap: var(--space-8); align-items: center; margin: var(--space-8) 0 0; font-size: 0.85rem; color: var(--text-dim); }

.badge {
  padding: 0.1rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-4);
  background: var(--accent-dim);
  color: var(--text-strong);
}

/* The screenshot: as wide as the text, framed, never wider than the screen. */
.doc-body figure { margin: var(--space-24) 0; }
.doc-body figure img { display: block; max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: var(--radius-8); }
.doc-body figcaption { margin-top: var(--space-8); color: var(--text-dim); font-size: 0.88rem; }

.doc-related { margin-top: var(--space-32); padding-top: var(--space-16); border-top: 1px solid var(--border); }
.doc-related h2 { font-size: 0.95rem; margin: 0 0 var(--space-8); }
.doc-related ul { margin: 0; padding-left: 1.2rem; }

.doc-pager { display: flex; justify-content: space-between; gap: var(--space-16); margin-top: var(--space-32); }
.doc-pager a {
  display: block;
  max-width: 48%;
  padding: var(--space-12) var(--space-16);
  border: 1px solid var(--border);
  border-radius: var(--radius-8);
  text-decoration: none;
}
.doc-pager a span { display: block; color: var(--text-dim); font-size: 0.8rem; }
.doc-pager .next { margin-left: auto; text-align: right; }
.doc-pager a:hover { border-color: var(--accent); }
