/*
 * Qaz.Vision public AVDS 5 semantic adapter.
 * Source: @avds/ui-kit@5.0.0, ebd4b2b82e5648e859cdda86e39873f3a6e1281b.
 * This file deliberately contains roles and primitives only; page composition
 * belongs in qazvision-public.css.
 */

:root {
  --qv5-canvas: hsl(var(--background));
  --qv5-surface: hsl(var(--card));
  --qv5-surface-muted: hsl(var(--muted));
  --qv5-ink: hsl(var(--foreground));
  --qv5-ink-muted: hsl(var(--muted-foreground));
  --qv5-link: hsl(var(--primary));
  --qv5-link-visited: hsl(var(--accent));
  --qv5-rule: hsl(var(--border));
  --qv5-rule-strong: hsl(var(--input));
  --qv5-accent: hsl(var(--accent));
  --qv5-accent-ink: hsl(var(--accent-foreground));
  --qv5-danger: hsl(var(--destructive));
  --qv5-danger-ink: hsl(var(--destructive-foreground));
  --qv5-focus: hsl(var(--ring));
  --qv5-radius: var(--radius);
  --qv5-border-width: 1px;
  --qv5-content-measure: 76rem;
  --qv5-reading-measure: 44rem;
  --qv5-gap-5: calc(var(--spacing) * 5);
  --qv5-gap-1: calc(var(--spacing) * 1);
  --qv5-gap-2: calc(var(--spacing) * 2);
  --qv5-gap-3: calc(var(--spacing) * 3);
  --qv5-gap-4: calc(var(--spacing) * 4);
  --qv5-gap-6: calc(var(--spacing) * 6);
  --qv5-gap-8: calc(var(--spacing) * 8);
  --qv5-shadow: 0 0 0 0 transparent;
  --small-font-size: 0.75rem;
  --qv5-font-size-sm: 0.8125rem;
  --avds-color-success: hsl(var(--status-success));
  --avds-color-warning: hsl(var(--status-warning));
  --avds-color-text-muted: hsl(var(--muted-foreground));
  --body-line-height: var(--avds-type-body-line-height);
  --body-weight: 400;
  --heading-line-height: var(--avds-type-display-line-height);
  --heading-weight: 600;
  --heading-letter-spacing: var(--avds-type-display-tracking);
  --label-weight: 700;
  --label-line-height: var(--avds-type-ui-line-height);
  --label-letter-spacing: var(--avds-type-micro-tracking);
}

html {
  background: var(--qv5-canvas);
  color: var(--qv5-ink);
  font-family: var(--font-sans);
  text-size-adjust: 100%;
}

body[data-avds-typography="editorial-source"] {
  background: var(--qv5-canvas);
  color: var(--qv5-ink);
  font-family: var(--font-sans);
  line-height: var(--body-line-height);
}

body[data-avds-typography="editorial-source"] :where(h1, h2, h3, h4, h5, h6, .qv-display, .qv-document-title, .quote-text) {
  font-family: var(--font-serif);
  font-weight: var(--heading-weight);
  letter-spacing: var(--heading-letter-spacing);
  line-height: var(--heading-line-height);
}

:where(a) {
  color: var(--qv5-link);
  text-decoration-color: color-mix(in srgb, currentColor 42%, transparent);
  text-underline-offset: 0.15em;
  text-decoration-thickness: var(--qv5-border-width);
}

:where(a:visited) {
  color: var(--qv5-link-visited);
}

:where(a:hover) {
  color: var(--qv5-ink);
  text-decoration-color: currentColor;
}

:where(button, input, select, textarea) {
  color: inherit;
  font: inherit;
}

:where(button, [role="button"], input, select, textarea, a):focus-visible {
  outline: calc(var(--qv5-border-width) * 2) solid var(--qv5-focus);
  outline-offset: calc(var(--qv5-border-width) * 2);
}

.qv5-skip-link {
  background: var(--qv5-ink);
  color: var(--qv5-canvas);
  inset-block-start: var(--qv5-gap-2);
  inset-inline-start: var(--qv5-gap-2);
  padding: var(--qv5-gap-2) var(--qv5-gap-3);
  position: fixed;
  transform: translateY(-160%);
  z-index: 100;
}

.qv5-skip-link:focus {
  transform: translateY(0);
}

.qv5-surface,
.avds-panel,
.avds-callout,
.avds-empty,
.search-empty,
.assistant-panel,
.status-card,
.publisher-card,
.quote-embed-card {
  background: var(--qv5-surface);
}

.qv5-rule-top {
  border-block-start: var(--qv5-border-width) solid var(--qv5-rule);
}

.qv5-rule-bottom {
  border-block-end: var(--qv5-border-width) solid var(--qv5-rule);
}

.qv5-eyebrow,
.eyebrow,
.section-kicker,
.document-kicker,
.quote-meta-label,
.source-label,
.meta-label {
  color: var(--qv5-ink-muted);
  font-family: var(--font-sans);
  font-size: var(--small-font-size);
  font-weight: var(--label-weight);
  letter-spacing: var(--label-letter-spacing);
  line-height: var(--label-line-height);
  text-transform: uppercase;
}

.qv5-button,
.avds-button,
.avds-btn,
button:not(.language-picker-button):not(.site-menu-button):not(.search-toggle) {
  align-items: center;
  background: var(--qv5-ink);
  border: var(--qv5-border-width) solid var(--qv5-ink);
  border-radius: var(--qv5-radius);
  color: var(--qv5-canvas);
  cursor: pointer;
  display: inline-flex;
  gap: var(--qv5-gap-1);
  justify-content: center;
  min-block-size: calc(var(--spacing) * 11);
  padding: var(--qv5-gap-2) var(--qv5-gap-3);
  text-decoration: none;
}

.qv5-button:hover,
.avds-button:hover,
.avds-btn:hover,
button:not(.language-picker-button):not(.site-menu-button):not(.search-toggle):hover {
  background: var(--qv5-link);
  border-color: var(--qv5-link);
  color: var(--qv5-canvas);
}

.qv5-button--quiet,
.avds-button--quiet,
.avds-btn--secondary,
.button-secondary,
.button-quiet {
  background: transparent;
  border-color: var(--qv5-rule-strong);
  color: var(--qv5-ink);
}

.qv5-button--quiet:hover,
.avds-button--quiet:hover,
.avds-btn--secondary:hover,
.button-secondary:hover,
.button-quiet:hover {
  background: var(--qv5-surface-muted);
  border-color: var(--qv5-ink);
  color: var(--qv5-ink);
}

.qv5-input,
.avds-input,
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  background: var(--qv5-surface);
  border: var(--qv5-border-width) solid var(--qv5-rule-strong);
  border-radius: var(--qv5-radius);
  min-block-size: calc(var(--spacing) * 11);
  padding: var(--qv5-gap-2);
}

.qv5-input:focus,
.avds-input:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: var(--qv5-focus);
  outline: none;
}

/* Border ledger: a repeated row owns its sole separator. Cells never own it. */
.qv-border-ledger,
.qv-main table,
.document-facts,
.quote-facts,
.source-facts {
  border-collapse: collapse;
  border-spacing: 0;
  inline-size: 100%;
}

.qv-border-ledger :where(th, td),
.qv-main table :where(th, td),
.document-facts :where(th, td),
.quote-facts :where(th, td),
.source-facts :where(th, td) {
  border: 0;
  padding: var(--qv5-gap-2) var(--qv5-gap-3);
  text-align: start;
  vertical-align: top;
}

.qv-border-ledger thead tr,
.qv-main table thead tr,
.document-facts thead tr,
.quote-facts thead tr,
.source-facts thead tr {
  border-block: var(--qv5-border-width) solid var(--qv5-rule-strong);
}

.qv-border-ledger tbody tr,
.qv-main table tbody tr,
.document-facts tbody tr,
.quote-facts tbody tr,
.source-facts tbody tr {
  border-block-end: var(--qv5-border-width) solid var(--qv5-rule);
}

.qv-border-ledger tbody tr:last-child,
.qv-main table tbody tr:last-child,
.document-facts tbody tr:last-child,
.quote-facts tbody tr:last-child,
.source-facts tbody tr:last-child {
  border-block-end-color: var(--qv5-rule-strong);
}

.qv-table-scroll {
  -webkit-overflow-scrolling: touch;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.qv-table-scroll::before {
  color: var(--qv5-ink-muted);
  content: attr(data-scroll-label);
  display: block;
  font-size: var(--small-font-size);
  margin-block-end: var(--qv5-gap-2);
}

@media (max-width: 44rem) {
  .qv-table-scroll > table,
  .avds-table-shell > table {
    min-inline-size: 38rem;
  }

  .qv-table-stack[data-compact="list"] :where(thead) {
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
  }

  .qv-table-stack[data-compact="list"] :where(tbody, tr, th, td) {
    display: block;
  }

  .qv-table-stack[data-compact="list"] td::before {
    color: var(--qv5-ink-muted);
    content: attr(data-label);
    display: block;
    font-size: var(--small-font-size);
    font-weight: var(--label-weight);
    letter-spacing: var(--label-letter-spacing);
    text-transform: uppercase;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
