/* Keep editor-content rules outside the CSS build: no layers or modern selectors. */
.course-details-layout {
  grid-template-columns: minmax(0, 1fr);
}

.course-details-layout > * {
  min-width: 0;
  max-width: 100%;
}

.legacy-content {
  min-width: 0;
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
  overflow-wrap: anywhere;
}

.legacy-content ul,
.legacy-content ol {
  box-sizing: border-box;
  max-width: 100%;
  margin: 1rem 0;
  padding: 0 1.6rem 0 0;
  list-style-position: outside;
}

.legacy-content [dir="ltr"] ul,
.legacy-content [dir="ltr"] ol,
.legacy-content ul[dir="ltr"],
.legacy-content ol[dir="ltr"] {
  padding: 0 0 0 1.6rem;
}

.legacy-content ul { list-style-type: disc; }
.legacy-content ul ul { list-style-type: circle; }
.legacy-content ul ul ul { list-style-type: square; }
.legacy-content ol { list-style-type: decimal; }
.legacy-content ol[type="a"] { list-style-type: lower-alpha; }
.legacy-content ol[type="A"] { list-style-type: upper-alpha; }
.legacy-content ol[type="i"] { list-style-type: lower-roman; }
.legacy-content ol[type="I"] { list-style-type: upper-roman; }

.legacy-content li {
  display: list-item;
  margin-bottom: 0.5rem;
  padding: 0;
}

.legacy-content li p,
.legacy-content li div {
  margin-bottom: 0.35rem;
}

.legacy-content li ul,
.legacy-content li ol {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Word/editor preformatted paragraphs must wrap without losing line breaks. */
.legacy-content pre,
.legacy-content pre * {
  white-space: pre-wrap !important;
  word-wrap: break-word;
  overflow-wrap: break-word;
  overflow-wrap: anywhere;
}

.legacy-content pre {
  max-width: 100%;
  margin: 0 0 0.5rem;
  font-family: inherit;
  line-height: 1.8;
}

@media (min-width: 1024px) {
  .course-details-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
}

@media (max-width: 700px) {
  .course-details-layout .legacy-content {
    padding: 1rem;
  }

  .legacy-content p,
  .legacy-content div,
  .legacy-content pre,
  .legacy-content li {
    box-sizing: border-box;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
  }
}
