/* Generated revision material.
 *
 * Every value here is from spec 7c. Nothing is taken from samples 5 or 6 - not
 * the lined-paper ground, not the red margin rule, not the coral/teal/green
 * pills, not the paperclip. 7c drives the components; the photographs are
 * context.
 *
 * The print rules are in this file rather than a later one on purpose. He asked
 * to be able to print anything and read it in bed or in the car, and the phone
 * card and the A4 page are two views of one document - retrofitting the second
 * always distorts the first.
 *
 * Typefaces (7c): Fredoka 600 headings and buttons, Nunito 400-900 everything
 * else. The host page links them; both still need checking against Lithuanian
 * diacritics before the LT switch ships (7b).
 */

.bc-scope {
  --paper: #FFFAF8;
  --ink: #4A3330;
  --ink-soft: #7A6260;
  --muted: #A38D8B;

  --rose: #E09B96;
  --rose-deep: #C87B76;
  --rose-bg: #FCEFEC;
  --mint: #7FAE7B;
  --mint-bg: #F1F7F0;
  --lilac: #BFB3D9;
  --lilac-bg: #F3EFF9;
  --peach: #E5B888;
  --peach-bg: #FDF1E4;

  --r-card: 24px;
  --r-row: 17px;
  --shadow: 0 6px 18px rgba(150, 100, 95, 0.10);

  --sans: "Nunito", ui-sans-serif, system-ui, sans-serif;
  --display: "Fredoka", "Nunito", ui-sans-serif, system-ui, sans-serif;

  font-family: var(--sans);
  color: var(--ink);
}

/* ------------------------------------------------------------------ card */
.bc {
  background: var(--paper);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 34rem;
  line-height: 1.5;
}

.bc-head { display: flex; flex-direction: column; gap: 4px; position: relative; }
.bc-eyebrow {
  margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-soft);
}
.bc-title {
  margin: 0; font-family: var(--display); font-weight: 600;
  font-size: 22px; line-height: 1.2; text-wrap: balance; color: var(--ink);
  padding-right: 5.5rem;
}
.bc-mode {
  position: absolute; top: 0; right: 0;
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  padding: 5px 11px; border-radius: 999px;
}
.bc-revisit .bc-mode { background: var(--lilac-bg); color: var(--ink-soft); }
.bc-test    .bc-mode { background: var(--rose-bg);  color: var(--ink); }

.bc-intro { margin: 0; color: var(--ink-soft); }
.bc-body  { margin: 0; }
.bc-h {
  margin: 0 0 8px; font-family: var(--display); font-weight: 600; font-size: 16px;
}
.bc-h-icon { display: flex; align-items: center; gap: 7px; }

.bc-i { width: 18px; height: 18px; flex: 0 0 auto; }
.bc-i-done { color: var(--ink-soft); }
.bc-i-no   { color: var(--ink-soft); }

/* Sparing, per the schema's cap of two per block. */
.bc-mark {
  background: var(--peach-bg);
  box-shadow: 0 -0.35em 0 var(--peach-bg) inset;
  color: inherit; padding: 0 2px; border-radius: 3px;
}

/* ------------------------------------------------------ provenance */
/* ink-soft, not muted. 7c assigns muted to "captions, evidence lines" and a
 * provenance chip is exactly an evidence line - but at 12.5px muted lands at
 * 3.01:1 on card and below 2.9:1 on every tint, so the one line whose whole job
 * is showing her where a claim came from was the least legible text in the
 * system. ink-soft clears 4.5:1 and still reads as secondary. */
.bc-src {
  margin: 0; display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--ink-soft);
}
.bc-src .bc-i { width: 14px; height: 14px; }

/* Peach is the strongest warning colour in the system. There is no red. */
.bc-outside {
  margin: 0; display: flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 700; color: var(--ink);
  background: var(--peach-bg); border-radius: 10px; padding: 7px 11px;
}
.bc-outside .bc-i { width: 15px; height: 15px; }

/* ----------------------------------------------------------- blocks */
.bc-block { display: block; }

.bc-steplist {
  margin: 0; padding: 0; list-style: none;
  display: flex; flex-direction: column; gap: 10px;
}
.bc-step {
  background: var(--lilac-bg); border-radius: var(--r-row); padding: 12px 14px;
  display: flex; flex-direction: column; gap: 5px;
}
/* Rose: the current thing, what matters. */
.bc-step-key { background: var(--rose-bg); }
.bc-step-head { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
/* The teacher's own phrasing, never translated. */
.bc-step-label {
  font-family: var(--display); font-weight: 600; font-size: 14px;
  letter-spacing: .02em; color: var(--ink);
}
.bc-step-role { font-size: 13px; color: var(--ink-soft); font-style: italic; }
.bc-dont { margin: 0; font-size: 13.5px; font-weight: 700; color: var(--ink-soft); }
/* ink, not rose-deep. The rose BACKGROUND already carries "this is the one that
 * matters"; the text does not need to say it twice, and rose-deep on rose-bg is
 * 2.85:1. This is the earns-marks line - the most useful sentence on the card. */
.bc-key  { margin: 0; font-size: 13px; font-weight: 700; color: var(--ink); }

.bc-example {
  background: var(--rose-bg); border-radius: var(--r-row); padding: 14px;
}
.bc-question { margin: 0 0 10px; font-weight: 700; }
.bc-lines { display: flex; flex-direction: column; gap: 7px; }
.bc-line { display: flex; gap: 9px; align-items: baseline; }
.bc-line-label {
  font-family: var(--display); font-weight: 600; font-size: 12.5px;
  color: var(--ink); flex: 0 0 auto; min-width: 6.5rem;
}
.bc-line-text { display: inline-flex; align-items: center; gap: 6px; }
.bc-line-final .bc-line-text { font-weight: 700; color: var(--ink); }

.bc-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.bc-table { border-collapse: collapse; width: 100%; font-size: 14px; }
.bc-table th, .bc-table td {
  padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--rose-bg);
}
.bc-table thead th {
  font-family: var(--display); font-weight: 600; font-size: 12.5px;
  color: var(--ink-soft); vertical-align: bottom;
}
.bc-rowlabel { font-weight: 700; white-space: nowrap; }

/* ------------------------------------------------------- questions */
.bc-q {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 12px; border-radius: var(--r-row); background: var(--rose-bg);
  margin-bottom: 8px;
}
.bc-q-text { flex: 1 1 10rem; }
.bc-q-right { background: var(--mint-bg); }
.bc-q-other { background: var(--peach-bg); }
.bc-choice { display: flex; gap: 8px; flex: 0 0 auto; }
/* 7c: touch targets 44px minimum. */
.bc-opt {
  width: 44px; height: 44px; border-radius: 14px; cursor: pointer;
  border: 1.5px solid rgba(122, 98, 96, .22); background: var(--paper);
  color: var(--ink-soft); display: grid; place-items: center;
  font-family: var(--display);
}
.bc-opt .bc-i { width: 21px; height: 21px; }
.bc-opt:focus-visible { outline: 3px solid var(--rose-deep); outline-offset: 2px; }
.bc-opt.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.bc-because {
  flex: 1 0 100%; margin: 2px 0 0; font-size: 13.5px; color: var(--ink-soft);
}

/* --------------------------------------------------- closing pieces */
.bc-clarify, .bc-selfcheck {
  display: flex; gap: 10px; align-items: flex-start;
  border-radius: var(--r-row); padding: 12px 14px;
}
.bc-clarify  { background: var(--peach-bg); }
.bc-selfcheck { background: var(--mint-bg); }
.bc-clarify > div, .bc-selfcheck > div { display: flex; flex-direction: column; gap: 2px; }
.bc-clarify b, .bc-selfcheck b {
  font-family: var(--display); font-weight: 600; font-size: 13px;
  letter-spacing: .03em; text-transform: uppercase;
}
.bc-clarify b { color: var(--ink); }
.bc-selfcheck b { color: var(--ink); }
.bc-clarify .bc-i { color: var(--ink); margin-top: 2px; }
.bc-selfcheck .bc-i { color: var(--ink); margin-top: 2px; }

.bc-sources {
  border-top: 1px solid var(--rose-bg); padding-top: 12px;
  font-size: 12.5px; color: var(--ink-soft);
}
.bc-sources-h {
  font-family: var(--display); font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; font-size: 11px; display: block; margin-bottom: 4px;
}
.bc-sources ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 2px; }

@media (prefers-reduced-motion: reduce) {
  .bc-opt { transition: none; }
}

/* =====================================================================
 * PRINT - A4
 * =====================================================================
 * "She must be able to print anything the app produces and read it in bed or
 * in the car."
 *
 * Two things this must get right, and they are not obvious:
 *
 * 1. A printed TEST card has to stay answerable. Tap targets become empty
 *    boxes, and the reasons stay hidden - printing them turns an exercise into
 *    a reading sheet. This is why self_check is required on test cards: on
 *    paper it is the ONLY way she can check herself, since there is no app to
 *    turn a row mint.
 * 2. The source ledger prints. The traceability rule is worth least when it is
 *    only on the screen she has closed - on paper, in the car, it is the thing
 *    that tells her whether a line came from her own notes.
 */
@page { size: A4; margin: 16mm 15mm; }

@media print {
  .bc-scope { color: var(--ink); }

  .bc {
    box-shadow: none;
    border: 1px solid var(--muted);
    max-width: none;
    padding: 14mm 12mm;
    break-inside: auto;
    page-break-inside: auto;
  }

  /* Keep a unit of meaning together across a page break. */
  .bc-block, .bc-step, .bc-q, .bc-clarify, .bc-selfcheck, .bc-example, .bc-line {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .bc-h, .bc-title { break-after: avoid; page-break-after: avoid; }

  /* Backgrounds survive only if the browser is asked; if the user declines,
   * every one of these still has a border or a rule to fall back on. */
  .bc-step, .bc-example, .bc-q, .bc-clarify, .bc-selfcheck {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    border: 1px solid var(--muted);
  }

  /* A printed exercise must remain an exercise. */
  .bc-test .bc-because { display: none; }
  .bc-q-right, .bc-q-other { background: var(--rose-bg); }
  .bc-opt { background: var(--paper); border: 1.5px solid var(--ink-soft); color: transparent; }
  .bc-opt .bc-i, .bc-opt.on { color: transparent; background: var(--paper); }
  .bc-test .bc-table td .bc-i { display: none; }

  /* A revisit card is meant to be read, so it keeps its ticks. */
  .bc-revisit .bc-table td .bc-i { display: inline; }

  .bc-sources { color: var(--ink); }
  .bc-scroll { overflow: visible; }
  .bc-table { font-size: 11pt; }
}
