/* Sterling Student Portal — contrast audit repair v1.0.42
   Visual-only CSS: no student/course/notes/timetable/English logic changes.
   WCAG AA-oriented text contrast; scoped to authenticated Student Portal pages.
   Last-loaded source styles or inline page styles are intentionally overridden
   only for the specific gradients/cards listed below. */

/* Reading History: parent gradient has light text but generic h1/body rules
   were forcing navy onto purple. Use sufficiently dark gradient under white. */
body.portal-body.page-courses .rh-hero {
    background:linear-gradient(120deg,#29216c 0%,#5530a8 54%,#713a94 100%) !important;
}
body.portal-body.page-courses .rh-hero h1,
body.portal-body.page-courses .rh-hero h2,
body.portal-body.page-courses .rh-hero p,
body.portal-body.page-courses .rh-hero .eyebrow,
body.portal-body.page-courses .rh-hero .eyebrow.light,
body.portal-body.page-courses .rh-hero :is(strong,b) {
    color:#ffffff !important;
    -webkit-text-fill-color:#ffffff !important;
    opacity:1 !important;
}
body.portal-body.page-courses .rh-hero p { line-height:1.6 !important; }
body.portal-body.page-courses .rh-stats .rh-stat small,
body.portal-body.page-courses .rh-row .rh-meta,
body.portal-body.page-courses .rh-row .rh-date {color:#3f5574 !important;}
body.portal-body.page-courses .rh-row .rh-title {color:#102e5d !important;}

/* Practice Tests: all text in the coloured hero—including <b> values inside
   translucent pills—must be light. Avoid the bright-pink low-contrast end. */
body.portal-body.page-tests .tests-page .tp-hero {
    background:linear-gradient(125deg,#302172 0%,#5634b1 52%,#942e72 100%) !important;
}
body.portal-body.page-tests .tests-page .tp-hero :is(h1,h2,p,.eyebrow,.eyebrow.light),
body.portal-body.page-tests .tests-page .tp-hero .tp-hero-stat,
body.portal-body.page-tests .tests-page .tp-hero .tp-hero-stat :is(b,strong,span,small) {
    color:#ffffff !important;
    -webkit-text-fill-color:#ffffff !important;
    opacity:1 !important;
}
body.portal-body.page-tests .tests-page .tp-hero .tp-hero-stat {
    background:rgba(16,21,75,.28) !important;
    border-color:rgba(255,255,255,.38) !important;
}
body.portal-body.page-tests .tests-page .tp-section-title :is(h2,h3),
body.portal-body.page-tests .tests-page .tp-step :is(h3,.tp-field-label),
body.portal-body.page-tests .tests-page .tp-rule strong {color:#152d56 !important;}
body.portal-body.page-tests .tests-page .tp-section-title p,
body.portal-body.page-tests .tests-page .tp-step small,
body.portal-body.page-tests .tests-page .tp-rule span {color:#435977 !important;}

/* Learning Progress: preserve the teal-blue banner but assert bright labels
   in case global typography rules would override inherited white. */
body.portal-body.page-progress .page>.hero-card :is(h1,h2,p,.eyebrow,.eyebrow.light),
body.portal-body.page-progress .page>.hero-card .hero-meta span,
body.portal-body.page-progress .page>.hero-card .hero-meta :is(b,strong) {
    color:#ffffff !important;
    -webkit-text-fill-color:#ffffff !important;
}
body.portal-body.page-progress .stats-grid .stat-card small,
body.portal-body.page-progress .history-row small {color:#475d7b !important;}
body.portal-body.page-progress .stats-grid .stat-card strong {color:#142f58 !important;}

/* Main Dashboard: the focus card is dark; a common small/p rule was colouring
   the caption grey. These selectors win even over global !important rules. */
body.portal-body.page-dashboard .sch-focus-box .sch-focus-top small {
    color:#b9f9f1 !important;
    -webkit-text-fill-color:#b9f9f1 !important;
    opacity:1 !important;
}
body.portal-body.page-dashboard .sch-focus-box .sch-focus-top h2,
body.portal-body.page-dashboard .sch-focus-box .sch-focus-clock {
    color:#ffffff !important;
    -webkit-text-fill-color:#ffffff !important;
    opacity:1 !important;
}
body.portal-body.page-dashboard .sch-focus-box .sch-focus-top p,
body.portal-body.page-dashboard .sch-focus-box .sch-focus-status {
    color:#e3eeff !important;
    -webkit-text-fill-color:#e3eeff !important;
    opacity:1 !important;
}
body.portal-body.page-dashboard .sch-focus-box .sch-focus-controls button:not(#sch-focus-start) {
    color:#ffffff !important;
    -webkit-text-fill-color:#ffffff !important;
    background:rgba(255,255,255,.18) !important;
    border-color:rgba(255,255,255,.4) !important;
}
body.portal-body.page-dashboard .sch-focus-box #sch-focus-start {
    color:#1b3760 !important;
    -webkit-text-fill-color:#1b3760 !important;
    background:#ffdc8f !important;
}
body.portal-body.page-dashboard .sch-find-box .sch-find-heading small {color:#254e81 !important;}
body.portal-body.page-dashboard .sch-find-box .sch-find-heading p {color:#455c79 !important;}

/* Hero study-goal caption, numbers and descriptive labels on glass surfaces. */
body.portal-body.page-dashboard .sch-hub .sch-hub-goal-top span,
body.portal-body.page-dashboard .sch-hub .sch-hub-stat>p,
body.portal-body.page-dashboard .sch-hub .sch-hub-metrics small,
body.portal-body.page-dashboard .sch-hub .sch-hub-metrics :is(b,strong) {
    color:#f5faff !important;
    -webkit-text-fill-color:#f5faff !important;
    opacity:1 !important;
}
body.portal-body.page-dashboard .sch-hub .sch-hub-next :is(strong,span) {
    color:#ffffff !important;
    -webkit-text-fill-color:#ffffff !important;
}
body.portal-body.page-dashboard .sch-hub .sch-hub-links a {
    color:#ffffff !important;
    -webkit-text-fill-color:#ffffff !important;
}
body.portal-body.page-dashboard .sch-hub .sch-hub-primary,
body.portal-body.page-dashboard .sch-hub .sch-hub-primary span {
    color:#1e3762 !important;
    -webkit-text-fill-color:#1e3762 !important;
}

/* My Subjects: vivid cards with dark clear descriptions. Previously the
   white "Choose chapter" text was invisible at the light end of each gradient. */
body.portal-body.page-dashboard #dashboard-my-subjects .sc-dashboard-subject .subject-course-label {
    color:#344f70 !important;
    -webkit-text-fill-color:#344f70 !important;
    font-weight:750 !important;
}
body.portal-body.page-dashboard #dashboard-my-subjects .sc-dashboard-subject .subject-study {
    background:var(--ink,#174477) !important;
    color:#ffffff !important;
    -webkit-text-fill-color:#ffffff !important;
    border:1px solid rgba(255,255,255,.18) !important;
}
body.portal-body.page-dashboard #dashboard-my-subjects .sc-dashboard-subject:nth-child(8n + 4) .subject-study {
    background:#874905 !important;
}
body.portal-body.page-dashboard #dashboard-my-subjects .sc-dashboard-subject .subject-study :is(b,strong,span) {
    color:#ffffff !important;
    -webkit-text-fill-color:#ffffff !important;
}
body.portal-body.page-dashboard #dashboard-my-subjects .sc-dashboard-subject strong {
    color:#173358 !important;
    -webkit-text-fill-color:#173358 !important;
}
body.portal-body.page-dashboard #dashboard-my-subjects .subject-heading p,
body.portal-body.page-dashboard #dashboard-my-subjects .sc-subject-total {color:#3c5575 !important;}

/* Separate English course remains separate: only the soft informational text
   on the pale pastel panel is darkened. No day/progression data changes. */
body.portal-body.page-dashboard .sterling-english-special .english-special-header p {
    color:#3a5575 !important;
    -webkit-text-fill-color:#3a5575 !important;
}
body.portal-body.page-dashboard .sterling-english-special .english-special-eyebrow {
    color:#0c685d !important;
    -webkit-text-fill-color:#0c685d !important;
}

/* Library: subdued metadata on white/pastel subject cards must stay legible. */
body.portal-body.page-lessons .library-hero :is(h1,h2,p,.eyebrow,.eyebrow.light) {
    color:#ffffff !important;
    -webkit-text-fill-color:#ffffff !important;
}

/* Use visible keyboard outlines, no hover dependence for legibility. */
body.portal-body :is(.rh-hero,.tp-hero,.sch-focus-box,#dashboard-my-subjects) a:focus-visible,
body.portal-body.page-dashboard #dashboard-my-subjects .sc-dashboard-subject:focus-visible {
    outline:3px solid #ffcd61 !important;
    outline-offset:3px !important;
}
@media (prefers-contrast:more) {
    body.portal-body.page-dashboard .sch-hub .sch-hub-metrics>div,
    body.portal-body.page-dashboard .sch-hub .sch-hub-metrics>a,
    body.portal-body.page-dashboard .sch-hub .sch-hub-links a {
        background:rgba(0,17,57,.47) !important;
    }
}
