/* learnmingo.com - /word/<address>: a word's own page (hand-written; the pages are generated by site/build-words.py). The site's type
   and tokens only (site.css --w-*, read from palette.css): no color is written here, and no control is styled here - the speaker
   (.icon-btn), the stroke tiles (.stroke-tile) and the action (.cta) are the site's kit parts in site.css; this file places them.
   One 860 px column like the Glossary, the entry lying on the page (no box around the subject): the breadcrumb, the head (the
   word, its pinyin, the speaker's place, the meaning, the facts, the one action), then the sections under hairlines. At 640 px and
   under the readings, the characters table and the action reflow; nothing scrolls sideways at 320. */
.wrap-wd { max-width: 860px; flex: 1; }
.wd { padding: 32px 0 96px; }
.wd-crumbs { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 0; font-size: 14px; line-height: 20px; }
.wd-crumbs span { color: var(--w-ink-2); }

/* the head: the word and its pinyin on one line where they fit, the speaker's reserved place beside them (word.js puts the speaker in
   only when the browser has a Chinese voice: the place is kept either way, so nothing moves). The speaker stands right after the
   pinyin for every word, as the approved page has it: the third, flexible column takes the rest of the row, so the meaning, the
   facts and the action (which span all three) never widen the word's column and carry the speaker away from the word (2026-11-22;
   an item that spans a flexible track does not size the tracks before it). The speaker's column is its 40px and the 16px before it. */
.wd-head { display: grid; grid-template-columns: minmax(0, max-content) 56px minmax(0, 1fr); align-items: center; padding: 18px 0 40px; }
.wd-head h1 { margin: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 20px; font-weight: 400; min-width: 0; }
.wd-w { font: 400 clamp(56px, 40px + 4vw, 76px)/1.15 var(--w-zh); letter-spacing: .02em; white-space: nowrap; }
/* a word of three or more characters never pushes the speaker out of a narrow window: its size is also capped by the room the column
   leaves beside the speaker (the window less the column's 20px sides, the 16px gap and the 40px speaker, and some slack), one em a
   character plus the letter spacing (build-words.py writes the character count as data-n) */
.wd-head[data-n="3"] .wd-w { font-size: min(clamp(56px, 40px + 4vw, 76px), calc((100vw - 104px) / 3.06)); }
.wd-head[data-n="4"] .wd-w { font-size: min(clamp(56px, 40px + 4vw, 76px), calc((100vw - 104px) / 4.08)); }
.wd-head[data-n="5"] .wd-w { font-size: min(clamp(56px, 40px + 4vw, 76px), calc((100vw - 104px) / 5.1)); }
.wd-head[data-n="6"] .wd-w { font-size: min(clamp(56px, 40px + 4vw, 76px), calc((100vw - 104px) / 6.12)); }
.wd-py { font: 400 clamp(22px, 18px + 1vw, 28px)/1.2 var(--w-font); }
.wd-say { justify-self: start; display: block; width: 40px; height: 40px; margin-left: 16px; }
.wd-say > .icon-btn { margin: 0; }
.wd-en { grid-column: 1 / -1; margin: 10px 0 0; font-family: var(--w-display); font-weight: 600; font-size: clamp(22px, 16px + 1.2vw, 28px); letter-spacing: -.02em; line-height: 1.2; overflow-wrap: anywhere; }
.wd-pos { font-weight: 500; }
.wd-facts { grid-column: 1 / -1; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; }
.wd-facts li { height: 28px; padding: 0 10px; border-radius: 980px; background: var(--w-in); font-size: 14px; line-height: 28px; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* the one action: its two labels stand one over the other (the longer one's width, whoever reads it); unseen until word.js has
   painted the right one for this reader, as the Glossary's .gl-mark */
.wd-act { grid-column: 1 / -1; justify-self: start; display: inline-grid; justify-items: center; align-items: center; margin-top: 26px; }
.wd-act > span { grid-area: 1 / 1; }
.wd-act:not([data-painted]) { visibility: hidden; }
.wd-act:not([data-who="in"]) .wd-act-in, .wd-act[data-who="in"] .wd-act-out { visibility: hidden; }

.wd section { padding: 0 0 44px; }
.wd h2 { margin: 0 0 4px; padding: 0 0 12px; border-bottom: 1px solid var(--w-rule); font-family: var(--w-display); font-weight: 600; font-size: 24px; letter-spacing: -.02em; line-height: 1.15; }

/* the readings: one row a language, the syllables of every language under one another (one column a character) */
.wd-read { list-style: none; margin: 0; padding: 0; }
.wd-read li { display: grid; grid-template-columns: 132px auto minmax(0, 1fr); align-items: baseline; column-gap: 28px; padding: 11px 0; border-bottom: 1px solid var(--w-rule); font-size: 16px; }
.wd-lang { display: inline-flex; align-items: baseline; gap: 9px; }
.wd-lang i { width: 7px; height: 7px; border-radius: 50%; align-self: center; flex: none; background: var(--good); }
.wd-read li[data-state="shifted"] .wd-lang i { background: var(--warn); }
.wd-read li[data-state="different"] .wd-lang i { background: var(--accent); }
.wd-syls { display: grid; grid-auto-flow: column; grid-auto-columns: 104px; font-size: 19px; }
.wd-read[data-n="3"] .wd-syls { grid-auto-columns: 88px; }
.wd-read[data-n="4"] .wd-syls { grid-auto-columns: 76px; }
.wd-syl { white-space: nowrap; }
/* A READING NEVER RUNS INTO ITS NEIGHBOR (2026-11-22, the coverage audit: しゅつ shutsu stood on ふ fu in a 76 px column, くちばし kuchibashi
   on its row's note; about 270 pages). The columns keep their least width (104 / 88 / 76) and GROW to the widest reading of the page,
   still one column a character under one another: the list is ONE grid and each row and its syllables are subgrids of it. A browser
   without subgrid keeps the fixed columns above. Phones keep their wrapping rows (the rule at the end of this file). */
@supports (grid-template-columns: subgrid) {
  @media (min-width: 641px) {
    .wd-read { --wd-n: 1; --wd-col: 104px; display: grid; grid-template-columns: 132px repeat(var(--wd-n), minmax(var(--wd-col), max-content)) minmax(0, 1fr); }
    .wd-read[data-n="2"] { --wd-n: 2; }
    .wd-read[data-n="3"] { --wd-n: 3; --wd-col: 88px; }
    .wd-read[data-n="4"] { --wd-n: 4; --wd-col: 76px; }
    .wd-read li { grid-column: 1 / -1; grid-template-columns: subgrid; column-gap: 0; }
    .wd-read .wd-syls, .wd-read[data-n] .wd-syls { grid-column: 2 / span var(--wd-n); grid-template-columns: subgrid; grid-auto-flow: row; grid-auto-columns: auto; padding-left: 28px; }
    .wd-read .wd-syl { padding-right: 14px; }
    .wd-read .wd-syl:last-child { padding-right: 0; }
    .wd-read .wd-note { padding-left: 28px; }
  }
}
/* Hokkien wherever the row writes it: its syllables AND the everyday word in its note (kan-khó͘: the dot of o͘ stood apart in the
   site's own face) */
.wd-l-hok, .wd-read [lang="nan-Latn"] { font-family: 'Mingo POJ', var(--w-font); }
.wd-read [lang="ja"] { font-family: "Yu Gothic UI", "Yu Gothic", "Meiryo", "Hiragino Sans", "Noto Sans JP", "Noto Sans CJK JP", sans-serif; }
.wd-read [lang="ko"] { font-family: "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", "Noto Sans CJK KR", sans-serif; }
.wd-read [lang="zh-Hant"] { font-family: var(--w-zh); }
.wd-rom { font-size: 14px; color: var(--w-ink-2); font-family: var(--w-font); }
.wd-note { font-size: 16px; overflow-wrap: anywhere; }

/* Hokkien's two marks few fonts have: the app's own POJ face, for that row only (loaded only where a Hokkien row asks for it) */
@font-face { font-family: 'Mingo POJ'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/ui/fonts/mingo-poj.woff2) format('woff2'); }

/* the ten sentences */
.wd-sents { list-style: none; margin: 0; padding: 0; }
.wd-sents li { padding: 14px 0 15px; border-bottom: 1px solid var(--w-rule); }
.wd-sents p { margin: 0; }
.wd-zh { font: 400 22px/1.4 var(--w-zh); }
.wd-zh a { color: inherit; }
.wd-zh b { font-weight: 700; }
.wd-sents .wd-spy { margin-top: 2px; font-size: 15px; line-height: 1.45; }
.wd-sents .wd-sen { margin-top: 2px; font-size: 16px; line-height: 1.45; }

/* the characters */
.wd-chars { width: 100%; border-collapse: collapse; font-size: 16px; }
.wd-chars th, .wd-chars td { padding: 11px 20px 11px 0; border-bottom: 1px solid var(--w-rule); text-align: left; vertical-align: baseline; font-weight: 400; }
.wd-chars thead th { font-size: 14px; color: var(--w-ink-2); white-space: nowrap; }
.wd-chars tbody th { font: 400 24px/1.25 var(--w-zh); width: 72px; }
.wd-chars td:last-child, .wd-chars th:last-child { padding-right: 0; }
.wd-chars td a { font: 400 18px/1.3 var(--w-zh); margin-right: 12px; white-space: nowrap; }
.wd-part { white-space: nowrap; }
.wd-more { font-size: 14px; color: var(--w-ink-2); white-space: nowrap; }

/* the stroke tiles (site.css .stroke-tile: a character is an object, so it has a tile; a click plays its strokes) */
.wd-tiles { list-style: none; display: flex; flex-wrap: wrap; gap: 16px; margin: 0; padding: 20px 0 0; }
.wd-tiles li { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 14px; }

/* the words around it in its level, in the Glossary's order: the Glossary's own rows, the word a link */
.wd .gl-w { color: var(--w-current); }
.wd-all { margin: 18px 0 0; font-size: 16px; }

@media (max-width: 640px) {
  .wrap-wd { padding: 0 20px; }
  .wd-crumbs { margin-top: 16px; }
  .wd-head { padding-bottom: 32px; }
  .wd-act { justify-self: stretch; }
  .wd-read li { grid-template-columns: 104px minmax(0, 1fr); row-gap: 2px; column-gap: 12px; }
  .wd-note { grid-column: 2; }
  .wd-syls, .wd-read[data-n] .wd-syls { display: flex; flex-wrap: wrap; gap: 0 14px; }
  .wd-zh { font-size: 20px; }
  .wd-chars, .wd-chars tbody { display: block; }
  .wd-chars thead { display: none; }
  .wd-chars tr { display: grid; grid-template-columns: 56px minmax(0, 1fr); padding: 11px 0; border-bottom: 1px solid var(--w-rule); }
  .wd-chars th, .wd-chars td { border: 0; padding: 0; }
  .wd-chars tbody th { grid-row: 1 / span 6; width: auto; }
  .wd-chars td { grid-column: 2; padding: 1px 0; overflow-wrap: anywhere; }
  .wd-chars td[data-h]::before { content: attr(data-h); font: 400 14px/1.3 var(--w-font); color: var(--w-ink-2); margin-right: 8px; }
  .wd-part { white-space: normal; }
}
