/* Shared style for sarahdasher.com problem sets.
   Link it from any problem set with <link rel="stylesheet" href="../quiz.css"> */
:root {
  --paper: #fbfcfe;
  --gridline: #dfe8f3;
  --ink: #1b2a4a;
  --graphite: #566070;
  --redpen: #c2342b;
  --rule: #c9d6e6;

  /* names used by the quiz script */
  --bg: #ffffff;
  --fg: var(--ink);
  --muted: var(--graphite);
  --line: var(--rule);
  --card: #ffffff;
  --accent: var(--ink);
  --accent-fg: #ffffff;
  --ok: #1e7a46;
  --ok-bg: #e8f4ec;
  --bad: var(--redpen);
  --bad-bg: #fbecea;
  --dot: #e9eef5;
  --grid: #e3e8ef;
  --axis: #9aa6b6;
  --pad: var(--redpen);

  --sans: "Libre Franklin", system-ui, sans-serif;
  --hand: "Kalam", "Comic Sans MS", cursive;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 1rem/1.55 var(--sans);
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--gridline) 1px, transparent 1px),
    linear-gradient(90deg, var(--gridline) 1px, transparent 1px);
  background-size: 24px 24px;
}
a { color: var(--ink); }
button { font-family: var(--sans); }
:focus-visible { outline: 3px solid var(--redpen); outline-offset: 2px; }

/* site header */
.site-head {
  max-width: 760px; margin: 0 auto; padding: 20px 16px 4px;
}
.site-head a { font-weight: 800; font-size: 1.05rem; text-decoration: none; letter-spacing: -0.01em; }

/* note from Sarah */
div.letter {
  max-width: 760px; margin: 12px auto 4px; padding: 0 16px;
}
.letter-inner {
  background: #fff; border: 1px solid var(--rule); border-radius: 3px;
  padding: 22px 26px; box-shadow: 6px 6px 0 var(--gridline);
}
div.letter p { margin: 0 0 10px; max-width: 62ch; }
div.letter p:last-child { margin-bottom: 0; }
div.letter .sign { font-family: var(--hand); color: var(--redpen); font-size: 1.35rem; line-height: 1.2; }

/* quiz layout */
.wrap { max-width: 760px; margin: 0 auto; padding: 24px 16px 48px; }
h1 { font-size: clamp(1.5rem, 3.4vw, 1.9rem); letter-spacing: -0.02em; font-weight: 800; line-height: 1.15; margin: 0 0 4px; }
.sub { color: var(--muted); font-size: .92rem; margin: 0 0 14px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.score { font-weight: 700; font-size: .95rem; font-variant-numeric: tabular-nums; }

/* section chips */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 12px; }
.chip {
  border: 2px solid var(--ink); background: transparent; color: var(--ink);
  border-radius: 3px; padding: 3px 10px; font-size: .84rem; font-weight: 700; cursor: pointer;
}
.chip.on { background: var(--ink); color: #fff; }

/* question navigator */
.dots { display: grid; grid-template-columns: repeat(auto-fill, minmax(28px, 1fr)); gap: 4px; margin-bottom: 16px; }
.dots button {
  height: 28px; border: 1px solid var(--rule); border-radius: 3px; background: #fff;
  color: var(--ink); font-size: .74rem; font-weight: 600; cursor: pointer; padding: 0;
  font-variant-numeric: tabular-nums;
}
.dots button.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.dots button.bad { background: var(--redpen); border-color: var(--redpen); color: #fff; }
.dots button.cur { outline: 2px solid var(--ink); outline-offset: 1px; }

/* question card */
.card {
  background: #fff; border: 1px solid var(--rule); border-radius: 3px;
  padding: 20px 22px; box-shadow: 6px 6px 0 var(--gridline);
}
.meta { display: flex; justify-content: space-between; color: var(--muted); font-size: .85rem; margin-bottom: 10px; gap: 8px; flex-wrap: wrap; }
.tip {
  border-left: 3px solid var(--redpen); padding: 6px 12px; margin: 0 0 14px;
  font-size: .93rem; background: #fdf6f5;
}
.figbox { background: #fff; border: 1px solid var(--rule); border-radius: 3px; padding: 10px; margin-bottom: 12px; text-align: center; }
.fig { width: 100%; max-width: 440px; height: auto; color: var(--ink); }
.fig .ln { stroke: currentColor; stroke-width: 1.8; fill: none; }
.fig .thin { stroke: currentColor; stroke-width: 1.3; fill: none; }
.fig .dt { fill: currentColor; }
.fig .lb { fill: currentColor; font: 700 15px var(--sans); text-anchor: middle; dominant-baseline: middle; }
.cap { font-size: .86rem; color: var(--muted); margin: 6px 0 0; }
.q { font-size: 1.12rem; font-weight: 700; margin: 8px 0 14px; letter-spacing: -0.005em; }

/* answer choices: one stacked list, styled like a bubble answer sheet.
   .opts/.opt = geometry sets, .choices/.choice = ACT sets */
.opts, .choices {
  display: flex; flex-direction: column; margin: 0;
  border: 1px solid var(--rule); border-radius: 4px; overflow: hidden; background: #fff;
}
.opt, .choice {
  display: flex; align-items: center; gap: 14px; width: 100%; margin: 0;
  padding: 12px 16px; text-align: left;
  background: #fff; color: var(--ink); font: inherit; font-size: 1.02rem;
  border: 0; border-bottom: 1px solid var(--rule); border-radius: 0; cursor: pointer;
  transition: background .12s;
}
.opt:last-child, .choice:last-child { border-bottom: 0; }
.opt:hover:not([disabled]), .choice:hover:not(:disabled) { background: #f3f6fa; }
.opt[disabled], .choice:disabled { cursor: default; }

/* the letter bubble */
.opt .k, .choice .letter {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  border: 1.5px solid var(--axis); color: var(--graphite);
  display: grid; place-items: center; font-size: .8rem; font-weight: 700;
  transition: border-color .12s, background .12s, color .12s;
}
.opt:hover:not([disabled]) .k, .choice:hover:not(:disabled) .letter { border-color: var(--ink); color: var(--ink); }

/* after answering: the bubble fills in */
.opt.right, .choice.correct { background: var(--ok-bg); }
.opt.right .k, .choice.correct .letter { background: var(--ok); border-color: var(--ok); color: #fff; }
.opt.wrong, .choice.wrong { background: var(--bad-bg); }
.opt.wrong .k, .choice.wrong .letter { background: var(--redpen); border-color: var(--redpen); color: #fff; }

/* feedback */
.fb { margin-top: 14px; padding: 12px 14px; border-radius: 3px; font-size: .96rem; }
.fb.ok { background: var(--ok-bg); border-left: 3px solid var(--ok); }
.fb.bad { background: var(--bad-bg); border-left: 3px solid var(--redpen); }
.fb b { display: block; margin-bottom: 2px; }
.fb.bad b { color: var(--redpen); }
.fb.ok b { color: var(--ok); }

/* buttons */
.nav { display: flex; justify-content: space-between; gap: 8px; margin-top: 16px; }
.btn {
  border: 2px solid var(--ink); background: var(--ink); color: #fff; border-radius: 4px;
  padding: 8px 16px; font: 700 .95rem var(--sans); cursor: pointer;
}
.btn:hover:not([disabled]) { background: #2c4170; border-color: #2c4170; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover:not([disabled]) { background: #eef2f8; border-color: var(--ink); }
.btn[disabled] { opacity: .35; cursor: default; }

/* coordinate sketch pad */
.padwrap { margin: 12px 0 6px; background: #fff; border: 1px dashed var(--rule); border-radius: 3px; padding: 10px; text-align: center; }
.padwrap svg { width: 100%; max-width: 300px; height: auto; cursor: crosshair; touch-action: manipulation; }
.padhead { display: flex; justify-content: space-between; align-items: center; font-size: .85rem; color: var(--muted); margin-bottom: 4px; }
.padhead span { font-family: var(--hand); color: var(--redpen); font-size: 1.05rem; }
.padhead button { font-size: .8rem; padding: 3px 10px; }

/* results */
.res h2 { font-size: 1.2rem; margin: 0 0 4px; }
.big { font-size: 2.6rem; font-weight: 800; letter-spacing: -0.03em; margin: 2px 0; font-variant-numeric: tabular-nums; }
.bar { height: 12px; border-radius: 2px; background: #eef2f8; overflow: hidden; margin: 6px 0 14px; }
.bar span { display: block; height: 100%; background: var(--ink); }
.row { display: flex; justify-content: space-between; font-size: .95rem; }
.missed { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; }
.missed button {
  border: 1px solid var(--redpen); background: var(--bad-bg); color: var(--redpen);
  border-radius: 3px; padding: 3px 10px; cursor: pointer; font-size: .85rem; font-weight: 600;
}

@media (max-width: 480px) {
  .card { padding: 14px; }
  .letter-inner { padding: 18px; }
}

/* sample pages */
.kicker { font-weight: 800; font-size: 1.05rem; letter-spacing: -0.01em; margin-bottom: 6px !important; }
div.letter a { font-weight: 600; }
.cta {
  margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--rule);
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
}
.cta p { margin: 0; font-weight: 700; }
.cta .btn { text-decoration: none; display: inline-block; }
.hidden { display: none !important; }

/* ACT English quiz layout (scoped so it doesn't affect other sets) */
body.act .card > p { margin: 0 0 12px; }
body.act label.opt { display: flex; gap: 8px; align-items: center; margin: 10px 0; cursor: pointer; }
body.act .row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; justify-content: flex-start; font-size: 1rem; }
body.act .btn.secondary { background: transparent; color: var(--ink); }
body.act .btn.secondary:hover { background: #eef2f8; }
body.act .hint, body.act .running, body.act .muted { color: var(--muted); font-size: .88rem; margin: 14px 0 0; }
body.act .topbar { color: var(--muted); font-size: .88rem; margin-bottom: 8px; }
body.act .progress { height: 8px; background: #eef2f8; border-radius: 2px; overflow: hidden; margin-bottom: 20px; }
body.act .progress > div { height: 100%; background: var(--ink); transition: width .2s; }
body.act .question { font-size: 1.15rem; margin-bottom: 18px; }
body.act .question u { text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: var(--redpen); }
body.act .qnum { font-weight: 800; margin-right: 6px; }
body.act .feedback { margin-top: 14px; padding: 12px 14px; border-radius: 3px; font-size: .96rem; }
body.act .feedback.good { background: var(--ok-bg); border-left: 3px solid var(--ok); }
body.act .feedback.good b { color: var(--ok); }
body.act .feedback.bad { background: var(--bad-bg); border-left: 3px solid var(--redpen); }
body.act .feedback.bad b { color: var(--redpen); }
body.act .score { font-size: 2.6rem; font-weight: 800; letter-spacing: -0.03em; margin: 0; }
body.act h3 { font-size: 1.1rem; margin: 24px 0 8px; }
body.act table { border-collapse: collapse; width: 100%; font-size: .95rem; }
body.act th, body.act td { border-bottom: 1px solid var(--rule); padding: 8px; text-align: left; }
body.act .review-item { border-top: 1px solid var(--rule); padding: 14px 0; }
body.act .review-item .ui { font-size: .92rem; color: var(--muted); margin-top: 6px; }

/* ACT sample: directions above the first question */
body.act .directions { font-size: .95rem; color: var(--ink); margin: 0 0 14px; max-width: 62ch; }
body.act .directions .keys { display: block; color: var(--muted); font-size: .85rem; margin-top: 4px; }
