/* Quality gate — info icon + hover popover with full config/result JSON. */

.qg-info {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 0;
}

.qg-info__trigger {
  /* Hit target ≥ icon; do not size to --indicator-size (status dots). */
  width: 1.125rem;
  height: 1.125rem;
  color: var(--color-text-muted);
}

.qg-info__trigger .icon {
  --icon-size-md: 1rem;
}

.qg-info__trigger:hover,
.qg-info:focus-within .qg-info__trigger,
.qg-info--open .qg-info__trigger {
  position: relative;
  z-index: 101;
  color: var(--color-text);
}

/* Pinned popover — toggle stays visibly pressed until second click. */
.qg-info--pinned .qg-info__trigger,
.qg-info__trigger[aria-expanded="true"] {
  position: relative;
  z-index: 101;
  color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 14%, var(--color-surface-soft));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-primary) 45%, var(--color-border));
}

.qg-info--pinned .qg-info__trigger:hover,
.qg-info__trigger[aria-expanded="true"]:hover {
  background: color-mix(in srgb, var(--color-primary) 20%, var(--color-surface-soft));
}

.qg-info__popover {
  position: fixed;
  z-index: 100;
  width: min(28rem, calc(100vw - 4rem));
  max-height: calc(100vh - 4rem);
  height: auto;
  overflow-y: auto;
  scrollbar-width: thin;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--color-text) 16%, transparent);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity var(--duration-fast) var(--ease-out),
    visibility var(--duration-fast) var(--ease-out);
}

.qg-info--open .qg-info__popover {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.qg-info__paths {
  margin: 0 0 var(--space-2);
  padding: 0;
  list-style: none;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: var(--space-2);
}

.qg-info__path {
  display: flex;
  gap: var(--space-2);
  align-items: baseline;
}

.qg-info__path + .qg-info__path {
  margin-top: var(--space-1);
}

.qg-info__path-label {
  flex: 0 0 3.25rem;
  color: var(--color-text-muted);
}

.qg-info__path-label::after {
  content: ":";
}

.qg-info__path-value {
  min-width: 0;
  color: var(--color-text);
  word-break: break-all;
}

.qg-info__path-link {
  min-width: 0;
  font-family: inherit;
  font-size: inherit;
  word-break: break-all;
  /* Canon: light mono text + underline (not blue URL chrome). */
  color: var(--color-text);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--color-text) 55%, transparent);
  text-underline-offset: 2px;
}

.qg-info__path-link:hover {
  text-decoration-color: var(--color-text);
}

.qg-info__code.ch-code {
  margin: 0;
  padding: var(--space-2);
  font-size: 0.72rem;
  line-height: 1.45;
  border-radius: var(--radius-sm);
}

.qg-info__code:not(.ch-code) {
  margin: 0;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.72rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--color-text);
}

/* Light report / standalone — JSON block follows surface, not terminal-dark default */
html.theme-light .qg-info__popover.ch-theme--vscode .qg-info__code.ch-code,
html[data-theme="light"] .qg-info__popover.ch-theme--vscode .qg-info__code.ch-code {
  --ch-code-bg: var(--color-surface-soft);
  --ch-code-fg: var(--color-text);
  background: var(--ch-code-bg);
  color: var(--ch-code-fg);
}

html.theme-light .qg-info__popover.ch-theme--vscode .ch-tok-key,
html[data-theme="light"] .qg-info__popover.ch-theme--vscode .ch-tok-key {
  color: #0451a5;
}

html.theme-light .qg-info__popover.ch-theme--vscode .ch-tok-str,
html[data-theme="light"] .qg-info__popover.ch-theme--vscode .ch-tok-str {
  color: #a31515;
}

html.theme-light .qg-info__popover.ch-theme--vscode .ch-tok-num,
html[data-theme="light"] .qg-info__popover.ch-theme--vscode .ch-tok-num {
  color: #098658;
}

html.theme-light .qg-info__popover.ch-theme--vscode .ch-tok-bool,
html[data-theme="light"] .qg-info__popover.ch-theme--vscode .ch-tok-bool,
html.theme-light .qg-info__popover.ch-theme--vscode .ch-tok-null,
html[data-theme="light"] .qg-info__popover.ch-theme--vscode .ch-tok-null {
  color: #0000ff;
}

html.theme-light .qg-info__popover.ch-theme--vscode .ch-tok-punct,
html[data-theme="light"] .qg-info__popover.ch-theme--vscode .ch-tok-punct {
  color: rgba(57, 58, 52, 0.55);
}

html.theme-light .qg-info__popover.ch-theme--vscode .ch-tok-comment,
html[data-theme="light"] .qg-info__popover.ch-theme--vscode .ch-tok-comment {
  color: #008000;
}

html.theme-light .qg-info__popover.ch-theme--vscode .ch-tok-cmd,
html[data-theme="light"] .qg-info__popover.ch-theme--vscode .ch-tok-cmd {
  color: #795e26;
}
