/**
 * pace.css - PACE research 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.
 * Use the shared tokens for color; see DESIGN.md.
 */

/* ----- Links in research 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;
}

/* Keep the button label white when the link hover color above applies. */
main .btn-primary:hover {
  color: var(--white);
}

/* ----- Full-width section bands.
   The parent breaks sections out of a container with negative margins.
   Here each band is a direct child of main, so no breakout is needed. ----- */

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 and identifiers wrap at narrow widths and enlarged text. */
main {
  overflow-wrap: break-word;
}

/* ----- Shared text patterns ----- */

main .section-lead {
  margin: 0 0 1rem;
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--hero-text-emphasis);
}

main .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.25rem 0;
}

main .actions .btn-primary {
  flex: 0 1 auto;
  border: 1px solid transparent; /* gives the button an edge in forced colors */
}

/* Button labels may wrap at narrow widths and large text. */
main .actions .btn-secondary {
  white-space: normal;
}

/* ----- The study ----- */

main .study-design {
  margin: 1.5rem 0;
  padding: 1.25rem;
  background: var(--hero-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 0.5rem;
}

main .study-design figcaption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  font-weight: 600;
  color: var(--gaad-heading);
}

main .study-design__edition {
  font-weight: 400;
  font-size: 0.875rem;
  color: var(--gaad-muted);
}

main .study-design__question {
  margin: 0.25rem 0 1rem;
  color: var(--hero-text);
}

main .study-design__factors {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(7rem, 100%), 1fr));
  gap: 1rem;
  margin: 0;
  padding: 1rem 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

main .study-design__factors dt {
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--gaad-muted);
}

main .study-design__factors dd {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--gaad-brand);
}

main .study-design__total {
  margin: 1rem 0 0;
}

main .study-design__total strong {
  font-size: 1.75rem;
  line-height: 1.2;
  color: var(--gaad-brand);
}

main .study-design__foot {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: var(--gaad-muted);
}

main .disclosures {
  margin-top: 1.5rem;
  border-bottom: 1px solid var(--gaad-border);
}

main .disclosures details {
  border-top: 1px solid var(--gaad-border);
}

main .disclosures summary {
  padding: 0.75rem 0.25rem;
  font-weight: 600;
  color: var(--gaad-brand);
  cursor: pointer;
}

main .disclosures summary:focus-visible {
  outline: var(--focus-ring);
  outline-offset: calc(-1 * var(--focus-offset));
}

main .disclosures details p {
  margin: 0 0.25rem 0.75rem;
}

/* ----- Measurement: the parent's comparison columns on a gray band ----- */

main .comparison-col {
  min-width: 0; /* let the grid column shrink below its longest word */
  background: var(--gaad-bg);
}

main .comparison-col h3 {
  margin-top: 0;
}

/* ----- Findings ----- */

main .findings {
  margin: 1.5rem 0;
  padding-left: 2rem;
}

main .findings li {
  margin-bottom: 1.5rem;
  padding-left: 0.25rem;
}

/* Match the marker to the h3 it numbers. */
main .findings li::marker {
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--gaad-heading);
}

main .findings h3 {
  margin: 0 0 0.5rem;
}

main .findings p {
  margin: 0;
}

main .scope-note {
  margin-top: 2rem;
  padding: 1.25rem;
  background: var(--gaad-surface);
  border-left: 4px solid var(--gaad-brand);
}

main .scope-note h3 {
  margin-top: 0;
}

main .scope-note p:last-child {
  margin-bottom: 0;
}

/* ----- Research resources ----- */

main .resources {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

main .resources li {
  padding: 1.25rem 0;
  border-top: 1px solid var(--gray-300);
}

main .resources li:last-child {
  padding-bottom: 0;
}

main .resources h3 {
  margin: 0;
}

main .resources__type {
  margin: 0.25rem 0 0.5rem;
  font-size: 0.875rem;
  color: var(--gaad-muted);
}

main .resources p:last-child {
  margin: 0;
}

/* ----- The researchers ----- */

main .authors {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem 2rem;
  margin: 1.5rem 0 1rem;
  padding: 0;
  list-style: none;
}

@media (min-width: 48em) {
  main .authors {
    grid-template-columns: 1fr 1fr;
  }
}

main .authors a {
  font-weight: 600;
}

main .authors span {
  display: block;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--gaad-muted);
}

main .citation-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

main .citation-links li {
  min-width: 0;
}

/* ----- Footer change ahead of the parent: the footer logo is a link.
   The link is sized to the logo so its focus outline wraps the image.
   Move this rule to the shared styles when AIMAC adopts the footer,
   then delete it here. See DESIGN.md. ----- */

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

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