/* Article pages (lib/articles.mjs), in the Moymer house style. Loaded after moymer.css and level.css, which hold the
   tokens, the button, option, bubble and progress recipes, the header, the footer and the closing band.
   This file lays out the article and its six blocks (assets/blocks.js). The blocks started in site/lab/.
   Concept: an article is a short lesson: the answer, then the block where you do it, then the explanation in plain text.
   Only what can be tapped has a lip. Text stays flat on white. */

.mm-wrap.ar-col { max-width: calc(720px + 2 * var(--mm-gutter)); }
.ar-head { padding-block: clamp(12px, 3vw, 28px) 4px; }
.ar-head h1 { font-size: clamp(2rem, 1.3rem + 3vw, 3rem); line-height: 1.1; margin: 0 0 16px; text-wrap: balance; }
.ar-answer { font-size: clamp(1.125rem, 1rem + .5vw, 1.3125rem); font-weight: 700; line-height: 1.45; margin: 0; max-width: 60ch; }
.ar-body { padding-block: 28px clamp(56px, 8vw, 96px); font-size: var(--mm-body); line-height: 1.6; }
.ar-body > h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 1.875rem); line-height: 1.2; margin: 56px 0 14px; text-wrap: balance; }
.ar-body > h3 { font-size: 1.25rem; line-height: 1.25; margin: 36px 0 10px; }
.ar-body > p, .ar-body > ul, .ar-body > ol, .ar-body > blockquote { margin: 0 0 18px; max-width: 68ch; font-weight: 500; }
.ar-body > ul, .ar-body > ol { padding-left: 1.3em; }
.ar-body li { margin-bottom: 8px; }
.ar-body a { color: var(--brand); font-weight: 800; text-underline-offset: 3px; }
.ar-body strong { font-weight: 900; }
.ar-body blockquote { border-left: 4px solid var(--mm-line); padding-left: 16px; color: var(--mm-slate); }
.ar-body hr { border: 0; border-top: 2px solid var(--mm-line); margin: 40px 0; }
.ar-body code { font-size: .9em; background: var(--mm-ice); padding: 2px 6px; border-radius: 6px; }
.ar-by { color: var(--mm-slate); font-size: .875rem; font-weight: 700; margin-top: 40px !important; }

/* A bank phrase inside the text, and one on its own line */
.ph { font-weight: 900; }
.ph-r { font-style: normal; color: var(--mm-slate); font-weight: 700; }
.ar-phrase { margin: 28px 0; display: grid; gap: 4px; justify-items: start; }
.ar-phrase p { margin: 0; }
.ar-phrase__t { font-size: clamp(1.75rem, 1.3rem + 2vw, 2.375rem); font-weight: 900; line-height: 1.15; }
.ar-phrase__tr { font-weight: 700; font-size: 1.125rem; }
.ar-phrase__r { font-size: .9375rem; }
.ar-phrase .mm-btn { margin-top: 10px; }

.ar-table { overflow-x: auto; margin: 0 0 24px; }
.ar-table table { border-collapse: collapse; width: 100%; }
.ar-table th { text-align: left; font-size: .8125rem; text-transform: uppercase; letter-spacing: .08em; color: var(--mm-slate); padding: 0 16px 10px 0; font-weight: 900; }
.ar-table td { padding: 12px 16px 12px 0; border-top: 2px solid var(--mm-line); font-weight: 500; vertical-align: top; }
.ar-sources { margin-top: 56px; font-size: .875rem; }
.ar-sources h2 { font-size: .8125rem; text-transform: uppercase; letter-spacing: .08em; color: var(--mm-slate); margin: 0 0 8px; }
.ar-sources ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.ar-sources a { font-weight: 700; }
.ar-review { max-width: var(--mm-max); }
.ar-review h1 { font-size: 2rem; }
.ar-review td { font-size: .9375rem; }

/* ---------- the blocks: one ice panel, things to tap inside it */
.fx { --x: var(--brand); background: var(--mm-ice); border-radius: 24px; padding: 24px; margin: 32px 0 40px; display: grid; gap: 14px; justify-items: center; text-align: center; }
.fx p { margin: 0; }
.fx a { color: var(--brand); font-weight: 900; }
/* Without the script the block is a plain list of what it holds; with it, the list gives way to the game. */
.fx:not(.is-live) > :not(.fx-static):not(script) { display: none; }
.fx.is-live > .fx-static { display: none; }
.fx-static { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; gap: 12px; text-align: left; }
.fx-static ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.fx-static li { display: grid; gap: 2px; }
.fx-static li b { font-size: 1.25rem; font-weight: 900; }
.fx-static li small { color: var(--mm-slate); font-weight: 700; font-size: .875rem; }
.fx-link { background: none; border: 0; padding: 8px; font: 700 .9375rem var(--mm-font); color: var(--mm-slate); text-decoration: underline; cursor: pointer; }
.fx .fx-cta { color: #fff; text-decoration: none; }
.fx-dots { list-style: none; display: flex; gap: 8px; margin: 0; padding: 0; }
.fx-dots li { width: 34px; height: 10px; border-radius: 5px; background: var(--mm-soft); transition: background-color .2s; margin: 0; }
.fx-dots li.is-on { background: var(--mm-correct); }
.fx-dots li.is-now { background: var(--x); }
.fx .mm-option.is-ok { border-color: var(--mm-correct); box-shadow: 0 var(--mm-depth) 0 var(--mm-correct); }
.fx .mm-option.is-no { border-color: var(--mm-wrong); box-shadow: 0 var(--mm-depth) 0 var(--mm-wrong); }
.fx .mm-option[disabled] { cursor: default; }
.fx :where(button, a, input):focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }

/* Hear it */
.say-note { font-weight: 900; font-size: .8125rem; text-transform: uppercase; letter-spacing: .08em; color: var(--mm-slate); min-height: 1.3em; }
.say-phrase { font-size: clamp(1.75rem, 6vw, 2.375rem); font-weight: 900; line-height: 1.15; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 10px; min-height: 1.3em; align-content: center; }
.say-phrase button { font: inherit; color: inherit; background: none; border: 0; padding: 2px 6px; border-radius: 10px; cursor: pointer; transition: background-color .25s, color .25s; }
.say-phrase button:hover { background: color-mix(in srgb, var(--x) 16%, transparent); }
.say-tr { font-weight: 700; font-size: 1.0625rem; }
.say-hint { font-size: .9375rem; min-height: 1.3em; }
.say-actions { display: flex; gap: 10px; }
.say-status { font-weight: 700; min-height: 1.4em; }
.say-status:empty { display: none; }
.say-next { max-width: 320px; margin-top: 6px; }

/* Which language is it? */
.guess-top { display: flex; align-items: center; gap: 12px; width: 100%; }
.guess-top .mm-progress { flex: 1; height: 20px; }
.guess-streak { font-weight: 900; color: color-mix(in srgb, var(--mm-streak) 70%, black); min-width: 2.2em; text-align: right; }
.guess-streak::before { content: "▲ "; font-size: .7em; }
.guess-phrase { font-size: clamp(1.75rem, 6vw, 2.25rem); font-weight: 900; line-height: 1.15; min-height: 1.2em; }
.guess-rom { min-height: 1.3em; font-weight: 700; }
.guess-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; width: 100%; }
.guess-opts .mm-option { margin-bottom: 4px; padding: 12px 14px; }
.guess-opts .mm-option img { width: 32px; height: 22px; border-radius: 4px; object-fit: cover; }
.guess-after { min-height: 3em; font-weight: 700; }

/* Plan builder: a dense picker, so only the chosen chip carries the lip */
.plan-group { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.plan-group button { font: 900 .9375rem/1 var(--mm-font); padding: 11px 14px; border-radius: var(--mm-r); border: 2px solid transparent; background: var(--mm-bg); color: var(--mm-slate); cursor: pointer; margin-bottom: 4px; }
.plan-group button[aria-checked="true"] { color: var(--mm-ink); border-color: var(--x); box-shadow: 0 4px 0 var(--x); }
.plan-result { font-size: 1.125rem; font-weight: 700; margin-top: 8px !important; }
.plan-when { display: block; font-size: clamp(2rem, 7vw, 2.75rem); line-height: 1.1; }
.plan-path { list-style: none; margin: 4px 0 8px; padding: 0; width: 100%; display: grid; gap: 10px; text-align: left; }
.plan-path li { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; font-weight: 700; margin: 0; }
.plan-path li > i { width: 44px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 900; color: #000; background: var(--x); margin-bottom: 5px; }
.plan-path li > span:last-child { color: var(--mm-slate); font-size: .9375rem; white-space: nowrap; }
.fx-plan > .mm-btn { color: #000; text-decoration: none; }
.plan-src { font-size: .8125rem; }
.plan-src a { font-weight: 700; color: inherit; }

/* 30-second chat */
.fx-chat { justify-items: stretch; text-align: left; }
.chat-log { min-height: 150px; }
.chat-log .mm-msg { margin: 0; cursor: pointer; }
.chat-log .mm-msg { background: var(--mm-bg); }
.chat-log .mm-msg--me { background: var(--lesson, var(--brand)); }
.chat-log .mm-msg__tr { display: block; font-weight: 500; font-size: .875rem; opacity: .75; margin-top: 2px; }
.chat-opts { display: grid; gap: 6px; }
.chat-opts .mm-option { font-size: 1rem; padding: 14px 16px; }
.chat-opts .mm-option small { display: block; font-weight: 500; color: var(--mm-slate); font-size: .8125rem; margin-top: 3px; }
.chat-tip { text-align: center; font-size: .875rem; }
.chat-end { display: grid; gap: 14px; justify-items: center; text-align: center; padding-top: 6px; }
.chat-end img { width: 110px; height: auto; }
.chat-end p { font-weight: 900; font-size: 1.25rem; }
.fx-chat .fx-static li.me { justify-items: end; text-align: right; }

/* Survive the trip. The stamps sit level (owner's call: no tilted tiles). */
.trip-stamps { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 0; padding: 0; }
.trip-stamps li { width: 68px; height: 68px; border-radius: 50%; border: 3px dashed var(--mm-soft); display: grid; place-items: center; font-size: .6875rem; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; color: var(--mm-slate); margin: 0; overflow: hidden; }
.trip-stamps li.is-on { border: 3px solid var(--x); color: color-mix(in srgb, var(--x) 55%, black); background: color-mix(in srgb, var(--x) 16%, var(--mm-bg)); }
.trip-stamps li.is-miss { border-style: solid; border-color: var(--mm-soft); }
.trip-scene { font-size: 1.125rem; font-weight: 700; line-height: 1.4; min-height: 4.2em; max-width: 34ch; }
.trip-opts { display: grid; gap: 6px; width: 100%; }
.trip-opts .mm-option { justify-content: center; text-align: center; }
.trip-after { font-weight: 700; min-height: 2.8em; max-width: 38ch; }
.fx-trip > .mm-btn { color: #000; }

/* Your name in Hangul */
.hg-label { display: grid; gap: 8px; justify-items: center; width: 100%; font-weight: 900; font-size: .8125rem; text-transform: uppercase; letter-spacing: .08em; color: var(--mm-slate); }
.hg-in { width: 100%; max-width: 300px; font: 900 1.375rem var(--mm-font); text-align: center; padding: 12px 14px; border: 3px solid var(--mm-line); border-radius: var(--mm-r); background: var(--mm-bg); color: var(--mm-ink); text-transform: none; letter-spacing: 0; }
.hg-in:focus { outline: none; border-color: var(--x); }
.hg-out { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; min-height: 96px; align-items: center; }
.hg-out button { font-family: "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif; font-weight: 800; font-size: 2.5rem; line-height: 1; width: 72px; height: 76px; border-radius: var(--mm-r); border: 2px solid var(--mm-line); background: var(--mm-bg); color: var(--mm-ink); box-shadow: 0 5px 0 var(--mm-line); margin-bottom: 5px; cursor: pointer; transition: transform 90ms ease-out, box-shadow 90ms ease-out; }
.hg-out button:active { transform: translateY(5px); box-shadow: 0 0 0 var(--mm-line); }
.hg-out button[aria-pressed="true"] { border-color: var(--x); box-shadow: 0 5px 0 var(--x); }
.hg-explain { min-height: 1.4em; font-weight: 700; }
.hg-explain b { color: var(--mm-ink); }
.hg-note { font-size: .8125rem; max-width: 44ch; }

@media (max-width: 600px) {
  .fx { padding: 20px 16px; margin-inline: -4px; }
  .trip-stamps li { width: 60px; height: 60px; font-size: .625rem; }
  .ar-body > h2 { margin-top: 44px; }
}
