/* ============================================================
   BJ 2.0 — Course Top Page Styles (bj20-course.css)
   対象: single-sfwd-courses.php
   依存: bj20-common.css（CSS変数定義）
   ============================================================ */


/* ----------------------------------------------------------
   [A] コースヘッダー
   ---------------------------------------------------------- */

.bj20-page .bj-course-header {
  background: var(--color-bg-sub);
  color: var(--color-text);
  padding: 104px 40px 44px;
}

/* デフォルト（タブレット）: 5:5 */
.bj20-page .bj-course-header__inner {
  max-width: var(--wide-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 48px;
}

/* PC（1200px〜）: 4:6 */
@media (min-width: 1200px) {
  .bj20-page .bj-course-header__inner {
    grid-template-columns: 4fr 6fr;
  }
}

/* 上段左: ラベル+タイトル */
.bj20-page .bj-course-header__identity {
  grid-column: 1 / 2;
  grid-row: 1 / 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* 上段右: サムネイル */
.bj20-page .bj-course-header__thumb-wrap {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
  max-width: 360px;
  margin-left: auto;
  border-radius: 4px;
  overflow: hidden;
}

.bj20-page .bj-course-header__thumb {
  width: 100%;
  height: auto;
  display: block;
}

/* 下段: 左列内に収める（PC/タブレット） */
.bj20-page .bj-course-header__actions {
  grid-column: 1 / 2;
}

/* 英字ラベル */
.bj20-page .bj-course-header__label {
  display: block;
  font-size: var(--fs-label);
  font-family: var(--serif-en);
  letter-spacing: var(--ls-wide);
  color: var(--color-accent);
  margin-bottom: 4px;
}

/* コースタイトル */
.bj20-page .bj-course-header__title {
  font-size: var(--fs-page-hero);
  font-family: var(--serif-jp);
  font-weight: 400;
  letter-spacing: var(--ls-heading);
  margin: 0;
  color: var(--color-text);
}

/* 説明文 */
.bj20-page .bj-course-header__desc {
  font-size: var(--fs-body-sm);
  font-family: var(--sans-jp);
  color: var(--color-text-sub);
  letter-spacing: var(--ls-tight);
  line-height: 1.8;
  margin: 12px 0 4px;
}

/* トピック数 */
.bj20-page .bj-course-header__topic-count {
  font-size: var(--fs-note);
  font-family: var(--sans-jp);
  color: var(--color-text-muted);
  letter-spacing: var(--ls-tight);
  margin: 0 0 20px;
}

/* Stats グループ（進捗 — identity 内） */
.bj20-page .bj-course-header__stats {
  margin-top: 16px;
  margin-bottom: 0;
}

/* 進捗バー */
.bj20-page .bj-course-header__progress {
  margin-bottom: 0;
}

.bj20-page .bj-progress-bar {
  width: 100%;
  max-width: 360px;
  height: 4px;
  background: var(--color-border);
  border-radius: 2px;
  overflow: hidden;
}

.bj20-page .bj-progress-bar__fill {
  height: 100%;
  background: var(--color-accent);
  border-radius: 2px;
  transition: width 0.6s ease;
}

.bj20-page .bj-course-header__progress-text {
  display: inline-block;
  margin-top: 6px;
  font-size: var(--fs-note);
  font-family: var(--sans-jp);
  color: var(--color-text-sub);
  letter-spacing: var(--ls-tight);
}

/* アクション */
.bj20-page .bj-course-header__actions {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* CTA ラッパー（ボタン + サブテキスト） */
.bj20-page .bj-course-header__cta-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

/* CTA サブテキスト */
.bj20-page .bj-course-header__cta-sub {
  font-size: var(--fs-note);
  font-family: var(--sans-jp);
  color: var(--color-text-muted);
  letter-spacing: var(--ls-tight);
}

/* CTA / Resume 幅統一 — コンテナ内全幅 */
.bj20-page .bj-course-header__cta-wrap {
  width: 100%;
}
.bj20-page .bj-course-header .bj-resume-card {
  width: 100%;
  max-width: none;
}
.bj20-page .bj-course-header__subscribe {
  width: 100%;
  justify-content: center;
}

/* CTA ボタン */
.bj20-page .bj-course-header__subscribe {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 28px;
  font-size: var(--fs-body);
  font-family: var(--serif-jp);
  letter-spacing: var(--ls-cta);
  background: var(--color-accent);
  color: #fff;
  border: 1.5px solid var(--color-accent);
  border-radius: 2px;
  text-decoration: none;
  transition: opacity 0.2s, gap 0.3s;
  white-space: nowrap;
}
.bj20-page .bj-course-header__subscribe:hover { opacity: 0.85; gap: 14px; }
.bj20-page .bj-course-header__subscribe svg { transition: transform 0.3s ease; }
.bj20-page .bj-course-header__subscribe:hover svg { transform: translateX(3px); }

/* ボタン共通（コース専用） */
.bj20-page .bj-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 28px;
  font-size: var(--fs-body);
  font-family: var(--serif-jp);
  letter-spacing: var(--ls-cta);
  background: var(--color-accent);
  color: #fff;
  border: 1.5px solid var(--color-accent);
  border-radius: 2px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.bj20-page .bj-btn:hover {
  background: var(--color-kitsurubami-600);
  border-color: var(--color-kitsurubami-600);
}

.bj20-page .bj-btn--outline {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}

.bj20-page .bj-btn--outline:hover {
  background: var(--color-border);
  border-color: var(--color-text-sub);
}

/* トピック数テキスト */
.bj20-page .bj-course-header__topic-count {
  font-size: var(--fs-note);
  font-family: var(--sans-jp);
  color: var(--color-text-muted);
  letter-spacing: var(--ls-tight);
}

/* スマホ: 上段(左2/3ラベル+タイトル, 右1/3アイキャッチ) + 下段(説明文+ボタン 全幅) */
@media (max-width: 767px) {
  .bj20-page .bj-course-header {
    padding: 88px 24px 32px;
  }

  .bj20-page .bj-course-header__inner {
    grid-template-columns: 2fr 1fr;
    gap: 0 16px;
  }

  /* 下段要素を全幅に */
  .bj20-page .bj-course-header__actions {
    grid-column: 1 / -1;
  }

  /* サムネイル */
  .bj20-page .bj-course-header__thumb-wrap {
    max-width: 100%;
  }

  /* ボタン類をフル幅に */
  .bj20-page .bj-course-header__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .bj20-page .bj-course-header__cta-wrap {
    align-items: stretch;
  }
  .bj20-page .bj-course-header__cta-wrap .bj-course-header__subscribe {
    display: flex;
    justify-content: center;
    width: 100%;
  }
  .bj20-page .bj-course-header__cta-sub {
    text-align: center;
  }

  .bj20-page .bj-course-header .bj-resume-card {
    display: flex;
    max-width: 100%;
    width: 100%;
  }

  .bj20-page .bj-course-header .bj-btn {
    display: flex;
    justify-content: center;
    width: 100%;
  }
}


/* ----------------------------------------------------------
   [B] アップセルエリア
   ---------------------------------------------------------- */

.bj20-page .bj-course-upsell {
  background: var(--color-bg-sub);
  color: var(--color-text);
  padding: 60px 40px;
  border-top: 1px solid var(--color-border);
}

/* デフォルト（タブレット）: 5:5 — コースヘッダーと同一 */
.bj20-page .bj-course-upsell__inner {
  max-width: var(--wide-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 48px;
}

/* PC（1200px〜）: 4:6 — コースヘッダーと同一 */
@media (min-width: 1200px) {
  .bj20-page .bj-course-upsell__inner {
    grid-template-columns: 4fr 6fr;
  }
}

/* 上段左: ラベル + タイトル + 説明文 */
.bj20-page .bj-course-upsell__identity {
  grid-column: 1 / 2;
  grid-row: 1 / 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* 上段右: サムネイル — ヘッダーと同じ max-width: 360px 横長 */
.bj20-page .bj-course-upsell__thumb-wrap {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
  max-width: 360px;
  margin-left: auto;
  border-radius: 4px;
  overflow: hidden;
}

.bj20-page .bj-course-upsell__thumb {
  width: 100%;
  height: auto;
  display: block;
}

/* 下段: アクション — 左列内に収める */
.bj20-page .bj-course-upsell__actions {
  grid-column: 1 / 2;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* eyebrow（英字 Onward） */
.bj20-page .bj-course-upsell__eyebrow {
  display: block;
  font-size: var(--fs-label);
  font-family: var(--serif-en);
  letter-spacing: var(--ls-wide);
  color: var(--color-accent);
  margin-bottom: 4px;
}

/* タイトル — ヘッダーの __title と同じ */
.bj20-page .bj-course-upsell__title {
  font-size: var(--fs-page-hero);
  font-family: var(--serif-jp);
  font-weight: 400;
  letter-spacing: var(--ls-heading);
  margin: 0;
  color: var(--color-text);
}

/* 説明文 — ヘッダーの __desc と同じ */
.bj20-page .bj-course-upsell__desc {
  font-size: var(--fs-body-sm);
  font-family: var(--sans-jp);
  color: var(--color-text-sub);
  letter-spacing: var(--ls-tight);
  line-height: 1.8;
  margin: 12px 0 4px;
}

/* CTA ボタン — ヘッダーの __subscribe と同じ構造、アップセル専用のダーク配色 */
.bj20-page .bj-course-upsell__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px 28px;
  font-size: var(--fs-body);
  font-family: var(--serif-jp);
  letter-spacing: var(--ls-cta);
  background: var(--color-surface-dark);
  color: #fff;
  border: 1.5px solid var(--color-surface-dark);
  border-radius: 2px;
  text-decoration: none;
  transition: opacity 0.2s, gap 0.3s, background 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.bj20-page .bj-course-upsell__cta:hover {
  background: var(--color-tetsukon-600);
  border-color: var(--color-tetsukon-600);
  gap: 14px;
}
.bj20-page .bj-course-upsell__cta svg { transition: transform 0.3s ease; }
.bj20-page .bj-course-upsell__cta:hover svg { transform: translateX(3px); }

/* モバイル: ヘッダーと同様 2fr:1fr + actions 全幅 */
@media (max-width: 767px) {
  .bj20-page .bj-course-upsell {
    padding: 40px 24px;
  }

  .bj20-page .bj-course-upsell__inner {
    grid-template-columns: 2fr 1fr;
    gap: 0 16px;
  }

  /* サムネイル */
  .bj20-page .bj-course-upsell__thumb-wrap {
    max-width: 100%;
  }

  /* 下段アクションを全幅 */
  .bj20-page .bj-course-upsell__actions {
    grid-column: 1 / -1;
    flex-direction: column;
    align-items: stretch;
  }

  .bj20-page .bj-course-upsell__cta {
    display: flex;
    justify-content: center;
    width: 100%;
  }
}


/* ----------------------------------------------------------
   [F] フィルターエリア
   ---------------------------------------------------------- */

.bj20-page .bj-course-filter {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  padding: 0 40px;
}

.bj20-page .bj-course-filter__inner {
  max-width: var(--wide-w);
  margin: 0 auto;
  display: flex;
  gap: 0;
}

.bj20-page .bj-course-filter__btn {
  flex-shrink: 0;
  padding: 14px 24px;
  font-size: var(--fs-note);
  font-family: var(--sans-jp);
  letter-spacing: var(--ls-tight);
  color: var(--color-text-sub);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.bj20-page .bj-course-filter__btn:hover {
  color: var(--color-text);
}

.bj20-page .bj-course-filter__btn.is-active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

@media (max-width: 767px) {
  .bj20-page .bj-course-filter {
    padding: 0 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .bj20-page .bj-course-filter__inner {
    min-width: max-content;
  }

  .bj20-page .bj-course-filter__btn {
    padding: 12px 16px;
    font-size: 11px;
  }
}


/* ----------------------------------------------------------
   [C] コンテンツリスト
   ---------------------------------------------------------- */

.bj20-page .bj-course-content {
  background: var(--color-bg);
  padding: 0 0 var(--section-py);
}

.bj20-page .bj-course-content__inner {
  max-width: var(--wide-w);
  margin: 0 auto;
  padding: 0 40px;
}

.bj20-page .bj-course-content__empty {
  padding: 60px 0;
  color: var(--color-text-muted);
  font-size: var(--fs-body);
  text-align: center;
}

/* ③ すべて開く / すべて閉じるツールバー */
.bj20-page .bj-course-content__toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 32px 0 12px;
}

/* フィルター件数カウンター */
.bj20-page .bj-filter-count {
  margin-right: auto;
  font-size: var(--fs-body-sm);
  font-family: var(--sans-jp);
  color: var(--color-text-muted);
  letter-spacing: var(--ls-tight);
}

/* 分子（現在件数）— カウントアップ中だけ accent 色 + 太字 + 少し大きく */
.bj20-page .bj-filter-count__current {
  display: inline-block;
  color: inherit;
  font-weight: 400;
  font-size: 1em;
  transition: color 280ms ease, font-size 280ms ease;
}

.bj20-page .bj-filter-count.is-counting .bj-filter-count__current {
  color: var(--color-accent);
  font-weight: 700;
  font-size: 1.18em;
}

/* トピックの stagger フェード — 列方向: 各レッスン内の同じ位置のトピックが同時にふわっと */
.bj20-page .bj-course-content.is-refreshing .bj-topic {
  animation: bj-topic-fade 2000ms cubic-bezier(0.25, 0.8, 0.3, 1) both;
  animation-delay: min(calc(var(--bj-i, 0) * 100ms), 600ms);
}

@keyframes bj-topic-fade {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .bj20-page .bj-filter-count.is-counting .bj-filter-count__current,
  .bj20-page .bj-course-content.is-refreshing .bj-topic {
    animation: none;
    transition: none;
  }
}

/* Expand/Collapse all アイコンボタン（.bj-view-toggle__btn と同体裁） */
.bj20-page .bj-course-content__toggle-all {
  margin-right: 8px;
}

/* -- レッスンブロック -- */
.bj20-page .bj-lesson {
  border-bottom: 1px solid var(--color-border);
}

.bj20-page .bj-lesson:first-child {
  border-top: 1px solid var(--color-border);
  margin-top: 48px;
}

/* レッスンヘッダー（クリック可） */
.bj20-page .bj-lesson__header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px;
  background: var(--color-bg-sub);
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.bj20-page .bj-lesson__header:hover {
  background: var(--color-border);
}

.bj20-page .bj-lesson__status {
  flex-shrink: 0;
  color: var(--color-accent);
  display: flex;
  align-items: center;
}

.bj20-page .bj-lesson__status-icon {
  color: var(--color-text-muted);
}

.bj20-page .bj-lesson--complete .bj-lesson__status-icon--done {
  color: var(--color-accent);
}

.bj20-page .bj-lesson__title {
  flex: 1;
  font-size: var(--fs-h2);
  font-family: var(--serif-jp);
  font-weight: 400;
  color: var(--color-text);
  letter-spacing: var(--ls-heading);
  margin: 0;
}

.bj20-page .bj-lesson__count {
  font-size: var(--fs-note);
  font-family: var(--sans-jp);
  color: var(--color-text-muted);
  white-space: nowrap;
}

.bj20-page .bj-lesson__toggle-icon {
  flex-shrink: 0;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  transition: transform 0.25s;
}

/* 折りたたみ時: アイコンを反転 */
.bj20-page .bj-lesson__header[aria-expanded="false"] .bj-lesson__toggle-icon {
  transform: rotate(-90deg);
}

/* -- トピックグリッド -- */
.bj20-page .bj-lesson__topics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 24px;
  background: var(--color-bg);
}

/* 折りたたみ */
.bj20-page .bj-lesson__topics[aria-hidden="true"] {
  display: none;
}

.bj20-page .bj-lesson__no-topics {
  grid-column: 1 / -1;
  color: var(--color-text-muted);
  font-size: var(--fs-body-sm);
  padding: 8px 0;
}

@media (max-width: 1024px) {
  .bj20-page .bj-lesson__topics {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .bj20-page .bj-course-content__inner {
    padding: 0 16px;
  }

  .bj20-page .bj-lesson__topics {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px;
  }

  .bj20-page .bj-lesson__header {
    padding: 16px;
  }
}


/* -- トピックカード -- */
.bj20-page .bj-topic {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 4px;
  overflow: hidden;
  background: var(--color-bg);
}

/* サムネイルラッパー */
.bj20-page .bj-topic__thumb-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--color-bg-sub);
}

.bj20-page .bj-topic__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

a.bj-topic:hover .bj-topic__thumb {
  transform: scale(1.05);
}

/* プレースホルダー（サムネイルなし時） */
.bj20-page .bj-topic__thumb-placeholder {
  width: 100%;
  height: 100%;
  background: var(--color-suna-200);
}

/* 非受講者ロック表示 */
.bj20-page .bj-topic--locked .bj-topic__thumb-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(var(--color-black-rgb), 0.55);
  pointer-events: none;
}

.bj20-page .bj-topic__lock-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0.75;
  z-index: 1;
  pointer-events: none;
}

/* ステータスバッジ */
.bj20-page .bj-topic__badge {
  position: absolute;
  top: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: var(--fs-note);
  font-family: var(--sans-jp);
  letter-spacing: var(--ls-tight);
  border-radius: 2px;
  line-height: 1.4;
  z-index: 2;
}

.bj20-page .bj-topic__badge--complete {
  background: var(--color-accent);
  color: #fff;
}

.bj20-page .bj-topic__badge--in-progress {
  background: var(--color-surface-dark);
  color: #fff;
}

/* tier バッジ: 他コース由来のトピックの「上位tier」を英字ラベルで右上に列挙 */
.bj20-page .bj-topic__tier-badges {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  z-index: 2;
  pointer-events: none;
}

.bj20-page .bj-topic__tier-badge {
  background: rgba(var(--color-black-rgb), 0.7);
  color: #fff;
  font-family: var(--sans-jp);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 2px;
  letter-spacing: var(--ls-tight);
  line-height: 1.3;
  font-weight: 400;
}

/* タイトル */
.bj20-page .bj-topic__title {
  font-size: var(--fs-body-sm);
  font-family: var(--sans-jp);
  color: var(--color-text);
  letter-spacing: var(--ls-tight);
  line-height: 1.6;
  margin: 8px 0 0;
  padding: 0 4px;
}


/* ----------------------------------------------------------
   [A-2] Resume カード
   ---------------------------------------------------------- */

.bj20-page .bj-resume-card {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  border-radius: 4px;
  padding: 8px 16px 8px 8px;
  max-width: 380px;
  transition: border-color 0.2s, background 0.2s;
}

.bj20-page .bj-resume-card:hover {
  border-color: var(--color-accent);
  background: var(--color-bg-sub);
}

.bj20-page .bj-resume-card__thumb-wrap {
  position: relative;
  flex-shrink: 0;
  width: 80px;
  height: 45px;
  border-radius: 2px;
  overflow: hidden;
  background: var(--color-bg-sub);
}

.bj20-page .bj-resume-card__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bj20-page .bj-resume-card__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
}

.bj20-page .bj-resume-card__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.bj20-page .bj-resume-card__label {
  font-size: var(--fs-note);
  font-family: var(--serif-en);
  letter-spacing: var(--ls-wide);
  color: var(--color-accent);
  text-transform: uppercase;
  line-height: 1;
}

.bj20-page .bj-resume-card--review .bj-resume-card__label {
  color: var(--color-text-sub);
}

.bj20-page .bj-resume-card__title {
  font-size: var(--fs-body-sm);
  font-family: var(--sans-jp);
  color: var(--color-text);
  letter-spacing: var(--ls-tight);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bj20-page .bj-resume-card__arrow {
  flex-shrink: 0;
  color: var(--color-accent);
}

.bj20-page .bj-resume-card--review .bj-resume-card__arrow {
  color: var(--color-text-muted);
}


/* ----------------------------------------------------------
   [F-2] フィルター検索input
   ---------------------------------------------------------- */

.bj20-page .bj-course-filter__search {
  flex: 1;
  min-width: 100px;
  max-width: 200px;
  margin-left: auto;
  padding: 12px 12px;
  font-size: var(--fs-note);
  font-family: var(--sans-jp);
  letter-spacing: var(--ls-tight);
  color: var(--color-text);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  outline: none;
  transition: border-color 0.15s;
}

.bj20-page .bj-course-filter__search::placeholder {
  color: var(--color-text-muted);
}

.bj20-page .bj-course-filter__search:focus {
  border-bottom-color: var(--color-accent);
}

/* 虫眼鏡（タグフィルター）ボタン */
.bj20-page .bj-course-filter__tag-btn {
  flex-shrink: 0;
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  width: 48px;
  padding: 0;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: color 0.15s;
}

.bj20-page .bj-course-filter__tag-btn:hover {
  color: var(--color-text);
}

.bj20-page .bj-course-filter__tag-btn.is-active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

.bj20-page .bj-course-filter__tag-btn.is-hidden {
  display: none;
}


/* ----------------------------------------------------------
   [C-2] ビュー切替ボタン
   ---------------------------------------------------------- */

.bj20-page .bj-course-content__toolbar {
  justify-content: space-between;
  align-items: center;
}

.bj20-page .bj-view-toggle {
  display: flex;
  gap: 4px;
}

.bj20-page .bj-view-toggle__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: none;
  border: 1.5px solid var(--color-border);
  border-radius: 2px;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: color 0.15s, border-color 0.15s;
}

.bj20-page .bj-view-toggle__btn:hover {
  color: var(--color-text);
  border-color: var(--color-text-sub);
}

.bj20-page .bj-view-toggle__btn.is-active {
  color: var(--color-accent);
  border-color: var(--color-accent);
}


/* ----------------------------------------------------------
   [C-3] リスト表示モード
   ---------------------------------------------------------- */

.bj20-page .bj-course-content--list-view .bj-lesson__topics {
  grid-template-columns: 1fr;
  gap: 0;
  padding: 0;
}

.bj20-page .bj-course-content--list-view .bj-topic {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--color-border);
  border-radius: 0;
}

.bj20-page .bj-course-content--list-view .bj-topic__thumb-wrap {
  flex-shrink: 0;
  width: 80px;
  height: 45px;
  aspect-ratio: unset;
  border-radius: 2px;
  overflow: visible; /* バッジが小さなサムネからはみ出せるよう */
}

/* overflow:visible にした分、画像自体を border-radius でクリップ */
.bj20-page .bj-course-content--list-view .bj-topic__thumb {
  border-radius: 2px;
}

.bj20-page .bj-course-content--list-view .bj-topic__title {
  flex: 1;
  margin: 0;
  padding: 0;
}

/* リスト表示: バッジをアイコンのみの小さな円に縮小（左肩） */
.bj20-page .bj-course-content--list-view .bj-topic__badge {
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  padding: 2px;
  border-radius: 50%;
  font-size: 0; /* テキスト非表示 */
  gap: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bj20-page .bj-course-content--list-view .bj-topic__badge svg {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
}

/* リスト表示では tier バッジを非表示（情報量が増えすぎるため） */
.bj20-page .bj-course-content--list-view .bj-topic__tier-badges {
  display: none;
}

.bj20-page .bj-course-content--list-view .bj-topic__lock-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0.75;
  z-index: 1;
}

@media (max-width: 767px) {
  .bj20-page .bj-course-content--list-view .bj-topic {
    padding: 10px 16px;
  }
}


/* ----------------------------------------------------------
   [E] Fune プレビューセクション
   ---------------------------------------------------------- */

.bj20-page .bj-fune-preview {
  background: var(--color-bg);
  padding: 60px 0 var(--section-py);
  border-top: 2px solid var(--color-border);
}

.bj20-page .bj-fune-preview__inner {
  max-width: var(--wide-w);
  margin: 0 auto;
  padding: 0 40px;
}

.bj20-page .bj-fune-preview__header {
  margin-bottom: 40px;
}

.bj20-page .bj-fune-preview__eyebrow {
  display: block;
  font-size: var(--fs-label);
  font-family: var(--serif-en);
  letter-spacing: var(--ls-wide);
  color: var(--color-accent);
  margin-bottom: 4px;
}

.bj20-page .bj-fune-preview__kanji {
  font-size: var(--fs-kanji);
  font-family: var(--serif-jp);
  font-weight: 500;
  line-height: 1;
  margin-bottom: 8px;
  color: var(--color-text);
}

.bj20-page .bj-fune-preview__title {
  font-size: var(--fs-h2);
  font-family: var(--serif-jp);
  font-weight: 400;
  letter-spacing: var(--ls-heading);
  color: var(--color-text);
  margin: 0 0 12px;
}

.bj20-page .bj-fune-preview__desc {
  font-size: var(--fs-body-sm);
  font-family: var(--sans-jp);
  color: var(--color-text-sub);
  line-height: 2;
  letter-spacing: var(--ls-tight);
  margin-bottom: 24px;
}

.bj20-page .bj-fune-preview__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 28px;
  font-size: var(--fs-body);
  font-family: var(--serif-jp);
  letter-spacing: var(--ls-cta);
  background: var(--color-surface-dark);
  color: #fff;
  border: 1.5px solid var(--color-surface-dark);
  border-radius: 2px;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}

.bj20-page .bj-fune-preview__cta:hover {
  background: var(--color-tetsukon-600);
  border-color: var(--color-tetsukon-600);
}

@media (max-width: 767px) {
  .bj20-page .bj-fune-preview {
    padding: 40px 0 var(--section-py);
  }

  .bj20-page .bj-fune-preview__inner {
    padding: 0 16px;
  }

  .bj20-page .bj-fune-preview__kanji {
    font-size: 28px;
  }
}


/* ----------------------------------------------------------
   タグフィルターモーダル
   ---------------------------------------------------------- */

.bj-tag-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000; /* ヘッダー(9990)・ナビ(9998)より手前 */
}

.bj-tag-modal.is-open {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.bj-tag-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.bj-tag-modal__panel {
  position: relative;
  z-index: 1;
  width: 480px;
  max-width: 100%;
  height: auto;
  max-height: 80vh;
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.bj-tag-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.bj-tag-modal__title {
  font-size: var(--fs-body);
  font-family: var(--serif-jp);
  color: var(--color-text);
  letter-spacing: var(--ls-heading);
}

.bj-tag-modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: color 0.15s;
}

.bj-tag-modal__close:hover {
  color: var(--color-text);
}

.bj-tag-modal__body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.bj-tag-modal__group-label {
  font-size: var(--fs-note);
  font-family: var(--sans-jp);
  color: var(--color-text-sub);
  letter-spacing: var(--ls-tight);
  margin: 0 0 10px;
}

.bj-tag-modal__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bj-tag-chip {
  position: relative;
  cursor: pointer;
}

.bj-tag-chip__input {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.bj-tag-chip__label {
  display: inline-block;
  padding: 5px 12px;
  font-size: var(--fs-note);
  font-family: var(--sans-jp);
  letter-spacing: var(--ls-tight);
  color: var(--color-text-sub);
  background: var(--color-bg-sub);
  border: 1.5px solid var(--color-border);
  border-radius: 99px;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  user-select: none;
}

.bj-tag-chip__input:checked + .bj-tag-chip__label {
  color: #fff;
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.bj-tag-chip:hover .bj-tag-chip__label {
  border-color: var(--color-text-sub);
  color: var(--color-text);
}

.bj-tag-modal__footer {
  display: flex;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;
}

/* .bj20-page button { border:none; background:none } より詳細度を上げるため .bj20-page を前置 */
.bj20-page .bj-tag-modal__reset {
  flex: 1;
  padding: 10px;
  font-size: var(--fs-note);
  font-family: var(--sans-jp);
  letter-spacing: var(--ls-tight);
  color: #2D2B28;
  background: transparent;
  border: 1.5px solid #2D2B28;
  border-radius: 2px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.bj20-page .bj-tag-modal__reset:hover {
  background: #E2E0D4;
}

.bj20-page .bj-tag-modal__apply {
  flex: 2;
  padding: 10px;
  font-size: var(--fs-note);
  font-family: var(--sans-jp);
  letter-spacing: var(--ls-tight);
  color: #fff;
  background: #111B3A;
  border: 1.5px solid #111B3A;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.15s;
}

.bj20-page .bj-tag-modal__apply:hover {
  background: #0E162E;
  border-color: #0E162E;
}

/* キーワード検索入力 */
.bj-tag-modal__keyword {
  padding-bottom: 20px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--color-border);
}

.bj-tag-modal__keyword-input {
  width: 100%;
  padding: 10px 12px;
  font-size: var(--fs-note);
  font-family: var(--sans-jp);
  color: var(--color-text);
  background: #fff;
  border: 1.5px solid var(--color-border);
  border-radius: 2px;
  box-sizing: border-box;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.bj-tag-modal__keyword-input:focus {
  border-color: #6C6B68;
}

@media (max-width: 767px) {
  .bj-tag-modal.is-open {
    align-items: center;
    justify-content: center;
    padding: 16px;
  }

  .bj-tag-modal__panel {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 85vh;
    border-radius: 12px;
  }
}

