/* The reference pages built by Web/tools/make_pages.py (bang-chu-cai.html, bang-van.html), on top of the legal
   pages' reading style (legal/legal.css). Letters and rhymes use the app's reading font, Andika, whose a and g are
   the shapes children learn to write. */
@font-face { font-family: "Andika"; src: url("../assets/fonts/Andika-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

main.wide { max-width: 1120px; }
header.doc .app a { color: inherit; text-decoration: none; }
.muted { color: var(--ink-soft); font-weight: 600; }
.read, .letter, .steps { font-family: "Andika", "Nunito", sans-serif; }
.steps { font-weight: 700; }

.voice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 18px; font-weight: 800; color: var(--ink-soft); }
.voice button { min-height: 56px; padding: 0 18px; border-radius: 16px; border: 2px solid var(--line); background: var(--card);
  font: inherit; color: var(--ink); cursor: pointer; }
.voice button[aria-pressed="true"] { border-color: var(--accent); background: #FFF1DC; }

.toc ol { columns: 2 260px; column-gap: 28px; margin: 8px 0 0; }
.toc li { break-inside: avoid; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 14px; margin: 14px 0 8px; }
/* A letter's card holds a picture, a spelled-out word and a 🔊 side by side: it needs more width than a rhyme's. */
.grid.letters { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.card { background: var(--card); border-radius: 18px; padding: 14px 16px; box-shadow: 0 3px 0 var(--line); min-width: 0; }
.card .head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.letter { font-size: 38px; font-weight: 700; line-height: 1.15; }
.kind { font-size: 14px; font-weight: 800; color: var(--ink-soft); background: #F3EEE6; border-radius: 999px; padding: 2px 10px; }
.kind.v { background: #FFE7D6; color: #A9520B; }
.row { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.row .txt { flex: 1; min-width: 0; line-height: 1.45; }
.lbl { font-size: 14px; font-weight: 800; color: var(--ink-soft); }
.read { font-size: 21px; }
.pic { width: 64px; height: 64px; flex: none; object-fit: contain; }

/* Scripts add sound; without them the buttons stay hidden and the text says it all. */
.say { display: none; }
.js .say { display: grid; place-items: center; width: 56px; height: 56px; flex: none; border: 0; border-radius: 50%; background: #FFF1DC;
  color: var(--ink); font-size: 22px; cursor: pointer; }
.say.on { background: var(--accent); color: #fff; }
.ico { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
@media (hover: hover) and (pointer: fine) { .say:hover { filter: brightness(.97); transform: translateY(-1px); } }
section { scroll-margin-top: 12px; }
@media print { .say, .voice { display: none !important; } }

/* ---- Calls to action: the pages exist to bring parents to the app (web) or the iPad app (App Store). ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px; padding: 0 22px;
  border-radius: 18px; font-weight: 900; font-size: 18px; line-height: 1.2; text-decoration: none; text-align: center; }
.btn.primary { background: var(--accent); color: #fff; box-shadow: 0 4px 0 #B86A06; }
.btn.store { background: #1F2030; color: #fff; box-shadow: 0 4px 0 #000; }
.btn.ghost { background: #FFF1DC; color: var(--ink); box-shadow: 0 3px 0 #F1DDBF; font-size: 16px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 14px 0 6px; }
.cta-row .btn { flex: 1 1 auto; }   /* sized to its label; a row too narrow for both puts them one above the other */
.fine { color: var(--ink-soft); font-size: 15px; font-weight: 700; margin: 6px 0 0; }

.hero { display: grid; gap: 18px; background: var(--card); border-radius: 22px; padding: 18px; box-shadow: 0 3px 0 var(--line); margin: 10px 0 22px; }
.hero h2 { margin: 0; font-size: 22px; }
.hero p { margin: 8px 0 0; }
.hero img { width: 100%; height: auto; border-radius: 14px; box-shadow: 0 2px 0 var(--line); }
@media (min-width: 720px) { .hero { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center; padding: 24px; } }

.promo { background: #FFF1DC; border-radius: 22px; padding: 18px; margin: 26px 0; }
.promo h2 { margin: 0 0 10px; }
.promo ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.promo li { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 16px; padding: 10px 12px; margin: 0; font-weight: 700; }
.promo li img { width: 44px; height: 44px; flex: none; }
.cta-end { text-align: center; }
.cta-end .cta-row { justify-content: center; max-width: 620px; margin-left: auto; margin-right: auto; }

.group-cta { margin: 6px 0 4px; }
.write { display: flex; align-items: center; justify-content: center; min-height: 56px; margin-top: 10px; border-radius: 14px;
  background: #F3EEE6; color: var(--ink); text-decoration: none; font-weight: 800; }

/* The bar: a phone gets it along the bottom, wider screens a card in the corner. */
.dock { position: fixed; z-index: 10; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); display: flex; align-items: center;
  gap: 10px; padding: 8px 8px 8px 12px; background: var(--card); border-radius: 20px; box-shadow: 0 8px 28px rgba(43, 45, 66, .22);
  transform: translateY(140%); transition: transform .25s ease; }
.dock.show { transform: none; }
.dock img { width: 40px; height: 40px; border-radius: 10px; flex: none; }
.dock-t { min-width: 0; flex: 1; line-height: 1.25; }
.dock-t b { display: block; }
.dock-t span { color: var(--ink-soft); font-size: 14px; font-weight: 700; }
.dock .btn { padding: 0 16px; font-size: 16px; flex: none; }
.dock-x { width: 44px; min-height: 56px; flex: none; border: 0; background: none; color: var(--ink-soft); font-size: 18px; cursor: pointer; }
.dock .wide-only { display: none; }
@media (max-width: 420px) { .dock-t span { display: none; } }
@media (min-width: 720px) { .dock { left: auto; right: 18px; bottom: 18px; } .dock .wide-only { display: inline-flex; } }
body.has-dock main { padding-bottom: calc(env(safe-area-inset-bottom) + 110px); }
@media (prefers-reduced-motion: reduce) { .dock { transition: none; } }

@media (hover: hover) and (pointer: fine) {
  .btn:hover, .write:hover { transform: translateY(-2px); filter: brightness(1.03); }
}
@media print { .hero .cta-row, .promo, .cta-end, .dock, .write, .group-cta { display: none !important; } }
