/* =========================================================
   ABZ Learning — Decodable Passage (read.html)
   Responsive overrides only (≤1200px)
   ---------------------------------------------------------
   Assumes the base styles from your <style> block.
   Keep this file loaded AFTER base CSS.
   ========================================================= */

   /* --- Modal visibility hardening --- */
.modal,
.rr-modal{
  position: fixed;
  inset: 0;
  display: none;                 /* <-- keep hidden by default */
  align-items: center;
  justify-content: center;
  background: rgba(3,7,18,.58);
  z-index: 60;
}

.modal.show,
.rr-modal.show{
  display: flex;                 /* <-- only show when .show is added */
}

.modal[hidden],
.rr-modal[hidden]{
  display: none !important;
}

#btnAssign{
    background-color: #f87427;
    color: white;
}

/* the white card inside */
.modal .card,
.rr-modal .rr-modal-card{
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  max-width: 560px;
  width: min(92vw, 560px);
  padding: 18px;
  box-shadow: 0 18px 40px rgba(2,6,23,.24);
}

.score-mini{ font-weight:800; color:white}
.score-mini.ok  { color:#16a34a; }  /* green  (80–100%) */
.score-mini.mid { color:#d97706; }  /* amber  (50–79%)  */
.score-mini.bad { color:#dc2626; }  /* red    (0–49%)   */
.score-mini.muted { color:#6b7280; }



/* ---------- 1200px and under ---------- */
@media (max-width: 1200px) {
  .hero-wrap { max-width: 940px; gap: 8px; padding: 12px 16px; }
  .hero-back { font-size: 0.95rem; }
  .hero-title { font-size: 0.95rem; letter-spacing: .15px; }

  .wrap { max-width: 820px; margin: 16px auto 84px; padding: 0 16px; }

  .title { font-size: 3.2rem; }
  .sub { font-size: 13px; }

  .media { max-height: 340px; }
  .passage { font-size: 2.3rem; padding: 14px 16px; }

  .q { padding: 14px 16px; }
  .q h3 { font-size: 1.6rem; }
  .choices { gap: 10px; font-size: 1.4rem; }
  .choice { padding: 10px 12px; }

  .actions { padding: 14px 16px; gap: 8px; }
  .btn { padding: 11px 14px; }

  .ribbon { top: 14px; right: 14px; font-size: 11px; padding: 6px 10px; }
  #scoreText, #feedback { font-size: 1.8rem; }
}

/* ---------- 992px and under (small laptop / large tablet) ---------- */
@media (max-width: 992px) {
  .hero-wrap { max-width: 860px; }
  .wrap { max-width: 760px; }

  /* If you later render a header block inside the card */
  .hdr { grid-template-columns: 1fr; gap: 4px; align-items: start; }

  .title { font-size: 2.8rem; line-height: 1.18; }
  .chips { margin-top: 4px; }
  .chip { font-size: 11px; padding: 5px 9px; }

  .media { max-height: 300px; }
  .passage { font-size: 2rem; line-height: 1.65; }

  .q h3 { font-size: 1.45rem; }
  .choices { font-size: 1.3rem; }

  .scorebox { margin: 12px 16px 16px; }
}

/* ---------- 840px and under (portrait tablet) ---------- */
@media (max-width: 840px) {
  .hero-wrap { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .hero-back { font-size: 0.9rem; }
  .hero-title { font-size: 0.9rem; opacity: .9; }

  .wrap { max-width: 680px; margin-bottom: 72px; }

  .card { border-radius: 18px; }
  .pad { padding: 16px; }

  .title { font-size: 2.5rem; }
  .sub { font-size: 12px; }

  .media { max-height: 270px; }

  .passage { font-size: 1.8rem; padding: 14px 14px; }
  .q { padding: 14px; }
  .q h3 { font-size: 1.35rem; }

  .choice { padding: 10px 12px; border-radius: 12px; }
  .choice input { margin-top: 1px; }

  .actions { padding: 14px; gap: 8px; }
  .btn { font-size: 0.95rem; border-radius: 12px; }

  .ribbon { top: 12px; right: 12px; font-size: 10px; padding: 5px 9px; }
  #scoreText, #feedback { font-size: 1.6rem; }
}

/* ---------- 768px and under (small tablet) ---------- */
@media (max-width: 768px) {
  .hero-wrap { gap: 6px; }
  .hero-back { font-size: 0.9rem; }
  .hero-title { font-size: 0.85rem; max-width: 55vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .wrap { max-width: 620px; }

  .title { font-size: 2.25rem; }
  .chips { gap: 6px; }
  .chip { font-size: 10.5px; padding: 4px 8px; }

  .media { max-height: 240px; }
  .passage { font-size: 1.6rem; line-height: 1.6; }

  .q h3 { font-size: 1.25rem; }
  .choices { font-size: 1.2rem; gap: 8px; }
  .choice { padding: 10px 12px; }

  .actions { gap: 8px; }
  .btn { padding: 10px 12px; }

  .scorebox { padding: 12px 14px; }
  #scoreText, #feedback { font-size: 1.45rem; }
}

/* ---------- 640px and under (large phones / phablets) ---------- */
@media (max-width: 640px) {
  .hero-wrap { padding: 10px 12px; }
  .hero-back { font-size: 0.9rem; }
  /* Optionally hide the long title to save space */
  .hero-title { display: none; }

  .wrap { max-width: 560px; margin: 12px auto 64px; padding: 0 12px; }

  .card { border-radius: 16px; }
  .pad { padding: 14px; }

  .title { font-size: 2.05rem; }
  .sub { font-size: 12px; }

  .media { max-height: 220px; }

  .passage { font-size: 1.45rem; padding: 12px 12px; }
  .q { padding: 12px; }
  .q h3 { font-size: 1.2rem; }

  .choices { font-size: 1.1rem; gap: 8px; }
  .choice { padding: 10px 12px; }

  .actions { padding: 12px; gap: 8px; }
  .btn {
    padding: 12px 14px;
    width: 100%;               /* full-width buttons for easier tapping */
    text-align: center;
  }

  .scorebox { margin: 12px; padding: 12px; }
  #scoreText, #feedback { font-size: 1.35rem; }

  .ribbon { top: 10px; right: 10px; font-size: 10px; padding: 5px 8px; }
}

/* ---------- 520px and under (most phones) ---------- */
@media (max-width: 520px) {
  .wrap { max-width: 480px; margin-bottom: 56px; }

  .title { font-size: 1.85rem; line-height: 1.2; }
  .chips { gap: 5px; }
  .chip { font-size: 10px; padding: 4px 7px; }

  .media { max-height: 200px; }

  .passage { font-size: 1.35rem; line-height: 1.55; }
  .q h3 { font-size: 1.1rem; }

  .choices { font-size: 1.05rem; gap: 8px; }
  .choice { padding: 10px 10px; border-radius: 10px; }

  .sa { min-height: 88px; padding: 10px; }

  .btn { font-size: 0.95rem; padding: 11px 12px; }

  .score { font-size: 1.05rem; }
  #scoreText, #feedback { font-size: 1.25rem; }
}

/* ---------- 400px and under (small phones) ---------- */
@media (max-width: 400px) {
  .hero-wrap { padding: 8px 10px; }
  .hero-back { font-size: 0.85rem; }

  .wrap { padding: 0 10px; }

  .card { border-radius: 14px; }
  .pad { padding: 12px; }

  .title { font-size: 1.65rem; }
  .sub { font-size: 11px; }

  .media { max-height: 180px; }

  .passage { font-size: 1.25rem; padding: 10px; }
  .q { padding: 10px; }
  .q h3 { font-size: 1rem; }

  .choices { font-size: 1rem; gap: 6px; }
  .choice { padding: 9px 10px; }

  .actions { padding: 10px; gap: 6px; }
  .btn { font-size: 0.9rem; padding: 10px 12px; }

  .scorebox { margin: 10px; padding: 10px; }
  #scoreText, #feedback { font-size: 1.15rem; }

  .ribbon { top: 8px; right: 8px; font-size: 9px; padding: 4px 7px; }
}

/* ---------- 360px and under (very small phones) ---------- */
@media (max-width: 360px) {
  .title { font-size: 1.5rem; }
  .media { max-height: 160px; }

  .passage { font-size: 1.18rem; }
  .q h3 { font-size: 0.95rem; }
  .choices { font-size: 0.98rem; }

  .btn { font-size: 0.88rem; padding: 10px 10px; }
  #scoreText, #feedback { font-size: 1.05rem; }
}

/* ---------- Helpful tweaks for very short viewports (landscape phones) ---------- */
@media (max-height: 480px) and (max-width: 768px) {
  .media { max-height: 160px; }
  .passage { padding-top: 10px; padding-bottom: 10px; }
  .ribbon { display: none; } /* save vertical space */
}

/* ---------- Optional: honor users who prefer less motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
