/* EdgeMed EM — Library page (topic index + topic detail) */

.library-main {
  flex: 1;
  padding: 28px;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

/* Hero block on /library */
.library-hero { margin-bottom: 22px; }
.library-hero h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}
.library-hero .muted { font-size: 14px; }
.lib-search {
  margin-top: 14px;
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  background: var(--card);
  transition: border 0.15s, box-shadow 0.15s;
}
.lib-search:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 107, 107, 0.12);
}

/* Topic grid (index) */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.topic-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  text-decoration: none;
  color: inherit;
  transition: all 0.15s;
  box-shadow: var(--shadow);
}
.topic-card:hover {
  border-color: var(--teal);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(15, 107, 107, 0.10);
}
.topic-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.topic-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}
.topic-card-stats {
  display: flex;
  gap: 14px;
  font-size: 12.5px;
  color: var(--ink-soft);
}
.topic-card-stats b { color: var(--ink); }

/* Topic detail hero */
.topic-hero {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.topic-hero h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 10px;
}
.topic-meta {
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 10px;
}
.topic-meta b { color: var(--ink); font-weight: 700; }
.topic-refs {
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 14px;
}
.topic-actions { display: flex; gap: 10px; margin-top: 14px; }
.topic-actions .btn-primary,
.topic-actions .btn-secondary {
  display: inline-block;
  text-decoration: none;
  padding: 9px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid var(--teal);
}
.topic-actions .btn-primary { background: var(--teal); color: #fff; }
.topic-actions .btn-primary:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
.topic-actions .btn-secondary { background: #fff; color: var(--teal); }
.topic-actions .btn-secondary:hover { background: #f0f7f7; }

/* Difficulty bars */
.dbars { display: flex; gap: 4px; margin-top: 8px; }
.dbar {
  display: inline-block;
  min-width: 30px;
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  color: #fff;
}
.dbar.d1 { background: #94c5a4; }
.dbar.d2 { background: #66b78a; }
.dbar.d3 { background: var(--teal); }
.dbar.d4 { background: #d18b3a; }
.dbar.d5 { background: var(--red); }

/* Pearls card */
.pearls-card,
.questions-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px 26px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.pearls-card h3,
.questions-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--teal-dark);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.pearls-card .small { font-size: 12px; margin-bottom: 12px; }
.pearls-list { list-style: none; padding: 0; }
.pearl {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-left: 3px solid var(--line);
  margin-bottom: 8px;
  background: #f9fafb;
  border-radius: 0 4px 4px 0;
}
.pearl.hy {
  border-left-color: var(--gold);
  background: #fcf8ee;
}
.hy-mark { color: var(--gold); font-size: 18px; line-height: 1; padding-top: 1px; }
.pearl-sub {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}
.pearl-text {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.55;
}

/* Question list */
.qlist { list-style: none; padding: 0; }
.qrow {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 8px;
  background: #fff;
}
.qrow.hy { border-left: 3px solid var(--gold); }
.qrow-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.qrow-sub {
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
  flex: 1;
}
.qrow-diff {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
  background: #eef1f4;
  padding: 2px 7px;
  border-radius: 4px;
}
.qrow-stem {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.55;
  margin-bottom: 6px;
}
.qrow-lead {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

/* High-yield pill (shared) */
.hy-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--gold);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.3px;
}

/* Topbar nav (re-use if not present) */
.topbar-nav { display: flex; gap: 14px; align-items: center; }
.mode-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-left: 8px;
}
.mode-badge.gold { background: var(--gold); color: #fff; }
.mode-badge.teal { background: #fff; color: var(--teal); }

.muted { color: var(--ink-soft); }
