/*
 * TaroDict Web: a word's card (card.js), and a 華語 word's entry, as its
 * own page (/m/…) and as its card (Docs/TaroDictWeb/TaroDictWeb.md §3.2).
 * Split from word.css, which every page that links this links first, so
 * these rules still come after it (review, 2026-11-01).
 */

/* ---- A word's card (card.js) ---------------------------------------------
 * The app's word card without its speaker, pointing at its word from inside
 * the pane, so it scrolls with it. card-place.js sets its place and width and
 * where its arrow points (--arrow-left); `above` turns it over the word. */

.word-card {
  position: absolute;
  z-index: 20;
  box-sizing: border-box;
  width: 380px;
  max-height: 480px;
  overflow: auto;
  padding: 14px 16px 10px;
  border-radius: 14px;
  background: var(--page);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18), 0 0 0 1px color-mix(in srgb, var(--dark) 10%, transparent);
  color: var(--dark);
  font-size: 16px;
  line-height: 1.5;
}

/* The arrow, the card's own colour, on the side facing the word. */
.word-card::before {
  content: "";
  position: absolute;
  top: -8px;
  left: calc(var(--arrow-left, 30px) - 8px);
  border: 8px solid transparent;
  border-top: 0;
  border-bottom-color: var(--page);
}

.word-card.above::before {
  top: auto;
  bottom: -8px;
  border: 8px solid transparent;
  border-bottom: 0;
  border-top-color: var(--page);
}

.word-card p {
  margin: 0;
}

.word-card-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.word-card-head > div {
  flex: 1;
}

.word-card-headword {
  font-size: 26px;
  line-height: 1.3;
}

.word-card-reading {
  color: var(--medium);
  font-size: 20px;
}

/* ›, the app's chevron in its filled circle: the word's page. */
.word-card-open {
  display: grid;
  flex: none;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--medium);
}

.word-card-open svg {
  fill: none;
  stroke: #FFFFFF;
  stroke-width: 2.5;
}

.word-card-senses {
  margin: 6px 0 0;
  padding: 0 0 0 1.4em;
}

.word-card-senses.one {
  padding: 0;
  list-style: none;
}

.word-card-senses li + li {
  margin-top: 4px;
}

/* 查無詞義, a word no entry is written as, in the supporting gray as the
   app's card. */
.word-card-none {
  margin-top: 8px;
  color: var(--supporting);
}

/* Examples in the supporting gray, the definitions in the dark, as the
   app's card. The reading starts past 「[例]」, as there. */
.word-card-example {
  color: var(--supporting);
}

.word-card .word-card-example-reading {
  margin-left: 2.2em;
  color: var(--supporting);
}

.word-card .word-card-source {
  margin-top: 8px;
  color: var(--supporting);
  font-size: 13px;
  text-align: right;
}

/* ---- A 華語 word's entry (/m/…, and its card) -------------------------------
 * 簡編本's or 修訂本's entry as the app's card shows it: 注音 in the theme's
 * colour, then pinyin; numbered senses, each example behind its mark, starting
 * where the sense's text does. The page and its card share these; the card
 * draws the headword at the word card's size. */

.mandarin-entry p,
.mandarin-card p {
  margin: 0;
}

.mandarin-reading-entry + .mandarin-reading-entry {
  margin-top: 14px;
}

.mandarin-reading-entry .reading {
  font-size: 20px;
}

.mandarin-reading-entry .zhuyin {
  color: var(--medium);
}

.mandarin-reading-entry .pinyin {
  margin-left: 0.6em;
}

.mandarin-reading-entry .label,
.mandarin-reading-entry .alias,
.mandarin-reading-entry .part-of-speech,
.mandarin-reading-entry .note {
  color: var(--supporting);
}

.mandarin-reading-entry .part-of-speech,
.mandarin-reading-entry .note,
.mandarin-sense {
  margin-top: 6px;
}

.mandarin-sense .mandarin-example {
  margin-left: 1.6em;
  color: var(--supporting);
}

.mandarin-entry .source {
  margin-top: 12px;
}

.mandarin-card .headword {
  margin: 0;
  font-size: 26px;
  line-height: 1.3;
}

.mandarin-card .source {
  margin-top: 8px;
  color: var(--supporting);
  font-size: 13px;
  text-align: right;
}
