/* Lesson blocks.
 *
 * Three blocks and one index, styled so a reader can tell them apart at a
 * glance and so none of them competes with a live sample for attention.
 * The sample is the only thing on a page carrying the accent; these carry
 * a rule and a label, which is the every-layout treatment: mark the edge,
 * do not fill the box.
 */

article.yue .eb-questions,
article.yue .eb-objectives,
article.yue .eb-exercise {
  border-left: 3px solid var(--eb-rule);
  padding: 0.1rem 0 0.1rem 1.1rem;
  margin-top: var(--eb-space-block);
  margin-bottom: var(--eb-space-block);
}

article.yue .eb-questions-label,
article.yue .eb-objectives-label,
article.yue .eb-exercise-label {
  font-family: var(--eb-sans);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--eb-fg-muted);
  margin: 0 0 0.5rem;
}

/* An exercise is a thing to do, so its edge is stated more firmly than an
   objective's, which is a thing to know. */
article.yue .eb-exercise {
  border-left-color: var(--eb-fg-muted);
}

article.yue .eb-objectives > *:last-child,
article.yue .eb-exercise > *:last-child {
  margin-bottom: 0;
}

/* Objectives are a short list and read better tight than spaced. */
article.yue .eb-questions ol,
article.yue .eb-questions ul,
article.yue .eb-objectives ol,
article.yue .eb-objectives ul {
  margin-top: 0;
}

article.yue .eb-questions li + li,
article.yue .eb-objectives li + li {
  margin-top: 0.25rem;
}

/* A real <details>: it opens with no JavaScript, the browser's own find
   searches inside it, and the print stylesheet can force it open. */
article.yue .eb-solution {
  margin-top: var(--eb-space);
}

article.yue .eb-solution-summary {
  font-family: var(--eb-sans);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--eb-fg-muted);
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.15rem 0;
}

article.yue .eb-solution-summary::-webkit-details-marker {
  display: none;
}

/* A disclosure triangle drawn rather than borrowed, so it points the same
   way in every browser. */
article.yue .eb-solution-summary::before {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 5px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform 0.12s ease-in-out;
}

article.yue .eb-solution[open] > .eb-solution-summary::before {
  transform: rotate(90deg);
}

article.yue .eb-solution-summary:hover {
  color: var(--eb-fg);
}

article.yue .eb-solution-summary:focus-visible {
  outline: 2px solid var(--eb-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

article.yue .eb-solution-body {
  margin-top: var(--eb-space);
  padding-left: 1.1rem;
  border-left: 1px solid var(--eb-rule);
}

article.yue .eb-solution-body > *:first-child {
  margin-top: 0;
}

/* The index of every exercise in the book. */
article.yue .eb-exercise-index-chapter {
  font-family: var(--eb-sans);
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--eb-fg-muted);
  margin-top: var(--eb-space-block);
  margin-bottom: 0.4rem;
}

article.yue .eb-exercise-index ul {
  margin-top: 0.3rem;
}

/* A solution the reader asked to see should still be there on paper. */
@media print {
  article.yue .eb-solution {
    display: block;
  }

  article.yue .eb-solution-body {
    display: block !important;
  }
}

/* --- keypoints, prerequisites, predict ------------------------------------
 *
 * The Carpentries pair objectives with keypoints, and the pairing is the
 * device: a promise at the top, a receipt at the bottom. So keypoints share
 * the objectives block's shape and reverse its accent, rather than being a
 * third kind of box a reader has to learn.
 */

article.yue .eb-keypoints {
  grid-column: wide-left / wide-right;
  margin: var(--eb-space-block) 0;
  padding: 0.9rem 1.1rem 0.75rem;
  border: 1px solid var(--eb-surface-edge);
  border-top: 3px solid var(--eb-accent);
  border-radius: 3px;
  background: var(--eb-surface);
}

article.yue .eb-prerequisites {
  grid-column: text-left / text-right;
  margin: var(--eb-space-block) 0;
  padding: 0.75rem 1rem 0.6rem;
  border-left: 3px solid var(--eb-fg-muted);
  background: transparent;
}

article.yue .eb-keypoints > p:first-child,
article.yue .eb-prerequisites > p:first-child {
  margin: 0 0 0.5rem;
  font-family: var(--eb-sans);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--eb-fg-muted);
}

article.yue .eb-keypoints > *,
article.yue .eb-prerequisites > *,
article.yue .eb-predict > *,
article.yue .eb-reveal-body > * {
  grid-column: auto;
}

/* Predict-then-reveal. The prompt is a question the reader answers before
 * the book does, so it must not look like an aside that can be skimmed: it
 * gets the exercise block's weight and its own label. */
article.yue .eb-predict {
  grid-column: text-left / text-right;
  margin: var(--eb-space-block) 0;
  padding: 0.9rem 1.1rem 0.7rem;
  border: 1px dashed var(--eb-accent);
  border-radius: 3px;
}

article.yue .eb-predict-label {
  margin: 0 0 0.5rem;
  font-family: var(--eb-sans);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--eb-accent);
}

article.yue .eb-reveal {
  margin-top: 0.7rem;
  border-top: 1px solid var(--eb-rule);
  padding-top: 0.5rem;
}

article.yue .eb-reveal-summary {
  cursor: pointer;
  font-family: var(--eb-sans);
  font-size: 0.85rem;
  color: var(--eb-accent);
}

article.yue .eb-reveal-body {
  margin-top: 0.6rem;
}

article.yue .eb-reveal-body > * + * {
  margin-top: var(--eb-space);
}

/* The digest page: one heading per chapter, its keypoints under it. */
article.yue .eb-keypoints-index-chapter {
  margin-top: var(--eb-space-block);
  font-family: var(--eb-sans);
  font-weight: 600;
}

/* Print opens a prediction's answer, because a printed page cannot be
 * clicked and a reader with paper still deserves the answer. */
@media print {
  article.yue .eb-reveal[open],
  article.yue .eb-reveal {
    border-top: 1px solid #ccc;
  }
  article.yue .eb-reveal > .eb-reveal-body {
    display: block !important;
  }
}
