/* Tutor's legacy lesson workspace: one column after collapse, an accessible
   off-canvas curriculum on smaller screens. No course data is changed. */
@media (min-width: 1200px) {
  body .tutor-course-single-content-wrapper.tutor-course-single-sidebar-hidden {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  body .tutor-course-single-content-wrapper.tutor-course-single-sidebar-hidden > .tutor-course-single-sidebar-wrapper {
    display: none !important;
  }
  body .tutor-course-single-content-wrapper.tutor-course-single-sidebar-hidden > #tutor-single-entry-content {
    grid-column: 1 / -1;
    min-width: 0;
    width: 100% !important;
    max-width: none !important;
  }
}

body .tutor-course-single-content-wrapper :is([tutor-course-topics-sidebar-toggler], [tutor-course-topics-sidebar-offcanvas-toggler], [tutor-hide-course-single-sidebar]) {
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 10px;
  margin: 0;
  border: 1px solid #8697a2;
  border-radius: 6px;
  background: #152e40 !important;
  color: #fff !important;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease;
}
body .tutor-course-single-content-wrapper :is([tutor-course-topics-sidebar-toggler], [tutor-course-topics-sidebar-offcanvas-toggler], [tutor-hide-course-single-sidebar]) > span {
  color: #fff !important;
  margin: 0 !important;
  font-size: 18px;
  line-height: 1;
}
body .tutor-course-single-content-wrapper :is([tutor-course-topics-sidebar-toggler], [tutor-course-topics-sidebar-offcanvas-toggler], [tutor-hide-course-single-sidebar]):hover {
  background: #25475c !important;
  border-color: #fff;
}
body .tutor-course-single-content-wrapper :is([tutor-course-topics-sidebar-toggler], [tutor-course-topics-sidebar-offcanvas-toggler], [tutor-hide-course-single-sidebar]):focus-visible {
  outline: 3px solid #fff !important;
  outline-offset: 3px;
  box-shadow: 0 0 0 6px #152e40 !important;
}
.ca-lesson-sidebar-backdrop { display: none; }

@media (max-width: 1199.98px) {
  body.ca-lesson-drawer-open { overflow: hidden !important; }
  body .tutor-course-single-content-wrapper #tutor-single-entry-content .tutor-course-topic-single-header {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    gap: 12px;
    padding: 14px 12px !important;
  }
  body .tutor-course-single-content-wrapper .tutor-course-topic-single-header-title {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    margin: 0 !important;
    font-size: clamp(14px, 2vw, 18px);
    line-height: 1.4;
    overflow-wrap: anywhere;
  }
  body .tutor-course-single-content-wrapper .tutor-course-topic-single-header > a:not([tutor-course-topics-sidebar-toggler]) {
    grid-column: 1;
    grid-row: 1;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 10px;
    margin: 0;
  }
  body .tutor-course-single-content-wrapper .tutor-course-topic-single-header > .tutor-d-xl-none {
    grid-column: 3;
    grid-row: 1;
    margin: 0 !important;
  }
  body .tutor-course-single-content-wrapper .tutor-course-topic-single-header > a.tutor-d-xl-none {
    grid-column: 1;
  }
  body .tutor-course-single-content-wrapper [tutor-course-topics-sidebar-toggler] { display: none !important; }
  body .tutor-course-single-content-wrapper :is([tutor-course-topics-sidebar-offcanvas-toggler], [tutor-hide-course-single-sidebar]) { display: inline-flex; }

  /* A fixed drawer does not reserve an empty screen above the lesson. */
  body .tutor-course-single-content-wrapper[data-ca-sidebar-ready] > .tutor-course-single-sidebar-wrapper,
  body .tutor-course-single-content-wrapper[data-ca-sidebar-ready].tutor-course-single-sidebar-open > .tutor-course-single-sidebar-wrapper {
    display: block !important;
    position: fixed !important;
    inset: var(--ca-lesson-header-bottom, 80px) auto auto 0 !important;
    z-index: 1100 !important;
    width: min(380px, 100vw) !important;
    max-width: 100% !important;
    height: calc(100vh - var(--ca-lesson-header-bottom, 80px)) !important;
    height: calc(100dvh - var(--ca-lesson-header-bottom, 80px)) !important;
    max-height: calc(100dvh - var(--ca-lesson-header-bottom, 80px)) !important;
    box-sizing: border-box;
    margin: 0 !important;
    padding-bottom: calc(20px + env(safe-area-inset-bottom)) !important;
    border-radius: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    opacity: 1 !important;
    transform: translateX(-105%);
    visibility: hidden !important;
    pointer-events: none;
    transition: transform 220ms cubic-bezier(.2, .7, .2, 1), visibility 220ms;
  }
  body .tutor-course-single-content-wrapper[data-ca-sidebar-ready].tutor-course-single-sidebar-open > .tutor-course-single-sidebar-wrapper {
    transform: translateX(0);
    visibility: visible !important;
    pointer-events: auto;
    /* Expose the dialog to focus immediately; only its position animates in. */
    transition: transform 220ms cubic-bezier(.2, .7, .2, 1), visibility 0s;
  }
  body .tutor-course-single-content-wrapper[data-ca-sidebar-ready] .tutor-course-single-sidebar-title {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 68px;
    padding: 12px 16px !important;
    border-radius: 0;
  }
  body .tutor-course-single-content-wrapper .tutor-course-single-sidebar-wrapper .tutor-accordion-item-header {
    padding-inline: 16px 52px !important;
  }
  body .tutor-course-single-content-wrapper .tutor-course-single-sidebar-wrapper .tutor-accordion-item-header > .tutor-row {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    flex-wrap: nowrap;
    margin-inline: 0;
  }
  body .tutor-course-single-content-wrapper .tutor-course-single-sidebar-wrapper .tutor-accordion-item-header > .tutor-row > .tutor-col { min-width: 0; }
  body .tutor-course-single-content-wrapper .tutor-course-single-sidebar-wrapper .tutor-course-topic-title { overflow-wrap: anywhere; }
  body .tutor-course-single-content-wrapper .tutor-course-single-sidebar-wrapper .tutor-course-topic-summary { white-space: nowrap; font-size: 13px; }
  body .tutor-course-single-content-wrapper .tutor-course-single-sidebar-wrapper .tutor-accordion-item-header::after {
    right: 18px;
    width: 16px;
    text-align: center;
    pointer-events: none;
  }
  body .tutor-course-single-content-wrapper > .ca-lesson-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: var(--ca-lesson-header-bottom, 80px) 0 0;
    z-index: 1099;
    width: auto;
    height: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgb(10 25 35 / 48%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 220ms ease, visibility 220ms;
  }
  body .tutor-course-single-content-wrapper.tutor-course-single-sidebar-open > .ca-lesson-sidebar-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
}

@media (max-width: 480px) {
  body .tutor-course-single-content-wrapper[data-ca-sidebar-ready] > .tutor-course-single-sidebar-wrapper,
  body .tutor-course-single-content-wrapper[data-ca-sidebar-ready].tutor-course-single-sidebar-open > .tutor-course-single-sidebar-wrapper {
    width: 100vw !important;
  }
}

/* Keep curriculum links available when JavaScript is disabled. */
html:not(.ca-js) body .tutor-course-single-content-wrapper :is([tutor-course-topics-sidebar-toggler], [tutor-course-topics-sidebar-offcanvas-toggler], [tutor-hide-course-single-sidebar]) { display: none !important; }
@media (max-width: 1199.98px) {
  html:not(.ca-js) body .tutor-course-single-content-wrapper { display: flex !important; flex-direction: column; gap: 24px; }
  html:not(.ca-js) body .tutor-course-single-content-wrapper > .tutor-course-single-sidebar-wrapper {
    display: block !important;
    position: static !important;
    inset: auto !important;
    z-index: auto !important;
    order: 2;
    width: 100% !important;
    height: auto !important;
    max-height: min(420px, 70vh) !important;
    margin: 0 !important;
    padding-bottom: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    pointer-events: auto;
    overflow-y: auto !important;
  }
  html:not(.ca-js) body .tutor-course-single-content-wrapper > #tutor-single-entry-content { order: 1; }
  html:not(.ca-js) body .tutor-course-single-sidebar-wrapper .tutor-accordion-item-body { display: block !important; height: auto !important; }
}
@media (prefers-reduced-motion: reduce) {
  body .tutor-course-single-content-wrapper[data-ca-sidebar-ready] > .tutor-course-single-sidebar-wrapper,
  body .tutor-course-single-content-wrapper > .ca-lesson-sidebar-backdrop,
  body .tutor-course-single-content-wrapper :is([tutor-course-topics-sidebar-toggler], [tutor-course-topics-sidebar-offcanvas-toggler], [tutor-hide-course-single-sidebar]) { transition: none !important; }
}
