/* ============================================================
   Module reader — v2 real redesign (not a recolor)
   Fixes: unreadable 1100px measure, tiny body type, flat layout,
   leftover purple CTA. Premium emerald reading experience.
   Additive + !important so it beats the page's inline <style>.
   ============================================================ */

body.page-module-reader {
  --mr-ink:#0b1220; --mr-body:#3a4658; --mr-muted:#6b7686; --mr-line:#e7ebf3;
  --mr-accent:#059669;
}

/* Article surface: soft light with a faint emerald glow (was flat white) */
body.page-module-reader .module-article {
  background:
    radial-gradient(760px 420px at 82% -8%, rgba(13,148,136,.08), transparent 60%),
    #eceff5 !important;
  padding: 2.4rem 2rem 7.5rem !important;
}

/* The reading sheet: constrained measure, elevated white card, centered */
body.page-module-reader .module-inner {
  max-width: 748px !important;
  width: 100% !important;
  margin: 0 auto !important;
  background: #ffffff;
  border: 1px solid var(--mr-line);
  border-radius: 22px;
  box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 24px 56px -26px rgba(24,28,54,.24);
  padding: clamp(30px, 4vw, 54px) clamp(24px, 4.5vw, 60px) clamp(34px, 4vw, 58px);
}

/* Title */
body.page-module-reader .module-title {
  font-size: clamp(2rem, 3vw, 2.7rem) !important;
  font-weight: 800 !important;
  letter-spacing: -.03em !important;
  color: var(--mr-ink) !important;
  line-height: 1.08 !important;
  margin-bottom: .7rem !important;
}

/* Subtitle becomes a proper lead paragraph + a divider to separate header from body */
body.page-module-reader .module-subtitle {
  font-size: clamp(1.1rem, 1.5vw, 1.26rem) !important;
  color: var(--mr-muted) !important;
  font-weight: 500 !important;
  line-height: 1.6 !important;
  margin: 0 0 1.7rem !important;
  padding-bottom: 1.8rem;
  border-bottom: 1px solid var(--mr-line);
}

/* Section headings: refined weight + an emerald accent bar for rhythm */
body.page-module-reader .module-lesson-heading {
  font-size: clamp(1.4rem, 2vw, 1.72rem) !important;
  font-weight: 750 !important;
  letter-spacing: -.02em !important;
  color: var(--mr-ink) !important;
  line-height: 1.24 !important;
  margin: 2.7rem 0 1rem !important;
}
body.page-module-reader .module-lesson-heading::before {
  content: ''; display: block; width: 40px; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, #10b981, #0d9488); margin-bottom: 15px;
}

/* Body copy: bigger, warmer ink, comfortable line-height (was .98rem) */
body.page-module-reader .module-lesson-paragraph {
  font-size: 1.08rem !important;
  color: var(--mr-body) !important;
  line-height: 1.78 !important;
  margin-bottom: 1.15rem !important;
  letter-spacing: .002em;
}

/* Quiz CTA card: kill the leftover purple, go emerald */
body.page-module-reader .module-cta-card {
  background: linear-gradient(135deg, rgba(16,185,129,.10), rgba(13,148,136,.05)) !important;
  border: 1px solid rgba(5,150,105,.22) !important;
  border-radius: 18px !important;
  padding: 22px 24px !important;
}
body.page-module-reader .module-cta-title { color: var(--mr-ink) !important; font-weight: 800 !important; }

/* Interactive practice tool card: clean light premium card */
body.page-module-reader .module-tool-card {
  background: #f8faf9 !important;
  border: 1px solid rgba(5,150,105,.18) !important;
  border-left: 3px solid var(--mr-accent) !important;
  border-radius: 16px !important;
  box-shadow: 0 8px 22px -14px rgba(5,150,105,.30) !important;
}
body.page-module-reader .module-tool-pill {
  background: rgba(5,150,105,.10) !important;
  color: var(--mr-accent) !important;
  border: 1px solid rgba(5,150,105,.22) !important;
}
body.page-module-reader .module-tool-pill__dot { background: var(--mr-accent) !important; }
body.page-module-reader .module-tool-card__title { color: var(--mr-ink) !important; }
body.page-module-reader .module-tool-card .ml-input,
body.page-module-reader .module-tool-card input[type="text"] {
  background: #fff !important; border: 1.5px solid var(--mr-line) !important; border-radius: 12px !important;
  color: var(--mr-ink) !important; padding: 12px 14px !important;
}

/* Sidebar: clean white rail with an emerald active section */
body.page-module-reader .module-sidebar {
  background: #fbfcfe !important; border-right: 1px solid var(--mr-line) !important;
}
body.page-module-reader .module-title + * ,
body.page-module-reader .module-sidebar-head .module-title { font-size: 1.15rem !important; }
body.page-module-reader .lesson-row {
  border-radius: 12px !important; transition: background .16s ease;
}
body.page-module-reader .lesson-row:hover { background: rgba(5,150,105,.05) !important; }
body.page-module-reader .lesson-row--active,
body.page-module-reader .lesson-row.is-active {
  background: rgba(5,150,105,.08) !important;
  box-shadow: inset 3px 0 0 var(--mr-accent);
}
/* readable row text (the active row title was near-invisible) */
body.page-module-reader .lesson-row-title { color: var(--mr-ink) !important; font-weight: 700 !important; }
body.page-module-reader .lesson-row-meta { color: var(--mr-muted) !important; }
body.page-module-reader .lesson-row--faded .lesson-row-title { color: #9aa4b4 !important; font-weight: 600 !important; }
body.page-module-reader .lesson-row--active .lesson-row-title { color: #065f46 !important; }
body.page-module-reader .lesson-dot-active,
body.page-module-reader .lesson-dot-active-inner { background: var(--mr-accent) !important; border-color: var(--mr-accent) !important; }
body.page-module-reader .lesson-dot-done { background: var(--mr-accent) !important; border-color: var(--mr-accent) !important; }

/* XP reward pill in sidebar */
body.page-module-reader [class*="reward"], body.page-module-reader .module-sb-hint + * {
  /* left to base unless emerald pill class matches below */
}

/* Bottom bar + continue button */
body.page-module-reader .module-bottom-bar {
  border-top: 1px solid var(--mr-line) !important;
  background: rgba(255,255,255,.82) !important; backdrop-filter: blur(12px);
}
body.page-module-reader .module-bottom-fill,
body.page-module-reader .module-bottom-track > * {
  background: linear-gradient(90deg, #10b981, #0d9488) !important;
}
body.page-module-reader .module-bottom-btn {
  background: linear-gradient(135deg, #10b981, #0d9488) !important;
  border: none !important; color: #fff !important; font-weight: 750 !important;
  box-shadow: 0 8px 18px -6px rgba(5,150,105,.5) !important;
}
