/* The Support page (support.qmd), its Welcome page line, and the line at the
   end of each chapter (filters/support-note.lua).
   Readers reach the page from the footer, the Resources menu, the Welcome
   page, and the end of each chapter. It is listed in the book so that Quarto
   renders it; the first rule keeps it out of the sidebar and out of the
   next-page link on the page before it.
   The page takes its accent from _variables.yml and uses it for the Give
   button and the chosen amount. v5 (Bryan approved 14 November 2026): each
   book uses a deeper shade of its own accent, chosen so white text passes
   WCAG AA (Physician #0b7c80 5.0:1, Public Health #2563eb 5.2:1, Biosecurity
   #7c611c 5.9:1, Life Sciences #15803d 5.0:1); the page is set flush left
   like every other page; and the editorial-independence note sits under the
   introduction, before the amounts. Amounts, the frequency toggle and the
   checkout links are unchanged. Identical in all four handbooks. Stylesheets
   are cached as immutable, so change this by adding a -v6 file, not by
   editing it. */

.sidebar-item:has(> .sidebar-item-container > a[href$="support.html"]),
.nav-page-next:has(> a[href$="support.html"]) {
  display: none;
}

/* The page carries its own title, so Quarto's title block is hidden here. */
body:has(.support-page) #title-block-header {
  display: none;
}

.support-page {
  --support-accent: #2761e3;
  --support-ink: #1a2332;
  --support-text: #4a5565;
  --support-muted: #6b7280;
  --support-line: #dfe3e8;
  --support-face: #ffffff;
  --support-track: #f2f4f6;
  --support-tint: #eef3fd;
  --support-mark: var(--support-ink);
  max-width: 34rem;
  margin: 2.25rem 0 4rem;
  text-align: left;
}

.quarto-dark .support-page,
[data-bs-theme="dark"] .support-page {
  --support-ink: #eef1f5;
  --support-text: #c5ccd6;
  --support-muted: #9aa4b1;
  --support-line: #3a3f47;
  --support-face: #22262c;
  --support-track: #1b1e23;
  --support-tint: #262f3e;
}

@supports (color: color-mix(in srgb, red 50%, white)) {
  .support-page {
    --support-tint: color-mix(in srgb, var(--support-accent) 8%, #ffffff);
  }

  .quarto-dark .support-page,
  [data-bs-theme="dark"] .support-page {
    --support-tint: color-mix(in srgb, var(--support-accent) 22%, #22262c);
  }
}

.support-page .support-title {
  margin: 0 0 1rem;
  border: 0;
  color: var(--support-ink);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
}

.support-lead {
  margin: 0 0 0.9rem;
  color: var(--support-text);
  font-size: 1.08rem;
  line-height: 1.65;
}

/* One line under the lead that points to the Changelog. */
.support-record {
  margin: 0 0 2.25rem;
  color: var(--support-muted);
  font-size: 0.95rem;
}

.support-record a {
  color: var(--support-accent);
  text-underline-offset: 0.18em;
}

.quarto-dark .support-record a,
[data-bs-theme="dark"] .support-record a {
  color: var(--support-ink);
}

.support-options {
  text-align: left;
}

.support-panel + .support-panel {
  margin-top: 1.5rem;
}

.support-panel[hidden] {
  display: none;
}

.support-panel-label {
  margin: 0 0 0.6rem;
  color: var(--support-muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.support-amounts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

#support-monthly .support-amounts {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.support-page .support-amount {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0.4rem;
  border: 1px solid var(--support-line);
  border-radius: 8px;
  background-color: var(--support-face);
  color: var(--support-ink);
  font-size: 1.08rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}

.support-page .support-amount:hover {
  border-color: var(--support-accent);
  color: var(--support-ink);
  text-decoration: none;
}

.support-page .support-amount[aria-checked="true"] {
  border: 2px solid var(--support-accent);
  background-color: var(--support-tint);
}

/* The script turns the two panels into a choice: frequency, then amount,
   then one Give button. Without it, each amount is its own checkout link. */
.support-options.is-enhanced .support-panel + .support-panel {
  margin-top: 0;
}

.support-frequency {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 1rem;
  padding: 4px;
  border-radius: 10px;
  background-color: var(--support-track);
}

.support-frequency button {
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--support-muted);
  font: inherit;
  font-size: 0.97rem;
  font-weight: 500;
  cursor: pointer;
}

.support-frequency button[aria-checked="true"] {
  background-color: var(--support-face);
  color: var(--support-ink);
  font-weight: 650;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.12);
}

.support-page .support-give {
  display: block;
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  background-color: var(--support-accent);
  color: #ffffff;
  font-size: 1.08rem;
  font-weight: 650;
  text-align: center;
  text-decoration: none;
}

.support-page .support-give[hidden] {
  display: none;
}

.support-page .support-give:hover {
  color: #ffffff;
  filter: brightness(0.94);
}

.support-page .support-amount:focus-visible,
.support-frequency button:focus-visible,
.support-page .support-give:focus-visible,
.support-fine a:focus-visible {
  outline: 3px solid var(--support-mark);
  outline-offset: 2px;
}

.support-fine {
  margin: 0.85rem 0 0;
  color: var(--support-muted);
  font-size: 0.85rem;
  text-align: left;
}

.support-fine svg {
  margin-right: 0.3rem;
  vertical-align: -2px;
}

.support-fine a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

@media (max-width: 575.98px) {
  .support-page {
    margin-top: 1.5rem;
  }

  .support-page .support-title {
    font-size: 1.65rem;
  }

  .support-amounts {
    gap: 0.45rem;
  }

  .support-page .support-amount {
    font-size: 1rem;
  }
}

/* One plain line at the bottom of the Welcome page, under the license note. */
.home-support {
  margin: 0.6rem 0 0.5rem;
  color: #5b6b7f;
}

.quarto-dark .home-support,
[data-bs-theme="dark"] .home-support {
  color: #9aa7b6;
}

/* One plain line at the end of each chapter. It sits under a chapter's
   closing italic line when there is one, and is left out of print. */
.support-note {
  margin: 2.5rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid #e3e6ea;
  color: #5b6b7f;
  font-size: 0.95rem;
  line-height: 1.6;
}

.support-note.support-note-closing {
  margin-top: -0.4rem;
  padding-top: 0;
  border-top: 0;
}

.support-note p {
  margin: 0;
  color: inherit;
}

.support-note a {
  font-weight: 600;
  text-underline-offset: 0.18em;
}

.quarto-dark .support-note,
[data-bs-theme="dark"] .support-note {
  border-color: #3a3f47;
  color: #9aa7b6;
}

@media print {
  .support-note {
    display: none;
  }
}

/* Support page: below the amounts, two boxed cards (Other ways to support,
   For institutions). */
.support-more {
  display: grid;
  gap: 1rem;
  margin: 2.75rem 0 0;
  text-align: left;
}

.support-page .support-box {
  padding: 1.15rem 1.35rem 1.2rem;
  border: 1px solid var(--support-line);
  border-radius: 10px;
  background-color: var(--support-face);
  text-align: left;
}

/* The ID selector outranks Quarto's first-section heading margin
   (#quarto-content section:first-of-type h2:first-of-type). */
.support-page .support-box h2,
#quarto-content .support-page .support-more section.support-box > h2 {
  margin: 0 0 0.55rem;
  padding: 0;
  border: 0;
  color: var(--support-ink);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
  text-align: left;
}

.support-page .support-box p,
.support-page .support-box li {
  margin: 0;
  color: var(--support-text);
  font-size: 0.98rem;
  line-height: 1.6;
  text-align: left;
}

.support-page .support-box ul {
  margin: 0;
  padding: 0 0 0 1.15rem;
  list-style: disc outside;
}

.support-page .support-box li + li {
  margin-top: 0.35rem;
}

.support-page .support-box li::marker {
  color: var(--support-muted);
}

.support-page .support-box a {
  color: var(--support-accent);
  text-underline-offset: 0.18em;
}

.quarto-dark .support-page .support-box a,
[data-bs-theme="dark"] .support-page .support-box a {
  color: var(--support-ink);
}

@media (max-width: 575.98px) {
  .support-more {
    margin-top: 2.25rem;
    gap: 0.8rem;
  }

  .support-page .support-box {
    padding: 1rem 1.05rem 1.05rem;
  }
}

/* Editorial independence: a quiet note under the introduction, before the
   amounts, so the reader learns that support never shapes the content
   before being asked for any. A hairline rule on the left, a small label,
   muted text. The ID selector outranks Quarto's first-section heading
   margin. */
.support-page .support-independence {
  margin: 0 0 2.25rem;
  padding: 0.1rem 0 0.1rem 0.9rem;
  border-left: 2px solid var(--support-line);
  text-align: left;
}

.support-page .support-independence h2,
#quarto-content .support-page section.support-independence > h2 {
  margin: 0 0 0.2rem;
  padding: 0;
  border: 0;
  color: var(--support-muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.4;
  text-align: left;
  text-transform: uppercase;
}

.support-page .support-independence p {
  margin: 0;
  color: var(--support-text);
  font-size: 0.95rem;
  line-height: 1.6;
  text-align: left;
}

/* The record line now leads into the note, so it sits closer to it. */
.support-page .support-record {
  margin-bottom: 1.25rem;
}
