/* CADOTECH LMS – fit LMS screens into any theme. Loaded only on LMS screens.
   Uses body classes added by the plugin (no page-wide :has() selectors, so the
   browser never re-checks the whole page while a video plays). */

/* 1. Sticky headers (course builder, lesson page, dashboard) stop working when a
      theme puts overflow:hidden on the page wrapper. overflow:clip hides
      sideways overflow the same way without breaking sticky. (<html>/<body> are
      handled by cadotech-theme-fit.js only when needed.) */
:is(body.cadotech-screen-course-builder,body.cadotech-learning-page,body.cadotech-screen-frontend-dashboard) :is(#page,#wrapper,.site,.wrapper,.main-wrapper,.site-content,#content,.content-area,.page-wrapper,.edu-wrapper,.edublink-page-wrapper,.cadotech-site-wrap,#cadotech-page-wrap){
	overflow-x:clip!important;overflow-y:visible!important;
}

/* 2. Full-screen LMS pages: one background from top to bottom (no white strip). */
body.cadotech-screen-frontend-dashboard,
body.cadotech-screen-course-builder{background-color:var(--cadotech-surface-base,#fff)!important}
.cadotech-dashboard-isolated-page-wrapper,.cadotech-dashboard-layout{min-height:100vh;min-height:100dvh}

/* 3. Lesson page inside the theme: theme header menus stay above the course
      header and sidebar. */
:where(body.cadotech-learning-page) :where(header.edu-header,.edu-header,#masthead,.site-header,.elementor-location-header,[data-elementor-type="header"],body>header,#page>header,.site>header){position:relative}
body.cadotech-learning-page :is(header.edu-header,.edu-header,#masthead,.site-header,.elementor-location-header,[data-elementor-type="header"],body>header,#page>header,.site>header){z-index:1000}
.cadotech-learning-area.cadotech-has-site-shell .cadotech-learning-header{z-index:30}
@media (min-width:993px){.cadotech-learning-area.cadotech-has-site-shell .cadotech-learning-sidebar{z-index:29}}

/* 4. Video lessons: use the free width next to the sidebar, but never taller
      than the screen, so the whole video and its controls are visible without
      scrolling (16:9 maths: width = available height x 16/9). */
@media (min-width:992px){
	body.cadotech-lesson-has-video .cadotech-learning-area .cadotech-learning-area-container{
		max-width:clamp(760px,calc((100dvh - var(--cadotech-site-header-offset,0px) - var(--cadotech-learning-header-height,64px) - 150px) * 16 / 9),1120px);
	}
}
body.cadotech-lesson-has-video .cadotech-learning-area .cadotech-video-player{border-radius:12px;overflow:hidden;background:#000}
.cadotech-learning-area .cadotech-video-player .plyr{border-radius:inherit}

/* 5. Space under the lesson + motivation card. The section continues the
      lesson background down to the theme footer, so its text is always
      readable in light and dark mode. */
.cdlms-motivation{--cdlms-m-accent:var(--cadotech-actions-brand-primary,var(--cadotech-color-primary,#2f55d4));
	background:var(--cadotech-surface-base,#f6f7fb);color:var(--cadotech-text-primary,#1d2433);
	margin:0;padding:24px 16px 56px;text-align:center}
.cdlms-motivation__card{display:flex;align-items:center;gap:18px;max-width:880px;margin:0 auto;padding:20px 24px;border-radius:16px;text-align:start;
	background:var(--cadotech-surface-l1,#fff);border:1px solid var(--cadotech-border-idle,rgba(16,24,40,.1));
	box-shadow:0 1px 2px rgba(16,24,40,.05);color:inherit}
.cdlms-motivation__icon{flex:0 0 46px;height:46px;border-radius:12px;display:inline-flex;align-items:center;justify-content:center;background:var(--cdlms-m-accent);color:#fff}
.cdlms-motivation__icon svg{width:24px;height:24px}
.cdlms-motivation__body{flex:1;min-width:0}
.cdlms-motivation__title{margin:0 0 4px;font-size:18px;line-height:1.35;font-weight:700;color:var(--cadotech-text-primary,#1d2433)}
.cdlms-motivation__text{margin:0;font-size:15px;line-height:1.55;color:var(--cadotech-text-secondary,#4b5565)}
.cdlms-motivation__progress{margin-top:12px;height:6px;border-radius:99px;background:var(--cadotech-surface-l2,rgba(47,85,212,.15));overflow:hidden}
.cdlms-motivation__progress span{display:block;height:100%;border-radius:inherit;background:var(--cdlms-m-accent)}
@media (max-width:600px){.cdlms-motivation{padding:16px 12px 36px}.cdlms-motivation__card{flex-direction:column;text-align:center;padding:18px}.cdlms-motivation__title{font-size:16px}}

/* 6. Course builder: WordPress editor buttons (Add Media, Add H5P Content)
      keep a compact editor look whatever the theme does to buttons. */
body.cadotech-screen-course-builder :is(.wp-media-buttons,.wp-editor-tools) :is(.button,button,a.button){
	display:inline-flex!important;align-items:center!important;gap:6px!important;width:auto!important;height:32px!important;min-height:32px!important;
	margin:0 6px 6px 0!important;padding:0 12px!important;font-family:inherit!important;font-size:13px!important;font-weight:500!important;line-height:1!important;
	letter-spacing:normal!important;text-transform:none!important;color:var(--cadotech-text-brand,#2f55d4)!important;background:var(--cadotech-surface-l1,#fff)!important;
	border:1px solid var(--cadotech-border-idle,#d0d5dd)!important;border-radius:8px!important;box-shadow:none!important;transform:none!important;vertical-align:middle!important;
	transition:background-color .15s ease,border-color .15s ease!important}
body.cadotech-screen-course-builder :is(.wp-media-buttons,.wp-editor-tools) :is(.button,button,a.button):hover{background:var(--cadotech-surface-l1-hover,#f2f4ff)!important;border-color:var(--cadotech-text-brand,#2f55d4)!important}
body.cadotech-screen-course-builder :is(.wp-media-buttons,.wp-editor-tools) :is(.button,button,a.button)::before,
body.cadotech-screen-course-builder :is(.wp-media-buttons,.wp-editor-tools) :is(.button,button,a.button)::after{display:none!important}
body.cadotech-screen-course-builder .wp-media-buttons .wp-media-buttons-icon,
body.cadotech-screen-course-builder .wp-media-buttons .dashicons{width:16px!important;height:16px!important;margin:0!important;font-size:16px!important;line-height:1!important;color:inherit!important}
body.cadotech-screen-course-builder .wp-editor-tools{display:flex!important;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;padding:0 0 4px!important;background:none!important}
body.cadotech-screen-course-builder .wp-editor-tabs .wp-switch-editor{height:28px!important;padding:0 10px!important;font-size:12px!important;line-height:26px!important}
body.cadotech-screen-course-builder .wp-editor-wrap,body.cadotech-screen-course-builder .wp-editor-container{max-width:100%;box-sizing:border-box}
