/* ========================================
   CHECK YOURSELF
   The recall section at the end of a kanji page (_includes/kanji/check.html)
   and of a same-reading word page
   (_includes/explanation/same-reading-check.html). Loaded by
   _includes/head/assets.html on the pages that show it.
   ======================================== */

.self-check__question {
  margin-block: 0.6rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
}

.self-check__question > summary {
  font-weight: 700;
  cursor: pointer;
}

.self-check__question .self-check__answer > :first-child {
  margin-top: 0.5rem;
}

.self-check__question .self-check__answer > :last-child {
  margin-bottom: 0.15rem;
}

.self-check__cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  gap: 0.5rem;
  align-items: start;
  list-style: none;
  margin: 0.75rem 0 1.5rem;
  padding: 0;
}

.self-check__cards li {
  margin: 0;
}

.self-check__card {
  text-align: center;
  border: 1px solid var(--color-border);
  border-radius: 4px;
}

.self-check__card > summary {
  padding: 0.7rem 0.5rem 0.55rem;
  list-style: none;
  cursor: pointer;
}

.self-check__card > summary::-webkit-details-marker {
  display: none;
}

.self-check__card > summary::after {
  content: "Show reading";
  display: block;
  font-size: var(--font-size-tiny);
  color: var(--color-gray);
}

.self-check__card[open] > summary::after {
  content: "Hide";
}

.self-check__card > summary:hover,
.self-check__card > summary:focus-visible {
  background: var(--color-mark-secondary-bg);
}

.self-check__word {
  display: block;
  font-size: 1.8rem;
  line-height: 1.35;
}

.self-check__card .self-check__answer {
  display: grid;
  gap: 0.1rem;
  padding: 0.4rem 0.5rem 0.65rem;
  border-top: 1px solid var(--color-border);
}

.self-check__card .kanji-reading {
  font-size: 1.1rem;
  white-space: normal;
}

.self-check__gloss {
  font-size: var(--font-size-small);
}

.self-check__back {
  font-size: var(--font-size-tiny);
}

.self-check__transfer {
  margin-block: 1rem 1.5rem;
  padding-inline-start: 1rem;
  border-inline-start: 3px solid var(--color-border);
}

.self-check__line {
  margin: 0.5rem 0 0.75rem;
}

.self-check__line p {
  margin: 0;
  font-size: var(--font-size-large);
  line-height: 1.95;
}

.self-check__line figcaption {
  font-size: var(--font-size-tiny);
  color: var(--color-gray);
}

/* Cards that ask for a spelling's meaning instead of a reading. The words
   run longer than one kanji (明く・明ける), so they get wider cells. */

.self-check__cards--meaning {
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
}

.self-check__card--meaning > summary::after {
  content: "Show meaning";
}

.self-check__card--meaning[open] > summary::after {
  content: "Hide";
}

.self-check__card--meaning .self-check__word {
  font-size: 1.5rem;
}

.self-check__card .self-check__tag {
  justify-self: center;
  padding: 0 0.4rem;
  font-size: var(--font-size-tiny);
  letter-spacing: 0.04em;
  color: var(--color-gray);
  border: 1px solid var(--color-border);
  border-radius: 3px;
}

/* A kana phrase the reader spells with the right kanji. */

.self-check__pick > summary {
  font-weight: 400;
  font-size: var(--font-size-large);
}

.self-check__pick .self-check__answer p {
  margin: 0.5rem 0 0.15rem;
}

.self-check__pick .self-check__spelling {
  font-weight: 700;
}
