/* ============================================================================
   IBD Delta LMS — bridging layer
   ----------------------------------------------------------------------------
   The ONLY stylesheet in this theme that is not byte-identical to the main-site
   ibd-delta theme. Everything MasterStudy-facing lives here so that theme.json
   and delta.css can be re-synced from the main site by copying files.

   Load order matters and was measured on the live site:

       32   global-styles-inline-css   ← theme.json output
       37-41 MasterStudy stylesheets
       42   theme stylesheet + delta.css + THIS FILE

   So MasterStudy overrides theme.json on a tie, and this file overrides
   MasterStudy on a tie. Anything here that could have been solved in
   MasterStudy's own settings instead should be — see the Stage F record.

   RULES FOR THIS FILE
   - Prefer MasterStudy's public CSS custom properties over its class names.
   - Every rule states what it targets and why.
   - No Hebrew, no content, no layout invention. Bridging only.
   ========================================================================= */


/* --- 1. Footer grid, LMS variant -------------------------------------------
   delta.css sets .ibd-footgrid to `1.5fr 1fr 1fr 1fr` for the main site's four
   marketing columns. The LMS footer has three children (brand, study links,
   contact), so the base rule would leave a dead fourth track. Additive
   modifier: the base rule is untouched and still correct for four columns. */
@media (min-width: 1001px) {
  .ibd-footgrid--lms { grid-template-columns: 1.5fr 1fr 1fr; }
}


/* --- 2. MasterStudy: archive chrome ----------------------------------------
   Every colour below arrives as an inline CSS custom property written into
   page 18 by the MasterStudy wizard, frozen at save time. They are NOT driven
   by the plugin's `accent_color` setting, which is why changing that setting to
   bronze fixed the account and auth screens but left the archive blue.

   Because the values are set inline, a stylesheet can only win with !important
   on the custom property itself. That is deliberate and contained: we override
   four variables, never a component rule, so MasterStudy's own CSS keeps doing
   the drawing and a plugin update cannot silently break the layout.

   Each value maps to a theme.json palette token rather than a hex, so the
   archive tracks the design system.

   Measured before/after on /courses/ — saturated blue on the page went from
   19 computed occurrences to 0.                                             */

/* 2.1  The large band behind the archive was #EEF1F7, a cool grey-blue that
        read as stock SaaS against the ivory page. -> stone (#F0E9DA), the
        palette's designed secondary band. Charcoal body text on it measures
        about 13:1. */
.wp-block-masterstudy-archive-container {
  --lms-archive-courses-layoutBackground: var(--wp--preset--color--soft) !important;
}

/* 2.2  The filter sidebar. Hidden at the presentation layer, as agreed: the
        block cannot be removed (its container enforces templateLock "all" and
        re-inserts it on re-parse), and with no courses there is nothing to
        filter. This one rule also removes ~17 further blue values that live
        inside it, so it replaces a dozen colour overrides.
        The parent is display:flex, so the results column simply reflows. */
.wp-block-masterstudy-courses-filter {
  display: none;
}

/* 2.3  Sort tabs (Newest / Oldest / Popular / Overall rating): track and
        buttons were #DAE5F8 with #227AFF text. -> white track, bronze label,
        bronze fill when active, keeping MasterStudy's own white active text. */
.wp-block-masterstudy-courses-tab-options {
  --lms-sort-tabsBackground: var(--wp--preset--color--surface) !important;
  --lms-sort-background:     var(--wp--preset--color--surface) !important;
  --lms-sort-color:          var(--wp--preset--color--primary) !important;
  --lms-sort-backgroundHover: var(--wp--preset--color--primary) !important;
}

/* 2.4  "Load more" button was #227AFF / #438EFF on hover. -> bronze, with the
        palette's lighter bronze for hover. */
.wp-block-masterstudy-courses-load-more {
  --lms-lm-background:       var(--wp--preset--color--primary) !important;
  --lms-lm-backgroundHover:  var(--wp--preset--color--primary-2) !important;
  --lms-lm-activeBackground: var(--wp--preset--color--primary) !important;
}


/* --- 3. Deliberately NOT bridged -------------------------------------------
   .masterstudy-authorization__switch and .masterstudy-authorization-modal__close
   still use #EEF1F7. They sit inside the authorization modal, which is only
   visible on click, MasterStudy sets them at a higher specificity than a plain
   class rule can beat, and the text on them already measures 14.4:1 and 5.9:1.
   Escalating specificity for a hidden cosmetic detail is not worth it. Revisit
   in the account/auth pass.

   Course detail, lesson / course-player, quiz and certificate screens: nothing
   written. There are zero courses, so their DOM cannot be inspected. Deferred
   to the student-path pass after a test course exists.
   ------------------------------------------------------------------------- */

/* --- 4. Footer social row --------------------------------------------------
   The LMS footer is three columns where the main site has four, so the contact
   column is shorter and the social row sat higher than on tapuach-coach.com.
   TikTok was restored to parts/footer.html (the real inline SVG from the
   export), so both sites now carry the same five icons in the same source
   order: WhatsApp, LinkedIn, Facebook, Instagram, TikTok — which in RTL renders
   right-to-left as on the main site.

   delta.css sets no margin on .ibd-social; on the main site its position comes
   from the taller column above it. One spacing token restores that here rather
   than an invented pixel value. Scoped to the LMS footer variant so the shared
   .ibd-social rules stay untouched. */
.ibd-footgrid--lms .ibd-social {
  margin-block-start: var(--wp--preset--spacing--30);
}


/* --- 5. MasterStudy account bottom navigation ------------------------------
   Component: .masterstudy-account-mobile-menu
   (_core/assets/css/account/mobile-menu.css, MasterStudy Core 3.7.45)

   Base rule is display:none; position:fixed; bottom:0; z-index:999; height:80px.
   It is revealed inside @media (max-width: 1279.98px).

   That breakpoint is the problem: 1280px is not a mobile width. Meanwhile the
   account sidebar (account/menu.css) has its own breakpoint at max-width:1024px
   and stays visible above it. So between 1025px and 1279.98px BOTH are on
   screen — a fixed bottom bar duplicating a sidebar that is right there.

   Aligning the bar to the sidebar's own 1024px breakpoint removes the overlap
   band and strands nobody: below 1024px the sidebar changes and the bar is
   genuinely the account navigation, so it is kept.

   No !important: this rule sits in a later stylesheet at equal specificity. */
@media (min-width: 1025px) {
  .masterstudy-account-mobile-menu { display: none; }
}

/* Inactive icons and labels are hard-coded #4d5e6f, a cool slate that reads as
   foreign against the warm palette. The ACTIVE state needs no change — it uses
   MasterStudy's own --accent-100, which now resolves to rgba(107,83,44,1),
   i.e. the bronze is already correct there. */
.masterstudy-account-mobile-menu .masterstudy-account-mobile-menu__item,
.masterstudy-account-mobile-menu a.masterstudy-account-mobile-menu__link i {
  color: var(--wp--preset--color--muted);
}


/* ===========================================================================
   6. MasterStudy course player — design bridge
   Added 2026-09-06 after a live audit of /courses-archive-gutenberg/diy/40
   (course "DELTA™ DIY", 10 lessons).

   WHY DIRECT PROPERTY OVERRIDES AND NOT VARIABLES
   The archive chrome (section 2) was bridged by re-pointing MasterStudy's own
   inline custom properties. The course player has no equivalent seam: its
   palette is written as hard-coded hex literals in the plugin's stylesheets.
   78 :root colour custom properties were enumerated on the player page and
   none of them carries #EEF1F7, #4D5E6F, #001931 or #DBE0E9. So the only
   update-safe route is to override the same declarations on the same class
   selectors. No plugin file is touched.

   WHY THE SELECTORS LOOK HEAVIER THAN IN SECTIONS 1-5
   MasterStudy prints 16 of its player stylesheets inside <body>, AFTER
   wp_head. This file is enqueued in the head, so for those files "later
   stylesheet wins at equal specificity" does not hold — the bridge must win
   on specificity instead. Every rule below is therefore scoped to a
   light-mode guard which adds exactly one class:

     .masterstudy-course-player-content:not(.masterstudy-course-player-content_dark-mode)
     .masterstudy-course-player-header:not(.masterstudy-course-player-header_dark-mode)

   That guard does double duty. The player ships a working dark-mode toggle
   (.masterstudy-dark-mode-button, 50x50, in the player header, available to
   students). Its 97 rules are all specificity 0,2,0 or higher and live in the
   body-printed files, so they still beat — or tie and then out-order — every
   rule here. The bridge repaints light mode only and leaves dark mode to
   MasterStudy.

   No !important anywhere in this section.
   --------------------------------------------------------------------------- */

/* --- 6.1 Typeface ---------------------------------------------------------
   css/course-player/fonts.css (99 selectors) and css/components/fonts.css
   (64 selectors) both declare, verbatim:  {font-family:"Albert Sans",sans-serif}

   Albert Sans ships no Hebrew glyphs. Every Hebrew string inside the player —
   lesson titles, lesson body copy, the curriculum list — was therefore being
   rendered by an arbitrary browser fallback face, not by Assistant. This is
   the single largest reason the player did not read as ibd-delta.

   `inherit` re-attaches the theme's own stack rather than naming a family, so
   it follows any future change to the theme font with no edit here.

   [class*="stmlms-"] is excluded: those are MasterStudy's icon classes and
   they set font-family:stmlms on the element itself (assets/icons/style.css).
   Icons drawn on ::before/::after pseudo-elements are untouched either way.
   The three plyr rules in course-player/fonts.css carry !important and are
   deliberately left alone — that is the video control bar.

   This is the one rule in section 6 with no dark-mode guard, deliberately:
   none of MasterStudy's 97 dark-mode rules touches font-family, and the
   missing-glyph problem is the same in either mode. Specificity is 0,2,0
   against MasterStudy's 0,1,0, so it wins on specificity alone. */
.masterstudy-course-player-header *:not([class*="stmlms-"]),
.masterstudy-course-player-content *:not([class*="stmlms-"]) {
  font-family: inherit;
}

/* --- 6.2 Chrome surfaces --------------------------------------------------
   #EEF1F7 is the cool blue-grey that made the player read as generic SaaS.
     course-player/header.css      .masterstudy-course-player-header   background:#eef1f7
     course-player/curriculum.css  .masterstudy-course-player-curriculum background:#eef1f7
     course-player/navigation.css  .masterstudy-course-player-navigation background:#fff
   Header, curriculum sidebar and the bottom navigation bar are all chrome, so
   they take one warm neutral and together frame the reading area. */
.masterstudy-course-player-header:not(.masterstudy-course-player-header_dark-mode),
.masterstudy-course-player-content:not(.masterstudy-course-player-content_dark-mode) .masterstudy-course-player-curriculum,
.masterstudy-course-player-content:not(.masterstudy-course-player-content_dark-mode) .masterstudy-course-player-navigation {
  background: var(--wp--preset--color--soft);
}

/* --- 6.3 Reading ground ---------------------------------------------------
   The lesson column is max-width:860px, centred. The surrounding
   .masterstudy-course-player-content__wrapper was flat #fff across the whole
   viewport — at a wide desktop width that is ~820px of empty white on each
   side, which is what made the video look like it was floating in a generic
   white interface. Ivory is the ground the rest of the site reads on.
   The 860px measure, the 16:9 video box and the responsive ladder are
   deliberately not touched. */
.masterstudy-course-player-content:not(.masterstudy-course-player-content_dark-mode),
.masterstudy-course-player-content:not(.masterstudy-course-player-content_dark-mode) .masterstudy-course-player-content__wrapper {
  background: var(--wp--preset--color--base);
}

/* --- 6.4 Curriculum section header ---------------------------------------
   components/curriculum-accordion.css
     .masterstudy-curriculum-accordion__section { background:#4d5e6f }
   Its children are already white (title, 700) and white-70% (the 0/10 count),
   and the toggler is a light icon asset, so swapping the slate for the
   ibd-delta charcoal panel preserves the light-on-dark relationship exactly. */
.masterstudy-course-player-content:not(.masterstudy-course-player-content_dark-mode) .masterstudy-curriculum-accordion__section {
  background: var(--wp--preset--color--panel);
}

/* --- 6.5 Hairlines --------------------------------------------------------
   #DBE0E9 and #ddd appear as 1px borders on the player header, the back
   button, the discussions toggler, the sidebar's inner edge, the bottom
   navigation bar and the per-lesson completion checkbox. All become the
   ibd-delta line token. The two body.rtl rules below mirror MasterStudy's own
   RTL declarations — the LTR side is left to MasterStudy so that a future
   English or Russian locale still gets the correct edge. */
.masterstudy-course-player-header:not(.masterstudy-course-player-header_dark-mode) {
  border-bottom-color: var(--wp--preset--color--line);
}
body.rtl .masterstudy-course-player-header:not(.masterstudy-course-player-header_dark-mode) .masterstudy-course-player-header__back {
  border-left-color: var(--wp--preset--color--line);
}
body.rtl .masterstudy-course-player-header:not(.masterstudy-course-player-header_dark-mode) .masterstudy-course-player-header__discussions-toggler {
  border-right-color: var(--wp--preset--color--line);
}
.masterstudy-course-player-content:not(.masterstudy-course-player-content_dark-mode) .masterstudy-course-player-curriculum {
  border-right-color: var(--wp--preset--color--line);
}
.masterstudy-course-player-content:not(.masterstudy-course-player-content_dark-mode) .masterstudy-course-player-navigation {
  border-top-color: var(--wp--preset--color--line);
}
.masterstudy-course-player-content:not(.masterstudy-course-player-content_dark-mode) .masterstudy-curriculum-accordion__check {
  border-color: var(--wp--preset--color--line);
}

/* --- 6.6 Type colour ------------------------------------------------------
   #001931 (navy) and #4D5E6F (slate) are the player's two text colours.
     course-player/main.css        .masterstudy-course-player-content__header h1        #001931
     course-player/header.css      a.masterstudy-course-player-header__course-title     #001931
     course-player/curriculum.css  .masterstudy-course-player-curriculum__title         #001931
     components/curriculum-accordion.css  .masterstudy-curriculum-accordion__title      #001931
     lesson/main.css               .masterstudy-course-player-lesson h1..h6             #4d5e6f
     lesson/main.css               .masterstudy-course-player-lesson p, ul li, ol li    #4d5e6f
     course-player/main.css        .masterstudy-course-player-content__header-lesson-type #4d5e6f
     course-player/curriculum.css  .masterstudy-course-player-curriculum__mobile-title  #4d5e6f
     components/curriculum-accordion.css  .masterstudy-curriculum-accordion__meta       #808c98 */
.masterstudy-course-player-header:not(.masterstudy-course-player-header_dark-mode) a.masterstudy-course-player-header__course-title {
  color: var(--wp--preset--color--contrast);
}
.masterstudy-course-player-content:not(.masterstudy-course-player-content_dark-mode) .masterstudy-course-player-content__header h1,
.masterstudy-course-player-content:not(.masterstudy-course-player-content_dark-mode) .masterstudy-course-player-curriculum__title,
.masterstudy-course-player-content:not(.masterstudy-course-player-content_dark-mode) .masterstudy-curriculum-accordion__title,
.masterstudy-course-player-content:not(.masterstudy-course-player-content_dark-mode) .masterstudy-course-player-lesson h1,
.masterstudy-course-player-content:not(.masterstudy-course-player-content_dark-mode) .masterstudy-course-player-lesson h2,
.masterstudy-course-player-content:not(.masterstudy-course-player-content_dark-mode) .masterstudy-course-player-lesson h3,
.masterstudy-course-player-content:not(.masterstudy-course-player-content_dark-mode) .masterstudy-course-player-lesson h4,
.masterstudy-course-player-content:not(.masterstudy-course-player-content_dark-mode) .masterstudy-course-player-lesson h5,
.masterstudy-course-player-content:not(.masterstudy-course-player-content_dark-mode) .masterstudy-course-player-lesson h6 {
  color: var(--wp--preset--color--contrast);
}
.masterstudy-course-player-content:not(.masterstudy-course-player-content_dark-mode) .masterstudy-course-player-lesson p,
.masterstudy-course-player-content:not(.masterstudy-course-player-content_dark-mode) .masterstudy-course-player-lesson ul li,
.masterstudy-course-player-content:not(.masterstudy-course-player-content_dark-mode) .masterstudy-course-player-lesson ol li {
  color: var(--wp--preset--color--contrast-2);
}
.masterstudy-course-player-content:not(.masterstudy-course-player-content_dark-mode) .masterstudy-course-player-content__header-lesson-type,
.masterstudy-course-player-content:not(.masterstudy-course-player-content_dark-mode) .masterstudy-course-player-curriculum__mobile-title {
  color: var(--wp--preset--color--muted);
}

/* The curriculum meta line and the header "קורס:" label sit on `soft`, where
   `muted` measures 4.35:1 and MasterStudy's own #808C98 measures 2.84:1 —
   both under AA for 12–13px text. `contrast-2` is 8.63:1 there and still
   reads as secondary because these are 12–13px at weight 500 against 14–15px
   titles. Measured after section 6 changed the chrome to `soft`. */
.masterstudy-course-player-content:not(.masterstudy-course-player-content_dark-mode) .masterstudy-curriculum-accordion__item .masterstudy-curriculum-accordion__meta,
.masterstudy-course-player-header:not(.masterstudy-course-player-header_dark-mode) .masterstudy-course-player-header__course-label {
  color: var(--wp--preset--color--contrast-2);
}

/* --- 6.7 List sizing inside the lesson -----------------------------------
   lesson/main.css sets list items to font-size:16px / line-height:28px while
   everything around them in the same 860px column is the theme's 1.2rem /
   1.75. Inheriting restores one reading size for the whole column. Only the
   size and leading are inherited; the list markers and indentation are
   MasterStudy's and are left alone. Unguarded for the same reason as 6.1 —
   this is a measure, not a colour, and dark mode does not set it. */
.masterstudy-course-player-content .masterstudy-course-player-lesson ul li,
.masterstudy-course-player-content .masterstudy-course-player-lesson ol li {
  font-size: inherit;
  line-height: inherit;
}

/* --- 6.8 Curriculum list hierarchy ---------------------------------------
   Every lesson link inherits color from MasterStudy's own
   --masterstudy-color--primary, which is now bronze, so all ten lesson titles
   were bronze and the current lesson had only its 5% bronze fill to
   distinguish it. 6.6 puts the titles on charcoal; this restores bronze to the
   one lesson that should carry it. The 5% fill, the completion checkbox and
   the hover behaviour are MasterStudy's and are unchanged. */
.masterstudy-course-player-content:not(.masterstudy-course-player-content_dark-mode) .masterstudy-curriculum-accordion__link_current .masterstudy-curriculum-accordion__title {
  color: var(--wp--preset--color--primary);
}

/* --- 6.9 Navigation button radius ----------------------------------------
   components/nav-button.css uses 4px. The rest of the site uses --ibd-rs.
   Colour, size, padding and label weight are already correct — the bronze
   comes from the MasterStudy primary setting. */
.masterstudy-course-player-content:not(.masterstudy-course-player-content_dark-mode) .masterstudy-nav-button {
  border-radius: var(--ibd-rs, 8px);
}

/* --- 6.10 Single course page ---------------------------------------------
   The course detail page is the entry point of the student path and carries
   the same hard-coded palette as the player: #DBE0E9 hairlines, #001931 navy
   for titles and values, #4D5E6F slate for secondary labels and description
   body copy. Mapped with the same tokens and the same reasoning as 6.5–6.6,
   so the two screens read as one product.

   (Added while verifying the section 8 RTL fix — once the page laid out
   correctly the palette mismatch against the player was the obvious next
   thing on screen. Flagged as an addition, not something that was asked for.) */
.masterstudy-single-course-tabs {
  background: var(--wp--preset--color--line);
}
.masterstudy-single-course-minimalistic__info,
.masterstudy-single-course-minimalistic__info-wrapper,
.masterstudy-single-course-minimalistic__info-wrapper-column,
.masterstudy-single-course-minimalistic__info-block {
  border-color: var(--wp--preset--color--line);
}

/* #001931 navy → charcoal: titles, names, values, the active tab. */
.masterstudy-single-course-title,
.masterstudy-single-course-instructor__name,
.masterstudy-single-course-details__quantity,
.masterstudy-single-course-tabs__item_active,
.masterstudy-single-course-share-button-modal__head {
  color: var(--wp--preset--color--contrast);
}

/* #4D5E6F slate → muted: the secondary labels around them. */
.masterstudy-single-course-categories__item,
.masterstudy-single-course-instructor__title,
.masterstudy-single-course-rating__quantity,
.masterstudy-single-course-wishlist__title,
.masterstudy-single-course-share-button__title,
.masterstudy-single-course-details__name,
.masterstudy-single-course-tabs__item {
  color: var(--wp--preset--color--muted);
}

/* Description body copy, matching the lesson column in 6.6. Scoped to the
   description container so it cannot reach the labels above. */
.masterstudy-single-course-description__content,
.masterstudy-single-course-description__content p,
.masterstudy-single-course-description__content li,
.masterstudy-single-course-description__content strong {
  color: var(--wp--preset--color--contrast-2);
}

/* --- 6.11 Deliberately NOT bridged ---------------------------------------
   - The active-lesson 5% bronze fill, the complete/next button fill and the
     course "start" button: already correct, they resolve through MasterStudy's
     own primary colour setting.
   - Scrollbar hiding (scrollbar-width:none / ::-webkit-scrollbar{display:none}
     on the curriculum): intentional in MasterStudy, left as-is.
   - The responsive ladder (1600 / 1366 / 1024 / 782 / 576). Nothing in this
     section changes layout, and MasterStudy's own media queries contain no
     colour or font declarations, so the bridge is breakpoint-independent.
   - RTL. MasterStudy ships assets/css/rtl-styles.css plus per-component
     body.rtl rules and the player audited clean: sidebar right, back button
     far right, prev/next in correct RTL order, dir=rtl throughout. Nothing
     here flips a direction or an icon.
   - Dark mode, per the note at the top of this section.
   - The lesson body's own inline markup (html-div wrappers carried in with the
     pasted lesson content). That is course content, not chrome.  */


/* ===========================================================================
   7. MasterStudy course player — dark-mode contrast
   Added 2026-09-06 after auditing the live player with dark mode ON
   (.masterstudy-course-player-content_dark-mode present on the container).

   WHAT WAS ACTUALLY WRONG
   MasterStudy's dark mode is mostly sound: it repaints its own surfaces
   (#171717 ground, #1E1E1E sidebar, #2D2D2D chrome) and sets its own text to
   #fff / rgba(255,255,255,.7). A WCAG sweep of every text-bearing element in
   the player, with the effective background resolved by walking ancestors,
   returned only four failures — and section 6 was not the cause: with dark
   mode on, every rule in section 6 is correctly inert and MasterStudy's dark
   backgrounds are intact.

     1.10:1  lesson prose that is not <p>, <ul><li> or <ol><li>
             MasterStudy's dark rules cover exactly those three selectors. The
             lesson content here is pasted markup built from <div>/<span>/
             <strong> wrappers, plus <blockquote> which has no colour rule at
             all anywhere. All of it therefore kept inheriting the THEME's
             body colour, charcoal #232019, on a #171717 ground. This is the
             large block of near-invisible text.
     2.47:1  links inside the lesson. `.masterstudy-course-player-lesson a`
             resolves to var(--accent-100) — MasterStudy's own accent, i.e.
             bronze #6B532C — and there is NO dark-mode rule for it.
     2.30:1  .masterstudy-button__title on tertiary buttons (the discussions
             "תגובה" button): same bronze, same missing dark rule.
     4.86:1  .masterstudy-curriculum-accordion__meta #808C98 — passes AA, but
             it is a cool blue-grey and the only remaining foreign hue.

   Plus one non-text finding: the current lesson is not identifiable in dark
   mode. Its fill is rgba(107,83,44,.05) over #1E1E1E — a 0.4% lift, invisible
   — and MasterStudy paints its title the same #fff as every other lesson.

   THE DARK BRONZE
   Bronze #6B532C is simply too dark to sit on a dark ground. Measured against
   the three MasterStudy dark surfaces:
     primary-2 #7A5C2E   2.90 / 2.70 / 2.23   fails everywhere
     accent    #A9884E   5.39 / 5.02 / 4.14   fails on chrome
     accent-2  #C6A575   7.72 / 7.18 / 5.93   passes everywhere
   So accent-2 — already an ibd-delta token, same bronze family — is the
   dark-mode accent. Light mode keeps primary; nothing below touches it.

   ON THE DARK NEUTRALS
   MasterStudy's dark ramp is neutral grey while ibd-delta's dark tokens are
   warm (panel #242019, deep #33271A). Those two tokens sit 1 unit apart in
   luminance, so they cannot supply a three-step ground/sidebar/chrome ramp;
   building a warm ramp would mean inventing colours that are not in the
   design system. Coherence with ibd-delta is therefore carried by the
   typeface (already Assistant via 6.1, in both modes) and by the accent
   family, not by repainting the greys. If a warm dark ramp is wanted it needs
   new approved tokens — flagged, not guessed.

   SCOPE
   Every rule below carries a `_dark-mode` modifier class, so none of them can
   match in light mode. No global or element-wide colour override is used.
   No !important.
   --------------------------------------------------------------------------- */

/* --- 7.1 Lesson body copy -------------------------------------------------
   One inherited baseline on the lesson container, rather than a list of tag
   selectors. Elements that have their own dark rule (p, ul li, ol li) keep it;
   everything else — the pasted <div>/<span>/<strong> markup, <blockquote>,
   and any future wrapper — inherits from here instead of from <body>. Matches
   the value MasterStudy already uses for lesson body copy, so the column is
   one consistent tone. */
.masterstudy-course-player-content_dark-mode .masterstudy-course-player-lesson {
  color: rgba(255, 255, 255, .7);
}

/* --- 7.2 Lesson headings --------------------------------------------------
   MasterStudy paints lesson h1–h6 at the same rgba(255,255,255,.7) as body
   copy, so headings carry no weight of their own. #fff is MasterStudy's own
   dark heading colour (it is what .masterstudy-course-player-content__header
   h1 already uses), so this is continuity with the component, not an invented
   value. It also mirrors light mode, where 6.6 gives headings `contrast` and
   body `contrast-2`. Doubled container class to clear MasterStudy's 0,2,1. */
.masterstudy-course-player-content.masterstudy-course-player-content_dark-mode .masterstudy-course-player-lesson h1,
.masterstudy-course-player-content.masterstudy-course-player-content_dark-mode .masterstudy-course-player-lesson h2,
.masterstudy-course-player-content.masterstudy-course-player-content_dark-mode .masterstudy-course-player-lesson h3,
.masterstudy-course-player-content.masterstudy-course-player-content_dark-mode .masterstudy-course-player-lesson h4,
.masterstudy-course-player-content.masterstudy-course-player-content_dark-mode .masterstudy-course-player-lesson h5,
.masterstudy-course-player-content.masterstudy-course-player-content_dark-mode .masterstudy-course-player-lesson h6 {
  color: #fff;
}

/* --- 7.3 Links in the lesson ---------------------------------------------- */
.masterstudy-course-player-content_dark-mode .masterstudy-course-player-lesson a {
  color: var(--wp--preset--color--accent-2);
}

/* --- 7.4 Tertiary buttons -------------------------------------------------
   The discussions reply button. Label to the dark bronze, and the 10% bronze
   fill re-tinted to the same accent so the button still reads as a surface
   against #1E1E1E instead of disappearing into it.
   Selector shape mirrors MasterStudy's own a.…button.…button_style-tertiary
   .…button__title (0,3,1) plus the dark-mode scope, for the same reason. */
.masterstudy-course-player-content_dark-mode a.masterstudy-button.masterstudy-button_style-tertiary {
  background: rgba(198, 165, 117, .14);
}
.masterstudy-course-player-content_dark-mode a.masterstudy-button.masterstudy-button_style-tertiary .masterstudy-button__title {
  color: var(--wp--preset--color--accent-2);
}

/* --- 7.5 Current lesson in the curriculum --------------------------------
   Restores in dark mode exactly what light mode has: a quiet bronze fill plus
   a bronze title, so the lesson you are on is identifiable. Every other
   lesson keeps MasterStudy's #fff.

   The __item segment and the doubled link class are not decoration: the rules
   being overridden are
     .…accordion_dark-mode .…__item a.…__link_current      { background: var(--accent-5) }
     .…accordion_dark-mode .…__item .…__title              { color: #fff }
   at 0,3,1 and 0,3,0, in body-printed files. Matching their shape and adding
   one class is the smallest way past them without !important. (MasterStudy's
   own --accent-5 is a 5% bronze tint, which over #1E1E1E is a 0.4% lift —
   invisible. That is why it is overridden rather than left native.) */
.masterstudy-curriculum-accordion_dark-mode .masterstudy-curriculum-accordion__item a.masterstudy-curriculum-accordion__link.masterstudy-curriculum-accordion__link_current {
  background: rgba(198, 165, 117, .12);
}
.masterstudy-curriculum-accordion_dark-mode .masterstudy-curriculum-accordion__item .masterstudy-curriculum-accordion__link_current .masterstudy-curriculum-accordion__title {
  color: var(--wp--preset--color--accent-2);
}

/* --- 7.6 Curriculum meta and completion checkbox -------------------------
   #808C98 is the last cool hue left in the player; a neutral white alpha both
   raises contrast and removes the blue cast. The completion checkbox outline
   was #2D2D2D on #1E1E1E — 1.4:1, effectively invisible — and it is the
   affordance that tells a student which lessons are done, so it is lifted to
   the 3:1 WCAG non-text threshold. */
.masterstudy-curriculum-accordion_dark-mode .masterstudy-curriculum-accordion__meta {
  color: rgba(255, 255, 255, .55);
}
.masterstudy-curriculum-accordion_dark-mode .masterstudy-curriculum-accordion__item .masterstudy-curriculum-accordion__check {
  border-color: rgba(255, 255, 255, .35);
}

/* --- 7.7 Deliberately NOT changed in dark mode ---------------------------
   - The next/complete button: bronze #6B532C fill with a #fff label is
     7.24:1 and is the one place bronze should stay full strength.
   - MasterStudy's dark surfaces, its #fff / .7-white text, the switch button,
     the discussions empty state, the section header — all measured 7.5:1 or
     better and are left alone.
   - .masterstudy-course-player-header__course-label at 4.66:1 — MasterStudy's
     own, passes AA, not worth a rule.
   - Everything in section 6. Verified: with dark mode on, no section 6 rule
     matches and MasterStudy's dark backgrounds are intact.  */


/* ===========================================================================
   8. MasterStudy single-course template — document direction
   Added 2026-09-06.

   ROOT CAUSE (measured, not inferred)
   The course DETAIL response is a bare HTML fragment. Fetched raw, it has no
   <!DOCTYPE>, no <html>, no <head> and no <body> — it begins at
   <meta name="viewport">. Every other MasterStudy front-end URL on this
   install returns a proper document; this template is the only one that does
   not. The browser therefore synthesises a root element with zero attributes,
   and two things follow:

     document.documentElement has no dir  → computed direction is ltr on the
       whole page, which is the reported symptom: header, container, course
       tabs, description and footer all lay out left-to-right.
     document.compatMode === "BackCompat" → the page renders in quirks mode.

   The single rule below restores the direction. It is written against the
   defect itself rather than against the page: html:not([dir]) can only match
   a document that shipped with no dir attribute, and on this install every
   correctly rendered page ships <html dir="rtl">. It therefore cannot reach
   the archive, the account area, the player, checkout or the front page, and
   it will stop applying by itself the day MasterStudy fixes the template.

   Measured on the live page, viewport 2489px, before → after:
     site brand        x 655→864     →  x 1626→1835   (moves to the right edge)
     course tabs       תיאור 864 … ביקורות 1372  →  תיאור 1372 … ביקורות 864
     CTA button        x 1330→1630   →  x 890→1190
     instructor block  x 860→1300    →  x 1190→1630
     course H1         left-aligned  →  right-aligned
     footer            direction ltr →  direction rtl

   Two things this rule deliberately does NOT do:

   - It does not add the missing `rtl` BODY CLASS. CSS cannot add a class, and
     that class is what MasterStudy's own rtl-styles.css keys on — 41 of its
     rules match elements on this page and are currently inert. Re-declaring
     those 41 mirrored margins here would be a copy of the plugin's RTL layer
     that rots on the next update. The class is restored instead by a small
     self-detecting shim in functions.php, so MasterStudy's own RTL CSS does
     its own job. See the comment there.
   - It does not attempt to leave quirks mode. Only a doctype can do that, and
     only the plugin can emit one. Flagged for upstream; the layout measures
     correctly with box-sizing:border-box, which both the theme and MasterStudy
     set explicitly, so the practical impact is limited to legacy edge cases.
   --------------------------------------------------------------------------- */
html:not([dir]) {
  direction: rtl;
}
