/* Daily challenge — hub calendar + per-day question cards.
   Loaded only on the daily-challenges section (see partials/head.html).
   Colours come from v2.css tokens; each .dpp-q carries data-paper, which
   v2.css already maps to --accent / --accent-soft, so cards tint themselves. */

/* ---------- hub ---------- */
.dpp-sub { color: var(--ink-2); margin: 10px 0 0; max-width: 62ch; }

.dpp-today-cta {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px;
  margin: 28px 0 0; padding: 18px 22px;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--brand-soft); color: var(--ink);
  text-decoration: none; box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease;
}
.dpp-today-cta:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.dpp-today-label { font-size: 13.5px; color: var(--ink-2); }
.dpp-today-action { font-family: var(--font-display); font-weight: 700; color: var(--brand); margin-left: auto; }

.dpp-cal {
  margin: 26px 0; padding: 22px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  max-width: 420px;
}
.dpp-cal-head { text-align: center; margin-bottom: 14px; }
.dpp-cal-month { font-family: var(--font-display); font-size: 18px; }
.dpp-cal-dows, .dpp-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dpp-cal-dows { margin-bottom: 6px; }
.dpp-cal-dows span { text-align: center; font-size: 11px; letter-spacing: .06em; color: var(--ink-3); text-transform: uppercase; }

.dpp-day {
  display: grid; place-items: center; aspect-ratio: 1;
  border-radius: var(--r-sm); font-size: 14px; font-weight: 500;
  color: var(--ink); text-decoration: none; position: relative;
}
a.dpp-day:hover { background: var(--bg-tint); }
.dpp-day.is-blank { visibility: hidden; }
.dpp-day.is-future { color: var(--ink-3); }
.dpp-day.is-today { outline: 2px solid var(--brand); outline-offset: -2px; color: var(--brand); font-weight: 700; }
.dpp-day.is-done { background: var(--gs3-soft); color: var(--gs3); font-weight: 600; }
.dpp-day.is-done::after {
  content: ""; position: absolute; bottom: 5px; width: 4px; height: 4px;
  border-radius: 50%; background: var(--gs3);
}
.dpp-streak { margin: 16px 0 0; text-align: center; font-size: 14px; color: var(--ink-2); }
.dpp-streak-n { font-weight: 700; color: var(--brand); }

.dpp-archive { margin-top: 40px; }
.dpp-archive ul { list-style: none; padding: 0; }
.dpp-archive li { padding: 3px 0; }
.dpp-archive li.is-done a::before { content: "✓ "; color: var(--gs3); font-weight: 700; }

/* ---------- per-day questions ---------- */
.dpp-day-panel { margin-top: 26px; }

.dpp-q {
  margin: 0 0 26px; padding: 22px 24px 20px;
  background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}
.dpp-q-head { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.dpp-chip {
  font-size: 12px; font-weight: 600; letter-spacing: .02em;
  padding: 4px 11px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
}
.dpp-chip-soft { background: var(--bg-tint); color: var(--ink-3); }

.dpp-topic { font-family: var(--font-display); font-size: 19px; margin: 0 0 4px; }
.dpp-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--ink-3); margin-bottom: 16px; }

.dpp-statement { margin-bottom: 18px; line-height: 1.65; }
.dpp-statement p:last-child { margin-bottom: 0; }

/* Scanned crop from the original paper. Always on white — these are black-ink
   scans, so inheriting the dark-mode surface would invert them into mud. */
.dpp-scan {
  margin: 0 0 18px; padding: 12px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  overflow-x: auto;
}
.dpp-scan img { display: block; max-width: 100%; height: auto; margin: 0 auto; }

.dpp-options { display: grid; gap: 9px; }
/* Letter-only buttons for scanned questions: the option text is in the image. */
.dpp-options-keys { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dpp-options-keys .dpp-option { justify-content: center; }

.dpp-option {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 15px; text-align: left; cursor: pointer;
  background: var(--bg-tint); border: 1px solid var(--line);
  border-radius: var(--r); color: var(--ink);
  font: inherit; transition: border-color .12s ease, background .12s ease;
}
.dpp-option:hover:not([disabled]) { border-color: var(--accent); }
.dpp-option-key {
  flex: none; display: grid; place-items: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line-2);
  font-size: 13px; font-weight: 700; color: var(--ink-2);
}
.dpp-option-text > p { margin: 0; }

.dpp-q.is-answered .dpp-option { cursor: default; }
.dpp-option.is-correct { background: var(--gs3-soft); border-color: var(--gs3); }
.dpp-option.is-correct .dpp-option-key { background: var(--gs3); border-color: var(--gs3); color: #fff; }
.dpp-option.is-wrong { background: color-mix(in srgb, #ef4444 12%, transparent); border-color: #ef4444; }
.dpp-option.is-wrong .dpp-option-key { background: #ef4444; border-color: #ef4444; color: #fff; }
.dpp-option.is-picked { border-color: var(--accent); background: var(--accent-soft); }

.dpp-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.dpp-btn {
  font: inherit; font-size: 14px; font-weight: 600;
  padding: 9px 16px; border-radius: var(--r-sm); cursor: pointer;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  text-decoration: none; display: inline-flex; align-items: center;
}
.dpp-btn:hover { border-color: var(--accent); color: var(--accent); }
.dpp-solve { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.dpp-solve:hover { filter: brightness(1.06); color: var(--on-accent); }

.dpp-solution {
  margin-top: 16px; padding: 16px 18px;
  background: var(--bg-tint); border-radius: var(--r);
  border: 1px solid var(--line); line-height: 1.65;
}
.dpp-solution > :first-child { margin-top: 0; }
.dpp-solution > :last-child { margin-bottom: 0; }
.dpp-answer-line { font-size: 15px; }
.dpp-answer-line strong { color: var(--gs3); font-size: 17px; }
.dpp-note { color: var(--ink-2); font-size: 14px; }

@media (max-width: 640px) {
  .dpp-q { padding: 18px 16px 16px; }
  .dpp-cal { padding: 16px; }
  .dpp-today-cta { flex-direction: column; }
  .dpp-today-action { margin-left: 0; }
}
