/* REQ-25 topic hub pages — aligns with school-page / landing-page tokens */

.topic-page {
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(15, 54, 133, 0.08), transparent 55%),
    linear-gradient(180deg, #f7f9fc 0%, #eef3f9 40%, #f7f9fc 100%);
  padding: 28px 20px 72px;
  min-height: 50vh;
}

.topic-page-inner {
  max-width: 860px;
  margin: 0 auto;
}

.topic-breadcrumb {
  font-size: 0.875rem;
  color: var(--text-muted, #64748b);
  margin-bottom: 24px;
}

.topic-breadcrumb a {
  color: var(--navy, #0f3685);
  text-decoration: none;
}

.topic-breadcrumb a:hover {
  color: var(--blue, #0055ff);
}

.topic-breadcrumb-sep {
  margin: 0 0.4em;
  opacity: 0.55;
}

.topic-hero {
  margin-bottom: 28px;
}

.topic-hero-eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--navy, #0f3685);
  margin: 0 0 10px;
  opacity: 0.85;
}

.topic-hero-title {
  font-family: var(--font-serif, 'DM Serif Display', Georgia, serif);
  font-size: clamp(1.65rem, 4vw, 2.45rem);
  font-weight: 400;
  line-height: 1.18;
  color: var(--navy, #0f3685);
  margin: 0 0 14px;
}

.topic-hero-definition {
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--text-muted, #475569);
  margin: 0 0 22px;
}

.topic-index-switch {
  font-size: 0.95rem;
  color: var(--text-muted, #64748b);
  margin: 0 0 8px;
}

.topic-index-switch a {
  color: var(--navy, #0f3685);
  font-weight: 600;
}

.topic-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.topic-stat {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border, #dbe3ef);
  border-radius: 12px;
  padding: 16px 14px;
  text-align: center;
}

.topic-stat-value {
  display: block;
  font-family: var(--font-serif, 'DM Serif Display', Georgia, serif);
  font-size: 1.55rem;
  color: var(--navy, #0f3685);
  line-height: 1.1;
}

.topic-stat-label {
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.topic-section {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border, #dbe3ef);
  border-radius: 14px;
  padding: 24px 26px;
  margin-bottom: 20px;
}

.topic-section h2 {
  font-family: var(--font-serif, 'DM Serif Display', Georgia, serif);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--navy, #0f3685);
  margin: 0 0 12px;
}

.topic-section p {
  font-size: 1rem;
  line-height: 1.65;
  color: #334155;
  margin: 0 0 12px;
}

.topic-section p:last-child {
  margin-bottom: 0;
}

.topic-worked-note {
  color: var(--text-muted, #64748b) !important;
  font-size: 0.95rem !important;
}

.topic-worked-card {
  border: 1px solid var(--border, #dbe3ef);
  border-radius: 12px;
  padding: 18px 20px;
  background: #f8fafc;
}

.topic-worked-meta {
  font-size: 0.9rem;
  color: var(--text-muted, #64748b);
  margin: 0 0 14px !important;
}

.topic-worked-meta a {
  color: var(--navy, #0f3685);
  font-weight: 600;
  text-decoration: none;
}

.topic-worked-meta a:hover {
  color: var(--blue, #0055ff);
}

.topic-worked-answer,
.topic-worked-explanation {
  margin-top: 14px;
}

.topic-worked-answer strong,
.topic-worked-explanation strong {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--navy, #0f3685);
  margin-bottom: 6px;
}

.topic-worked-body {
  font-size: 0.98rem;
  line-height: 1.6;
  color: #1e293b;
  overflow-x: auto;
}

.topic-mistakes {
  margin: 0;
  padding-left: 1.2rem;
}

.topic-mistakes li {
  margin-bottom: 10px;
  line-height: 1.55;
  color: #334155;
}

.topic-mistakes li:last-child {
  margin-bottom: 0;
}

.topic-papers-wrap {
  overflow-x: auto;
  margin-top: 8px;
}

.topic-papers-table {
  display: table; /* override mobile.css table{display:block} */
  width: 100%;
  max-width: none;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.95rem;
  overflow: visible;
}

.topic-papers-table th,
.topic-papers-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border, #dbe3ef);
}

.topic-papers-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #64748b);
  font-weight: 600;
}

.topic-papers-table td:last-child,
.topic-papers-table th:last-child {
  text-align: right;
  white-space: nowrap;
  width: 3.5rem;
}

.topic-papers-table a {
  color: var(--navy, #0f3685);
  text-decoration: none;
  font-weight: 600;
}

.topic-papers-table a:hover {
  color: var(--blue, #0055ff);
}

.topic-related-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.topic-related-list a {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 8px;
  background: #f1f5f9;
  color: var(--navy, #0f3685);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
}

.topic-related-list a:hover {
  background: rgba(15, 54, 133, 0.1);
  color: var(--blue, #0055ff);
}

.topic-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.topic-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.topic-btn--primary {
  background: var(--blue, #0055ff);
  color: #fff;
  box-shadow: 0 8px 20px rgba(0, 102, 255, 0.22);
}

.topic-btn--primary:hover {
  transform: translateY(-1px);
  background: #0044dd;
  color: #fff;
}

.topic-btn--ghost {
  background: rgba(255, 255, 255, 0.7);
  color: var(--navy, #0f3685);
  border: 1px solid var(--border, #dbe3ef);
}

.topic-btn--ghost:hover {
  background: #fff;
  color: var(--blue, #0055ff);
}

.topic-index-list {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.topic-index-item {
  margin: 0;
}

.topic-index-link {
  display: block;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border, #dbe3ef);
  border-radius: 14px;
  padding: 18px 22px;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.topic-index-link:hover {
  border-color: rgba(15, 54, 133, 0.35);
  box-shadow: 0 8px 24px rgba(15, 54, 133, 0.08);
}

.topic-index-name {
  display: block;
  font-family: var(--font-serif, 'DM Serif Display', Georgia, serif);
  font-size: 1.25rem;
  color: var(--navy, #0f3685);
  margin-bottom: 4px;
}

.topic-index-meta {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted, #64748b);
  margin-bottom: 8px;
}

.topic-index-def {
  display: block;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #475569;
}

@media (max-width: 640px) {
  .topic-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topic-section {
    padding: 20px 18px;
  }

  .topic-hero-title {
    font-size: 1.55rem;
  }
}
