/**
 * results.css - AIMAC Agents results content
 *
 * Loads after aimac-tokens.css and aimac-shared.css. Rules are scoped to
 * main, so the shared header and footer keep the parent's styling. The one
 * exception is the labelled footer block at the end of this file.
 * The link, band and note rules are PACE's (pace.css at GAAD-Foundation/pace-site
 * commit 674610a). Use the shared tokens for color; see DESIGN.md.
 */

/* ----- Links in content: the parent's byline link treatment ----- */

main a {
  color: var(--gaad-brand);
  text-decoration: underline;
  text-underline-offset: 2px;
}

main a:hover {
  color: var(--gaad-brand-2);
}

main a:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
  border-radius: 2px;
}

/* ----- Full-width section bands, as on PACE ----- */

main > .band {
  padding: 2.5rem 0;
}

main > .band--first {
  padding-top: 0.75rem;
}

main > .band--gray {
  background-color: var(--hero-bg-end);
  border-top: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
}

/* The footer's dark top border ends the page. */
main > .band--last {
  border-bottom: 0;
}

@media (min-width: 48em) {
  main > .band {
    padding: 3rem 0;
  }

  main > .band--first {
    padding-top: 1.5rem;
  }
}

@media (min-width: 62em) {
  main > .band {
    padding: 4rem 0;
  }

  main > .band--first {
    padding-top: 2rem;
  }
}

/* Long words, selectors and identifiers wrap at narrow widths and enlarged text. */
main {
  overflow-wrap: break-word;
}

/* Results hold tables and screenshots, so they use the parent's wider
   64rem page container. Prose keeps the shared 48rem measure. */
main .section-container--wide {
  max-width: 64rem;
}

/* Keep the label and intro prose at the 48rem measure inside the wider hero. */
main .hero > * {
  max-width: 48rem;
}

main .section-container--wide > p,
main .section-container--wide > ul {
  max-width: 48rem;
}

/* ----- The demonstration label: PACE's scope note, in the accent color ----- */

main .demo-label {
  margin: 0 0 1.25rem;
  padding: 0.75rem 1rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--gaad-fg);
  background: var(--gaad-bg);
  border-left: 4px solid var(--gaad-accent);
}

/* ----- Tables ----- */

/* A wide table scrolls inside its own region, never the page body. */
main .table-scroll {
  max-width: 100%;
  overflow-x: auto;
  margin: 1rem 0 1.5rem;
}

main .table-scroll:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
}

main table {
  border-collapse: collapse;
  background: var(--gaad-bg);
}

main caption {
  text-align: left;
  font-weight: 600;
  color: var(--gaad-heading);
  padding-bottom: 0.5rem;
}

main th,
main td {
  border: 1px solid var(--table-border);
  padding: 0.375rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

main thead th {
  background: var(--gray-100);
}

main td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ----- One section per site ----- */

main .site-result {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--gray-300);
}

main .run-facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.25rem 1rem;
  margin: 1rem 0;
}

main .run-facts dt {
  font-weight: 600;
}

main .run-facts dd {
  margin: 0;
  min-width: 0;
}

main .failed {
  font-weight: 700;
}

main pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--gray-100);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 0.75rem;
}

/* The screenshot and its outlines share one box, so the outlines scale with the image. */
main .shot {
  position: relative;
  max-width: 100%;
  margin: 1rem 0;
}

main .shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--ui-border);
}

main .shot svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Magenta outline with a white halo, so it shows on light and dark pages. */
main .highlight {
  fill: none;
  stroke: #c00080;
  stroke-width: 4;
  paint-order: stroke;
  filter: drop-shadow(0 0 3px var(--white));
}

@media (forced-colors: active) {
  main .highlight {
    stroke: Highlight;
  }
}

main .site-links {
  padding-left: 1.25rem;
}

/* ----- Footer change ahead of the parent, copied from PACE: the footer logo is a link.
   The link is sized to the logo so its focus outline wraps the image. ----- */

.footer-logo a {
  display: inline-block;
}

.footer-logo a:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
}
