/* Citations render as small numbered superscripts, so a reference never
   interrupts the sentence carrying it. Paired with references/ieee.csl, which
   numbers entries in order of first use; the numbered list appears under each
   chapter. Both were set inside the search chapter alone until this file
   existed, which is why that one chapter looked different from the rest. */
.citation {
  font-size: 0.68em;
  vertical-align: super;
  line-height: 0;
}

.citation a {
  text-decoration: none;
  color: #2a5fd6;
  font-weight: 700;
  cursor: help;
}

/* Exercise items from the generated bank (scripts/exercise_bank.py).
   Deliberately quieter than a callout: the chapter already carries fourteen
   titled callouts and every piece of reader work sits inside one, so twenty-odd
   more notes would flatten a distinction the notes are carrying. This is a
   boundary for the eye, not a raised voice -- a tinted left edge and nothing
   else, so a run of items reads as a list of separate things rather than as a
   wall of paragraphs. */
.exercise {
  border-left: 3px solid #c7cee3;
  padding: 0.1rem 0 0.1rem 1rem;
  margin: 1.1rem 0;
}

.exercise > p:first-child {
  color: #4a5468;
  font-size: 0.9em;
}

/* The follow-up question, which is a second, harder ask rather than a hint. */
.exercise em:first-child {
  color: #4a5468;
}

/* Multiple-choice alternatives. Lettered, and tight enough to read as one
   question rather than as four claims. */
.exercise ol {
  margin: 0.35rem 0 0.35rem 0.5rem;
}

.exercise ol li {
  margin: 0.1rem 0;
}

/* Chapter epigraphs: a quotation under the chapter title, attribution below it. */
.epigraph {
  /* Shrink to the quotation, so a short one sits beside its source instead of
     leaving the width of a long one between them. */
  width: fit-content;
  max-width: 34rem;
  /* Italic glyphs lean past their box; without this the last one is clipped. */
  padding-right: 0.25em;
  margin: 0.5rem 0 2.25rem auto;
  font-style: italic;
  color: var(--bs-secondary-color, #4a5468);
}

.epigraph p {
  margin-bottom: 0.35rem;
}

.epigraph .epigraph-source {
  display: block;
  font-style: normal;
  font-size: 0.85em;
  text-align: right;
}

.epigraph .epigraph-source::before {
  content: "\2014\00a0";
}

/* A second epigraph sits close under the first, as one group. */
.epigraph + .epigraph {
  margin-top: -1.5rem;
}

/* A section's plain name under its story title: "Checking one place at a time" / Sequential search. */
.subhead {
  display: block;
  margin-top: -0.6rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--bs-secondary-color, #5a6478);
}

/* Section marks (book/section-marks.lua): what kind of section a heading opens,
   in the heading and in the side table of contents, so a reader can see at a
   glance what is core, what is practice, what puts the chapter in perspective,
   and what can be skipped. */
.sec-mark { font-weight: 400; }
.sec-mark.mark-advanced, .toc-legend .mark-advanced { color: #b7791f; }
.sec-mark.mark-practice, .toc-legend .mark-practice { color: #2f7d4f; }
.sec-mark.mark-bigpicture, .toc-legend .mark-bigpicture { color: #2a5fd6; }
.sec-mark-word {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.05rem 0.45rem;
  border-radius: 0.6rem;
  font-size: 0.55em;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  vertical-align: middle;
  border: 1px solid currentColor;
}
.sec-mark-word.mark-advanced { color: #b7791f; }
.sec-mark-word.mark-practice { color: #2f7d4f; }
.sec-mark-word.mark-bigpicture { color: #2a5fd6; }
#TOC .sec-mark-word { display: none; }
#TOC li.toc-group {
  list-style: none;
  margin: 0.7rem 0 0.15rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bs-secondary-color, #6c757d);
}
#TOC li.toc-group-advanced { color: #b7791f; }
#TOC li.toc-group-practice { color: #2f7d4f; }
#TOC li.toc-group-bigpicture { color: #2a5fd6; }
/* Click-to-open (section-marks.html): subsections show only under the one
   open entry, whatever Quarto's scroll handler does to its collapse class. */
#TOC.toc-click ul ul { display: none !important; }
#TOC.toc-click li.toc-open > ul { display: block !important; height: auto !important; }
#TOC .toc-legend {
  margin-top: 0.9rem;
  font-size: 0.72rem;
  color: var(--bs-secondary-color, #6c757d);
}

/* A key idea worth carrying out of the chapter: a statement, boxed, never
   collapsed. Distinct from the callouts, which hold the reader's own work. */
.key-idea {
  border: 1px solid #b9c8ef;
  border-left: 4px solid #2a5fd6;
  background: rgba(42, 95, 214, 0.05);
  border-radius: 6px;
  padding: 0.75rem 1rem 0.2rem;
  margin: 1.25rem 0;
}
.key-idea > p:first-child {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #2a5fd6;
  margin-bottom: 0.35rem;
}

/* About the author: a 4:5 portrait the text flows beside. */
.author-portrait {
  float: right;
  width: 200px;
  margin: 0.3rem 0 0.8rem 1.6rem;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
}
.author-portrait figure,
.author-portrait p {
  margin: 0;
}
.author-portrait img {
  display: block;
  width: 100%;
  height: auto;
}
@media (max-width: 575px) {
  .author-portrait {
    float: none;
    width: 220px;
    margin: 0 auto 1.2rem;
  }
}
