/* Question bank page: diagram tiles for the explained systems, a plain list
   of the rest, then the Final Exam. Loaded after styles.css. */

.question-bank-header { padding-bottom: clamp(2.4rem, 5vw, 3.4rem); }
.qb-hero { width: min(1160px, 100%); }
.qb-hero h1 { font-size: clamp(2.1rem, 5vw, 3rem); line-height: 1.1; }
.qb-hero > p { margin-top: 0.9rem; }

.question-bank-content { padding-top: clamp(2.2rem, 4vw, 3rem); }

.qb-systems h2,
.qb-final h2 {
  margin: 0 0 1rem;
  color: #13283c;
  font-size: 1.375rem;
  font-weight: 700;
}
.qb-systems section + section { margin-top: 3rem; }

.qb-count {
  color: #536577;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}
.qb-tile-body .qb-free { margin-left: auto; }
.qb-free {
  color: #2369d8;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.qb-free:hover,
.qb-free:focus-visible { color: #1b4f8f; text-decoration: underline; }

/* Diagram tiles */
.qb-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.qb-tile {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #dce3ea;
  border-radius: 14px;
}
.qb-tile:hover { border-color: #b9c7d6; }
.qb-tile-picture {
  display: block;
  height: 200px;
  background: #ffffff;
  border-bottom: 1px solid #e6ecf2;
}
.qb-tile-picture-dark { background: #16191e; }
.qb-tile-picture img {
  display: block;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 14px;
  object-fit: contain;
}
/* Name on its own line, then the count and the practice link, so every tile
   lines up whatever the name's length. */
.qb-tile-body {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  padding: 0.95rem 1.1rem 1rem;
}
.qb-tile-body h3 {
  flex: 1 0 100%;
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
}
.qb-tile-body h3 a { color: #13283c; text-decoration: none; }
.qb-tile-body h3 a:hover,
.qb-tile-body h3 a:focus-visible { text-decoration: underline; }

/* The other systems: one link per row */
.qb-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  margin: 0;
  padding: 0.5rem 0;
  list-style: none;
  background: #ffffff;
  border: 1px solid #dce3ea;
  border-radius: 14px;
}
.qb-list a {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  min-height: 44px;
  box-sizing: border-box;
  padding: 0.75rem 1.5rem;
  color: #13283c;
  text-decoration: none;
}
.qb-list a:hover,
.qb-list a:focus-visible { background: #f7fafd; }
.qb-list a:hover .qb-name,
.qb-list a:focus-visible .qb-name { text-decoration: underline; }
.qb-name { flex: 1 1 auto; font-size: 0.95rem; font-weight: 600; }
.qb-arrow { color: #2369d8; font-weight: 700; }

/* Final Exam, after every system */
.qb-final {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: #ffffff;
  border: 1px solid #dce3ea;
  border-radius: 14px;
}
.qb-final-copy { flex: 1 1 320px; }
.qb-final h2 { margin: 0; font-size: 1.25rem; }
.qb-final p { margin: 0.35rem 0 0; color: #536577; font-size: 0.95rem; }
.qb-final .qb-free { padding-left: 1rem; }

.qb-share { margin-top: 2rem; }
.qb-share .btn-secondary {
  background: #ffffff;
  border-color: #c7d3df;
  color: #173f61;
}
.qb-share .btn-secondary:hover,
.qb-share .btn-secondary:focus-visible { border-color: #8fa5bb; color: #13283c; }
.qb-share .question-bank-share-manual { margin-top: 0.75rem; max-width: 420px; }
.qb-share .question-bank-share-status { margin: 0.5rem 0 0; color: #536577; font-size: 0.875rem; }
.qb-share .question-bank-share-status:empty { display: none; }

.qb-note {
  max-width: 760px;
  margin: 1.75rem 0 0;
  color: #536577;
  font-size: 0.8125rem;
  line-height: 1.5;
}

@media (max-width: 599px) {
  /* Two small tiles a row, so eight systems stay one short scroll. */
  .qb-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
  .qb-tile-picture { height: 120px; }
  .qb-tile-picture img { padding: 8px; }
  .qb-tile-body { padding: 0.75rem 0.8rem 0.8rem; }
  .qb-tile-body h3 { font-size: 0.95rem; }
  .qb-list a { padding: 0.75rem 1rem; }
  .qb-final { padding: 1.1rem 1rem; }
}
