/* Reader funnel (Bryan, November 12, 2026): the chapter-end vote and author
   box (filters/chapter-end.lua) and the labeled Follow on X button in the
   header. v2 (Bryan, November 12, 2026): the author box carries Follow on X
   and Follow on LinkedIn side by side. v3 (Bryan, November 12, 2026, 22:36
   PT): the inline "Was this section useful?" box, the "Not quite" reason
   chips, the "Suggest an edit" link under the chapter title, and each book's
   accent (--handbook-accent, set in _quarto.yml) on the box's top rule, the
   vote buttons, and focus. Text in the accent uses a darkened (light theme) or
   lightened (dark theme) mix of it, so every book passes 4.5:1. The
   .follow-x-solid rules are unchanged from v1 because the homepage author line
   reuses them. v4 (Bryan, November 13, 2026, 14:16 PT): a Support button
   after Follow on LinkedIn in the author box. Identical in all four
   handbooks.
   Stylesheets can be cached for a year: change this by adding a -v5 file. */

.chapter-end,
.section-check {
  --ce-border: #e3e6ea;
  --ce-muted: #5b6b7f;
  --ce-text: #1f2a37;
  --ce-surface: #f8f9fb;
  --ce-face: #fff;
  --ce-accent: var(--handbook-accent, #2761e3);
  --ce-ink: #1f2a37;
  --ce-tint: #eef1f5;
  --ce-on-ink: #fff;
  margin: 2rem 0 0.5rem;
  border: 1px solid var(--ce-border);
  border-top: 3px solid var(--ce-accent);
  border-radius: 10px;
  background: var(--ce-surface);
  overflow: hidden;
}

.section-check {
  margin: 1.75rem 0 2rem;
}

.quarto-dark .chapter-end,
.quarto-dark .section-check,
[data-bs-theme="dark"] .chapter-end,
[data-bs-theme="dark"] .section-check {
  --ce-border: #3a3f47;
  --ce-muted: #9aa7b6;
  --ce-text: #e6e9ee;
  --ce-surface: #1d2127;
  --ce-face: #262b33;
  --ce-ink: #e6e9ee;
  --ce-tint: #2c323b;
  --ce-on-ink: #12161b;
}

/* The accent ink: the book's accent mixed toward black (light theme) or white
   (dark theme). Checked for 4.5:1 on the box and the chips for #0FB5BA,
   #2563eb, #c9a961 and #14532d. Older browsers keep the neutral ink above. */
@supports (color: color-mix(in srgb, red 50%, blue)) {
  .chapter-end,
  .section-check {
    --ce-ink: color-mix(in srgb, var(--ce-accent) 55%, #000);
    --ce-tint: color-mix(in srgb, var(--ce-accent) 9%, #fff);
  }

  .quarto-dark .chapter-end,
  .quarto-dark .section-check,
  [data-bs-theme="dark"] .chapter-end,
  [data-bs-theme="dark"] .section-check {
    --ce-ink: color-mix(in srgb, var(--ce-accent) 45%, #fff);
    --ce-tint: color-mix(in srgb, var(--ce-accent) 16%, #1d2127);
  }
}

main.content .chapter-end p,
.chapter-end p,
main.content .section-check p,
.section-check p {
  margin: 0;
  line-height: 1.5;
}

.section-check .chapter-vote {
  border-bottom: 0;
}

/* Vote */
.chapter-vote {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--ce-border);
}

.chapter-vote[hidden] {
  display: none;
}

.chapter-vote-ask {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}

.chapter-vote-question {
  font-weight: 600;
  color: var(--ce-text);
  font-size: 1rem;
}

.chapter-vote-choices {
  display: flex;
  gap: 0.5rem;
}

.chapter-vote-choice,
.chapter-vote-reason,
.chapter-vote-send {
  appearance: none;
  min-height: 2.25rem;
  padding: 0.35rem 1rem;
  border: 1px solid #c9d0d8;
  border-radius: 999px;
  background: #fff;
  color: var(--ce-text);
  font: inherit;
  font-size: 0.925rem;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.quarto-dark .chapter-vote-choice,
.quarto-dark .chapter-vote-reason,
.quarto-dark .chapter-vote-send,
[data-bs-theme="dark"] .chapter-vote-choice,
[data-bs-theme="dark"] .chapter-vote-reason,
[data-bs-theme="dark"] .chapter-vote-send {
  border-color: #4a515b;
  background: #262b33;
}

/* Yes / Not quite carry the book's accent so the box reads as a question,
   not page chrome. */
.chapter-vote-choice,
.quarto-dark .chapter-vote-choice,
[data-bs-theme="dark"] .chapter-vote-choice {
  border-color: var(--ce-ink);
  background: var(--ce-face);
  color: var(--ce-ink);
  font-weight: 600;
}

.chapter-vote-choice:hover:not(:disabled),
.chapter-vote-reason:hover,
.chapter-vote-send:hover:not(:disabled) {
  border-color: var(--ce-ink);
  background-color: var(--ce-tint);
}

.chapter-vote-send:hover:not(:disabled) {
  background-color: var(--ce-text);
}

.chapter-vote-choice:focus-visible,
.chapter-vote-reason:focus-visible,
.chapter-vote-send:focus-visible,
.chapter-vote-row input:focus-visible,
.follow-x:focus-visible,
.follow-li:focus-visible {
  outline: 2px solid var(--ce-ink, var(--handbook-accent, #2761e3));
  outline-offset: 2px;
}

.suggest-edit-link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
  border-radius: 4px;
}

.chapter-vote-choice:disabled {
  cursor: default;
  opacity: 0.55;
}

.chapter-vote-choice.is-chosen,
.chapter-vote-choice.is-chosen:disabled {
  opacity: 1;
  border-color: var(--ce-ink);
  background: var(--ce-ink);
  color: var(--ce-on-ink);
}

/* "Not quite" reasons: one tap, one choice at a time. */
.chapter-vote-reasons {
  margin-top: 0.9rem;
}

.chapter-vote-reasons[hidden] {
  display: none;
}

.chapter-vote-reasons-label {
  margin-bottom: 0.45rem !important;
  color: var(--ce-text);
  font-size: 0.925rem;
}

.chapter-vote-reason-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chapter-vote-reason {
  padding: 0.35rem 0.85rem;
  font-size: 0.875rem;
}

.chapter-vote-reason.is-chosen,
.quarto-dark .chapter-vote-reason.is-chosen,
[data-bs-theme="dark"] .chapter-vote-reason.is-chosen {
  border-color: var(--ce-ink);
  background: var(--ce-tint);
  box-shadow: inset 0 0 0 1px var(--ce-ink);
  color: var(--ce-ink);
  font-weight: 600;
}

.chapter-vote-note {
  margin-top: 0.9rem;
}

.chapter-vote-note[hidden] {
  display: none;
}

.chapter-vote-note label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--ce-text);
  font-size: 0.925rem;
}

.chapter-vote-optional {
  color: var(--ce-muted);
}

.chapter-vote-row {
  display: flex;
  gap: 0.5rem;
}

.chapter-vote-row input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 2.25rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid #c9d0d8;
  border-radius: 8px;
  background: #fff;
  color: var(--ce-text);
  font: inherit;
  font-size: 0.95rem;
}

.quarto-dark .chapter-vote-row input,
[data-bs-theme="dark"] .chapter-vote-row input {
  border-color: #4a515b;
  background: #262b33;
}

.chapter-vote-send {
  flex: 0 0 auto;
  border-color: var(--ce-text);
  background: var(--ce-text);
  color: #fff;
}

.quarto-dark .chapter-vote-send,
[data-bs-theme="dark"] .chapter-vote-send {
  border-color: #e6e9ee;
  background: #e6e9ee;
  color: #12161b;
}

.chapter-vote-send:disabled {
  cursor: default;
  opacity: 0.4;
}

.chapter-vote-status {
  color: var(--ce-muted);
  font-size: 0.875rem;
}

main.content .chapter-vote-status:not(:empty),
.chapter-vote-status:not(:empty) {
  margin-top: 0.6rem;
}

.chapter-vote .fb-trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Author box */
.author-box {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
}

.author-box-photo {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0;
}

.author-box-text {
  min-width: 0;
}

.author-box-name,
.author-box-name a {
  font-weight: 600;
  font-size: 1rem;
}

.author-box-name a {
  color: var(--ce-text);
  text-decoration: none;
}

.author-box-name a:hover {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.author-box-bio {
  margin-top: 0.1rem !important;
  color: var(--ce-muted);
  font-size: 0.925rem;
  line-height: 1.5;
}

/* Follow on X: solid in the author box and on the homepage author line,
   outlined in the header. .follow-x-solid is unchanged from v1 because the
   homepage author line reuses it. */
.follow-x,
.follow-li {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
  text-decoration: none;
}

.follow-x-solid {
  margin-top: 0.6rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: #0f1419;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
}

.follow-x-solid:hover,
.follow-x-solid:focus {
  background: #272c30;
  color: #fff;
  text-decoration: none;
}

.quarto-dark .follow-x-solid,
[data-bs-theme="dark"] .follow-x-solid {
  background: #e6e9ee;
  color: #0f1419;
}

.follow-x-solid .bi,
.follow-li .bi {
  font-size: 0.8rem;
}

/* Author box: Follow on X (solid) and Follow on LinkedIn (outlined) side by
   side, the same size. */
.author-box-follow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.author-box-follow .follow-x-solid {
  margin-top: 0;
  border: 1px solid #0f1419;
}

.author-box-follow .follow-x-solid:hover,
.author-box-follow .follow-x-solid:focus {
  border-color: #272c30;
}

.quarto-dark .author-box-follow .follow-x-solid,
[data-bs-theme="dark"] .author-box-follow .follow-x-solid {
  border-color: #e6e9ee;
}

.follow-li {
  padding: 0.4rem 0.9rem;
  border: 1px solid #c9d0d8;
  border-radius: 999px;
  background: #fff;
  color: var(--ce-text, #1f2a37);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
}

.follow-li .bi {
  color: #0a66c2;
}

.follow-li:hover,
.follow-li:focus {
  border-color: #0a66c2;
  background: #fff;
  color: var(--ce-text, #1f2a37);
  text-decoration: none;
}

.quarto-dark .follow-li,
[data-bs-theme="dark"] .follow-li {
  border-color: #4a515b;
  background: transparent;
  color: var(--ce-text, #e6e9ee);
}

.quarto-dark .follow-li .bi,
[data-bs-theme="dark"] .follow-li .bi {
  color: #70b5f9;
}

.quarto-dark .follow-li:hover,
.quarto-dark .follow-li:focus,
[data-bs-theme="dark"] .follow-li:hover,
[data-bs-theme="dark"] .follow-li:focus {
  border-color: #70b5f9;
  background: transparent;
  color: var(--ce-text, #e6e9ee);
}

/* Header: the X link becomes a labeled, outlined pill. */
.navbar .nav-link.follow-x-header,
.navbar a.nav-link[href="https://x.com/BryanTegomoh"] {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

@media (min-width: 992px) {
  .navbar .nav-link.follow-x-header,
  .navbar a.nav-link[href="https://x.com/BryanTegomoh"] {
    margin: 0 0.3rem;
    padding: 0.2rem 0.65rem !important;
    border: 1px solid currentColor;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.2;
  }

  .navbar a.nav-link[href="https://x.com/BryanTegomoh"] .bi {
    font-size: 0.8rem;
  }

  /* Keep the right-hand header items on one line and centered, so the
     pill sits level with the icons beside it. */
  #navbarCollapse > .navbar-nav.ms-auto {
    align-items: center;
  }

  /* The header has room for the full handle only on wide screens; below
     that the pill reads "Follow" and its label names the account. */
  .navbar a.nav-link[href="https://x.com/BryanTegomoh"] .menu-text {
    display: none;
  }

  .navbar a.nav-link[href="https://x.com/BryanTegomoh"]::after {
    content: "Follow";
  }
}

/* Narrow desktop headers are already full: the pill keeps only its icon. */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .navbar a.nav-link[href="https://x.com/BryanTegomoh"] {
    padding: 0.2rem 0.5rem !important;
  }

  .navbar a.nav-link[href="https://x.com/BryanTegomoh"]::after {
    content: none;
  }
}

@media (min-width: 1200px) {
  #navbarCollapse > .navbar-nav.ms-auto .nav-link {
    white-space: nowrap;
  }
}

@media (min-width: 1700px) {
  .navbar a.nav-link[href="https://x.com/BryanTegomoh"] .menu-text {
    display: inline;
  }

  .navbar a.nav-link[href="https://x.com/BryanTegomoh"]::after {
    content: none;
  }
}

/* "Suggest an edit": a quiet text link under the chapter title. It is a GET
   form button, so it works without JavaScript. */
.suggest-edit {
  margin: -0.5rem 0 1.25rem;
}

.suggest-edit-link {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 1.75rem;
  padding: 0.15rem 0;
  border: 0;
  background: none;
  color: var(--bs-secondary-color, #5b6b7f);
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.3;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.suggest-edit-link:hover {
  color: var(--bs-link-color, #2761e3);
}

.suggest-edit-link .bi {
  font-size: 0.85rem;
}

@media (max-width: 575.98px) {
  .chapter-vote,
  .author-box {
    padding: 0.9rem 1rem;
  }

  .chapter-vote-choices {
    flex: 1 1 100%;
  }

  .chapter-vote-choice {
    flex: 1 1 0;
  }

  .author-box {
    align-items: flex-start;
  }

  .author-box-photo {
    width: 52px;
    height: 52px;
  }
}

@media print {
  .chapter-end,
  .section-check,
  .suggest-edit {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chapter-vote-choice,
  .chapter-vote-reason,
  .chapter-vote-send {
    transition: none;
  }
}

/* Author box Support button (Bryan, November 13, 2026, 14:16 PT): the same
   outlined pill as Follow on LinkedIn, with the heart in the book's accent ink
   (--ce-ink: 6.4:1 or better on white and 6.1:1 or better on the dark box for
   all four accents). The pill keeps the look of its neighbours; an invisible
   layer makes the tap target at least 44px tall. Focus uses the shared
   .follow-li:focus-visible ring. */
.author-box-follow .follow-support {
  position: relative;
}

.author-box-follow .follow-support::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  height: 44px;
  min-height: 100%;
  transform: translateY(-50%);
}

.follow-support .bi,
.quarto-dark .follow-support .bi,
[data-bs-theme="dark"] .follow-support .bi {
  color: var(--ce-ink, currentColor);
}

.follow-support:hover,
.follow-support:focus,
.quarto-dark .follow-support:hover,
.quarto-dark .follow-support:focus,
[data-bs-theme="dark"] .follow-support:hover,
[data-bs-theme="dark"] .follow-support:focus {
  border-color: var(--ce-ink, currentColor);
}
