/* ----------------------------------------------------------------------------
   The course editor page.

   Loads styles.css and lessons.css first and adds only its own layout. The
   shape says what the job is: courses on the left, the chosen one in the
   middle, everything published on the right - building a course is moving
   lessons leftwards.
---------------------------------------------------------------------------- */

.courses-main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 16px;
  padding: 12px 18px 18px;
}

@media (max-width: 900px) {
  .courses-main { grid-template-columns: minmax(0, 1fr); }
}

.courses-list-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  overflow: hidden;
}

.course-list {
  flex: 1;
  min-height: 0;
  list-style: none;
  margin: 0;
  padding: 5px;
  overflow-y: auto;
}

.course-row {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 100%;
  padding: 8px 9px;
  border: none;
  border-radius: 7px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.course-row strong { font-size: 12px; }

.course-row:hover { background: var(--hover-bg); }

.course-row.is-selected {
  background: var(--accent-quiet);
  color: var(--accent-ink);
}

.course-detail {
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 12px;
}

.course-fields {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.course-columns {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 1100px) {
  .course-columns { grid-template-columns: minmax(0, 1fr); }
}

.course-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  overflow: hidden;
}

.course-picked,
.course-pool {
  flex: 1;
  min-height: 0;
  list-style: none;
  margin: 0;
  padding: 5px;
  overflow-y: auto;
  counter-reset: pick;
}

.course-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
}

.course-picked .course-item {
  cursor: grab;
  counter-increment: pick;
  background: var(--panel-sunken);
  margin-bottom: 4px;
}

/* The number is the point of the list - a course IS the order - so it is part
   of the row rather than a bullet the browser chose. */
.course-picked .course-item::before {
  content: counter(pick);
  flex: none;
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-quiet);
  color: var(--accent-ink);
  font-size: 10px;
  font-weight: 700;
}

/* A lesson that has since been unpublished. Shown, not silently dropped: a
   course that quietly got shorter is one nobody notices is broken. */
.course-item.is-missing {
  border-color: var(--danger);
  background: transparent;
}

.course-item.is-missing strong { color: var(--danger); }

.course-item-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.course-item-body strong {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.course-item-add {
  cursor: pointer;
}

.course-item-add:hover {
  border-color: var(--accent);
  background: var(--hover-bg);
}

.course-add-glyph {
  flex: none;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.course-item-add:hover .course-add-glyph { color: var(--accent); }

.course-hint {
  flex: none;
  margin: 0;
  padding: 7px 10px;
  border-top: 1px solid var(--line);
}
