/*
 * Schema directory pages — `/{locale}/schemas/` (index) and
 * `/{locale}/schemas/[name]` (detail).
 *
 * Inherits the design-token surface from tokens.css. The detail page
 * reuses `.response-table` from markdoc.css for the property listing
 * so the schema table looks identical to the per-operation response
 * tables on reference pages — single visual language for "schema
 * properties".
 */

.schemas-index {
  max-width: var(--content-max-width-prose, 70ch);
}

.schemas-index h1 {
  margin-top: 0;
}

.schemas-index .lead {
  color: var(--color-text-muted);
  font-size: var(--text-base);
}

.schemas-filter {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: var(--space-6) 0 var(--space-4);
}

.schemas-filter-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-weight: var(--weight-medium);
}

.schemas-filter input[type='search'] {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  background: var(--color-bg-subtle);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font: inherit;
  font-size: var(--text-base);
  width: 100%;
  max-width: 28rem;
}

.schemas-filter input[type='search']:focus-visible {
  outline: 2px solid var(--color-link);
  outline-offset: 2px;
  border-color: var(--color-border-strong);
}

.schemas-no-match {
  color: var(--color-text-muted);
  font-style: italic;
}

.schemas-empty {
  color: var(--color-text-muted);
  font-style: italic;
}

.schemas-group {
  margin-top: var(--space-6);
}

.schemas-group h2 {
  font-size: var(--text-base);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.schemas-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.schemas-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.schemas-item a {
  text-decoration: none;
  color: var(--color-text);
  /* Stack the name over its description (name top-left, description
     below it and left-aligned) instead of laying them out on one line. */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
  flex: 1 1 auto;
}

.schemas-item a:hover .schemas-name,
.schemas-item a:focus-visible .schemas-name {
  color: var(--color-link);
  text-decoration: underline;
}

.schemas-name {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text);
}

.schemas-desc {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.schemas-badge {
  padding: 0 var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
}

.schemas-badge-admin {
  border-color: var(--color-danger, #b91c1c);
  color: var(--color-danger, #b91c1c);
}

.schemas-badge-system {
  border-color: var(--color-warning, #b45309);
  color: var(--color-warning, #b45309);
}

/* ---------- Per-schema detail page ---------- */

.schema-detail {
  max-width: var(--content-max-width);
}

.schema-detail-name {
  font-family: var(--font-mono);
  font-size: var(--text-2xl, 1.5rem);
}

.schema-detail-desc {
  color: var(--color-text-muted);
}

.schema-detail-section {
  margin-top: var(--space-8);
}

.schema-detail-section h2 {
  font-size: var(--text-lg, 1.125rem);
  margin-bottom: var(--space-3);
}

.schema-variant-block {
  margin-top: var(--space-4);
}

.schema-variant-block h3 {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.schema-variant-list,
.schema-used-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.schema-variant-list code,
.schema-used-list code {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

.schema-variant-list a,
.schema-used-list a {
  color: var(--color-link);
  text-decoration: none;
}

.schema-variant-list a:hover,
.schema-used-list a:hover {
  text-decoration: underline;
}

.schema-detail-empty {
  color: var(--color-text-muted);
  font-style: italic;
}
