/*
 * LMS3 learning module (the shell of EXT:lms3scormplayer, Builder\ModuleShell): a bar on top (menu and title,
 * fullscreen in the middle, back and forward on the right), the pages on a white stage that scrolls, a bar
 * below (progress line, the audio of the page in the middle when it has one, back and forward on the right),
 * and the menu with all pages. One accent colour, set by the package (--shell-accent, and
 * --shell-accent-contrast for what stands on it). Pages are a column for reading, or use the whole width of
 * the stage (.shell-stage--full, option width "full").
 *
 * The rules for what a page holds are generic: headings, paragraphs, lists, links, images, figures, tables.
 * Layouts of particular content elements belong to the style sheet of the add-on that made the module.
 */
:root {
  --shell-accent: #1f2937;
  --shell-text: #1f2937;
  --shell-muted: #5b6573;
  --shell-line: #dfe3e8;
  --shell-hover: #f1f3f5;
  --shell-link: #1d4ed8;
  --shell-bar: 48px;
  --shell-width: 46rem;
}
html,
body {
  height: 100%;
  margin: 0;
  background: #ffffff;
}
[hidden] {
  display: none !important;
}
.shell-app {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: #ffffff;
  color: var(--shell-text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.35;
}

/* bars */
.shell-bar {
  position: relative;
  z-index: 2;
  flex: 0 0 var(--shell-bar);
  display: flex;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  padding: 0 8px;
  background: #ffffff;
}
/* on top: menu and title, fullscreen exactly in the middle, back and forward on the right */
.shell-bar--top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  border-bottom: 1px solid var(--shell-line);
}
.shell-bar__start {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.shell-bar__center {
  display: flex;
  min-width: 40px;
}
.shell-bar--bottom {
  justify-content: flex-end;
  border-top: 1px solid var(--shell-line);
}
/* back, position, forward: on the right of both bars */
.shell-nav {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-self: end;
}
.shell-button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.shell-button:hover {
  background: var(--shell-hover);
}
.shell-button:focus-visible,
.shell-menu__item:focus-visible {
  outline: 2px solid var(--shell-accent);
  outline-offset: -2px;
}
.shell-button:disabled {
  opacity: 0.3;
  cursor: default;
  background: transparent;
}
.shell-heading {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.shell-heading__module {
  font-weight: 600;
}
.shell-heading__page {
  color: var(--shell-muted);
}
.shell-heading__module:empty + .shell-heading__page::before,
.shell-heading__page:empty {
  display: none;
}
.shell-heading__page::before {
  content: "\00B7";
  margin: 0 8px;
}
.shell-position {
  min-width: 76px;
  margin: 0;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
/* how far the learner is, as a line on the edge of the lower bar */
.shell-progress {
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--shell-line);
}
.shell-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--shell-accent);
  transition: width 0.2s ease;
}
/* the audio of the page in the middle of the bar below (there when a page of the module has audio, hidden on
   a page without): play/pause, a slider and the time */
.shell-bar--audio {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}
.shell-bar--audio .shell-audio {
  grid-column: 2;
  grid-row: 1;
}
.shell-bar--audio .shell-nav {
  grid-column: 3;
  grid-row: 1;
}
.shell-audio {
  display: flex;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  width: 22rem;
  max-width: 100%;
  min-width: 0;
}
.shell-audio__media {
  display: none;
}
.shell-audio__toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--shell-accent);
  color: var(--shell-accent-contrast, #ffffff);
}
.shell-audio__toggle:hover {
  background: var(--shell-accent);
  filter: brightness(1.12);
}
.shell-audio__toggle:focus-visible {
  outline-offset: 2px;
}
.shell-audio__toggle svg {
  width: 20px;
  height: 20px;
}
.shell-audio__pause,
.shell-audio.is-playing .shell-audio__play {
  display: none;
}
.shell-audio__play,
.shell-audio.is-playing .shell-audio__pause {
  display: inline-flex;
}
/* the play triangle looks centred a little to the right */
.shell-audio__play {
  margin-left: 2px;
}
.shell-audio__seek {
  --shell-audio-done: 0%;
  --shell-audio-track: #cdd3da;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  height: 40px;
  margin: 0;
  border-radius: 6px;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.shell-audio__seek:disabled {
  cursor: default;
}
.shell-audio__seek:focus-visible {
  outline: 2px solid var(--shell-accent);
  outline-offset: -2px;
}
.shell-audio__seek::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--shell-accent) var(--shell-audio-done), var(--shell-audio-track) var(--shell-audio-done));
}
.shell-audio__seek::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: var(--shell-accent);
  box-shadow: 0 0 0 1px rgba(17, 24, 39, 0.2);
  -webkit-appearance: none;
  appearance: none;
}
.shell-audio__seek::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: var(--shell-audio-track);
}
.shell-audio__seek::-moz-range-progress {
  height: 4px;
  border-radius: 2px;
  background: var(--shell-accent);
}
.shell-audio__seek::-moz-range-thumb {
  box-sizing: border-box;
  width: 14px;
  height: 14px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: var(--shell-accent);
  box-shadow: 0 0 0 1px rgba(17, 24, 39, 0.2);
}
.shell-audio__seek:disabled::-webkit-slider-thumb {
  opacity: 0.5;
}
.shell-audio__seek:disabled::-moz-range-thumb {
  opacity: 0.5;
}
.shell-audio__time {
  flex: 0 0 auto;
  min-width: 4.6em;
  color: var(--shell-muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* for screen readers only */
.shell-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* stage: the page the learner is on, scrolling between the bars */
.shell-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: #ffffff;
}
.shell-page {
  box-sizing: border-box;
  max-width: var(--shell-width);
  margin: 0 auto;
  padding: 28px 24px 48px;
  font-size: 17px;
  line-height: 1.6;
  overflow-wrap: break-word;
  animation: shell-page-in 0.2s ease-out;
}
/* option width "full": the page takes the whole stage, with margins on the sides */
.shell-stage--full .shell-page {
  max-width: none;
  padding-left: clamp(16px, 4vw, 48px);
  padding-right: clamp(16px, 4vw, 48px);
}
@keyframes shell-page-in {
  from {
    opacity: 0;
  }
}
/* the start of a page, focused for screen readers, needs no ring */
.shell-page:focus,
.shell-page [tabindex="-1"]:focus {
  outline: none;
}

/* what a page holds */
.shell-page > :first-child {
  margin-top: 0;
}
.shell-page > :last-child {
  margin-bottom: 0;
}
.shell-page h1,
.shell-page h2,
.shell-page h3,
.shell-page h4,
.shell-page h5,
.shell-page h6 {
  margin: 1.4em 0 0.5em;
  line-height: 1.25;
  font-weight: 650;
}
.shell-page h1 {
  font-size: 1.9em;
}
.shell-page h2 {
  font-size: 1.5em;
}
.shell-page h3 {
  font-size: 1.25em;
}
.shell-page h4,
.shell-page h5,
.shell-page h6 {
  font-size: 1.05em;
}
.shell-page p,
.shell-page ul,
.shell-page ol,
.shell-page blockquote,
.shell-page figure,
.shell-page table {
  margin: 0 0 1em;
}
.shell-page ul,
.shell-page ol {
  padding-left: 1.5em;
}
.shell-page li + li {
  margin-top: 0.3em;
}
.shell-page li > ul,
.shell-page li > ol {
  margin: 0.3em 0 0;
}
.shell-page a {
  color: var(--shell-link);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
.shell-page a:hover {
  text-decoration-thickness: 2px;
}
.shell-page a:focus-visible {
  outline: 2px solid var(--shell-accent);
  outline-offset: 2px;
  border-radius: 2px;
}
.shell-page img,
.shell-page video,
.shell-page svg {
  max-width: 100%;
  height: auto;
}
.shell-page img {
  display: block;
}
.shell-page figure {
  margin-left: 0;
  margin-right: 0;
}
.shell-page figcaption {
  margin-top: 0.5em;
  color: var(--shell-muted);
  font-size: 0.88em;
  line-height: 1.45;
}
.shell-page blockquote {
  margin-left: 0;
  padding-left: 1em;
  border-left: 3px solid var(--shell-line);
  color: var(--shell-muted);
}
.shell-page hr {
  margin: 2em 0;
  border: 0;
  border-top: 1px solid var(--shell-line);
}
.shell-page table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}
.shell-page th,
.shell-page td {
  padding: 6px 10px;
  border: 1px solid var(--shell-line);
  text-align: left;
  vertical-align: top;
}
.shell-page th {
  background: var(--shell-hover);
}

/* menu */
.shell-backdrop {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: rgba(17, 24, 39, 0.4);
}
.shell-menu {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 11;
  display: flex;
  flex-direction: column;
  width: min(340px, 86%);
  background: #ffffff;
  box-shadow: 4px 0 24px rgba(17, 24, 39, 0.18);
  animation: shell-menu-in 0.18s ease-out;
}
@keyframes shell-menu-in {
  from {
    transform: translateX(-24px);
    opacity: 0;
  }
}
.shell-menu__head {
  flex: 0 0 var(--shell-bar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
  padding: 0 8px 0 16px;
  border-bottom: 1px solid var(--shell-line);
}
.shell-menu__title {
  margin: 0;
  font-weight: 600;
}
.shell-menu__list {
  flex: 1 1 auto;
  margin: 0;
  padding: 6px 0;
  overflow-y: auto;
  list-style: none;
}
.shell-menu__item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  box-sizing: border-box;
  width: 100%;
  padding: 10px 16px 10px 13px;
  border: 0;
  border-left: 3px solid transparent;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.shell-menu__item--level2 {
  padding-left: 37px;
}
.shell-menu__item--level3 {
  padding-left: 61px;
}
.shell-menu__item:hover {
  background: var(--shell-hover);
}
.shell-menu__item[aria-current="true"] {
  border-left-color: var(--shell-accent);
  background: var(--shell-hover);
  background: color-mix(in srgb, var(--shell-accent) 9%, #ffffff);
  font-weight: 600;
}
/* a ring: not seen yet; filled with a tick: seen */
.shell-menu__mark {
  flex: 0 0 18px;
  box-sizing: border-box;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border: 2px solid #b4bbc5;
  border-radius: 50%;
}
.shell-menu__item.is-visited .shell-menu__mark {
  position: relative;
  border-color: var(--shell-accent);
  background: var(--shell-accent);
}
/* The tick, cut out of a layer in the colour that is seen on the accent colour: white, or dark on a light
   accent colour (--shell-accent-contrast, set by the package) */
.shell-menu__item.is-visited .shell-menu__mark::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--shell-accent-contrast, #ffffff);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 6.2l2.3 2.3 4.7-5'/%3E%3C/svg%3E") center / 12px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 6.2l2.3 2.3 4.7-5'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.shell-menu__text {
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .shell-heading__page {
    display: none;
  }
}
/* narrow: the audio takes the room left of back and forward */
@media (max-width: 720px) {
  .shell-bar--audio {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .shell-bar--audio .shell-audio {
    grid-column: 1;
    width: auto;
  }
  .shell-bar--audio .shell-nav {
    grid-column: 2;
  }
}
/* a phone: the buttons keep their size, the title makes room, the page uses the width */
@media (max-width: 480px) {
  .shell-heading {
    display: none;
  }
  .shell-position {
    min-width: 60px;
  }
  .shell-bar {
    padding: 0 4px;
    gap: 4px;
  }
  .shell-page {
    padding: 20px 16px 40px;
    font-size: 16px;
  }
  .shell-page h1 {
    font-size: 1.6em;
  }
  .shell-page h2 {
    font-size: 1.35em;
  }
}
/* very narrow: the time, then the slider make room; the play button stays */
@media (max-width: 359px) {
  .shell-audio__time {
    display: none;
  }
}
@media (max-width: 299px) {
  .shell-audio__seek {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .shell-page,
  .shell-menu {
    animation: none;
  }
  .shell-progress span {
    transition: none;
  }
  .shell-stage {
    scroll-behavior: auto;
  }
}
@media print {
  .shell-bar,
  .shell-menu,
  .shell-backdrop {
    display: none !important;
  }
  .shell-app,
  .shell-stage {
    display: block;
    height: auto;
    overflow: visible;
  }
}
