/* ==========================================================================
   Free practice page (questionspractice.php): first screen, mobile, speed
   Loaded after style.css and practice-topics.css.
   ========================================================================== */

/* ---------- 1. Header (first screen) ---------- */
.qp-hero.qp-hero--v2 { padding: 28px 0 32px; }
.qp-hero--v2 .qp-crumb { margin-bottom: 16px; }
.qp-hero--v2 .qp-hero-split { display: grid; grid-template-columns: minmax(0, 1fr) 400px; align-items: center; gap: 48px; }
.qp-hero--v2 .qp-code { margin-bottom: 12px; }
.qp--b .qp-hero--v2 h1 { margin-bottom: 10px; font-size: clamp(30px, 4vw, 48px); line-height: 1.05; }
.qp-hero-page { font-size: .5em; font-weight: 500; letter-spacing: 0; color: var(--on-night-muted, #b6bdc1); vertical-align: middle; }
.qp-hero--v2 .qp-hero-topic { margin: 0 0 8px; }
.qp-hero-lead { max-width: 620px; margin: 0 0 20px; font-size: 17px; line-height: 1.55; color: var(--on-night-muted, #b6bdc1); }
.qp-hero-cta { display: flex; flex-wrap: wrap; gap: 10px; }
.qp-hero-cta .qp-btn { min-height: 48px; padding: 0 22px; gap: 10px; }
.qp-hero-cta .qp-i { width: 18px; height: 18px; }
.qp-hero .qp-hero-mock { background: transparent; border-color: rgba(255, 255, 255, .45); color: var(--on-night, #fff); }
.qp-hero .qp-hero-mock:hover { background: rgba(255, 255, 255, .1); border-color: #fff; color: #fff; }

/* Intro text (page 1) */
.qp-hero-intro { max-width: 700px; margin-bottom: 22px; }
.qp-hero--v2 .qp-hero-intro .qp-intro { max-width: none; margin: 0 0 10px; font-size: 16px; line-height: 1.6; color: var(--on-night-muted, #b6bdc1); }
.qp-hero--v2 .qp-hero-intro .qp-intro b { color: var(--on-night, #fff); font-weight: 500; }
.qp-hero--v2 .qp-hero-intro .qp-proof { display: flex; align-items: flex-start; gap: 10px; max-width: none; margin: 14px 0 0; padding: 12px 16px; background: var(--night-2, #353e43); border-left: 4px solid var(--accent, #c8102e); font-size: 15px; line-height: 1.5; color: var(--on-night, #fff); }
.qp-hero--v2 .qp-hero-intro .qp-proof .qp-i { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--sky, #ff8a99); }

/* What you get: 2x2 with plus-shaped dividers, no outer box */
.qp-feats { display: grid; grid-template-columns: 1fr 1fr; margin: 0; padding: 0; list-style: none; }
.qp-feats li { display: flex; flex-direction: column; gap: 3px; padding: 16px 22px; }
.qp-feats li:nth-child(odd) { padding-left: 0; border-right: 1px solid var(--night-line, rgba(255, 255, 255, .14)); }
.qp-feats li:nth-child(-n+2) { border-bottom: 1px solid var(--night-line, rgba(255, 255, 255, .14)); }
.qp-feats-top { display: flex; align-items: center; gap: 10px; min-height: 34px; margin-bottom: 4px; }
.qp-feats .qp-i { flex: none; width: 22px; height: 22px; color: var(--sky, #ff8a99); }
.qp-feats em { font-size: 30px; font-style: normal; font-weight: 700; line-height: 1; color: var(--on-night, #fff); }
.qp-feats b { font-size: 15px; font-weight: 500; line-height: 1.3; color: var(--on-night, #fff); }
.qp-feats-sub { font-size: 13px; line-height: 1.4; color: var(--on-night-muted, #b6bdc1); }

/* ---------- 2. Tabs and in-page jumps ----------
   style.css already keeps jumps clear of the site header (scroll-padding-top on html);
   this adds room for the sticky tab bar. */
.qp--b .qp-card,
.qp-guide { scroll-margin-top: 56px; }

/* ---------- 3. Topics box: folds on phones and tablets ---------- */
.qp-rail details.qp-topics > summary { display: flex; align-items: center; gap: 10px; list-style: none; cursor: default; }
.qp-rail details.qp-topics > summary::-webkit-details-marker { display: none; }
.qp-rail details.qp-topics > summary h2 { margin: 0; }
.qp-rail details.qp-topics[open] > summary { margin-bottom: 10px; }
.qp-rail .qp-topics-sum,
.qp-rail details.qp-topics > summary .qp-i { display: none; }

@media (min-width: 1100px) {
  .qp-rail details.qp-topics > summary { pointer-events: none; }   /* always open on desktop */
}

@media (max-width: 1099px) {
  .qp-rail details.qp-topics { padding: 0; }
  .qp-rail details.qp-topics > summary { min-height: 52px; padding: 0 16px; cursor: pointer; }
  .qp-rail details.qp-topics[open] > summary { margin-bottom: 0; border-bottom: 1px solid var(--line, #e1e4e5); }
  .qp-rail .qp-topics-sum { display: block; flex: 1; min-width: 0; overflow: hidden; font-size: 14px; color: var(--muted, #626b70); text-align: right; white-space: nowrap; text-overflow: ellipsis; }
  .qp-rail details.qp-topics > summary .qp-i { display: block; flex: none; width: 18px; height: 18px; color: var(--ink, #1f2528); transition: transform .2s; }
  .qp-rail details.qp-topics[open] > summary .qp-i { transform: rotate(180deg); }
  .qp-rail details.qp-topics .qp-topics-list { padding: 8px 16px 12px; }
  .qp-rail details.qp-topics .qp-topics-list a { min-height: 44px; }      /* finger-sized */

  /* Questions first: the mock exam is offered in the crimson band further down */
  .qp--b .qp-rail .qp-box--progress,
  .qp--b .qp-rail .qp-sim { display: none; }
}

/* ---------- 4. About + exam guide at the bottom ---------- */
.qp-guide { background: var(--surface, #fff); border-top: 1px solid var(--line, #e1e4e5); }
.qp-guide .qp-prose > h2:first-child { margin-top: 0; }
.qp-prose table { display: block; max-width: 100%; overflow-x: auto; }

/* ---------- 5. Wide content inside questions never widens the page ---------- */
.qp-q, .qp-answer, .qp-opt-text { overflow-wrap: anywhere; }
.qp-q table, .qp-answer table { display: block; max-width: 100%; overflow-x: auto; }
.qp-q pre, .qp-answer pre { max-width: 100%; overflow-x: auto; white-space: pre; }
.qp-q iframe, .qp-answer iframe, .qp-q video { max-width: 100%; }

/* ---------- 6. Tablets ---------- */
@media (max-width: 991px) {
  .qp-tabs { position: static; }                 /* the site header already stays on screen */
  .qp--b .qp-card, .qp-guide { scroll-margin-top: 0; }
  .qp-hero--v2 .qp-hero-split { grid-template-columns: 1fr; gap: 24px; }
  .qp-feats { grid-template-columns: repeat(4, 1fr); }
  .qp-feats li, .qp-feats li:nth-child(odd) { padding: 4px 18px; border: 0; border-left: 1px solid var(--night-line, rgba(255, 255, 255, .14)); }
  .qp-feats li:first-child { padding-left: 0; border-left: 0; }
}

/* ---------- 7. Phones ---------- */
@media (max-width: 767px) {
  .qp-hero.qp-hero--v2 { padding: 16px 0 22px; }
  .qp-hero--v2 .qp-crumb { flex-wrap: nowrap; margin-bottom: 12px; overflow: hidden; font-size: 13px; white-space: nowrap; }
  .qp-hero--v2 .qp-crumb > :last-child { overflow: hidden; text-overflow: ellipsis; }
  .qp-hero--v2 .qp-code { margin-bottom: 10px; font-size: 13px; }
  .qp--b .qp-hero--v2 h1 { font-size: 28px; }
  .qp-hero-lead { margin-bottom: 16px; font-size: 15px; }
  .qp-hero-cta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .qp-hero-cta .qp-btn { min-height: 46px; padding: 0 12px; font-size: 14px; }
  .qp-hero-cta .qp-hero-mock .qp-i { display: none; }
  .qp-hero--v2 .qp-hero-intro { margin-bottom: 16px; }
  .qp-hero--v2 .qp-hero-intro .qp-intro { font-size: 15px; line-height: 1.55; }
  .qp-hero--v2 .qp-hero-intro .qp-proof { padding: 10px 12px; font-size: 14px; }
  .qp-feats { grid-template-columns: 1fr 1fr; }
  .qp-feats li, .qp-feats li:nth-child(odd) { padding: 12px 14px; border: 0; }
  .qp-feats li:nth-child(odd) { padding-left: 0; border-right: 1px solid var(--night-line, rgba(255, 255, 255, .14)); }
  .qp-feats li:nth-child(-n+2) { border-bottom: 1px solid var(--night-line, rgba(255, 255, 255, .14)); }
  .qp-feats-top { min-height: 26px; margin-bottom: 2px; }
  .qp-feats .qp-i { width: 18px; height: 18px; }
  .qp-feats em { font-size: 22px; }
  .qp-feats b { font-size: 14px; }
  .qp-feats-sub { display: none; }
  .qp-feats .qp-feats-date .qp-feats-sub { display: block; }

  .qp-tabs a { padding: 13px 10px; font-size: 14px; }
  .qp-tabs a span { display: none; }

  .qp-layout.qp-layout--rail { gap: 12px; padding-top: 12px; }
  .qp-opt { min-height: 48px; }
  .qp-actions .qp-btn { min-height: 46px; }
  .qp-pages a { min-width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .qp-rail details.qp-topics > summary .qp-i { transition: none; }
}

/* ---------- 8. "All questions" link at the top of the Topics list ---------- */
.qp-rail .qp-topics-list li.qp-topics-all { margin-bottom: 4px; padding-bottom: 4px; border-bottom: 1px solid var(--line, #e1e4e5); }
.qp-rail .qp-topics-list li.qp-topics-all .qp-topics-name { font-weight: 500; }

/* ---------- 9. Full-access box in the left column: question bank + mock exam ---------- */
.qp-rail .qp-sim .qp-sim-tag { margin-bottom: 12px; }
.qp-rail .qp-sim .qp-sim-sub.qp-sim-first { margin-top: 0; padding-top: 0; border-top: 0; }
.qp-rail .qp-sim .qp-sim-sub { display: flex; align-items: center; gap: 8px; margin: 14px 0 6px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .14); font-size: 14px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--on-night, #fff); }
.qp-rail .qp-sim h2 + .qp-sim-sub { margin-top: 0; }
.qp-rail .qp-sim .qp-sim-sub .qp-i { flex: none; width: 18px; height: 18px; color: var(--sky, #ff8a99); }
.qp-rail .qp-sim ul { margin: 0; }
.qp-rail .qp-sim ul + .qp-sim-sub { margin-top: 14px; }
.qp-rail .qp-sim .qp-btn { margin-top: 16px; gap: 8px; }

/* ---------- 10. Phone fit: nothing in the header may be wider than the screen ----------
   Grid columns use minmax(0, 1fr) so a long button or exam name can't stretch the page. */
.qp-hero--v2 .qp-hero-split { grid-template-columns: minmax(0, 1fr) 400px; }
.qp-hero--v2 .qp-hero-main, .qp-hero--v2 .qp-hero-intro, .qp-feats li { min-width: 0; }
.qp-hero--v2 .qp-code { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.qp-hero-cta .qp-btn { height: auto; padding-top: 10px; padding-bottom: 10px; white-space: normal; text-align: center; line-height: 1.25; }
@media (max-width: 991px) {
  .qp-hero--v2 .qp-hero-split { grid-template-columns: minmax(0, 1fr); }
  .qp-feats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .qp-hero-cta { grid-template-columns: minmax(0, 1fr); }             /* buttons stacked, full width */
  .qp-hero-cta .qp-btn { width: 100%; }
  .qp-hero-cta .qp-hero-mock .qp-i { display: inline-block; }
  .qp-feats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qp-hero--v2 .qp-hero-intro .qp-proof { overflow-wrap: anywhere; }
}
/* Crimson mock-exam band: long button text ("Take CompTIA Security+ Mock Exam") wraps instead of widening the page */
.qp-promo-grid > * { min-width: 0; }
.qp-promo .qp-promo-btn { max-width: 100%; height: auto; min-height: 48px; padding-top: 10px; padding-bottom: 10px; white-space: normal; text-align: center; line-height: 1.25; }
@media (max-width: 991px) { .qp-promo-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 767px) { .qp-promo .qp-promo-btn { width: 100%; justify-content: center; } }
/* Pager and question cards: same rule */
.qp-layout > *, .qp-main > *, .qp-pager-row > * { min-width: 0; }
