/* Recital — app styles. Builds on motif tokens + Plex Sans + spakit
 * spa.css (chrome). Anything below is recital-specific: today's
 * story-card grid, the play card, the choice grid, story table,
 * about prose. */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: #f7f7f5;
  color: #222;
  line-height: 1.55;
  font-size: 16px;
  font-feature-settings: "kern" 1, "liga" 1;
}

.dropdown-menu .icon { width: 1rem; height: 1rem; opacity: 0.7; }

main {
  max-width: 56rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}
h1, h2, h3 { color: #2e4a25; margin: 0 0 0.5rem; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; margin-top: 1rem; }
h3 { font-size: 1rem; margin-top: 1.2rem; }
p { margin: 0.6rem 0; }
.muted { color: #888; font-weight: 400; font-size: 0.9rem; }
.form-text { color: #777; font-size: 0.85rem; }
.empty { text-align: center; padding: 3rem 1rem; color: #888; }
.back-link { color: #4f7c40; text-decoration: none; }

button, .btn {
  font: inherit;
  padding: 0.55rem 1.1rem;
  background: #4f7c40; color: #fff; border: 0; border-radius: 4px;
  cursor: pointer; text-decoration: none; display: inline-flex;
  align-items: center; gap: 0.4rem;
}
button:hover, .btn:hover { background: #3e6431; }
button.btn-secondary, .btn.btn-secondary {
  background: #fff; color: #4f7c40; border: 1px solid #4f7c40;
}

/* Welcome card (first-time onboarding) ------------------------------------ */
.welcome-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-left: 4px solid #4f7c40;
  border-radius: 6px;
  padding: 1rem 1.2rem;
  margin: 0.5rem 0 1.5rem;
}
.welcome-card h3 {
  margin: 0 0 0.4rem;
  color: #2e4a25;
  font-size: 1.1rem;
}
.welcome-card p { margin: 0.4rem 0; }

/* Today's queue ----------------------------------------------------------- */
.story-section {
  margin: 1.5rem 0;
}
.story-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.8rem;
  margin-top: 0.6rem;
}
.story-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.9rem 1rem;
  cursor: pointer;
  transition: transform 80ms ease, border-color 100ms ease;
  position: relative;
}
.story-card:hover {
  transform: translateY(-1px);
  border-color: #4f7c40;
}
.story-card.due {
  border-left: 4px solid #f59e0b;
}
.story-card.locked {
  opacity: 0.55;
  cursor: default;
}
.story-card.locked:hover {
  transform: none;
  border-color: #e5e7eb;
}
.story-card-tag {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  margin-bottom: 0.3rem;
}
.story-card-tag.new  { color: #166534; }
.story-card-tag.due  { color: #b45309; }
.story-card-tag.later { color: #6b7280; }
.story-card-title {
  font-weight: 500;
  font-size: 1.05rem;
  color: #2e4a25;
  margin-bottom: 0.3rem;
}
.story-card-meta {
  font-size: 0.85rem;
  color: #777;
}

/* Story playback view ----------------------------------------------------- */
.play-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 2rem 1.5rem;
  text-align: center;
  margin: 1rem 0;
}
.btn-play {
  font-size: 1.05rem;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  min-width: 12rem;
}
.btn-play:disabled {
  background: #9ca3af;
  cursor: default;
}
.btn-play .icon {
  width: 1.1rem; height: 1.1rem;
}
.read-along {
  margin-top: 1.5rem;
  text-align: left;
  font-size: 0.95rem;
}
.read-along summary {
  cursor: pointer;
  color: #6b7280;
  font-size: 0.9rem;
  padding: 0.4rem 0;
}
.read-along summary:hover { color: #2e4a25; }
.story-body {
  background: #fafaf7;
  padding: 1rem 1.2rem;
  border-radius: 6px;
  border-left: 3px solid #4f7c40;
  white-space: pre-wrap;
  margin: 0.6rem 0;
  line-height: 1.7;
  font-size: 1rem;
}

/* Question / choice UI ---------------------------------------------------- */
.choice-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
  max-width: 36rem;
  margin: 1rem auto;
}
@media (min-width: 540px) {
  .choice-grid { grid-template-columns: 1fr 1fr; }
}
.choice {
  font: inherit;
  padding: 1rem 1.1rem;
  background: #fff; color: #2e4a25;
  border: 2px solid #4f7c40; border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  min-height: 3.2rem;
  text-align: left;
  line-height: 1.4;
}
.choice:hover:not(:disabled) { background: #ecfccb; }
.choice.correct {
  background: #166534; color: #fff; border-color: #166534;
}
.choice.wrong {
  background: #fee2e2; color: #b91c1c; border-color: #b91c1c;
}
.choice:disabled { cursor: default; opacity: 0.95; }

.reveal-row {
  max-width: 36rem;
  margin: 0.6rem auto 0;
  text-align: center;
}

/* Stats ------------------------------------------------------------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.8rem;
  margin: 1rem 0 1.5rem;
}
.stat-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.9rem 1rem;
}
.stat-value {
  font-size: 1.7rem;
  font-weight: 600;
  color: #2e4a25;
  line-height: 1.1;
}
.stat-label {
  font-size: 0.85rem;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.2rem;
}
.stat-foot {
  font-size: 0.8rem;
  color: #777;
  margin-top: 0.4rem;
}
.story-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.6rem 0;
  font-size: 0.92rem;
}
.story-table th, .story-table td {
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid #e5e7eb;
}
.story-table th { color: #555; font-weight: 500; }
.story-table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* Reading-speed radios (Settings page) ------------------------------------ */
.rate-row {
  display: inline-flex;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  padding: 0.2rem;
  background: #fff;
  margin-top: 0.4rem;
}
.rate-chip {
  position: relative;
  cursor: pointer;
}
.rate-chip input[type="radio"] {
  position: absolute; opacity: 0; pointer-events: none;
}
.rate-chip span {
  display: inline-block;
  padding: 0.4rem 0.95rem;
  border-radius: 999px;
  color: #555;
  font-size: 0.9rem;
  user-select: none;
}
.rate-chip:hover span { color: #2e4a25; }
.rate-chip input[type="radio"]:checked + span {
  background: #4f7c40; color: #fff;
}

/* About prose ------------------------------------------------------------- */
.prose {
  max-width: 40rem;
  margin: 0 auto;
  font-size: 1rem;
  line-height: 1.65;
}
.prose h1 { margin-top: 0.5rem; }
.prose h2 { margin-top: 2rem; font-size: 1.15rem; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin: 0.4rem 0; }
.prose hr {
  border: 0; border-top: 1px solid #e5e7eb;
  margin: 2rem 0 1rem;
}
.prose .footnotes {
  font-size: 0.85rem;
  color: #555;
  margin: 0.4rem 0;
}
.prose ul.caveats li strong { color: #2e4a25; }
.prose sup a { color: #4f7c40; text-decoration: none; }
.prose sup a:hover { text-decoration: underline; }
