/* app/css/screens-study.css — topic chooser (.tp-*) and chapter resources (.cr-*)
   Owner: A2. Spec: docs/redesign/plan.md §2.3–§2.4; look: docs/redesign/mockups/03-topics-fourier.html (.topic, .cta in mock.css).
   Use tokens and shared .b-* classes from brutal.css; never hard-code colours. */

/* ── Topic chooser screen (.tp-*) ────────────────────────────────────────── */

.tp-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.tp-back {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: var(--rule, 2.5px) solid var(--ink);
  border-radius: var(--radius-sm, 6px);
  background: var(--paper);
  box-shadow: var(--shadow-sm, 4px 4px 0 var(--ink));
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms var(--ease, ease), box-shadow 120ms var(--ease, ease);
}

.tp-back:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
}

.tp-back .b-ico {
  width: 24px;
  height: 24px;
}

.tp-top .b-crumb {
  margin: 0;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.tp-title {
  font-size: 34px;
  line-height: 1.08;
  font-weight: 850;
  letter-spacing: -0.025em;
  margin: 4px 0 16px;
  color: var(--ink);
}

@media (min-width: 600px) {
  .tp-title {
    font-size: 40px;
    line-height: 1.02;
  }
}

.tp-continue {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--ink);
  color: var(--on-ink);
  border: var(--rule, 2.5px) solid var(--ink);
  border-radius: var(--radius, 7px);
  padding: 14px 18px;
  font-weight: 800;
  font-size: 18px;
  box-shadow: 5px 5px 0 var(--subject-accent, var(--fill-sand, #e8d6b2));
  margin: 4px 0 24px;
  text-decoration: none;
  min-height: 48px;
  transition: transform 120ms var(--ease, ease), box-shadow 120ms var(--ease, ease);
}

.tp-continue:active {
  transform: translate(2px, 2px);
  box-shadow: 3px 3px 0 var(--subject-accent, var(--fill-sand, #e8d6b2));
}

.tp-continue small {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  opacity: 0.8;
}

.tp-continue .b-ico {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  margin-left: 12px;
}

.tp-list {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  display: grid;
  gap: 16px;
}

.tp-topic {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  margin-bottom: 0;
  box-shadow: 5px 5px 0 var(--ink);
  position: relative;
  border: var(--rule, 2.5px) solid var(--ink);
  border-radius: var(--radius, 7px);
  box-sizing: border-box;
}

.tp-code {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 17px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm, 6px);
  background: var(--paper);
  text-align: center;
  padding: 14px 2px;
  line-height: 1.1;
  color: var(--ink);
  word-break: break-word;
}

.tp-topic.is-completed .tp-code {
  background: var(--ink);
  color: var(--on-ink);
}

.tp-name {
  font-weight: 800;
  font-size: 18px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
}

.tp-name a {
  color: inherit;
  text-decoration: none;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
}

.tp-counts {
  font-size: 14px;
  color: var(--ink-2);
  margin: 4px 0 0;
  line-height: 1.35;
}

.tp-topic .b-stamp {
  margin-top: 8px;
  display: inline-block;
}

.tp-topic.is-soon {
  opacity: 0.72;
  cursor: default;
}

.tp-topic.is-soon:active {
  transform: none;
}

.tp-resources {
  margin-top: 28px;
  min-height: 56px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.25;
  padding: 12px 18px;
  font-weight: 800;
  font-size: 16px;
}

@media (min-width: 800px) {
  .tp-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Chapter resources screen (.cr-*) ───────────────────────────────────── */

.cr-page {
  /* One column layout: math needs width */
  max-width: 46rem;
  margin: 0 auto;
}

.cr-sub {
  font-size: 18px;
  color: var(--ink-2);
  margin: -4px 0 18px;
  font-weight: 700;
}

.cr-tabs {
  /* Not sticky (owner, 2026-11-08): pinned under the top bar it was half-covered while scrolling.
     Was: position: sticky; top: var(--topbar-h, …); z-index: 10; */
  position: static;
  background: var(--paper);
  padding: 8px 0;
  margin-bottom: 12px;
  border-bottom: var(--rule, 2.5px) solid var(--ink);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cr-tabs .b-pill {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  font-size: 14px;
  font-family: var(--font-mono);
  font-weight: 700;
  text-decoration: none;
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm, 6px);
  background: var(--paper);
  color: var(--ink);
  white-space: nowrap;
  box-sizing: border-box;
}

.cr-tabs .b-pill.is-active {
  background: var(--ink);
  color: var(--on-ink);
}

.cr-section {
  scroll-margin-top: calc(var(--topbar-h, 60px) + 64px);
  margin-top: 28px;
}

.cr-section__title {
  font-size: 24px;
  font-weight: 850;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  color: var(--ink);
}

.cr-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
  padding-bottom: 4px;
}

.cr-filters .b-pill {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  font-size: 13px;
  font-family: var(--font-mono);
  font-weight: 700;
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm, 6px);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
  box-sizing: border-box;
}

.cr-filters .b-pill.is-active {
  background: var(--ink);
  color: var(--on-ink);
}

.cr-paper {
  margin-bottom: 24px;
}

.cr-paper__head {
  margin: 18px 0 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--ink);
  font-size: 14px;
}

.cr-q {
  padding: 14px 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm, 4px 4px 0 var(--ink));
  box-sizing: border-box;
}

.cr-q__prompt {
  overflow-x: auto;
  margin: 10px 0 14px;
  font-size: 16px;
  line-height: 1.5;
}

.cr-q__go {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  border: var(--rule, 2.5px) solid var(--ink);
  border-radius: var(--radius-sm, 6px);
  background: var(--paper);
  color: var(--ink);
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
  box-shadow: var(--shadow-sm, 4px 4px 0 var(--ink));
  cursor: pointer;
  transition: transform 120ms var(--ease, ease), box-shadow 120ms var(--ease, ease);
  box-sizing: border-box;
}

.cr-q__go:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
}

.cr-sol-card {
  margin-bottom: 20px;
}

.cr-sol-card .btn-primary,
.cr-sol-card .btn-secondary {
  min-height: 48px;
}

.cr-full {
  margin-top: 32px;
  margin-bottom: 40px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
