/*
 * LMS3 SCORM Creator: the layouts of the content elements of a learning module. The shell of the player
 * (lib/shell.css) does the bars, the menu and the typography of a page; this file comes after it.
 */

/* the title of the page stands in the bar; for a screen reader it is the heading of the page as well */
.module-page-title {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px !important;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.shell-page .module-element {
  margin: 0 0 1.75em;
}
.shell-page .module-page-title + .module-element,
.shell-page .module-element:first-child {
  margin-top: 0;
}
.shell-page .module-element:last-child {
  margin-bottom: 0;
}
.shell-page .module-element > :last-child,
.shell-page .module-textimage__text > :last-child {
  margin-bottom: 0;
}
.shell-page .module-element > :first-child,
.shell-page .module-textimage__text > :first-child {
  margin-top: 0;
}

/* text */
.shell-page .module-text__header {
  margin: 0 0 0.6em;
}
.shell-page .module-text__body > :first-child {
  margin-top: 0;
}
.shell-page .module-text__body > :last-child {
  margin-bottom: 0;
}

/* heading */
.shell-page .module-heading {
  margin-bottom: 1.25em;
}
.shell-page hgroup.module-heading h2 {
  margin: 0 0 0.3em;
}
.shell-page .module-subheader {
  margin: 0;
  color: var(--shell-muted, #5b6573);
  font-size: 1.15em;
  line-height: 1.4;
}

/* images */
.shell-page .module-textimage__figure,
.shell-page .module-image__figure {
  margin: 0;
}
.shell-page .module-textimage__figure img,
.shell-page .module-image__figure img {
  width: auto;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}
.shell-page .module-image__figure img {
  margin: 0 auto;
}
.shell-page .module-image__header,
.shell-page .module-textimage__header {
  margin: 0 0 0.6em;
}

/* text with image: above or below the text, or beside it on a wide screen */
.shell-page .module-textimage {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1em 1.5em;
  align-items: start;
}
.shell-page .module-textimage > * {
  margin: 0;
}
/* the image comes first in the page (see below for columns); on the right it stands after the text */
.shell-page .module-textimage--right > .module-textimage__figure {
  order: 2;
}
@media (min-width: 40em) {
  .shell-page .module-textimage--right {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  }
  .shell-page .module-textimage--left {
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  }
  .shell-page .module-textimage--left > .module-textimage__header,
  .shell-page .module-textimage--right > .module-textimage__header {
    grid-column: 1 / -1;
  }
}

/*
 * a page with a grid: its columns side by side (50/50, 33/66, 66/33, 33/33/33), each with its elements one below
 * the other; narrower than 720 px the columns stand one below the other: left, middle, right
 */
.shell-page .module-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.75em 2em;
  align-items: start;
}
.shell-page .module-grid__column {
  min-width: 0;
  container-type: inline-size;
}
@media (max-width: 719.98px) {
  .shell-page .module-grid__column:empty {
    display: none;
  }
}
@media (min-width: 720px) {
  .shell-page .module-grid--50-50 {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .shell-page .module-grid--33-66 {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  }
  .shell-page .module-grid--66-33 {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  }
  .shell-page .module-grid--33-33-33 {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  }
}
/*
 * text with image in a column: a column is too narrow for text and image side by side, so the image floats on its
 * side at 40 % of the column and the text flows around it and on below it. In a narrow column (a third of a page in a
 * reading column) and on a phone, image and text stand one below the other, the image above (left) or below (right)
 * the text.
 */
.shell-page .module-grid__column .module-textimage--left,
.shell-page .module-grid__column .module-textimage--right {
  grid-template-columns: minmax(0, 1fr);
}
/* only where the columns stand side by side; on a phone like everywhere else */
@media (min-width: 720px) {
  @container (min-width: 18em) {
    .shell-page .module-grid__column .module-textimage--left,
    .shell-page .module-grid__column .module-textimage--right {
      display: flow-root;
    }
    .shell-page .module-grid__column .module-textimage--left > .module-textimage__header,
    .shell-page .module-grid__column .module-textimage--right > .module-textimage__header {
      margin: 0 0 0.6em;
    }
    .shell-page .module-grid__column .module-textimage--right > .module-textimage__figure {
      float: right;
      width: 40%;
      margin: 0.3em 0 0.75em 1.25em;
    }
    .shell-page .module-grid__column .module-textimage--left > .module-textimage__figure {
      float: left;
      width: 40%;
      margin: 0.3em 1.25em 0.75em 0;
    }
    /* lists, quotes and tables beside an image: next to it as a block, so bullets and borders do not run under it */
    .shell-page .module-grid__column .module-textimage--left .module-textimage__text > :is(ul, ol, blockquote, table),
    .shell-page .module-grid__column .module-textimage--right .module-textimage__text > :is(ul, ol, blockquote, table) {
      display: flow-root;
    }
    .shell-page .module-grid__column .module-textimage--left .module-textimage__text > table,
    .shell-page .module-grid__column .module-textimage--right .module-textimage__text > table {
      display: table;
    }
  }
}
/* images, videos and PDF pages fill their column, not more */
.shell-page .module-grid__column img,
.shell-page .module-grid__column video {
  max-width: 100%;
  height: auto;
}

/* a PDF page of the module: the page of the PDF over the whole width, like a slide */
.shell-page .module-slide {
  margin: 0;
}
.shell-page .module-slide img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--shell-line, #d5d9de);
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* only for a screen reader: the text of a PDF page, the name of a play button */
.module-sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px !important;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* video: a file of the package, or the poster of a video on YouTube or Vimeo until it is clicked */
.shell-page .module-video__header,
.shell-page .module-pdf__header {
  margin: 0 0 0.6em;
}
.shell-page .module-video__player {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  background: #000;
  border-radius: 4px;
}
.shell-page .module-video__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #1f2933;
  border-radius: 4px;
}
.shell-page .module-video__load {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}
.shell-page .module-video__load:focus-visible {
  outline: 3px solid var(--shell-accent, #0b5cad);
  outline-offset: -3px;
}
.shell-page .module-video__poster {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.shell-page .module-video__play {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4.25rem;
  height: 3rem;
  transform: translate(-50%, -50%);
  color: #fff;
  background: rgba(20, 24, 28, 0.82);
  border-radius: 0.75rem;
  transition: background-color 0.15s;
}
.shell-page .module-video__load:hover .module-video__play,
.shell-page .module-video__load:focus-visible .module-video__play {
  background: var(--shell-accent, #0b5cad);
  color: var(--shell-accent-contrast, #fff);
}
.shell-page .module-video__iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.shell-page .module-video__notice {
  margin: 0.5em 0 0;
  color: var(--shell-muted, #5b6573);
  font-size: 0.9em;
}
.shell-page .module-video__text {
  margin-top: 1em;
}
.shell-page .module-video__text > :last-child {
  margin-bottom: 0;
}

/* PDF pages: one below the other, each with a thin line around it */
.shell-page .module-pdf__page {
  margin: 0 0 1.25em;
}
.shell-page .module-pdf__page img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border: 1px solid var(--shell-line, #d5d9de);
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.shell-page .module-pdf__download {
  margin: 0;
}

@media print {
  .shell-page .module-element {
    break-inside: avoid;
  }
  .shell-page .module-pdf {
    break-inside: auto;
  }
  .shell-page .module-pdf__page {
    break-inside: avoid;
  }
  .shell-page .module-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
