/* site/pages/course.css — 강좌 화면 전용: 강좌 목록(site/course/list.html)과 강좌 안내(site/course/guide.html)의 신청 버튼 줄.
   검색·정렬 줄과 빈 상태, 페이지 번호는 디자인 시스템 components/table-pagination.html,
   모집 상태 배지는 components/badges-labels.html의 상태 배지를 따른다. 목록의 한 줄은 그 둘과 정의형 라벨값(components/notice-list.html)을
   조합한 것이다 — 강좌 한 건의 항목을 한 줄에 담는 견본이 카드에 없다. */

/* ── 강좌 안내 본문 끝의 수강신청 버튼 줄 ── */
.course-guide-actions { display: flex; justify-content: center; margin-top: var(--sp-10); }

/* ── 목록 위의 길 · 모집중 강좌 없음 안내 ── */
.course-links { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-6); }
.course-alert {
  margin: 0 0 var(--sp-6); padding: var(--sp-4) var(--sp-5);
  border: var(--bd); border-radius: var(--r-md); background: var(--c-surface-tint);
  font-size: var(--fs-15); font-weight: var(--fw-semibold); color: var(--c-primary);
}

/* ── 검색·모집 상태·정렬 줄 ── */
.course-toolbar { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-8); }
/* 검색어 칸과 검색 버튼은 한 묶음이라 둘 사이에서 줄을 바꾸지 않는다 — 자리가 모자라면 칸이 먼저 줄고, 그래도 모자라면 바깥 줄이 묶음째 내린다 */
.course-toolbar__search { display: flex; flex-wrap: nowrap; gap: var(--sp-2); flex: 1 1 320px; max-width: 520px; }
.course-toolbar__search .input { flex: 1 1 auto; min-width: 0; }
/* 검색 묶음과 초기화는 왼쪽에 붙이고 선택 상자 묶음만 오른쪽 끝으로 민다 */
.course-toolbar__selects { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-left: auto; }

/* ── 강좌 목록 — 한 줄에 강좌 하나. 왼쪽에 강좌명·정보·소개, 오른쪽에 신청 버튼 ── */
.course-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--c-primary); }
.course-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: var(--sp-8);
  padding: var(--sp-6) var(--sp-2); border-bottom: var(--bd);
}
.course-row__main { display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; }
.course-row__head { display: flex; align-items: center; gap: var(--sp-2); }
.course-row__code { font-size: var(--fs-14); font-weight: var(--fw-semibold); color: var(--c-text-mute); }
.course-row__name { margin: 0; font-size: var(--fs-20); font-weight: var(--fw-bold); line-height: var(--lh-snug); color: var(--c-text); overflow-wrap: anywhere; }
.course-row__info { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2) var(--sp-8); }
.course-row__info > div { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: var(--sp-2); font-size: var(--fs-14); line-height: var(--lh-snug); }
.course-row__info dt { color: var(--c-text-mute); }
.course-row__info dd { margin: 0; color: var(--c-text); overflow-wrap: anywhere; }
.course-row__desc { border-top: var(--bd); padding-top: var(--sp-3); font-size: var(--fs-14); }
.course-row__desc-label { margin: 0; font-weight: var(--fw-semibold); color: var(--c-primary); }
.course-row__desc-text { margin: var(--sp-2) 0 0; line-height: var(--lh-base); color: var(--c-text-soft); white-space: pre-line; overflow-wrap: anywhere; }
/* 스크립트가 붙이는 세 줄 말줄임 — 더보기를 누르면 걷는다 */
.course-row__desc-text.is-clamped { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.course-row__more {
  margin-top: var(--sp-1); padding: 0; border: 0; background: none; cursor: pointer;
  font-size: var(--fs-14); font-weight: var(--fw-semibold); color: var(--c-primary);
  text-decoration: underline; text-underline-offset: 3px;
}
.course-row__side { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: var(--sp-2); text-align: right; }
.course-row__reason { font-size: var(--fs-13); color: var(--c-text-mute); }

/* ── 모집 상태 배지 — 예정은 카드에 없는 상태라 같은 모양에 테두리만 둔다 ── */
.course-badge {
  display: inline-flex; align-items: center; height: 30px; padding: 0 var(--sp-3);
  border-radius: var(--r-full); font-size: var(--fs-13); font-weight: var(--fw-bold);
  color: var(--c-on-primary); white-space: nowrap;
}
.course-badge--recruiting { background: var(--c-state-ongoing); }
.course-badge--closed { background: var(--c-state-closed); }
.course-badge--upcoming { background: var(--c-white); color: var(--c-primary); box-shadow: inset 0 0 0 1px var(--c-primary); }

/* ── 빈 상태 ── */
.course-empty {
  margin: 0; padding: var(--sp-24) var(--sp-6); text-align: center;
  border: var(--bd); border-radius: var(--r-xl); background: var(--c-surface-tint);
  font-size: var(--fs-18); font-weight: var(--fw-semibold); color: var(--c-text);
}

@media (max-width: 767px) {
  /* 좁은 화면에서는 신청 버튼이 정보 아래로 내려가고 정보는 한 열로 쌓인다 */
  .course-row { grid-template-columns: minmax(0, 1fr); gap: var(--sp-4); }
  .course-row__info { grid-template-columns: minmax(0, 1fr); }
  .course-row__side { flex-direction: row; align-items: center; justify-content: flex-end; text-align: left; flex-wrap: wrap; }
  /* 검색 묶음은 초기화 버튼과 한 줄을 나눠 쓰고, 선택 상자 묶음은 그 아래 한 줄을 다 쓴다 */
  .course-toolbar__search { max-width: none; flex: 1 1 0; min-width: 0; }
  .course-toolbar__selects { width: 100%; }
  .course-toolbar__selects .select-wrap { flex: 1 1 0; }
  .course-toolbar__selects select { width: 100%; }
}
