/* Secondary practice (templates/Secondary1/Practice*.html): phone width first, in Secondary 1's violet,
   with the site's fonts. Only these pages load it. */
.s1p-page {
  --s1p-colour: #993696;
  --s1p-dark: #7a2b78;
  --s1p-pale: #fbf3fb;
  --s1p-right: #157a2c;
  --s1p-right-pale: #effaf1;
  --s1p-wrong: #b3261e;
  --s1p-wrong-pale: #fdf1f0;
  --s1p-ink: #222;
  max-width: 820px;
  margin: 0 auto;
  padding: 0 0 30px;
  text-align: left;
  font-family: Catamaran, sans-serif;
  font-size: 18px;
  line-height: 1.5;
  color: var(--s1p-ink);
}
.s1p-trail {
  margin: 0 0 12px;
  padding: 8px 14px;
  border-radius: 8px;
  color: #fff;
  background: var(--s1p-colour);
  font-size: 15px;
}
.s1p-trail a { color: #fff !important; text-decoration: underline; }
.s1p-title, .s1p-menu-title {
  font-family: Voltaire, sans-serif;
  font-size: 28px;
  line-height: 1.2;
  color: var(--s1p-colour);
  margin: 4px 0 6px;
}
.s1p-number { color: var(--s1p-dark); opacity: 0.8; }
.s1p-status { margin: 0 0 8px; font-size: 16px; }
.s1p-status > span { display: inline-block; margin: 0 6px 4px 0; }
.s1p-count { color: #444; }
.s1p-count b { color: var(--s1p-dark); font-size: 18px; }
/* Maths at the size of the words around it (KaTeX's own default is 1.21 times larger), and figures
   in running text that line up with the maths figures */
.s1p-page .katex { font-size: 1.05em; }
.s1p-page { font-variant-numeric: lining-nums; }
.s1p-mastered {
  padding: 1px 10px;
  border-radius: 14px;
  color: #fff;
  background: var(--s1p-right);
}
.s1p-free, .s1p-note {
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 15px;
  background: #f5f5f5;
}

/* the question */
.s1p-area { margin-top: 6px; }
.s1p-question {
  padding: 14px 14px 10px;
  border: 2px solid var(--s1p-colour);
  border-radius: 10px;
  background: #fff;
}
.s1p-stem p, .s1p-prompt p, .s1p-step p { margin: 0 0 10px; }
.s1p-stem, .s1p-hints, .s1p-steps-body, .s1p-choice span, .s1w-steps { overflow-x: auto; overflow-y: hidden; }
.s1p-stem table, .s1p-step table, .s1p-steps-body table, .s1w-steps table {
  border-collapse: collapse;
  margin: 6px 0 12px;
}
.s1p-stem th, .s1p-stem td, .s1p-step th, .s1p-step td, .s1p-steps-body th, .s1p-steps-body td, .s1w-steps th, .s1w-steps td {
  border: 1px solid #bbb;
  padding: 4px 10px;
  text-align: center;
}
.s1p-stem th, .s1p-step th, .s1p-steps-body th, .s1w-steps th { background: var(--s1p-pale); }
.s1p-part {
  margin: 12px 0 0;
  padding: 10px 0 0;
  border-top: 1px dashed #ddd;
}
.s1p-part:first-child { border-top: 0; padding-top: 0; }
.s1p-prompt { margin: 0 0 8px; }
.s1p-label { color: var(--s1p-dark); }
.s1p-row { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; }   /* a box and its unit stay on one line: the box narrows */
.s1p-box {
  flex: 0 1 14em;
  min-width: 0;
  width: 14em;
  max-width: 100%;
  padding: 8px 10px;
  border: 2px solid #999;
  border-radius: 6px;
  font-size: 20px;
  font-family: inherit;
  background: #fff;
  box-sizing: border-box;
}
.s1p-box:focus { border-color: var(--s1p-colour); outline: 2px solid rgba(153, 54, 150, 0.25); }
.s1p-row math-field {
  flex: 1 1 14em;
  min-width: 0;
  max-width: 420px;
  padding: 4px 8px;
  border: 2px solid #999;
  border-radius: 6px;
  font-size: 22px;
  box-sizing: border-box;
}
.s1p-row math-field:focus-within { border-color: var(--s1p-colour); }
.s1p-row math-field::part(menu-toggle) { display: none; }     /* MathLive's own menu: not needed here */
.s1p-unit { font-size: 20px; }
.s1p-box.s1p-day { flex: 0 0 4.5em; width: 4.5em; }
.s1p-box.s1p-month { flex: 0 1 auto; width: auto; max-width: 12em; }
.s1p-box.s1p-time { flex: 0 0 6.5em; width: 6.5em; }
.s1p-row .s1p-math { flex: 1 1 14em; }
.s1p-ampm-button {
  padding: 7px 12px;
  border: 2px solid var(--s1p-colour);
  border-radius: 6px;
  background: #fff;
  color: var(--s1p-dark);
  font-size: 17px;
}
.s1p-ampm-button[aria-pressed="true"] { background: var(--s1p-colour); color: #fff; }
.s1p-choices { border: 0; margin: 0; padding: 0; width: 100%; }
.s1p-tick-all { width: 100%; margin: 0 0 6px; font-size: 16px; font-weight: bold; color: var(--s1p-dark); }
.s1p-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  padding: 8px 12px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-weight: normal;
  cursor: pointer;
}
.s1p-choice input { width: 20px; height: 20px; flex: none; margin: 0; }
.s1p-choice:has(input:checked) { border-color: var(--s1p-colour); background: var(--s1p-pale); }
.s1p-typing { margin: 4px 0 0; font-size: 14px; color: #555; }
.s1p-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* verdicts, hints and the worked solution */
.s1p-verdict:empty { display: none; }
.s1p-verdict {
  margin: 8px 0 0;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 17px;
}
.s1p-verdict.is-right { background: var(--s1p-right-pale); border-left: 5px solid var(--s1p-right); }
.s1p-verdict.is-wrong { background: var(--s1p-wrong-pale); border-left: 5px solid var(--s1p-wrong); }
.s1p-verdict.is-unreadable { background: #fff6dd; border-left: 5px solid #c88a00; }
.s1p-verdict-head { font-weight: bold; }
.s1p-verdict.is-right .s1p-verdict-head { color: var(--s1p-right); }
.s1p-verdict.is-wrong .s1p-verdict-head { color: var(--s1p-wrong); }
.s1p-verdict p { margin: 2px 0 0; }
.s1p-hints:empty { display: none; }
.s1p-hints { margin: 12px 0 0; }
.s1p-step {
  margin: 0 0 8px;
  padding: 8px 12px;
  border-left: 4px solid var(--s1p-colour);
  background: var(--s1p-pale);
}
.s1p-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 4px; }
.s1p-button {
  padding: 9px 22px;
  border: 0;
  border-radius: 6px;
  background: var(--s1p-colour);
  color: #fff;
  font-family: Voltaire, sans-serif;
  font-size: 20px;
  cursor: pointer;
}
.s1p-button:hover, .s1p-button:focus-visible { background: var(--s1p-dark); }
.s1p-button--quiet { background: #fff; color: var(--s1p-dark); border: 2px solid var(--s1p-colour); }
.s1p-button--quiet:hover, .s1p-button--quiet:focus-visible { color: #fff; }
.s1p-button[disabled] { opacity: 0.45; cursor: default; }
.s1p-message:empty { display: none; }
.s1p-message { margin: 6px 0; font-size: 16px; }
.s1p-steps { margin: 12px 0 0; padding: 10px 12px; border-radius: 8px; background: #f7f7f7; }
.s1p-steps-heading { font-family: Voltaire, sans-serif; font-size: 21px; margin: 0 0 6px; color: var(--s1p-dark); }
.s1p-steps-body > div { margin: 0 0 8px; }
.s1p-none { padding: 20px 0; }

/* under the question */
.s1p-after { margin-top: 20px; }
.s1p-pill {
  display: inline-block;
  margin: 0 8px 8px 0;
  padding: 6px 14px;
  border: 2px solid var(--s1p-colour);
  border-radius: 20px;
  color: var(--s1p-dark) !important;
  background: var(--s1p-pale);
  text-decoration: none;
}
.s1p-flag summary { cursor: pointer; color: #555; font-size: 16px; }
.s1p-flag label { display: block; margin: 8px 0 4px; font-size: 16px; }
.s1p-flag textarea { width: 100%; max-width: 520px; box-sizing: border-box; font: inherit; font-size: 16px; padding: 6px; }
.s1p-flag-done { margin-left: 10px; font-size: 16px; color: var(--s1p-right); }

/* the menu */
.s1p-chapter { margin: 0 0 18px; border: 2px solid var(--s1p-colour); border-radius: 10px; overflow: hidden; }
.s1p-chapter-name {
  margin: 0;
  padding: 8px 14px;
  font-family: Voltaire, sans-serif;
  font-size: 21px;
  color: #fff;
  background: var(--s1p-colour);
}
.s1p-skills { list-style: none; margin: 0; padding: 4px 0; }
.s1p-skill { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 7px 14px; border-top: 1px solid #eee; }
.s1p-skill:first-child { border-top: 0; }
.s1p-skill-link { color: var(--s1p-dark); font-weight: bold; }
.s1p-skill-soon { color: #777; }
.s1p-skill-state { font-size: 15px; color: #555; }
.s1p-join { padding: 12px 14px; border-radius: 6px; background: #f1faf1; }

@media (min-width: 768px) {
  .s1p-title, .s1p-menu-title { font-size: 32px; }
  .s1p-question { padding: 20px 22px 14px; }
}

/* worksheets (Worksheets.html, Worksheet.html) */
.s1w-person { margin: 0 0 22px; padding: 12px 14px; border: 2px solid var(--s1p-colour); border-radius: 10px; }
.s1w-person-name { margin: 0 0 8px; font-family: Voltaire, sans-serif; font-size: 22px; color: var(--s1p-dark); }
.s1w-make { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; margin: 0 0 10px; }
.s1w-make label { display: flex; flex-direction: column; font-size: 15px; font-weight: normal; }
.s1w-make select { min-width: 0; max-width: 100%; padding: 6px 8px; font-size: 16px; border: 2px solid #999; border-radius: 6px; }
.s1w-list-title { margin: 16px 0 8px; font-family: Voltaire, sans-serif; font-size: 21px; color: var(--s1p-dark); }
.s1w-sheets { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.s1w-sheet-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border: 2px solid var(--s1p-colour);
  border-radius: 10px;
  background: var(--s1p-pale);
  color: var(--s1p-ink) !important;
  text-decoration: none !important;
}
.s1w-sheet-card:hover, .s1w-sheet-card:focus-visible { background: #f3e3f3; }
.s1w-sheet-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.s1w-sheet-name { font-family: Voltaire, sans-serif; font-size: 22px; color: var(--s1p-dark); }
.s1w-sheet-about { font-size: 15px; color: #555; }
.s1w-sheet-score { font-size: 22px; font-weight: bold; color: var(--s1p-dark); }
.s1w-sheet-go {
  flex: none; padding: 7px 16px; border-radius: 6px;
  background: var(--s1p-colour); color: #fff;
  font-family: Voltaire, sans-serif; font-size: 18px;
}
.s1w-sheet-go.is-done { background: #fff; color: var(--s1p-dark); border: 2px solid var(--s1p-colour); }
.s1w-meta { margin: 0 0 6px; font-size: 16px; color: #444; }
.s1w-name-line { display: none; }
.s1w-questions { margin: 0; padding: 0 0 0 1.6em; }
.s1w-question { margin: 0 0 16px; }
.s1w-question > .s1p-question { padding: 10px 12px 8px; }
.s1w-question.is-right > .s1p-question { border-color: var(--s1p-right); }
.s1w-question.is-wrong > .s1p-question { border-color: var(--s1p-wrong); }
.s1w-result { margin: 10px 0 0; padding: 8px 12px; border-radius: 8px; background: #f7f7f7; font-size: 17px; }
.s1w-result p { margin: 2px 0; }
.s1w-mark { margin-left: 6px; padding: 0 8px; border-radius: 10px; font-size: 15px; color: #fff; }
.s1w-mark.is-right { background: var(--s1p-right); }
.s1w-mark.is-wrong { background: var(--s1p-wrong); }
.s1w-message { color: #555; }
.s1w-steps-title { margin: 8px 0 4px; font-family: Voltaire, sans-serif; font-size: 18px; color: var(--s1p-dark); }
.s1w-steps > div { margin: 0 0 6px; }

/* Printing a worksheet: the paper alone (the site's bars, buttons and links left out), with the answers
   wherever the page shows them (to parents and teachers, or once finished) */
@media print {
  body > *:not(#wrap), #wrap > *:not(main), .s1w-noprint, .s1p-verdict, .s1p-typing { display: none !important; }
  .s1p-page { max-width: none; font-size: 12pt; }
  .s1w-name-line { display: block; margin: 4px 0 12px; }
  .s1w-question { break-inside: avoid; }
  .s1w-question > .s1p-question { border: 1px solid #999; }
  .s1p-box, .s1p-row math-field { border: 0; border-bottom: 1px solid #000; border-radius: 0; }
  .s1w-result { background: none; border-top: 1px dashed #999; border-radius: 0; }
  .s1p-choice { border: 0; padding: 2px 0; }
}
