/*
 * Study pages on a computer screen: the questions use the whole width of the
 * screen, at a comfortable (not oversized) text size. Loaded last on the study
 * pages, after their own styles. Phones and tablets (under 1100px) keep the
 * layout they had.
 *
 * Practice and skill tests (.q-card): js/study-layout.js splits the card in
 * two columns, like the digital SAT: the passage on the left and the question
 * on the right. Math questions use one full-width column.
 */
@media (min-width: 1100px) {
  /* ---- Wide, but not so wide that lines get too long to read ---- */
  html.q-active .test-container.wrap,
  .bank-page.wrap { max-width: 1320px; padding-left: 40px; padding-right: 40px; }
  /* The header lines up with the content. */
  html.q-active header .nav.wrap, html:has(.bank-page) header .nav.wrap { max-width: 1320px; padding-left: 40px; padding-right: 40px; }
  /* Comfortable line length: about 75 characters, the length the eye reads best. */
  .q-card .q-text, .q-bank-text { max-width: 75ch; }
  .tak-step-text, .tak-step-detail, .tak-formula li, .q-bank-passage .tak-ptext { max-width: 85ch; }

  /* ---- Practice and skill tests ---- */
  html.q-active .progress-bar > * { flex-basis: 44px; }

  .q-card.q-split {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 44px; align-items: start;
    padding: 32px 40px; overflow: clip;
  }
  /* Math: one column, the choices two by two, help below. Once the answer is
     checked, the explanation moves beside the question, so nothing runs long. */
  .q-card.q-split:not(.has-passage) { grid-template-columns: minmax(0, 1fr); }
  .q-card.q-split:not(.has-passage) .options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .q-card.q-split:not(.has-passage) .q-col-b:not(:empty) { margin-top: 20px; }
  .q-card.q-split:not(.has-passage):has(#qExplanation.show) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
  .q-card.q-split:not(.has-passage):has(#qExplanation.show) .options { grid-template-columns: 1fr; }
  .q-card.q-split:not(.has-passage):has(#qExplanation.show) .q-col-b { margin-top: 0; }
  /* The passage stays in view while you work on the question. */
  .q-card.has-passage .q-col-a {
    position: sticky; top: 92px; max-height: calc(100vh - 120px); overflow-y: auto;
    border-right: 3px solid var(--line); margin-right: -22px; padding-right: 22px;
  }
  .q-card.q-split .q-passage { margin: 0; font-size: 1.04rem; line-height: 1.75; color: var(--ink); padding: 18px 22px; }
  .q-card .q-text { font-size: 1.22rem; line-height: 1.55; }
  .q-card .opt { font-size: 1.02rem; padding: 15px 18px; }
  .q-card .explanation { font-size: 0.98rem; line-height: 1.65; color: var(--ink); margin-top: 0; }
  .q-card.q-split:not(.has-passage) .q-col-b > * + * { margin-top: 16px; }
  .q-card.has-passage .explanation { margin-top: 20px; }

  /* ---- Question bank ---- */
  .q-bank-text { font-size: 1.12rem; }
  .q-bank-passage { font-size: 1rem; line-height: 1.75; color: var(--ink); }
  .q-bank-opt { font-size: 1rem; }

  /* ---- Full test (already full screen) ---- */
  .exam .ex-left { font-size: 1.04rem; line-height: 1.8; }
  .exam .ex-body.single .ex-right { max-width: 1000px; }
  .exam .qtext { max-width: 75ch; }
  .exam .qtext { font-size: 1.08rem; }
  .exam .opt { font-size: 1.02rem; }

  /* ---- Lessons ---- */
  .detail-page.wrap { max-width: 1000px; }
  .body-text p { font-size: 1.03rem; color: var(--ink); }

  /* ---- Taller cards: more room inside, and between the lines ---- */
  .q-card.q-split { padding: 44px 48px; }
  .q-card .q-text { line-height: 1.7; margin-bottom: 30px; }
  .q-card .opt { padding: 16px 22px; min-height: 60px; line-height: 1.55; }
  .q-card .options { gap: 12px; }
  .q-card .q-passage { line-height: 1.9; padding: 26px 30px; }
  .q-bank-card { padding: 34px 36px; }
  .q-bank-text { line-height: 1.7; margin-bottom: 24px; }
  .q-bank-opt { padding: 15px 20px; min-height: 56px; line-height: 1.55; }
  .q-bank-opts { gap: 14px; }
  .q-bank-passage { line-height: 1.9; padding: 22px 26px; }
  .exam .opt { padding: 20px 22px; min-height: 68px; }
}
