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

/* ---------- 1. Header (first screen): light, Microsoft Learn style ----------
   Left: exam eyebrow, title, exam name, intro, buttons.
   Right: white card with a hexagon exam badge and what the practice test includes. */
.qp-hero.qp-hero--ms { padding: 24px 0 44px; }
.qp-hero--ms .qp-crumb { margin-bottom: 28px; }
.qph-split { display: grid; grid-template-columns: minmax(0, 1fr) 380px; align-items: center; gap: 56px; }
.qph-main { min-width: 0; }
.qph-eyebrow { display: inline-block; margin-bottom: 10px; font-size: 14px; font-weight: 600; color: var(--accent, #0067b8); }
.qp--b .qp-hero--ms h1 { margin-bottom: 6px; font-size: clamp(30px, 4vw, 46px); font-weight: 600; line-height: 1.12; letter-spacing: -.01em; }
.qph-name { margin: 0 0 18px; font-size: 20px; line-height: 1.4; color: var(--text, #2f2f2f); }
.qp-hero-page { font-size: .5em; font-weight: 400; letter-spacing: 0; color: var(--muted, #616161); vertical-align: middle; }
.qp-hero--ms .qp-hero-topic { margin: -8px 0 14px; color: var(--muted, #616161); }
.qp-hero-lead { max-width: 620px; margin: 0 0 24px; font-size: 17px; line-height: 1.55; color: var(--text, #2f2f2f); }
.qp-hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.qp-hero-cta .qp-btn { min-height: 44px; padding: 0 22px; gap: 10px; border-radius: 2px; }
.qp-hero-cta .qp-i { width: 18px; height: 18px; }
.qp-hero .qp-hero-mock { background: var(--surface, #fff); border-color: var(--line-3, #8a8a8a); color: var(--ink, #1b1b1b); }
.qp-hero .qp-hero-mock:hover { background: var(--surface, #fff); border-color: var(--ink, #1b1b1b); color: var(--ink, #1b1b1b); }

/* Intro text (page 1) */
.qp-hero-intro { max-width: 680px; margin-bottom: 24px; }
.qp-hero--ms .qp-hero-intro .qp-intro { max-width: none; margin: 0 0 12px; font-size: 16px; line-height: 1.6; color: var(--text, #2f2f2f); }
.qp-hero--ms .qp-hero-intro .qp-proof { display: flex; align-items: flex-start; gap: 10px; max-width: none; margin: 0; padding: 12px 16px; background: var(--accent-soft, #eff6fc); border-left: 3px solid var(--accent, #0067b8); font-size: 15px; line-height: 1.5; color: var(--ink, #1b1b1b); }
.qp-hero--ms .qp-hero-intro .qp-proof .qp-i { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--accent, #0067b8); }

/* Exam card */
.qph-card { min-width: 0; background: var(--surface, #fff); border: 1px solid var(--line, #e5e5e5); border-radius: var(--r-lg, 8px); box-shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 8px 24px rgba(0, 0, 0, .06); }
.qph-card-head { display: flex; align-items: center; gap: 16px; padding: 22px 22px 18px; border-bottom: 1px solid var(--line, #e5e5e5); }
.qph-hex { display: grid; place-items: center; flex: none; width: 76px; height: 86px; background: linear-gradient(150deg, #2b88d8 0%, #0063b1 60%, #243a5e 100%);
  clip-path: polygon(50% 0, 93.3% 25%, 93.3% 75%, 50% 100%, 6.7% 75%, 6.7% 25%); }
.qph-hex span { max-width: 62px; font-size: 14px; font-weight: 600; line-height: 1.1; color: #fff; text-align: center; overflow-wrap: anywhere; }
.qph-card-kicker { display: block; font-size: 13px; color: var(--muted, #616161); }
.qph-card-title { display: block; margin-top: 2px; font-size: 16px; font-weight: 600; line-height: 1.35; color: var(--ink, #1b1b1b); }
.qph-facts { margin: 0; padding: 8px 22px; list-style: none; }
.qph-facts li { display: flex; align-items: flex-start; gap: 14px; padding: 12px 0; }
.qph-facts li + li { border-top: 1px solid var(--line, #e5e5e5); }
.qph-facts .qp-i { flex: none; width: 20px; height: 20px; margin-top: 2px; color: var(--accent, #0067b8); }
.qph-facts span { font-size: 14px; line-height: 1.4; color: var(--muted, #616161); }
.qph-facts b { display: block; font-size: 15px; font-weight: 600; color: var(--ink, #1b1b1b); }
.qph-card-foot { display: flex; align-items: center; gap: 8px; margin: 0; padding: 12px 22px; background: var(--bg, #f5f5f5); border-top: 1px solid var(--line, #e5e5e5); border-radius: 0 0 var(--r-lg, 8px) var(--r-lg, 8px); font-size: 13px; color: var(--muted, #616161); }
.qph-card-foot .qp-i { width: 16px; height: 16px; }

@media (max-width: 991px) {
  .qph-split { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .qph-card { max-width: 560px; }
}
@media (max-width: 767px) {
  .qp-hero.qp-hero--ms { padding: 16px 0 28px; }
  .qp-hero--ms .qp-crumb { flex-wrap: nowrap; margin-bottom: 16px; overflow: hidden; font-size: 13px; white-space: nowrap; }
  .qp-hero--ms .qp-crumb > :last-child { overflow: hidden; text-overflow: ellipsis; }
  .qph-eyebrow { font-size: 13px; }
  .qp--b .qp-hero--ms h1 { font-size: 28px; }
  .qph-name { margin-bottom: 14px; font-size: 17px; }
  .qp-hero-lead { margin-bottom: 18px; font-size: 15px; }
  .qp-hero-cta { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .qp-hero-cta .qp-btn { width: 100%; }
  .qp-hero--ms .qp-hero-intro { margin-bottom: 18px; }
  .qp-hero--ms .qp-hero-intro .qp-intro { font-size: 15px; line-height: 1.55; }
  .qp-hero--ms .qp-hero-intro .qp-proof { padding: 10px 12px; font-size: 14px; overflow-wrap: anywhere; }
  .qph-card-head { padding: 16px; gap: 14px; }
  .qph-hex { width: 62px; height: 70px; }
  .qph-hex span { font-size: 12px; }
  .qph-facts { display: grid; grid-template-columns: 1fr 1fr; padding: 4px 16px; }
  .qph-facts li { gap: 10px; padding: 12px 0; }
  .qph-facts li + li { border-top: 0; }
  .qph-facts li:nth-child(n+3) { border-top: 1px solid var(--line, #e5e5e5); }
  .qph-facts li:nth-child(even) { padding-left: 12px; border-left: 1px solid var(--line, #e5e5e5); }
  .qph-facts span { font-size: 13px; }
  .qph-facts b { font-size: 14px; }
  .qph-card-foot { padding: 10px 16px; }
}

/* ---------- 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, #e5e5e5); }
  .qp-rail .qp-topics-sum { display: block; flex: 1; min-width: 0; overflow: hidden; font-size: 14px; color: var(--muted, #616161); 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, #1b1b1b); 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, #e5e5e5); }
.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; }
}

/* ---------- 7. Phones ---------- */
@media (max-width: 767px) {

  .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, #e5e5e5); }
.qp-rail .qp-topics-list li.qp-topics-all .qp-topics-name { font-weight: 600; }

/* ---------- 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: 600; 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, #50e6ff); }
.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 ---------- */
.qp-hero-cta .qp-btn { height: auto; padding-top: 10px; padding-bottom: 10px; white-space: normal; text-align: center; line-height: 1.25; }

/* Blue mock-exam band: long button text ("Take Microsoft Azure Administrator 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; }
