/* Free resources: guides, the fact practice tool, blending tiles and printable sheets. Loaded only on /resources/ pages. */

.page-head .crumbs { padding: 0 var(--gutter); max-width: 1240px; margin: 0 auto; font-weight: 800; font-size: 0.98rem; }
.crumbs a { color: var(--ink); }
.byline { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 18px; font-weight: 800; font-size: 0.98rem; color: #4a2f2c; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* A plain note in the prose column */
.prose .note { background: #fff1c7; border-radius: 22px; padding: 18px 22px; font-weight: 700; }
.prose .note p + p { margin-top: 0.6em; }
.prose .sources { font-size: 1rem; color: var(--ink-muted); }
.prose .sources li { margin: 0.5em 0; }
.prose .app-note { background: var(--ink); color: #fff; border-radius: var(--radius-card); padding: 26px 28px; margin: 2.4em 0 0; }
.prose .app-note h2 { margin: 0 0 0.4em; font-size: 1.5rem; }
.prose .app-note p { color: #e9e5ff; font-weight: 600; }
.prose .app-note .btn { margin-top: 18px; }
.prose .app-note a.more { color: #fff; margin-left: 18px; }

/* Small secondary button, same pressed material */
.btn.small { font-size: 1.02rem; padding: 12px 18px; border-radius: 16px; box-shadow: 0 4px 0 var(--night); }
.btn.small:hover { box-shadow: 0 5px 0 var(--night); }
.btn.small:active { box-shadow: 0 1px 0 var(--night); }
.btn.ghost { background: var(--paper); color: var(--ink); box-shadow: 0 4px 0 rgba(41, 39, 64, 0.22), inset 0 0 0 2px rgba(41, 39, 64, 0.16); }
.btn.ghost:hover { color: var(--ink); box-shadow: 0 5px 0 rgba(41, 39, 64, 0.22), inset 0 0 0 2px rgba(41, 39, 64, 0.16); }
.btn.ghost:active { box-shadow: 0 1px 0 rgba(41, 39, 64, 0.22), inset 0 0 0 2px rgba(41, 39, 64, 0.16); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ---------- Blending tiles ---------- */
.blend { background: linear-gradient(160deg, #fff1c7, #ffe1c4); border-radius: var(--radius-card); padding: clamp(20px, 3vw, 32px); margin: 1.4em 0 1.6em; }
.blend-stage { display: flex; justify-content: center; align-items: center; min-height: 132px; gap: var(--blend-gap, 44px); transition: gap 520ms cubic-bezier(.16, 1, .3, 1); list-style: none; margin: 0; padding: 0; }
.blend[data-state="close"] .blend-stage { --blend-gap: 4px; }
.blend[data-state="word"] .blend-stage { --blend-gap: 0px; }
.blend .tile { width: clamp(72px, 16vw, 104px); font-size: clamp(2.4rem, 6vw, 3.4rem); background: var(--paper); color: var(--ink); box-shadow: 0 4px 0 rgba(41, 39, 64, 0.16); transition: width 520ms cubic-bezier(.16, 1, .3, 1), background 380ms cubic-bezier(.16, 1, .3, 1), border-radius 380ms cubic-bezier(.16, 1, .3, 1); }
.blend[data-state="word"] .tile { width: clamp(46px, 9vw, 64px); aspect-ratio: auto; height: clamp(72px, 16vw, 104px); }
.blend[data-state="word"] .tile { background: var(--mint); box-shadow: 0 4px 0 var(--mint-deep); border-radius: 0; }
.blend[data-state="word"] .tile:first-child { border-radius: var(--radius-tile) 0 0 var(--radius-tile); }
.blend[data-state="word"] .tile:last-child { border-radius: 0 var(--radius-tile) var(--radius-tile) 0; }
.blend .tile.swapped { animation: pulse 900ms cubic-bezier(.16, 1, .3, 1) 1; }
.blend-say { text-align: center; font-weight: 800; font-size: 1.15rem; margin: 18px auto 16px; min-height: 3.2em; max-width: 40ch; }
.blend-say b { font-weight: 900; color: var(--ink-soft); letter-spacing: 0.02em; }
.blend .btn-row { justify-content: center; }
.word-pick { display: flex; gap: 8px; justify-content: center; margin-top: 16px; flex-wrap: wrap; font-weight: 800; align-items: center; }
.word-pick button { font: inherit; font-weight: 900; font-size: 1.1rem; min-width: 64px; min-height: 44px; padding: 8px 14px; border: 0; border-radius: 14px; cursor: pointer; background: rgba(255, 253, 249, 0.7); color: var(--ink); box-shadow: 0 3px 0 rgba(41, 39, 64, 0.12); }
.word-pick button[aria-pressed="true"] { background: var(--paper); box-shadow: 0 3px 0 rgba(41, 39, 64, 0.25), inset 0 0 0 3px var(--ink); }

/* ---------- Fact practice tool ---------- */
.tool { background: linear-gradient(160deg, #fff1c7, #ffe1c4); border-radius: var(--radius-card); padding: clamp(18px, 3vw, 36px); }
.tool h2 { font-size: clamp(1.5rem, 2.4vw, 2rem); margin: 0 0 6px; }
.tool .hint { color: var(--ink-muted); font-weight: 600; margin: 0 0 18px; }
.op-switch { border: 0; padding: 0; margin: 0 0 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.op-switch legend { font-weight: 900; margin-bottom: 8px; width: 100%; padding: 0; }
.op-switch label { position: relative; }
.op-switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.op-switch span { display: block; font-weight: 900; padding: 10px 16px; border-radius: 16px; background: rgba(255, 253, 249, 0.6); box-shadow: 0 3px 0 rgba(41, 39, 64, 0.12); cursor: pointer; }
.op-switch input:checked + span { background: var(--paper); box-shadow: 0 3px 0 rgba(41, 39, 64, 0.25), inset 0 0 0 3px var(--ink); }
.op-switch input:focus-visible + span { outline: 3px solid var(--ink-soft); outline-offset: 3px; }

.fact-grid { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: clamp(3px, 0.6vw, 6px); max-width: 620px; }
.fact-grid .axis { display: grid; place-items: center; font-weight: 900; font-size: clamp(0.8rem, 1.6vw, 1.05rem); color: var(--ink); aspect-ratio: 1; }
.fact-grid .axis.op { color: var(--ink-soft); }
.fact-cell {
  aspect-ratio: 1; min-width: 24px; border: 0; padding: 0; cursor: pointer; border-radius: clamp(6px, 1vw, 12px);
  font: inherit; font-weight: 900; font-size: clamp(0.62rem, 1.2vw, 0.82rem); line-height: 1;
  background: var(--paper); color: transparent; box-shadow: inset 0 0 0 2px rgba(41, 39, 64, 0.1);
  transition: background 200ms cubic-bezier(.16, 1, .3, 1), box-shadow 200ms cubic-bezier(.16, 1, .3, 1);
}
.fact-cell:hover { color: rgba(41, 39, 64, 0.55); box-shadow: inset 0 0 0 2px rgba(41, 39, 64, 0.3); }
.fact-cell[aria-pressed="true"] { background: var(--ink); color: #fff; box-shadow: 0 3px 0 var(--night); }
.chosen { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 18px 0 0; min-height: 44px; align-items: center; }
.chosen li { font-weight: 900; background: var(--paper); border-radius: 14px; padding: 8px 12px; box-shadow: 0 3px 0 rgba(41, 39, 64, 0.16); }
.chosen .empty { background: none; box-shadow: none; padding: 0; font-weight: 700; color: var(--ink-muted); }
.tool .btn-row { margin-top: 22px; }

.practice { background: var(--paper); border-radius: 22px; padding: clamp(18px, 3vw, 32px); box-shadow: 0 4px 0 rgba(41, 39, 64, 0.12); }
.practice .count { font-weight: 800; color: var(--ink-muted); }
.practice-q { font-size: clamp(2.6rem, 7vw, 4.4rem); font-weight: 900; letter-spacing: -0.03em; line-height: 1.05; margin: 8px 0 18px; }
.answer { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.answer input {
  font: inherit; font-weight: 900; font-size: 2rem; width: 5.2ch; padding: 10px 14px; border-radius: 16px;
  border: 0; background: #fff; color: var(--ink); box-shadow: inset 0 0 0 3px rgba(41, 39, 64, 0.22); caret-color: var(--ink-soft);
}
.answer input:focus { outline: none; box-shadow: inset 0 0 0 3px var(--ink-soft); }
.feedback { min-height: 1.6em; margin: 14px 0 0; font-weight: 800; }
.feedback.yes { color: var(--mint-deep); }
.practice .btn-row { margin-top: 18px; }
.picture { margin: 22px 0 0; padding: 18px; border-radius: 18px; background: #fff8e6; }
.picture svg { display: block; width: 100%; max-width: 360px; height: auto; margin: 0 auto 12px; }
.picture figcaption { font-weight: 700; max-width: 52ch; }

.record { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.record li { display: grid; grid-template-columns: minmax(84px, auto) 1fr; gap: 12px; align-items: center; background: var(--paper); border-radius: 18px; padding: 12px 14px; }
.record .fact { font-weight: 900; font-size: 1.3rem; }
.support { display: flex; flex-wrap: wrap; gap: 6px; }
.support button { font: inherit; font-weight: 800; font-size: 0.95rem; min-height: 40px; padding: 6px 12px; border: 0; border-radius: 12px; cursor: pointer; background: rgba(41, 39, 64, 0.06); color: var(--ink); }
.support button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.support button[data-level="help"][aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 3px rgba(41, 39, 64, 0.5); }

/* ---------- Checklist (offline rehearsal) ---------- */
.checks { list-style: none; padding: 0 !important; margin: 0 0 1em; display: grid; gap: 8px; }
.checks li { margin: 0 !important; }
.checks label { display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: start; cursor: pointer; padding: 12px 14px; border-radius: 16px; background: #fff8e6; font-weight: 700; }
.checks input { appearance: none; -webkit-appearance: none; width: 28px; height: 28px; margin: 0; border-radius: 8px; background: var(--paper); box-shadow: inset 0 0 0 3px rgba(41, 39, 64, 0.35); cursor: pointer; display: grid; place-items: center; }
.checks input:checked { background: var(--ink); box-shadow: 0 3px 0 var(--night); }
.checks input:checked::after { content: ""; width: 7px; height: 13px; border: solid #fff; border-width: 0 3px 3px 0; transform: translateY(-2px) rotate(45deg); }
.checks input:focus-visible { outline: 3px solid var(--ink-soft); outline-offset: 3px; }

/* ---------- Printable sheets ---------- */
.sheet { border: 3px dashed rgba(41, 39, 64, 0.25); border-radius: 22px; padding: clamp(18px, 3vw, 28px); margin: 1.2em 0 1em; background: #fff; }
.sheet h3 { margin: 0 0 0.4em; font-size: 1.4rem; }
.sheet .blank { display: inline-block; min-width: 9ch; border-bottom: 2px solid var(--ink); margin: 0 4px; }
.sheet .lines { display: grid; gap: 10px; margin: 12px 0; }
.sheet table { width: 100%; border-collapse: collapse; }
.sheet th, .sheet td { border-bottom: 2px solid rgba(41, 39, 64, 0.15); padding: 10px 8px; text-align: left; }
.sheet .box { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--ink); border-radius: 4px; vertical-align: -3px; margin-right: 6px; }
.sheet .box.on { background: var(--ink); }
.sheet .key { margin-top: 18px; padding-top: 12px; border-top: 2px dashed rgba(41, 39, 64, 0.3); font-size: 0.95rem; color: var(--ink-muted); }
.cut-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; margin: 14px 0; }
.cut-tiles span { aspect-ratio: 1; display: grid; place-items: center; font-weight: 900; font-size: clamp(2.4rem, 8vw, 4.4rem); border: 2px dashed rgba(41, 39, 64, 0.45); margin: -1px 0 0 -1px; }
.ten-boxes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 12px 0; }
.ten-boxes span { aspect-ratio: 4 / 3; border: 2px solid var(--ink); border-radius: 12px; display: grid; place-items: center; font-weight: 900; font-size: 1.2rem; }

@media (max-width: 560px) {
  .record li { grid-template-columns: 1fr; gap: 8px; }
  .prose .app-note a.more { display: inline-block; margin: 14px 0 0; }
}

@media print {
  @page { margin: 14mm; }
  body { font-size: 11pt; background: #fff; }
  .skip, .site-head, .site-foot, .toc, .crumbs, .no-print, .btn, .btn-row, .app-note, .tool .hint, .op-switch, .fact-grid, .chosen { display: none !important; }
  .page-head { background: none; padding: 0; }
  .page-head .title { padding: 0; }
  .page-head h1 { font-size: 22pt; }
  .doc { display: block; padding: 0; }
  .prose { max-width: none; }
  a { color: inherit; text-decoration: none; }
  .sheet { border: 0; padding: 0; break-inside: avoid; }
  .sheet .box.on, .cut-tiles span { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  /* A "Print" button prints only its own sheet. */
  html[data-printing] .page-head, html[data-printing] .prose > :not(.printing) { display: none !important; }
  html[data-printing] .printing { display: block !important; margin: 0; }
  .cut-tiles span { font-size: 64pt; }
}
@media (prefers-reduced-motion: reduce) {
  .blend-stage, .blend .tile { transition: none; }
}

[hidden] { display: none !important; }
.doc.solo { grid-template-columns: minmax(0, 1fr); max-width: 860px; }
.doc.solo .prose { max-width: none; }
.prose .chosen, .prose .record { padding-left: 0; }
