/* ==========================================================================
   Project styles layered on top of the Edurock theme (assets/css/style.css).
   Loaded last in every layout (app / student / admin) so these rules win.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Brand palette.

   The two official brand hexes live in ONE place — `--primaryColor` and
   `--secondaryColor*` in assets/css/style.css `:root`. The theme already
   routes ~175 rules through those two tokens, so a rebrand is a two-line edit
   there. Everything below is derived from them:

     blue  #001946  primary / structural — buttons, links, icon circles, fills
     red   #c50201  accent / highlight   — eyebrow labels, badges, small marks

   The `*OnDark` tints exist because both brand hexes are very dark. They read
   fine as fills behind white text, but as *text or icons* on the dark theme's
   #0C0E2B surface they collapse to ~1.3:1. Use the OnDark tint whenever brand
   colour is the foreground inside `.is_dark`.
   -------------------------------------------------------------------------- */
:root {
    /* Lighter companion for gradients and the hover state of a brand-blue fill.
       Brand blue is near-black, so its hover lightens rather than darkens. */
    --brandBlueSoft: #002e77;
    --brandBlueDeep: #00102f;
    /* Brand blue lifted to 7.1:1 on the dark theme background (#0C0E2B). */
    --brandBlueOnDark: #7ca0de;

    --brandRedDeep: #9c0201;
    /* Brand red lifted to 5.4:1 on the dark theme background (#0C0E2B). */
    --brandRedOnDark: #f54947;
}

/* --------------------------------------------------------------------------
   Bootstrap 5 bridge.

   bootstrap.min.css is the stock build, so `.btn-primary` / `.bg-primary` /
   `.text-primary` shipped Bootstrap's own blue (#0d6efd) — an off-brand blue
   that turned up on ~30 buttons across the admin panel, the student dashboard
   and the public site. Point Bootstrap's primary at the brand token instead of
   recolouring those call sites one by one.

   `.bg-primary` / `.text-primary` read `--bs-primary-rgb`; the button variants
   bake the hex into `--bs-btn-*` and have to be restated.
   -------------------------------------------------------------------------- */
:root {
    --bs-primary: #001946;
    --bs-primary-rgb: 0, 25, 70;
}

.btn-primary {
    --bs-btn-bg: var(--primaryColor);
    --bs-btn-border-color: var(--primaryColor);
    --bs-btn-hover-bg: var(--brandBlueSoft);
    --bs-btn-hover-border-color: var(--brandBlueSoft);
    --bs-btn-active-bg: var(--brandBlueDeep);
    --bs-btn-active-border-color: var(--brandBlueDeep);
    --bs-btn-disabled-bg: var(--primaryColor);
    --bs-btn-disabled-border-color: var(--primaryColor);
    --bs-btn-focus-shadow-rgb: 0, 25, 70;
}

.btn-outline-primary {
    --bs-btn-color: var(--primaryColor);
    --bs-btn-border-color: var(--primaryColor);
    --bs-btn-hover-bg: var(--primaryColor);
    --bs-btn-hover-border-color: var(--primaryColor);
    --bs-btn-active-bg: var(--primaryColor);
    --bs-btn-active-border-color: var(--primaryColor);
    --bs-btn-disabled-color: var(--primaryColor);
    --bs-btn-disabled-border-color: var(--primaryColor);
    --bs-btn-focus-shadow-rgb: 0, 25, 70;
}

/* Outline buttons and `.text-primary` put brand blue on whatever is behind them.
   Inside a Bootstrap `.card` that is still a white surface (the layouts force
   cards light in both themes — see layouts/app.blade.php), but anywhere else in
   dark mode the background is #0C0E2B and near-black-on-near-black disappears. */
.is_dark .btn-outline-primary {
    --bs-btn-color: var(--brandBlueOnDark);
    --bs-btn-border-color: var(--brandBlueOnDark);
    --bs-btn-hover-bg: var(--brandBlueOnDark);
    --bs-btn-hover-border-color: var(--brandBlueOnDark);
    --bs-btn-hover-color: var(--brandBlueDeep);
    --bs-btn-active-bg: var(--brandBlueOnDark);
    --bs-btn-active-border-color: var(--brandBlueOnDark);
    --bs-btn-active-color: var(--brandBlueDeep);
    --bs-btn-disabled-color: var(--brandBlueOnDark);
    --bs-btn-disabled-border-color: var(--brandBlueOnDark);
}

.is_dark .card .btn-outline-primary {
    --bs-btn-color: var(--primaryColor);
    --bs-btn-border-color: var(--primaryColor);
    --bs-btn-hover-color: #ffffff;
    --bs-btn-hover-bg: var(--primaryColor);
    --bs-btn-hover-border-color: var(--primaryColor);
    --bs-btn-active-color: #ffffff;
    --bs-btn-active-bg: var(--primaryColor);
    --bs-btn-active-border-color: var(--primaryColor);
    --bs-btn-disabled-color: var(--primaryColor);
    --bs-btn-disabled-border-color: var(--primaryColor);
}

/* `.text-primary` outside a card, on the dark body. */
.is_dark .text-primary {
    color: var(--brandBlueOnDark) !important;
}

.is_dark .card .text-primary {
    color: var(--primaryColor) !important;
}

/* --------------------------------------------------------------------------
   Homepage — "How It Works" step icons.
   Edurock's .single__service card ships with inline SVG artwork. We reuse the
   card but swap in icofont glyphs, so the icon needs its own sizing/centering.
   -------------------------------------------------------------------------- */
.service__icon__font {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    /* Transparent border in the resting state so the hover border doesn't shift layout. */
    border: 2px solid transparent;
    background-color: rgba(0, 25, 70, 0.08);
    color: var(--primaryColor);
    font-size: 32px;
    line-height: 1;
}

/* .single__service:hover turns the whole card brand blue (var(--primaryColor)).
   The theme recolors its own SVG artwork to white there, but our icofont glyph and
   the <h3> are not covered: the icon stayed blue-on-blue and the heading stayed
   near-black, because the theme's hover rules are scoped to `.service__content h3 a`
   and these headings are not links. */
.single__service:hover .service__icon__font {
    border-color: rgba(255, 255, 255, 0.5);
    background-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.single__service:hover .service__content h3 {
    color: #ffffff;
}

/* Dark mode resting state: .single__service sits on var(--whiteColor), which the dark
   theme remaps to #0C0E2B. Brand blue on that navy is far too low contrast. */
.is_dark .service__icon__font {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--brandBlueOnDark);
}

/* The STEP 1/2/3 eyebrow. The theme's own convention is primary blue for
   structure and secondary for small highlight labels (e.g. `.mega__menu__label.new`),
   so the eyebrow takes brand red and the icon circle above it keeps brand blue —
   the same split the Edurock original expressed with gold-on-blue. */
.single__service .service__step {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--secondaryColor);
}

/* Brand red is 3.0:1 on the dark card; lift it to the on-dark tint. */
.is_dark .single__service .service__step {
    color: var(--brandRedOnDark);
}

/* The card turns solid brand blue on hover in both themes — red on blue is
   unreadable, so the eyebrow goes white with the rest of the card's text. */
.single__service:hover .service__step,
.is_dark .single__service:hover .service__step {
    color: rgba(255, 255, 255, 0.9);
}

/* --------------------------------------------------------------------------
   Homepage — testimonial slider arrows (slick injects .prev_class / .next_class).
   The theme sizes and backgrounds the arrows but never sets a colour on the glyph,
   so it inherits body text. In dark mode the theme flips the arrow background to
   var(--blackColor) — which the dark palette remaps to #fff — while body text is
   also #fff, leaving a white glyph on a white circle. Pin the glyph colour instead
   of touching the background, so the theme's hover states still apply.
   -------------------------------------------------------------------------- */
.is_dark .testimonial__slider__active__3 .slick-arrow {
    color: #0c0e2b;
}

.is_dark .testimonial__slider__active__3 .slick-arrow:hover {
    color: #ffffff;
}

/* --------------------------------------------------------------------------
   Homepage — closing CTA band.
   Edurock has no CTA-banner component, so this is built from theme primitives
   (section headings + .default__button) on a brand blue band.
   -------------------------------------------------------------------------- */
.ctaarea {
    background-color: var(--primaryColor);
    background-image: linear-gradient(135deg, var(--primaryColor) 0%, var(--brandBlueSoft) 100%);
    border-radius: 15px;
    padding: 60px 40px;
}

.ctaarea .ctaarea__heading h2 {
    margin-bottom: 12px;
    color: #ffffff;
}

.ctaarea .ctaarea__content p {
    margin-bottom: 0;
    color: rgba(255, 255, 255, 0.85);
}

/* Invert .default__button against the blue band. */
.ctaarea .default__button {
    background-color: #ffffff;
    border-color: #ffffff;
    color: var(--primaryColor);
}

.ctaarea .default__button:hover {
    background-color: var(--secondaryColor);
    border-color: var(--secondaryColor);
    color: #ffffff;
}

@media (max-width: 767px) {
    .ctaarea {
        padding: 40px 20px;
        text-align: center;
    }

    .ctaarea .ctaarea__button {
        margin-top: 24px;
    }
}

/* --------------------------------------------------------------------------
   Homepage — stats bar icons.

   Edurock ships these as flat pink PNGs (assets/img/counter/counter__*.png),
   which no amount of CSS can rebrand and which would need re-exporting every
   time the palette moves. Swapped for icofont glyphs — the same treatment
   .service__icon__font already gets on the "How It Works" cards above — so the
   stats bar now follows the brand tokens like everything else.

   Brand red, matching the STEP eyebrow: these are decorative accents next to
   the numbers, and the Edurock original deliberately contrasted them against
   the page's blue. Blue would have made the whole band monochrome.
   -------------------------------------------------------------------------- */
.counter__icon__font {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background-color: rgba(197, 2, 1, 0.08);
    color: var(--secondaryColor);
    font-size: 30px;
    line-height: 1;
}

/* The stats bar sits directly on the body, which is #0C0E2B in dark mode. */
.is_dark .counter__icon__font {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--brandRedOnDark);
}

/* --------------------------------------------------------------------------
   Footer — copyright year.

   The theme colours the year `<span>` with var(--primaryColor). The footer band
   is #0C0E2B in BOTH themes (light mode paints it var(--darkblack), dark mode
   re-paints it var(--lightGrey) — both resolve to the same navy), so brand blue
   on it lands at ~1.3:1 and the year all but vanished.

   Gaston asked for brand red here. Flat #c50201 on that navy is only 3.0:1 —
   legible but under the 4.5:1 AA threshold for body text — so this uses the
   on-dark tint of the same red instead, which reads as the brand accent at
   5.4:1. Not a `.is_dark` rule: the band is navy in both themes, so the tint
   applies unconditionally.
   -------------------------------------------------------------------------- */
.footerarea__copyright__wrapper .footerarea__copyright__content p span {
    color: var(--brandRedOnDark);
}

/* --------------------------------------------------------------------------
   Course detail — the course-type pill ("Video" / "Live" / "Hybrid").

   Edurock styles this `.course__2` variant with var(--indigo) (#B13BFF), a
   leftover template purple that survived both earlier rebrands. It is purely
   decorative — the pill beside it, <x-badge-level>, carries the semantic CEFR
   scale (green A1-A2 / blue B1-B2 / purple C1-C2) and is deliberately left
   alone. Brand red keeps the type pill distinct from the blue B1/B2 badge.
   -------------------------------------------------------------------------- */
.course__button a.course__2 {
    background: var(--secondaryColor);
    border: 1px solid var(--secondaryColor);
}

.course__button a.course__2:hover {
    background-color: var(--whiteColor);
    color: var(--secondaryColor);
    border: 1px solid var(--secondaryColor);
}

/* ==========================================================================
   Brand colour on dark surfaces.

   Both brand hexes are very dark (#001946 sits at L=0.6%, #c50201 at L=12%).
   As a FILL behind white text that is ideal. As a FOREGROUND on a dark surface
   it collapses — brand blue on the dark theme's #0C0E2B body measures 1.1:1,
   i.e. invisible. The Edurock theme paints ~100 rules `color: var(--primaryColor)`
   with only a white-page surface in mind, so every one of them that lands on a
   dark surface needs the lifted tint instead.

   The selectors below are not guesswork: each was found by walking the rendered
   DOM of every page type in dark mode, computing each element's true background
   from its ancestor chain, and keeping everything under 3:1. Measured ratios are
   noted so a future palette change can be re-checked the same way.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Bands that are dark in BOTH themes, so these are not `.is_dark` rules.
   The top bar sits on --darkdeep1 (#170F2F) and the footer on #0C0E2B in light
   mode as well — the brand-blue marks on them were unreadable in *both* modes.
   -------------------------------------------------------------------------- */

/* Location pin beside the address in the top bar — was 1.07:1. */
.topbar__right .topbar__icon i {
    color: var(--brandBlueOnDark);
}

/* Top bar social icon hover, and plain links (phone, email) in the mobile
   off-canvas panel — both bands are dark in both themes, and both hovers fell
   back to brand blue (1.0–1.1:1). The off-canvas menu items keep their own red
   hover, which is more specific. */
.topbar__right .topbar__list ul li a:hover,
.topbar__right .topbar__list ul li a:focus-visible,
.mobile-off-canvas-active .header-mobile-aside-wrap a:hover,
.mobile-off-canvas-active .header-mobile-aside-wrap a:focus-visible {
    color: var(--brandBlueOnDark);
}

/* Footer link hovers all resolve to brand blue on the navy footer (1.3:1),
   so hovering a footer link made it disappear rather than highlight. */
.footerarea__wrapper .footerarea__inner .footerarea__list ul li a:hover,
.footerarea__right__wraper .footerarea__right__list ul li a:hover .footerarea__right__content h6,
.footerarea__copyright__wrapper .footerarea__copyright__content p a:hover,
.footerarea__copyright__wrapper .footerarea__copyright__list ul li a:hover,
.is_dark .footerarea__right__wraper .footerarea__right__list ul li a:hover .footerarea__right__content h6 {
    color: var(--brandBlueOnDark);
}

/* --------------------------------------------------------------------------
   2. Dark mode only — brand blue text/icons sitting on the #0C0E2B body or on
   a card that the dark theme repaints (--whiteColor becomes #0C0E2B).
   -------------------------------------------------------------------------- */

/* Active item in the student/admin sidebar nav — was 1.1:1, so the page you
   were actually on was the one menu entry you could not read. The icon inside
   inherits, which also covers the per-page glyphs (road, file, video-cam …). */
.is_dark .dashboard__nav ul li a.active {
    color: var(--brandBlueOnDark);
}

/* Course card price and the meta row (level / lesson count) icons — 1.07:1. */
.is_dark .gridarea__wraper .gridarea__content .gridarea__price,
.is_dark .gridarea__wraper .gridarea__content .gridarea__list ul li i {
    color: var(--brandBlueOnDark);
}

/* Course detail sidebar: price plus the date/meta icons beside it — 1.1:1. */
.is_dark .course__details__price ul li .course__price,
.is_dark .course__details__price ul li .course__details__date i,
.is_dark .event__sidebar__wraper .event__price__wraper .event__price {
    color: var(--brandBlueOnDark);
}

/* The "One-time payment" pill: brand red on --whitegrey1, which the dark theme
   remaps from #EDEDED to #312a57 — 2.12:1. */
.is_dark .event__sidebar__wraper .event__price__wraper .event__Price__button a {
    color: var(--brandRedOnDark);
}

/* --------------------------------------------------------------------------
   3. Solid brand-blue buttons in dark mode.

   #001946 against the #0C0E2B body is only 1.1:1 of *edge* contrast, so the
   button's shape dissolves into the page even though its white label stays
   perfectly legible. A hairline in the lifted tint restores the edge without
   touching the brand fill. Cards are forced light in both themes (see
   layouts/app.blade.php), so buttons inside one keep the plain brand border.
   -------------------------------------------------------------------------- */
.is_dark .default__button,
.is_dark .headerarea__button a,
.is_dark .btn-primary {
    border-color: rgba(124, 160, 222, 0.5);
}

.is_dark .card .btn-primary {
    border-color: var(--primaryColor);
}

/* --------------------------------------------------------------------------
   4. Text sitting ON a brand fill.

   The mirror image of the block above, and the reason it needs its own pass:
   Edurock writes "white text" as var(--whiteColor), but the dark theme remaps
   --whiteColor to #0C0E2B so it can reuse the token as a *surface*. Anywhere the
   theme used it as a foreground, dark mode silently turns white text navy.
   -------------------------------------------------------------------------- */

/* Student dashboard banner: the "2 active courses · 1 completed · 1 certificate"
   row on the brand-blue banner went to #0C0E2B on #001946 — 1.1:1, invisible.
   The theme patched the <h4>/<h5> beside it in dark mode but not this list. */
.is_dark .dashboardarea__left__content ul li {
    color: #ffffff;
}

/* Same trap on badges. Only the brand-red badges are corrected: the coloured
   variants are a semantic status scale (green pass, blue in-progress, gold
   available) whose lighter fills genuinely read better with dark text — forcing
   white on the gold badge would take it from 6.9:1 down to 2.2:1. */
.is_dark .grid__badge:not(.green__color):not(.blue__color):not(.yellow__color):not(.purple__color):not(.orange__color),
.is_dark .grid__badge.pink__color {
    color: #ffffff;
}

/* --------------------------------------------------------------------------
   5. Pathway "Always available" badge.

   student/pathway/index.blade.php marks these courses with
   `<span class="grid__badge sky__color">`, but Edurock never defined a
   sky__color variant for .grid__badge — so it fell through to the base rule and
   painted itself with --secondaryColor. The result was an alarm-red "Always
   available" pill sitting next to a green "A1", which reads as a warning. The
   class name points at --skycolor, so wire it to that.
   -------------------------------------------------------------------------- */
.grid__badge.sky__color {
    background: var(--skycolor);
}

/* A badge dropped into a dashboard table loses its own label colour: the theme's
   `.dashboard__table … td span` rule is more specific than `.grid__badge` and
   paints every span var(--blackColor). In dark mode that token is #fff so it
   happens to look right; in light mode it put black on the brand-red badge at
   3.38:1. Restore white, again only for the brand-red variants. */
.dashboard__table table tbody tr td span.grid__badge:not(.green__color):not(.blue__color):not(.yellow__color):not(.purple__color):not(.orange__color),
.dashboard__table table tbody tr td span.grid__badge.pink__color {
    color: #ffffff;
}

/* --------------------------------------------------------------------------
   6. Remaining dark-mode cases found on the homepage and the lesson player.
   -------------------------------------------------------------------------- */

/* Homepage testimonial slider: the quote marks and the reviewer's location line
   are brand blue directly on the dark body — 1.07:1. */
.is_dark .testimonialarea__paragraph__3 .testimonial__quote i,
.is_dark .testimonialarea__person__3 .testimonial__name span {
    color: var(--brandBlueOnDark);
}

/* Hero eyebrow ("FRENCH PATHWAY ACADEMY — TEF & TCF CANADA PREP"): brand red on
   the dark hero measured 2.95:1, just under the large-text threshold. */
.is_dark .herobannerarea__title .herobannerarea__small__title span {
    color: var(--brandRedOnDark);
}

/* Bunny lesson player: the title bar above the video is a brand-blue band whose
   label is var(--whiteColor) — the same token the dark theme repurposes as a
   surface — so the lesson-type heading and its links turned #0C0E2B on #001946
   (1.1:1) and the bar read as empty. */
.is_dark .lesson__content__wrap h3,
.is_dark .lesson__content__wrap a {
    color: #ffffff;
}

/* Brand-red emphasis text on the dark hero/section backgrounds measured 2.95:1 —
   a hair under the 3:1 large-text threshold. These are deliberate emphasis (the
   headline highlight and the section eyebrows), so they should not end up the
   dimmest thing in their own block. */
.is_dark .herobannerarea__title .herobannerarea__title__heading__2 h2 span,
.is_dark .section__title__2 .section__small__title span {
    color: var(--brandRedOnDark);
}

/* --------------------------------------------------------------------------
   Rich text (admin-authored HTML from CKEditor — course excerpt/description,
   lesson description), rendered on public pages inside `.rich-text`.

   The Edurock reset strips list markers and the theme never styles tables, so
   every element the editor can emit is restated here. Colours come from theme
   tokens or `currentColor`, never hexes, so the same rules read correctly on
   the light surface and the dark `.is_dark` one.
   -------------------------------------------------------------------------- */
.rich-text {
    color: var(--contentColor);
    overflow-wrap: anywhere;
}

.rich-text::after {
    content: "";
    display: table;
    clear: both;
}

.rich-text > :last-child {
    margin-bottom: 0;
}

.rich-text p {
    color: inherit;
    margin-bottom: 1em;
}

.rich-text h2,
.rich-text h3,
.rich-text h4 {
    color: var(--headingColor);
    line-height: 1.3;
    margin: 1.25em 0 0.5em;
}

.rich-text h2 { font-size: 1.5rem; }
.rich-text h3 { font-size: 1.25rem; }
.rich-text h4 { font-size: 1.1rem; }

.rich-text > h2:first-child,
.rich-text > h3:first-child,
.rich-text > h4:first-child {
    margin-top: 0;
}

.rich-text a {
    color: var(--primaryColor);
    text-decoration: underline;
}

.is_dark .rich-text a {
    color: var(--brandBlueOnDark);
}

.rich-text ul,
.rich-text ol {
    margin: 0 0 1em;
    padding-left: 1.5em;
}

.rich-text ul { list-style: disc; }
.rich-text ol { list-style: decimal; }
.rich-text ul ul { list-style: circle; }

.rich-text li {
    color: inherit;
    /* Theme list rules set `li` inline (items ran together); restore list items. */
    display: list-item;
    float: none;
    list-style: inherit;
    margin-bottom: 0.25em;
}

.rich-text li::marker {
    color: currentColor;
}

.rich-text blockquote {
    border-left: 4px solid var(--secondaryColor);
    font-style: italic;
    margin: 0 0 1em;
    padding: 0.25em 0 0.25em 1em;
}

.is_dark .rich-text blockquote {
    border-left-color: var(--brandRedOnDark);
}

.rich-text hr {
    border: 0;
    border-top: 1px solid currentColor;
    margin: 1.5em 0;
    opacity: 0.25;
}

.rich-text figure.table {
    margin: 0 0 1em;
    overflow-x: auto;
}

.rich-text table {
    border-collapse: collapse;
    width: 100%;
}

.rich-text th,
.rich-text td {
    border: 1px solid color-mix(in srgb, currentColor 30%, transparent);
    padding: 0.5em 0.75em;
    text-align: left;
    vertical-align: top;
}

.rich-text th {
    background: color-mix(in srgb, currentColor 7%, transparent);
    color: var(--headingColor);
    font-weight: 600;
}

.rich-text figure.image {
    margin: 1em 0;
    text-align: center;
}

.rich-text img {
    border-radius: var(--borderRadius);
    height: auto;
    max-width: 100%;
}

.rich-text figure.image.image-style-side {
    float: right;
    margin: 0 0 1em 1.5em;
    max-width: 50%;
}

.rich-text figcaption {
    font-size: 0.875em;
    margin-top: 0.4em;
    opacity: 0.8;
}

@media (max-width: 575px) {
    .rich-text figure.image.image-style-side {
        float: none;
        margin: 1em 0;
        max-width: 100%;
    }
}

/* CKEditor 5 in the admin panel. The Edurock reset also hits the editing area,
   so restore list markers there; then give the editor chrome (toolbar,
   dropdowns, balloons — the latter render in a body-level wrapper) the dark
   palette. `html.is_dark` out-specifies CKEditor's own `:root` tokens, which
   load after this file. */
.ck-content ul { list-style: disc; padding-left: 1.5em; }
.ck-content ol { list-style: decimal; padding-left: 1.5em; }
.ck-content li { display: list-item; float: none; list-style: inherit; }
.ck-content a { color: var(--primaryColor); text-decoration: underline; }
html.is_dark .ck-content a { color: var(--brandBlueOnDark); }

html.is_dark {
    --ck-color-base-background: #170F2F;
    --ck-color-base-foreground: #0C0E2B;
    --ck-color-base-border: #312a57;
    --ck-color-focus-border: var(--brandBlueOnDark);
    --ck-color-text: #ffffff;
    --ck-color-toolbar-background: #170F2F;
    --ck-color-toolbar-border: #312a57;
    --ck-color-button-default-hover-background: #312a57;
    --ck-color-button-default-active-background: #312a57;
    --ck-color-button-on-background: #312a57;
    --ck-color-button-on-hover-background: #3d3570;
    --ck-color-button-on-color: #ffffff;
    --ck-color-button-on-disabled-background: #241d45;
    --ck-color-button-default-disabled-background: transparent;
    --ck-color-dropdown-panel-background: #170F2F;
    --ck-color-dropdown-panel-border: #312a57;
    --ck-color-panel-background: #170F2F;
    --ck-color-panel-border: #312a57;
    --ck-color-input-background: #0C0E2B;
    --ck-color-input-border: #312a57;
    --ck-color-input-text: #ffffff;
    --ck-color-list-background: #170F2F;
    --ck-color-list-button-hover-background: #312a57;
    --ck-color-list-button-on-background: #312a57;
    --ck-color-list-button-on-text: #ffffff;
    --ck-color-labeled-field-label-background: #170F2F;
    --ck-color-split-button-hover-background: #312a57;
    --ck-color-split-button-hover-border: #3d3570;
    --ck-color-shadow-drop: rgba(0, 0, 0, 0.5);
    --ck-color-image-caption-background: #0C0E2B;
    --ck-color-image-caption-text: #ffffff;
    --ck-color-widget-type-around-button-hover: var(--brandBlueOnDark);
}

html.is_dark .ck.ck-editor__editable {
    color: #ffffff;
}

/* Source view: CKEditor leaves the raw-HTML textarea to browser defaults (and
   the theme's own textarea rules), so colour it from the editor tokens, which
   the dark palette above already swaps. The area has no `.ck` class of its
   own; in fullscreen it moves out of `.ck-editor` into the fullscreen wrapper. */
.ck-editor .ck-source-editing-area textarea,
.ck-fullscreen__main-wrapper .ck-source-editing-area textarea {
    background: var(--ck-color-base-background);
    color: var(--ck-color-text);
    height: 100%;
    min-height: 0;
}

/* Fullscreen: CKEditor styles the editable as a fixed-width white A4 sheet.
   Use a fluid, theme-coloured writing column instead, as wide as the page
   allows. CKEditor's stylesheet loads after this file with selectors of the
   same weight, so these lead with the wrapper's own `.ck` class to win. */
.ck.ck-fullscreen__main-wrapper .ck-fullscreen__editable-wrapper {
    justify-content: center;
    padding-inline: 16px;
}

.ck.ck-fullscreen__main-wrapper .ck-fullscreen__editable {
    margin-left: 0;
    max-width: 1000px;
    width: 100%;
}

.ck.ck-fullscreen__main-wrapper .ck-fullscreen__sidebar:empty {
    display: none;
}

.ck.ck-fullscreen__main-wrapper .ck-fullscreen__editable .ck.ck-editor__editable:not(.ck-editor__nested-editable),
.ck.ck-fullscreen__main-wrapper .ck-fullscreen__editable .ck-source-editing-area {
    background: var(--ck-color-base-background);
    max-width: 100%;
    min-height: calc(100vh - 140px);
    padding: 24px 32px;
    width: 100%;
}

.ck.ck-fullscreen__main-wrapper .ck-fullscreen__editable .ck-source-editing-area {
    padding: 0;
}

/* --------------------------------------------------------------------------
   Course thumbnails: one 4:3 frame on the catalogue card and the course page,
   whatever the source image. New uploads are already centre-cropped to 4:3
   (1280×960) server-side; this also frames thumbnails uploaded before that
   (including the earlier 16:9 crops), so every card shows the same shape. The
   tint shows behind an image that is still loading or missing.
   -------------------------------------------------------------------------- */
.course__thumbnail {
    aspect-ratio: 4 / 3;
    background-color: color-mix(in srgb, currentColor 8%, transparent);
    display: block;
    height: auto;
    max-width: 100%;
    object-fit: cover;
    object-position: center;
    width: 100%;
}

/* Lesson covers in the admin lesson list: a small 9:16 portrait beside the
   title. Uploads are centre-cropped to 9:16 (360×640) server-side; the frame
   holds the ratio for any source regardless. */
.lesson__thumbnail {
    aspect-ratio: 9 / 16;
    background-color: color-mix(in srgb, currentColor 8%, transparent);
    border-radius: 6px;
    display: block;
    flex-shrink: 0;
    height: auto;
    object-fit: cover;
    object-position: center;
    width: 54px;
}

.lesson__thumbnail--sm {
    width: 36px;
}

/* --------------------------------------------------------------------------
   Course page curriculum: a grid of lesson cards, 9:16 cover on top. Phones
   get 2 columns, tablets 3, desktop 4 — at 9:16 fewer, wider columns make
   each cover taller than the screen. Colours come from the theme variables,
   so the cards follow html.is_dark.
   -------------------------------------------------------------------------- */
.lesson-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 576px) {
    .lesson-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 992px) {
    .lesson-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.lesson-card {
    background: var(--whiteColor);
    border: 1px solid var(--borderColor);
    border-radius: 10px;
    box-shadow: 0 0 20px 6px rgba(0, 25, 70, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.lesson-card:not(.lesson-card--locked):hover {
    box-shadow: 0 6px 24px 4px rgba(0, 25, 70, 0.12);
    transform: translateY(-2px);
}

.lesson-card__media {
    aspect-ratio: 9 / 16;
    background-color: color-mix(in srgb, currentColor 6%, transparent);
    color: var(--contentColor);
    position: relative;
}

.lesson-card__cover,
.lesson-card__placeholder {
    height: 100%;
    inset: 0;
    position: absolute;
    width: 100%;
}

.lesson-card__cover {
    object-fit: cover;
    object-position: center;
}

/* No cover: a muted block of the same shape with the lesson-type icon. */
.lesson-card__placeholder {
    display: grid;
    font-size: 34px;
    opacity: 0.3;
    place-items: center;
}

/* Locked (not enrolled): the cover is dimmed and each card wears a lock. */
.lesson-card--locked .lesson-card__cover {
    filter: grayscale(0.4) brightness(0.85);
}

.lesson-card__number,
.lesson-card__flag {
    background: rgba(12, 14, 43, 0.72);
    border-radius: 999px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    position: absolute;
    top: 8px;
}

.lesson-card__number {
    left: 8px;
    min-width: 24px;
    padding: 6px 8px;
    text-align: center;
}

.lesson-card__flag {
    padding: 6px 8px;
    right: 8px;
}

.lesson-card__flag--preview {
    background: #0dcaf0;
    color: #0c0e2b;
}

.lesson-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px 12px;
}

.lesson-card__title,
.lesson-card__title a {
    color: var(--headingColor);
    font-size: 15px;
    line-height: 1.35;
    margin: 0;
}

.lesson-card__title a:hover {
    color: var(--primaryColor);
}

.lesson-card__meta {
    color: var(--contentColor);
    display: flex;
    flex-wrap: wrap;
    font-size: 12.5px;
    gap: 2px 10px;
    margin-top: auto;
    opacity: 0.8;
}

.lesson-grid__notice {
    border: 1px dashed var(--borderColor);
    border-radius: 8px;
    color: var(--contentColor);
    font-size: 14px;
    margin: 0 0 16px;
    padding: 10px 14px;
}

/* ─── CEFR levels admin: live placement band coverage bar ─────────────────────
   Segments reuse the standalone .grid__badge colour classes so the bar matches
   each level's badge. Widths are percentages of 0–100. */
.cefr-band-bar {
  display: flex;
  height: 30px;
  border-radius: 4px;
  overflow: hidden;
  background: #eef0f4;
}
.cefr-band-bar > .grid__badge {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 0;
  border-radius: 0;
  overflow: hidden;
  white-space: nowrap;
  font-size: 11px;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.6);
}
.cefr-band-bar__gap {
  background: repeating-linear-gradient(45deg, #dc3545 0 6px, #f8d7da 6px 12px);
}

/* --------------------------------------------------------------------------
   Know Your Level — exam and level glossary page.
   -------------------------------------------------------------------------- */

/* Optional eyebrow + subtitle on the shared <x-page-header>, styled like the
   homepage hero eyebrow. Any page may pass them. */
.breadcrumb__eyebrow {
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--secondaryColor);
}
.is_dark .breadcrumb__eyebrow {
    color: var(--brandRedOnDark);
}
.breadcrumb__subtitle {
    margin: 12px 0 0;
    font-size: 18px;
    color: var(--contentColor);
}
@media (max-width: 767px) {
    .breadcrumb__eyebrow {
        font-size: 12px;
        letter-spacing: 2px;
    }
}

.glossary__section {
    margin-bottom: 50px;
}
.glossary__heading {
    margin-bottom: 18px;
    font-size: 26px;
    font-weight: 700;
    color: var(--headingColor);
}
.glossary__intro {
    margin-top: -8px;
    margin-bottom: 18px;
}

/* CEFR level cards. Neutral by default; the signed-in student's own level is
   gold, mirroring the highlighted C1 card in Gaston's PDF. */
.level__card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 130px;
    padding: 24px 12px;
    text-align: center;
    background: var(--whiteColor);
    border: 1px solid var(--borderColor1);
    border-radius: 10px;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.is_dark .level__card {
    background: var(--lightGrey10);
    border-color: var(--borderColor);
}
.level__card:hover {
    transform: translateY(-3px);
    border-color: var(--primaryColor);
    box-shadow: 0 10px 25px rgba(0, 25, 70, 0.12);
}
.is_dark .level__card:hover {
    border-color: var(--brandBlueOnDark);
}
.level__card__code {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--primaryColor);
}
.is_dark .level__card__code {
    color: var(--brandBlueOnDark);
}
.level__card__name {
    margin-top: 6px;
    font-size: 15px;
    color: var(--contentColor);
}
.level__card--current,
.is_dark .level__card--current {
    background: #fdf3d4;
    border: 2px solid var(--yellow1);
}
/* The gold card is light in both themes, so its text stays dark in both. */
.level__card--current .level__card__code,
.is_dark .level__card--current .level__card__code {
    color: var(--primaryColor);
}
.level__card--current .level__card__name,
.is_dark .level__card--current .level__card__name {
    color: #5c4a10;
}
.level__card--current:hover,
.is_dark .level__card--current:hover {
    border-color: var(--yellow1);
}
.level__card__tag {
    position: absolute;
    top: -11px;
    left: 50%;
    transform: translateX(-50%);
    padding: 2px 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: nowrap;
    color: #3a2d00;
    background: var(--yellow1);
    border-radius: 20px;
}

/* Glossary tables reuse .dashboard__table; add the borders and header colour a
   standalone reference table needs. The theme's --lightGrey5 header stays light
   in dark mode, so the dark theme gets its own header fill. */
.glossary__table {
    border: 1px solid var(--borderColor1);
    border-radius: 8px;
}
.is_dark .glossary__table {
    border-color: var(--borderColor);
}
.glossary__table table thead tr th {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--primaryColor);
    white-space: nowrap;
}
.is_dark .glossary__table table thead {
    background: var(--lightGrey10);
}
.is_dark .glossary__table table thead tr th {
    color: var(--brandBlueOnDark);
}
.glossary__table table tbody tr + tr {
    border-top: 1px solid var(--borderColor1);
}
.is_dark .glossary__table table tbody tr + tr {
    border-color: var(--borderColor);
}
.glossary__table table tbody tr th {
    font-weight: 700;
    white-space: nowrap;
    vertical-align: top;
}
.glossary__table table tbody tr td {
    vertical-align: top;
}
@media (max-width: 767px) {
    .glossary__table table tbody tr td {
        min-width: 180px;
    }
}

.glossary__callout {
    margin-top: 20px;
    padding: 18px 22px;
    border: 2px dashed var(--contentColor);
    border-radius: 8px;
    color: var(--headingColor);
}

.glossary__footnote {
    margin: 0;
    font-size: 13px;
    font-style: italic;
    color: var(--contentColor);
}

/* Contact page — the card keeps Bootstrap's white background in both themes,
   but .is_dark turns every <a> white, so pin the links to the brand colour. */
.contactarea .card a {
    color: var(--primaryColor);
}

.contactarea .card a:hover {
    text-decoration: underline;
}

/* Top bar contact links — look like the surrounding top bar text in both
   themes (.is_dark would otherwise turn them white on its light top bar). */
.topbar__left ul li a {
    color: inherit;
    text-decoration: none;
}

.topbar__left ul li a:hover,
.topbar__left ul li a:focus-visible {
    color: inherit;
    text-decoration: underline;
}

/* The top bar only shows from 992px (the theme hides it below). The full
   mailing address stays on one line and ellipsises if the half-width column
   runs out of room; the full text is in the title attribute. */
.topbar__right .topbar__text--address {
    min-width: 0;
    flex: 0 1 auto;
}

.topbar__right .topbar__text--address p {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --------------------------------------------------------------------------
   Curriculum Guide card (x-curriculum-guide-card).

   A site-level PDF download, deliberately styled unlike a .lesson-card so it
   never reads as a lesson: full-width row, red brand accent on the left.
   Variants: --course (top of the course curriculum area) and --home (band
   directly under the hero).
   -------------------------------------------------------------------------- */
.curriculum-guide-card {
    align-items: center;
    background: var(--whiteColor);
    border: 1px solid var(--borderColor);
    border-left: 4px solid var(--secondaryColor);
    border-radius: 10px;
    box-shadow: 0 0 20px 6px rgba(0, 25, 70, 0.05);
    display: flex;
    gap: 18px;
    margin: 0 0 20px;
    padding: 18px 20px;
}

.curriculum-guide-card__icon {
    align-items: center;
    background: rgba(197, 2, 1, 0.08);
    border-radius: 50%;
    color: var(--secondaryColor);
    display: flex;
    flex: 0 0 56px;
    font-size: 28px;
    height: 56px;
    justify-content: center;
}

.curriculum-guide-card__body {
    flex: 1 1 auto;
    min-width: 0;
}

.curriculum-guide-card__eyebrow {
    color: var(--secondaryColor);
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    margin-bottom: 2px;
    text-transform: uppercase;
}

.curriculum-guide-card__title {
    color: var(--headingColor);
    font-size: 18px;
    margin: 0 0 4px;
}

.curriculum-guide-card__text {
    color: var(--contentColor);
    font-size: 14px;
    margin: 0;
}

.curriculum-guide-card__action {
    flex: 0 0 auto;
}

.curriculum-guide-card__action .default__button {
    white-space: nowrap;
}

.curriculum-guide-card--home {
    margin: 0;
    padding: 24px 28px;
}

.curriculum-guide-card--home .curriculum-guide-card__title {
    font-size: 22px;
}

.curriculum-guide-band {
    padding-top: 40px;
}

.is_dark .curriculum-guide-card {
    border-left-color: var(--brandRedOnDark);
}

.is_dark .curriculum-guide-card__icon {
    background: rgba(245, 73, 71, 0.14);
    color: var(--brandRedOnDark);
}

.is_dark .curriculum-guide-card__eyebrow {
    color: var(--brandRedOnDark);
}

@media (max-width: 575px) {
    .curriculum-guide-card,
    .curriculum-guide-card--home {
        align-items: flex-start;
        flex-wrap: wrap;
        padding: 16px;
    }

    .curriculum-guide-card__body {
        flex-basis: calc(100% - 74px);
    }

    .curriculum-guide-card__action,
    .curriculum-guide-card__action .default__button {
        width: 100%;
    }
}

/* --------------------------------------------------------------------------
   Legal footer (x-footer-legal) — copyright notice + legal links row.
   The footer band is navy in BOTH themes, so these are not `.is_dark` rules;
   text inherits the theme's footer grey and links use the on-dark tint.
   -------------------------------------------------------------------------- */
.footer__legal {
    text-align: center;
}

.footer__legal .footer__legal__notice {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 8px;
}

.footer__legal__links ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer__legal__links li {
    font-size: 14px;
}

.footer__legal__links li + li::before {
    content: "·";
    color: var(--darkgray);
    padding: 0 8px;
}

.footer__legal__links a {
    color: var(--whiteColor);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.is_dark .footer__legal__links a {
    color: #fff;
}

.footer__legal__links a:hover,
.footer__legal__links a:focus-visible {
    color: var(--brandBlueOnDark);
}

/* --------------------------------------------------------------------------
   Legal pages (/copyright, /scam-alert, …).
   -------------------------------------------------------------------------- */
.legalpage__content .rich-text h2 {
    font-size: 1.35rem;
}

.legalpage__updated {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--borderColor, rgba(127, 127, 127, 0.25));
    color: var(--contentColor);
    font-size: 14px;
    font-style: italic;
}

/* --------------------------------------------------------------------------
   Scam Alert notice beside every button that leads to Stripe Checkout.
   -------------------------------------------------------------------------- */
.scam__alert__notice {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--contentColor);
    text-align: left;
}

.scam__alert__notice i {
    color: var(--secondaryColor);
    font-size: 16px;
    line-height: 1.4;
}

.scam__alert__notice a {
    color: var(--primaryColor);
    font-weight: 600;
    text-decoration: underline;
}

.is_dark .scam__alert__notice i {
    color: var(--brandRedOnDark);
}

.is_dark .scam__alert__notice a {
    color: var(--brandBlueOnDark);
}

/* --------------------------------------------------------------------------
   "I agree to the Terms of Service and Copyright Policy" checkbox on sign-up
   and every form that leads to Stripe (terms-acceptance spec).
   -------------------------------------------------------------------------- */
.terms__checkbox {
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.5;
    text-align: left;
    color: var(--contentColor);
}

/* Centred / right-aligned variants for centred or text-end cards. */
.terms__checkbox--center {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.terms__checkbox--end {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.terms__checkbox .form-check-input {
    cursor: pointer;
    border-color: var(--contentColor);
}

.terms__checkbox .form-check-input:checked {
    background-color: var(--primaryColor);
    border-color: var(--primaryColor);
}

.terms__checkbox .form-check-label {
    cursor: pointer;
    color: var(--contentColor);
}

.terms__checkbox a {
    color: var(--primaryColor);
    font-weight: 600;
    text-decoration: underline;
}

.is_dark .terms__checkbox .form-check-input {
    background-color: transparent;
    border-color: rgba(255, 255, 255, 0.6);
}

.is_dark .terms__checkbox .form-check-input:checked {
    background-color: var(--brandBlueOnDark);
    border-color: var(--brandBlueOnDark);
}

.is_dark .terms__checkbox a {
    color: var(--brandBlueOnDark);
}

/* Bootstrap .card stays white in the dark theme (quiz pages), so inside one
   keep the light-theme colours — also for the Scam Alert notice beside it. */
.is_dark .card .terms__checkbox .form-check-input {
    background-color: #fff;
    border-color: #5f6c76;
}

.is_dark .card .terms__checkbox .form-check-input:checked {
    background-color: var(--primaryColor);
    border-color: var(--primaryColor);
}

.is_dark .card .terms__checkbox .form-check-label,
.is_dark .card .scam__alert__notice {
    color: #5f6c76;
}

.is_dark .card .terms__checkbox a,
.is_dark .card .scam__alert__notice a {
    color: var(--primaryColor);
}

/* Admin Curriculum card + lesson "Attached Quiz" box: quiz links must read as
   links — the dark theme otherwise paints them the same white as the text. */
.curriculum__link {
    color: var(--primaryColor);
    text-decoration: underline;
}

.is_dark .curriculum__link {
    color: var(--brandBlueOnDark);
}

/* Curriculum card on phones: each lesson becomes a labelled block instead of a
   7-column table that would hide Quiz / Status behind a sideways scroll. */
@media (max-width: 767.98px) {
    .curriculum__table thead {
        display: none;
    }

    .curriculum__table,
    .curriculum__table tbody,
    .curriculum__table tr,
    .curriculum__table td {
        display: block;
        width: 100%;
    }

    .curriculum__table tr {
        padding: 10px 0;
        border-bottom: 1px solid var(--borderColor, #dee2e6);
    }

    .curriculum__table td {
        display: flex;
        gap: 12px;
        align-items: baseline;
        padding: 4px 0;
        border: 0;
        text-align: left !important;
    }

    .curriculum__table td[data-label]::before {
        content: attr(data-label);
        flex: 0 0 64px;
        font-weight: 600;
        font-size: 13px;
    }

    .curriculum__table td.curriculum__title {
        font-weight: 600;
    }
}

/* --------------------------------------------------------------------------
   PDF lesson viewer (specs/pdf-viewer-watermark.md).
   Self-hosted pdf.js renders the stamped document into canvases. The page
   surface stays white in both themes (it's paper); only the chrome follows
   the theme. Hidden entirely when printing.
   -------------------------------------------------------------------------- */
.pdf-viewer {
    --pdfChrome: #f4f6fa;
    --pdfChromeBorder: #dee2e6;
    --pdfChromeText: #1b2333;
    --pdfCanvasBg: #e9ecf2;
    --pdfBtnBg: #fff;
    --pdfMuted: #5b6475;
    border: 1px solid var(--pdfChromeBorder);
    border-radius: 8px;
    overflow: hidden;
    background: var(--pdfCanvasBg);
}

.is_dark .pdf-viewer {
    --pdfChrome: #170F2F;
    --pdfChromeBorder: #312a57;
    --pdfChromeText: #fff;
    --pdfCanvasBg: #0f1233;
    --pdfBtnBg: #221a45;
    --pdfMuted: #b9bdd6;
}

.pdf-viewer__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    background: var(--pdfChrome);
    border-bottom: 1px solid var(--pdfChromeBorder);
    color: var(--pdfChromeText);
    font-size: 14px;
}

.pdf-viewer__zoom {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pdf-viewer__btn {
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--pdfChromeBorder);
    border-radius: 6px;
    background: var(--pdfBtnBg);
    color: var(--pdfChromeText);
    font-size: 16px;
    line-height: 1;
}

.pdf-viewer__btn--text {
    font-size: 13px;
}

.pdf-viewer__btn:hover:not(:disabled) {
    border-color: var(--primaryColor);
}

.is_dark .pdf-viewer__btn:hover:not(:disabled) {
    border-color: var(--brandBlueOnDark);
}

.pdf-viewer__btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.pdf-viewer__zoomlabel {
    min-width: 44px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.pdf-viewer__body {
    height: 80vh;
    overflow: auto;
    padding: 12px;
    -webkit-user-select: none;
    user-select: none;
}

.pdf-viewer__page {
    position: relative;
    margin: 0 auto 12px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
}

.pdf-viewer__page canvas {
    display: block;
}

.pdf-viewer__page--failed::after {
    content: "This page could not be rendered.";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 14px;
}

.pdf-viewer__status {
    padding: 48px 16px;
    text-align: center;
    color: var(--pdfMuted);
}

.pdf-viewer__status--error {
    margin: 24px auto;
    max-width: 520px;
    padding: 20px;
    border: 1px solid #f1aeb5;
    border-radius: 8px;
    background: #f8d7da;
    color: #58151c;
}

.is_dark .pdf-viewer__status--error {
    border-color: #842029;
    background: #2c0b0e;
    color: #ea868f;
}

.pdf-viewer--error .pdf-viewer__body {
    height: auto;
}

.pdf-viewer__notice {
    margin: 0;
    padding: 8px 12px;
    background: var(--pdfChrome);
    border-top: 1px solid var(--pdfChromeBorder);
    color: var(--pdfMuted);
    font-size: 13px;
}

.pdf-viewer__print-blocked {
    display: none;
}

/* Keyboard focus ring for every toolbar button, readable on both chromes. */
.pdf-viewer__btn:focus-visible {
    outline: 2px solid var(--primaryColor);
    outline-offset: 2px;
}

.is_dark .pdf-viewer__btn:focus-visible {
    outline-color: var(--brandBlueOnDark);
}

.pdf-viewer__btn--fullscreen {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

/* The page tracker measures pages by offsetTop against the scroll box. */
.pdf-viewer__body {
    position: relative;
}

/*
 * Full screen (specs/v6-fixes.md): native :fullscreen, or the fixed overlay
 * fallback where the Fullscreen API can't be used on an element (iPhone
 * Safari). The pages area grows to fill whatever the toolbar leaves.
 */
.pdf-viewer:fullscreen,
.pdf-viewer:-webkit-full-screen,
.pdf-viewer.pdf-viewer--overlay {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    /* !important: the viewer carries Bootstrap's .mt-3, itself !important. */
    margin: 0 !important;
    border: 0;
    border-radius: 0;
}

.pdf-viewer.pdf-viewer--overlay {
    position: fixed;
    inset: 0;
    /* Above everything the theme stacks: the sticky header, back-to-top button
       and the theme switcher (z-index 9999999). */
    z-index: 2147483000;
    height: 100vh;
    height: 100dvh;
}

.pdf-viewer:fullscreen .pdf-viewer__body,
.pdf-viewer:-webkit-full-screen .pdf-viewer__body,
.pdf-viewer.pdf-viewer--overlay .pdf-viewer__body {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
}

body.pdf-viewer-overlay-open {
    overflow: hidden;
}

@media (max-width: 575.98px) {
    .pdf-viewer__body {
        height: 70vh;
        padding: 8px;
    }

    .pdf-viewer__toolbar {
        padding: 8px;
    }

    .pdf-viewer__pagecount {
        width: 100%;
    }

    /* Zoom + Fit width + Full screen don't fit one phone-width row: wrap the
       controls instead of letting the last button run off the edge. */
    .pdf-viewer__zoom {
        flex-wrap: wrap;
        row-gap: 6px;
    }

    .pdf-viewer__btn--text {
        white-space: nowrap;
    }
}

@media print {
    .pdf-viewer__toolbar,
    .pdf-viewer__body,
    .pdf-viewer__notice {
        display: none !important;
    }

    .pdf-viewer {
        border: 0;
        background: none;
    }

    .pdf-viewer__print-blocked {
        display: block !important;
        padding: 24px;
        text-align: center;
        color: #000;
    }
}

/* --------------------------------------------------------------------------
   Dark-mode interactive states (specs/v6-fixes.md, Fix 3).

   Edurock paints hover/focus/active text in the brand hexes — a global
   `a:hover { color: var(--primaryColor) }` plus component rules (top nav,
   breadcrumb, card titles, buttons). Dark mode never re-tints them, so on the
   #0C0E2B / #170F2F surfaces hovered text dropped to 1.1:1 (blue) or 3.0:1
   (red) and vanished. Light mode is untouched: every rule here is .is_dark.

   Same rule as the palette block at the top of this file: brand blue as a
   *foreground* on dark becomes --brandBlueOnDark (7.1:1), brand red becomes
   --brandRedOnDark (5.4:1). Light mode's nav hover is brand blue, so dark mode's
   is the lifted blue — the tint the active sidebar item already uses.
   -------------------------------------------------------------------------- */

/* Every plain link. :where() keeps this at the specificity of the theme's own
   `a:hover`, so a component's own hover colour (buttons, badges) still wins. */
:where(.is_dark) a:hover,
:where(.is_dark) a:focus-visible {
    color: var(--brandBlueOnDark);
}

/* Cards are forced light in both themes, so links on them keep brand navy. */
:where(.is_dark .card) a:hover,
:where(.is_dark .card) a:focus-visible {
    color: var(--primaryColor);
}

/* Top navigation (the reported "Know Your Level" item) and its caret. The
   theme's own dark rule still paints a hovered *submenu* item white. */
.is_dark .headerarea__main__menu nav ul > li:hover > a,
.is_dark .headerarea__main__menu nav ul > li > a:focus-visible {
    color: var(--brandBlueOnDark);
}

/* Student and admin sidebars (the reported "Dashboard" hover): the link, its
   icon and the Logout form-link. */
.is_dark .dashboard__nav ul li a:hover,
.is_dark .dashboard__nav ul li a:focus-visible,
.is_dark .dashboard__nav ul li a:hover i,
.is_dark .dashboard__nav ul li a:hover svg {
    color: var(--brandBlueOnDark);
}

/* Breadcrumb on the shared page header (#170F2F band). */
.is_dark .breadcrumb__inner ul li a:hover,
.is_dark .breadcrumb__inner ul li a:focus-visible {
    color: var(--brandBlueOnDark);
}

/* Course and lesson card titles. */
.is_dark .gridarea__wraper .gridarea__content .gridarea__heading h3 a:hover,
.is_dark .gridarea__wraper .gridarea__content .gridarea__heading h3 a:focus-visible,
.is_dark .lesson-card__title a:hover,
.is_dark .lesson-card__title a:focus-visible {
    color: var(--brandBlueOnDark);
}

/* Outline-on-hover buttons: the hover fill is --whiteColor, which dark mode
   remaps to the #0C0E2B surface, leaving brand-coloured text on near-black.
   :where() keeps these at the theme's own specificity, so a contextual hover
   with its own fill (the red "Browse Courses" banner/CTA buttons) still wins. */
:where(.is_dark) .default__button:hover,
:where(.is_dark) .default__button:focus-visible {
    color: var(--brandBlueOnDark);
    border-color: var(--brandBlueOnDark);
}

:where(.is_dark) .default__button.default__button--2:hover,
:where(.is_dark) .default__button.default__button--2:focus-visible,
:where(.is_dark) .course__button a.course__2:hover,
:where(.is_dark) .course__button a.course__2:focus-visible {
    color: var(--brandRedOnDark);
    border-color: var(--brandRedOnDark);
}

/* Mobile off-canvas menu: light mode hovers in brand red, so dark mode uses the
   lifted red (the theme's own dark rule repeats the 3.0:1 brand red). */
.is_dark .mobile-off-canvas-active .header-mobile-aside-wrap .mobile-menu-wrap .mobile-navigation nav .mobile-menu li a:hover,
.is_dark .mobile-off-canvas-active .header-mobile-aside-wrap .mobile-menu-wrap .mobile-navigation nav .mobile-menu li ul li a:hover,
.is_dark .mobile-off-canvas-active .header-mobile-aside-wrap .mobile-menu-wrap .mobile-navigation nav .mobile-menu li a:focus-visible,
.is_dark .mobile-off-canvas-active .header-mobile-aside-wrap .mobile-social-wrap a:hover,
.is_dark .mobile-off-canvas .mobile-aside-button:hover {
    color: var(--brandRedOnDark);
}

/* Bootstrap nav pills/tabs (admin status filters): stock #0d6efd/#0a58ca is
   4.2:1 at rest and 2.9:1 on hover against the dark surface. */
.is_dark .nav {
    --bs-nav-link-color: var(--brandBlueOnDark);
    --bs-nav-link-hover-color: #a9c1ea;
}

/* Homepage hero "Go to Dashboard": red outline-on-hover, same trap as above. */
.is_dark .hreobannerarea__button__2 .hreobannerarea__button__3:hover,
.is_dark .hreobannerarea__button__2 .hreobannerarea__button__3:focus-visible {
    color: var(--brandRedOnDark);
    border-color: var(--brandRedOnDark);
}

/* Student banner "Browse Courses": the theme keeps this button's red fill on
   hover (its rest rule out-specifies `.default__button:hover`) but still swaps
   the label to brand navy — 2.7:1 in BOTH themes. Keep the label white and
   deepen the fill instead, so hover still reads as a change. */
.dashboardarea__inner.student__dashboard__inner .default__button:hover,
.dashboardarea__inner.student__dashboard__inner .default__button:focus-visible {
    color: #ffffff;
    background-color: var(--brandRedDeep);
    border-color: var(--brandRedDeep);
}
