/* Course detail page. Course context stays visible at the top; lessons become
   equal, scan-friendly cards with explicit video and text paths. */
.course-hero {
  align-items: center;
}

.course-hero__description {
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  display: -webkit-box;
  max-width: 720px;
  overflow: hidden;
}

.course-stats {
  grid-template-columns: repeat(2, minmax(80px, 1fr));
}

.course-stats dd small {
  color: #8a7a6a;
  font-size: 0.55em;
  padding-left: 2px;
}

.course-plan {
  align-items: center;
  background-color: rgba(255, 255, 255, 0.68);
  border: 1px solid #d9d7c3;
  border-radius: 10px;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-top: 12px;
  padding: 11px 14px;
}

.course-plan__state {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 7px 10px;
}

.course-plan__badge {
  align-items: center;
  color: #4e0d0d;
  display: inline-flex;
  font-size: 0.85em;
  font-weight: 600;
  gap: 6px;
  white-space: nowrap;
}

.course-plan__badge i {
  color: #8a7a6a;
}

.course-plan__badge--active,
.course-plan__badge--active i,
.course-plan__badge--done,
.course-plan__badge--done i {
  color: #4a7c59;
}

.course-plan__hint {
  color: #8a7a6a;
  font-size: 0.78em;
}

.course-plan__actions {
  align-items: center;
  display: flex;
  flex: none;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}

.course-plan__actions form {
  margin: 0;
}

.course-plan__action {
  align-items: center;
  background-color: #fff;
  border: 1px solid #c7c5b1;
  border-radius: 999px;
  box-sizing: border-box;
  color: #1a5276;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 0.78em;
  gap: 6px;
  justify-content: center;
  min-height: 44px;
  padding: 7px 14px;
  text-decoration: none;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.course-plan__action:hover {
  background-color: #f7f5e9;
  border-color: #8e8a70;
  color: #4e0d0d;
  text-decoration: none;
}

.course-plan__action--primary {
  background-color: #4a7c59;
  border-color: #4a7c59;
  color: #fff;
}

.course-plan__action--primary:hover {
  background-color: #365e42;
  border-color: #365e42;
  color: #fff;
}

.course-plan__action--danger {
  color: #9b2c2c;
}

.course-plan__action:focus-visible {
  outline: 3px solid rgba(26, 82, 118, 0.35);
  outline-offset: 2px;
}

.course-library {
  padding-top: 24px;
}

.course-library__head {
  align-items: baseline;
  border-bottom: 1px solid #dddcc8;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
  padding: 0 2px 9px;
}

.course-library__head h2 {
  color: #4e0d0d;
  font-family: "Songti SC", "SimSun", "宋体", serif;
  font-size: 1.18em;
  font-weight: 600;
  margin: 0;
}

.course-library__head p {
  color: #8a7a6a;
  font-size: 0.82em;
  line-height: 1.5;
  margin: 0;
}

.course-lessons {
  display: grid;
  gap: 11px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

.course-lesson {
  background-color: rgba(255, 255, 255, 0.78);
  border: 1px solid #d9d9c6;
  border-radius: 11px;
  box-shadow: 0 4px 12px rgba(62, 47, 25, 0.04);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.course-lesson:hover {
  border-color: #c5c1a6;
  box-shadow: 0 8px 20px rgba(62, 47, 25, 0.1);
  transform: translateY(-1px);
}

.course-lesson__media {
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(circle at 50% 45%, rgba(74, 124, 89, 0.18), transparent 28%),
    linear-gradient(135deg, #e9e3d1, #f8f5e9);
  display: block;
  overflow: hidden;
  position: relative;
}

.course-lesson__media img {
  display: block;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.2s ease;
  width: 100%;
}

.course-lesson:hover .course-lesson__media img {
  opacity: 0.92;
}

.course-lesson__order {
  background-color: rgba(35, 28, 18, 0.72);
  border-radius: 999px;
  bottom: 8px;
  color: #fff;
  font-size: 0.72em;
  left: 8px;
  line-height: 1;
  padding: 5px 8px;
  position: absolute;
}

.course-lesson__duration {
  background-color: rgba(35, 28, 18, 0.72);
  border-radius: 999px;
  bottom: 8px;
  color: #fff;
  font-size: 0.72em;
  line-height: 1;
  padding: 5px 8px;
  position: absolute;
  right: 8px;
}

.course-lesson__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  padding: 13px;
}

.course-lesson__body h3 {
  font-family: "Songti SC", "SimSun", "宋体", serif;
  font-size: 0.96em;
  font-weight: 600;
  line-height: 1.55;
  margin: 0 0 14px;
}

.course-lesson__body h3 a {
  color: #4e0d0d;
  text-decoration: none;
}

.course-lesson__body h3 a:hover {
  color: #1a5276;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.course-lesson__body h3 a:focus-visible {
  outline: 3px solid rgba(26, 82, 118, 0.35);
  outline-offset: 2px;
}

.course-empty {
  align-items: center;
  background-color: rgba(255, 255, 255, 0.55);
  border: 1px dashed #cfcdb9;
  border-radius: 10px;
  color: #8a7a6a;
  display: flex;
  flex-direction: column;
  gap: 8px;
  grid-column: 1 / -1;
  padding: 34px 16px;
  text-align: center;
}

.course-empty i {
  color: #b99c60;
  font-size: 1.5em;
}

.course-empty p {
  margin: 0;
}

@media screen and (max-width: 900px) {
  .course-lessons {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  }
}

@media screen and (max-width: 720px) {
  .course-plan {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .course-plan__actions {
    justify-content: flex-start;
  }

  .course-library__head {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }
}

@media screen and (max-width: 560px) {
  .course-lessons {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .course-plan__actions,
  .course-plan__actions form,
  .course-plan__action {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .course-page *,
  .course-page *::before,
  .course-page *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* Tech-assistant strip: the playlist a course was built from keeps gaining
   episodes, so the comparison starts from the course itself. */
.course-admin {
  background-color: rgba(255, 255, 255, 0.68);
  border: 1px dashed #d9d7c3;
  border-radius: 10px;
  margin-top: 10px;
  padding: 10px 14px;
}

.course-admin__form {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.course-admin__form label {
  color: #7a6a58;
  font-size: 0.85em;
  font-weight: 600;
}

.course-admin__form input[type="text"] {
  flex: 1 1 260px;
  min-width: 0;
}
