/* ============================================
   Course Overview Page (courses.dracademy.com.tw/course-overview/)
   所有 rule 加 body.page-template-page-course-overview scope 提升權重
   避免被 Elementor 的 .elementor-XXX selectors 覆蓋
   ============================================ */

html:has(body.page-template-page-course-overview),
body.page-template-page-course-overview {
  background: #1a1d22 !important;
}

/* 消除 nav 與 main 之間的空白 */
body.page-template-page-course-overview main.course-overview {
  margin-top: 0;
  padding-top: 0;
}
body.page-template-page-course-overview main.course-overview > .course-overview__hero {
  margin-top: 0;
}

/* 隱藏 hello-elementor fallback 的 site-branding（title + description） */
body.page-template-page-course-overview .site-branding {
  display: none;
}

body.page-template-page-course-overview .course-overview {
  background: linear-gradient(180deg, #1a1d22 0%, #262b32 100%);
  min-height: 100vh;
  color: #fff;
  padding-bottom: 80px;
}

body.page-template-page-course-overview .course-overview__hero {
  padding: 80px 20px 40px;
  text-align: center;
}
body.page-template-page-course-overview .course-overview__hero-inner {
  max-width: 1200px;
  margin: 0 auto;
}
body.page-template-page-course-overview .course-overview__title {
  font-size: 42px;
  font-weight: 700;
  color: #39fff5;
  margin: 0 0 8px;
  letter-spacing: 2px;
}
body.page-template-page-course-overview .course-overview__subtitle {
  font-size: 16px;
  color: rgba(255,255,255,0.6);
  margin: 0;
}

body.page-template-page-course-overview .course-overview__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Filter buttons — segmented control（滑塊左右滑動） */
body.page-template-page-course-overview .course-overview__filters {
  display: inline-flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: stretch;
  gap: 0;
  margin: 0 auto 40px;
  padding: 4px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 999px;
  position: relative;
  overflow: hidden;
}
/* 外層 container 置中 */
body.page-template-page-course-overview .course-overview__container > .course-overview__filters {
  display: flex;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}
body.page-template-page-course-overview .course-overview__filters-slider {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: 0;
  background: #39fff5;
  border-radius: 999px;
  z-index: 0;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}
body.page-template-page-course-overview .course-overview__filter {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.75);
  padding: 10px 22px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  transition: color 0.25s;
  font-family: inherit;
  white-space: nowrap;
}
body.page-template-page-course-overview .course-overview__filter:hover {
  color: #fff;
}
body.page-template-page-course-overview .course-overview__filter.is-active {
  color: #1a1d22;
  font-weight: 700;
}
body.page-template-page-course-overview .course-overview__filter-count {
  display: inline-block;
  background: rgba(255,255,255,0.12);
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  min-width: 28px;
  text-align: center;
  transition: background-color 0.25s, color 0.25s;
}
body.page-template-page-course-overview .course-overview__filter.is-active .course-overview__filter-count {
  background: rgba(26, 29, 34, 0.15);
  color: #1a1d22;
}

/* Grid */
body.page-template-page-course-overview .course-overview__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}

/* Card */
body.page-template-page-course-overview .course-overview-card {
  display: flex;
  flex-direction: column;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: #fff;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
body.page-template-page-course-overview .course-overview-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(57, 255, 245, 0.15);
  border-color: rgba(57, 255, 245, 0.4);
}
body.page-template-page-course-overview .course-overview-card[hidden] { display: none; }

body.page-template-page-course-overview .course-overview-card__media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #2c343b center/cover no-repeat;
  background-size: cover;
}
body.page-template-page-course-overview .course-overview-card__tag {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(57, 255, 245, 0.95);
  color: #1a1d22;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

body.page-template-page-course-overview .course-overview-card__body {
  padding: 20px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
body.page-template-page-course-overview .course-overview-card__title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  line-height: 1.4;
  text-align: center;
}
/* B-6：副標題限制單行 + ellipsis 避免 NLC 等長副標撐爆 */
body.page-template-page-course-overview .course-overview-card__subtitle {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  margin: 0;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}
body.page-template-page-course-overview .course-overview-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
/* B-5：報名進度條（撐滿 footer 左側、距離 cta 20px） */
body.page-template-page-course-overview .course-overview-card__progress {
  flex: 1 1 auto;
  min-width: 0;
  margin-right: 20px;
  display: flex;
  flex-direction: column-reverse;
  gap: 4px;
}
body.page-template-page-course-overview .course-overview-card__progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 999px;
  overflow: hidden;
}
body.page-template-page-course-overview .course-overview-card__progress-fill {
  height: 100%;
  background: #39fff5;
  border-radius: 999px;
  transition: width 0.3s ease;
}
body.page-template-page-course-overview .course-overview-card__progress-text {
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.3px;
}
body.page-template-page-course-overview .course-overview-card__cta {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  color: #39fff5;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 18px 8px;
  border: 2px solid #39fff5;
  border-radius: 999px;
  line-height: 1;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}
body.page-template-page-course-overview .course-overview-card__cta::after {
  content: "›";
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  margin-top: -2px;
}

/* NLC 專用：取代進度條，顯示「目前 L 階段」純文字（無背景色） */
body.page-template-page-course-overview .course-overview-card__nlc-stage {
  flex: 1 1 auto;
  min-width: 0;
  margin-right: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255,255,255,0.85);
}
body.page-template-page-course-overview .course-overview-card__nlc-stage .nlc-stage-tag {
  color: #39fff5;
  font-weight: 700;
  letter-spacing: 0.3px;
}
body.page-template-page-course-overview .course-overview-card__nlc-stage .nlc-stage-dates {
  color: rgba(255,255,255,0.7);
  font-size: 12px;
  letter-spacing: 0.3px;
}
body.page-template-page-course-overview .course-overview-card:hover .course-overview-card__cta {
  background: #39fff5;
  color: #0a0a0a;
}


/* Pagination */
body.page-template-page-course-overview .course-overview__pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 40px 0 0;
}
body.page-template-page-course-overview .course-overview__pagination:empty { display: none; }
body.page-template-page-course-overview .course-overview__page-btn {
  min-width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.7);
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.15s;
  padding: 0 12px;
}
body.page-template-page-course-overview .course-overview__page-btn:hover:not(:disabled) {
  border-color: #39fff5;
  color: #39fff5;
}
body.page-template-page-course-overview .course-overview__page-btn.is-active {
  background: #39fff5;
  color: #1a1d22;
  border-color: #39fff5;
  font-weight: 700;
}
body.page-template-page-course-overview .course-overview__page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* RWD */
@media (max-width: 768px) {
body.page-template-page-course-overview .course-overview__title { font-size: 32px; }
/* 2026-07-17：filters 手機版改滿寬三等分，避免第三顆被切掉 */
body.page-template-page-course-overview .course-overview__container > .course-overview__filters {
  width: 100%;
  max-width: 420px;
}
body.page-template-page-course-overview .course-overview__filter {
  flex: 1 1 0;
  min-width: 0;
  justify-content: center;
  padding: 8px 8px;
  font-size: 13px;
  gap: 5px;
}
body.page-template-page-course-overview .course-overview__filter-count {
  min-width: 22px;
  padding: 2px 7px;
  font-size: 11px;
}
body.page-template-page-course-overview .course-overview__grid { grid-template-columns: 1fr; gap: 16px; }
}

/* 超小螢幕（<=380px）再縮一級 */
@media (max-width: 380px) {
body.page-template-page-course-overview .course-overview__filter {
  padding: 8px 5px;
  font-size: 12px;
  gap: 4px;
}
body.page-template-page-course-overview .course-overview__filter-count {
  min-width: 20px;
  padding: 2px 5px;
  font-size: 10px;
}
}
