/* CODE-D AIインストラクターズ：講座ページ専用（courses/） */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --text: #1a1a1a;
  --text-sub: #555555;
  --surface: #f2f2f2;
  --surface-strong: #e6e6e6;
  --line: #d4d4d4;
  --line-light: #e0e0e0;
  --thumb: #d9d9d9;
  --thumb-planned: #ececec;
  --ink: #1a1a1a;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --brand-light: #f0fdfa;
  --brand-soft: #ccfbf1;
  --player: #1f1f1f;
  --bg: #ffffff;
  --radius: 12px;
  --font: 'Noto Sans JP', sans-serif;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

a {
  color: var(--text);
}

img {
  max-width: 100%;
  display: block;
}

/* ── ヘッダー ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  padding: 12px max(20px, calc((100% - 1200px) / 2 + 20px));
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

/* ── Lab に合わせたヘッダー（一覧） ── */
.site-header-lab {
  justify-content: space-between;
  min-height: 64px;
  padding-top: 0;
  padding-bottom: 0;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  color: #1a1a2e;
  text-decoration: none;
  white-space: nowrap;
}

.header-logo-badge {
  background: var(--brand);
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.header-logo a {
  color: inherit;
  text-decoration: none;
}

.header-logo a:hover {
  color: var(--brand);
}

.header-logo a.header-logo-badge,
.header-logo a.header-logo-badge:hover {
  color: #ffffff;
}

.header-logo a.header-logo-badge:hover {
  background: var(--brand-dark);
}

.header-logo-sub {
  font-size: 14px;
}

.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--brand);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 6px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease;
}

.header-cta:hover {
  background: var(--brand-dark);
  color: #ffffff;
}

/* ── 共通の札 ── */
.tag {
  display: inline-block;
  align-self: flex-start;
  padding: 1px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.tag-light {
  background: var(--brand-light);
  color: var(--brand-dark);
  box-shadow: inset 0 0 0 1px var(--brand-soft);
}

/* ── ボタン ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 24px;
  border-radius: 22px;
  border: 0;
  background: var(--brand);
  color: #ffffff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover {
  background: var(--brand-dark);
  color: #ffffff;
}

/* ── 講座一覧 ── */
.list-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 64px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.list-title {
  font-size: 20px;
  margin-bottom: 16px;
}

.course-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}

.course-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

/* 講座と講座のあいだの区切り：中央に短い横線 */
.course-card + .course-card {
  position: relative;
  padding-top: 24px;
}

.course-card + .course-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 48px;
  height: 2px;
  border-radius: 1px;
  background: var(--line);
  transform: translateX(-50%);
}

.course-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  background: var(--thumb);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 13px;
  color: var(--text-sub);
}

.course-card:not(.is-planned) .course-thumb {
  background: var(--brand-light);
  color: var(--brand-dark);
}

.course-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.course-card.is-planned .course-thumb {
  background: var(--thumb-planned);
}

.course-thumb .tag {
  position: absolute;
  left: 8px;
  top: 8px;
}

/* 準備中：サムネイル全体を暗くして中央に表示 */
.planned-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 24, 28, 0.55);
  color: #ffffff;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.thumb-meta {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.8);
  color: #ffffff;
  font-size: 12px;
}

a.course-card:hover .course-thumb {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

.course-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 4px 0 0;
}

.course-body h2 {
  font-size: 18px;
  line-height: 1.4;
}

.course-card.is-planned h2 {
  color: #444444;
}

/* 講師のアイコンと名前 */
.course-instructor {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}

.avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #bdbdbd;
  overflow: hidden;
}

.course-instructor .avatar {
  width: 40px;
  height: 40px;
}

/* 講師のアイコン。背景が透明な画像なので、丸の地はブランドの淡い色にする */
.avatar:has(img) {
  background: var(--brand-light);
  box-shadow: inset 0 0 0 1px var(--brand-soft);
}

.avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.course-card.is-planned .avatar {
  background: var(--line-light);
}

.instructor-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.4;
}

.instructor-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.instructor-role {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-sub);
}

.unit-badge {
  padding: 0 7px;
  border-radius: 999px;
  background: var(--brand);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.course-desc {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.8;
}

/* YouTube の検索結果のように、1行に1講座。左にサムネイル、右に文字 */
@media (min-width: 641px) {
  .course-grid {
    gap: 32px;
  }

  .course-card + .course-card {
    padding-top: 32px;
  }

  .course-card {
    flex-direction: row;
    align-items: flex-start;
    gap: 28px;
  }

  .course-thumb {
    flex: 0 0 auto;
    width: min(400px, 42%);
  }

  .course-body {
    flex: 1 1 auto;
    min-width: 0;
    gap: 12px;
    padding-top: 6px;
  }

  .course-body h2 {
    font-size: 22px;
  }

  .course-desc {
    margin-top: 6px;
    font-size: 14px;
    max-width: 640px;
  }
}

/* ── チャンネルの帯（講座一覧） ── */
.channel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: -16px;
}

.channel-banner {
  height: 168px;
  border-radius: 16px;
  background: var(--brand-light);
  border: 1px solid var(--brand-soft);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 0 40px;
  overflow: hidden;
}

.channel-art {
  display: block;
  flex-shrink: 0;
  height: 140px;
  width: auto;
}

.channel-text {
  align-self: center;
  min-width: 0;
}

.channel-name {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--brand);
}

.channel-desc {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-sub);
}

.channel-desc span {
  display: block;
}

.channel-lab {
  margin-top: 4px;
}

.channel-lab a {
  color: var(--brand);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.channel-lab a:hover {
  color: var(--brand-dark);
}

/* ── 制作のご案内（一覧の末尾） ── */
.contact-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
  margin-top: 16px;
  padding: 32px 40px;
  border-radius: 16px;
  background: var(--brand);
  color: #ffffff;
}

.contact-text {
  flex: 1 1 420px;
}

.contact-label {
  display: inline-block;
  margin-bottom: 8px;
  padding: 1px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.contact-strip h2 {
  font-size: 22px;
  margin-bottom: 8px;
}

.contact-strip h2 span {
  display: inline-block;
}

.contact-strip p {
  font-size: 14px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.88);
}

.contact-strip p a {
  color: #ffffff;
  font-weight: 700;
  text-underline-offset: 3px;
}

.contact-strip p a:hover {
  color: var(--brand-soft);
}

.contact-strip p span {
  display: block;
}

.contact-btn,
.contact-btn:hover {
  flex-shrink: 0;
  background: #ffffff;
  color: var(--brand-dark);
}

.contact-btn:hover {
  background: var(--brand-light);
}

.site-footer a:hover {
  color: var(--brand);
}

/* ── 講座詳細 ── */
/*
 * 詳細ページの配置。HTML の並びは「プレーヤー → 左の列 → 右の列」で固定し、
 * 標準とワイドはグリッドの配置だけで切り替える（並びを変えると iframe が作り直され、動画が止まる）。
 * 標準：プレーヤーは左の列の上。ワイド：プレーヤーが2列ぶんの帯になる（HintGrip のワイド表示と同じ考え方）。
 */
.watch {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(320px, 3fr);
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "player side"
    "primary side";
  column-gap: 24px;
  row-gap: 16px;
  align-items: start;
}

.watch-player {
  grid-area: player;
  min-width: 0;
}

.watch-primary {
  grid-area: primary;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.watch-secondary {
  grid-area: side;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* プレーヤーの上の行：左に講義・ハンズオンのタブ、右端にワイドの切り替え */
.player-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 44px;
  padding-bottom: 4px;
}

.video-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
}

/* 講義・ハンズオンの切り替え。再生リストのバッジと同じ形のボタンにする */
.video-tab {
  flex-shrink: 0;
  min-height: 32px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg);
  color: var(--text-sub);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.video-tab:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.video-tab[aria-selected="true"] {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
}

.video-tab:focus-visible,
.wide-toggle:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.wide-toggle {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 0;
  background: none;
  color: var(--text-sub);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.wide-toggle:hover {
  color: var(--text);
}

/* ワイド：プレーヤーを2列ぶんの黒い帯にし、動画の幅は画面の高さに収まるように決める */
.watch.is-wide {
  grid-template-areas:
    "player player"
    "primary side";
  padding-top: 0;
}

.watch.is-wide .watch-player {
  /* 一覧と同じ幅の枠から、ウィンドウの幅いっぱいにはみ出させる */
  margin: 0 calc(50% - 50vw);
  background: #000000;
}

.watch.is-wide .watch-player-inner {
  /* 幅 = min(100%, (画面の高さ − ヘッダー 64px − タブの行 44px) × 16/10) */
  width: min(100%, calc((100dvh - 108px) * 16 / 10));
  margin: 0 auto;
}

.watch.is-wide .player {
  border-radius: 0;
}

.watch.is-wide .video-tab {
  border-color: rgba(255, 255, 255, 0.35);
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
}

.watch.is-wide .video-tab:hover {
  border-color: #ffffff;
  color: #ffffff;
}

.watch.is-wide .video-tab[aria-selected="true"] {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
}

.watch.is-wide .wide-toggle:hover {
  color: #ffffff;
}

.watch.is-wide .wide-toggle {
  color: rgba(255, 255, 255, 0.65);
}

.player {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  isolation: isolate;
}

/* 枠の幅が小数のピクセルになっても、すき間から背景が見えないよう1pxずつ広げる */
.player iframe {
  position: absolute;
  top: -1px;
  left: -1px;
  width: calc(100% + 2px);
  height: calc(100% + 2px);
  border: 0;
}

.player-placeholder {
  position: absolute;
  inset: 0;
  background: var(--player);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #e0e0e0;
  font-size: 15px;
}

.watch-heading {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.watch-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: #444444;
}

.watch-heading h1 {
  font-size: 26px;
  line-height: 1.35;
}

.owner-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}

/* 講師の行の左：シリーズの札と講座の種類。講師は右端 */
.owner-row .watch-tags {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  font-size: 12px;
  color: var(--text-sub);
}

.owner-row .owner {
  margin-left: auto;
}

/* 講座タイトル */
.owner-row .watch-course {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.owner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.owner .avatar {
  width: 44px;
  height: 44px;
}

.owner-name {
  font-weight: 700;
  font-size: 15px;
}

.owner-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-sub);
}

/* ── 読みもの（詳細ページ）：HintGrip の MarkdownRenderer に合わせた見た目 ── */
.reading-section {
  border-top: 1px solid var(--line-light);
  padding-top: 20px;
}

.reading-section > h2 {
  font-size: 18px;
  margin-bottom: 12px;
}

/* 幅は動画と同じ。左右に広めの余白をとって、1行の長さを抑える（文字の大きさと行の高さは HintGrip と同じ） */
.reading {
  padding: 24px clamp(16px, 6%, 64px);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 16px;
  line-height: 1.625;
  color: var(--text);
  overflow-wrap: anywhere;
}

.reading h2 {
  margin: 24px 0 16px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.4;
}

.reading > h2:first-child {
  margin-top: 0;
}

.reading h3 {
  margin: 20px 0 12px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
}

.reading h4 {
  margin: 16px 0 8px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
}

.reading p {
  margin-bottom: 16px;
}

.reading ul,
.reading ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

.reading ul {
  list-style: disc;
}

.reading ol {
  list-style: decimal;
}

.reading li + li {
  margin-top: 4px;
}

.reading strong {
  font-weight: 700;
}

.reading a {
  color: var(--brand);
  text-decoration: underline;
}

.reading a:hover {
  color: var(--brand-dark);
}

/* 本文中のコード */
.reading code {
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--surface);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
}

/* コードブロック：中の code の装飾は打ち消す（言語なしのブロックで行ごとに地が付かないように） */
.reading pre {
  margin-bottom: 16px;
  padding: 16px;
  border-radius: 8px;
  background: #111827;
  color: #f3f4f6;
  overflow-x: auto;
  line-height: 1.43;
}

.reading pre code {
  display: block;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-size: 14px;
}

.reading pre code.hljs {
  padding: 0;
  background: transparent;
}

.reading blockquote {
  margin-bottom: 16px;
  padding-left: 16px;
  border-left: 4px solid var(--brand);
  color: var(--text-sub);
  font-style: italic;
}

.reading table {
  display: block;
  max-width: 100%;
  margin-bottom: 16px;
  overflow-x: auto;
  border-collapse: collapse;
  border: 1px solid var(--line);
  font-size: 14px;
}

.reading th,
.reading td {
  padding: 8px 16px;
  text-align: left;
  border-top: 1px solid var(--line-light);
}

.reading th {
  background: var(--surface);
  font-weight: 700;
}

.reading hr {
  margin: 24px 0;
  border: 0;
  border-top: 1px solid var(--line-light);
}

.reading img {
  max-width: 100%;
  height: auto;
  margin: 16px 0;
  border-radius: 8px;
}

/* 数式：ブロックの数式は横にはみ出したらスクロール */
.reading .katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 0;
}

/* 開閉：閉じているときは先頭だけを見せ、下端をぼかす */
.reading.is-collapsed {
  position: relative;
  max-height: 360px;
  overflow: hidden;
}

.reading.is-collapsed::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 0 0 8px 8px;
  height: 96px;
  background: linear-gradient(rgba(255, 255, 255, 0), var(--bg));
  pointer-events: none;
}

.reading-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  margin-top: 8px;
  padding: 0 18px;
  border: 1px solid var(--brand);
  border-radius: 20px;
  background: var(--bg);
  color: var(--brand);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.reading-toggle:hover {
  background: var(--brand-light);
}

.reading-toggle:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.reading-toggle[hidden] {
  display: none;
}

.reading-error {
  color: var(--text-sub);
}

/* 右の列：カリキュラム（再生リスト） */
.playlist {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.playlist-head {
  padding: 14px 16px;
  background: var(--surface);
}

.playlist-head h2 {
  font-size: 17px;
}

.playlist-head span {
  font-size: 12px;
  color: #444444;
}

.playlist-body {
  max-height: 640px;
  overflow-y: auto;
}

.playlist summary {
  padding: 10px 16px;
  font-weight: 700;
  font-size: 14px;
  border-top: 1px solid var(--line-light);
  cursor: pointer;
}

.playlist-item {
  position: relative;
  display: flex;
  gap: 10px;
  width: 100%;
  padding: 8px 16px;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.playlist-item:hover {
  background: var(--surface);
}

.playlist-item:focus-visible,
.playlist-item:has(.playlist-title:focus-visible) {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

/* タイトルのボタン。押せる範囲を行全体に広げ、サムネイルを押しても講義が再生されるようにする */
.playlist-title {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.playlist-title::after {
  content: '';
  position: absolute;
  inset: 0;
}

.playlist-title:focus-visible {
  outline: none;
}

.playlist-item.is-current {
  background: var(--brand-light);
}

.playlist-item.is-current .playlist-text > span:not(.video-badges) {
  color: var(--brand-dark);
  font-weight: 700;
}

.playlist-thumb {
  position: relative;
  flex-shrink: 0;
  width: 120px;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 6px;
  background: var(--thumb);
  display: flex;
  align-items: center;
  justify-content: center;
}

.playlist-item.is-locked .playlist-thumb {
  background: var(--thumb-planned);
}

.playlist-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.duration {
  position: absolute;
  right: 4px;
  bottom: 4px;
  padding: 0 4px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.8);
  color: #ffffff;
  font-size: 11px;
}

.playlist-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
}

.playlist-text > span:not(.video-badges) {
  color: #444444;
  font-size: 12px;
}

/* 講義・ハンズオンのバッジ。再生中の行では、再生している方を塗る（上のタブと対応） */
.video-badges {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 2px 0;
}

/* バッジは押せるボタン。タイトルのボタンの広げた範囲より上に重ねる */
.video-badge {
  display: inline-block;
  min-height: 24px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text-sub);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 22px;
  white-space: nowrap;
  cursor: pointer;
}

.video-badge:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.video-badge:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.video-badge.is-active {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
}

.playlist-rest {
  padding: 6px 16px 12px;
  font-size: 12px;
  color: var(--text-sub);
}

/* 右の列：ほかの講座 */
.related h2 {
  font-size: 15px;
  margin-bottom: 12px;
}

.related-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.related-item {
  display: flex;
  gap: 10px;
  text-decoration: none;
}

.related-thumb {
  position: relative;
  flex-shrink: 0;
  width: 160px;
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  background: var(--thumb-planned);
  overflow: hidden;
}

.related-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 準備中：一覧と同じく、サムネイルを暗くして中央に表示 */
.related-planned {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 24, 28, 0.55);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.related-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
}

.related-text span {
  color: var(--text-sub);
  font-size: 12px;
}

/* 紹介文は3行まで */
.related-text .related-desc {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  line-height: 1.6;
}

/* ── フッター ── */
.site-footer {
  border-top: 1px solid var(--line-light);
  padding: 24px;
  font-size: 12px;
  color: var(--text-sub);
  text-align: center;
}

.site-footer a {
  color: var(--text-sub);
}

/* 画面読み上げ用 */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 900px) {
  .watch,
  .watch.is-wide {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    grid-template-areas:
      "player"
      "primary"
      "side";
    padding-top: 24px;
  }

  .watch.is-wide .watch-player {
    margin: 0;
    background: none;
  }

  .watch.is-wide .watch-player-inner {
    width: 100%;
  }

  .watch.is-wide .player {
    border-radius: var(--radius);
  }

  .watch.is-wide .video-tab {
    border-color: var(--line);
    background: var(--bg);
    color: var(--text-sub);
  }

  .watch.is-wide .video-tab[aria-selected="true"] {
    border-color: var(--brand);
    background: var(--brand);
    color: #ffffff;
  }

  .watch.is-wide .wide-toggle {
    color: var(--text-sub);
  }

  .wide-toggle {
    display: none;
  }
}

@media (max-width: 600px) {
  .reading {
    padding: 16px;
  }

  .site-header {
    flex-wrap: nowrap;
    gap: 8px;
    padding: 10px 20px;
  }

  .list-main,
  .watch {
    padding-left: 20px;
    padding-right: 20px;
  }

  .watch-heading h1 {
    font-size: 22px;
  }

  .owner-row .watch-tags {
    flex-direction: row;
    align-items: center;
  }

  .owner-row .owner {
    margin-left: 0;
  }

  .contact-strip {
    margin-top: 8px;
    padding: 24px 20px;
  }

  .contact-strip h2 {
    font-size: 19px;
  }

  .contact-strip p span {
    display: inline;
  }

  .channel-banner {
    height: auto;
    flex-direction: column;
    align-items: center;
    padding: 14px 16px 0;
    gap: 8px;
  }

  .channel-art {
    height: 80px;
    flex-shrink: 0;
  }

  .channel-name {
    font-size: 18px;
  }

  .site-header-lab {
    min-height: 56px;
  }

  .header-logo {
    gap: 6px;
    font-size: 14px;
  }

  .header-logo-sub {
    font-size: 12px;
  }

  .header-cta {
    padding: 7px 12px;
    font-size: 12px;
  }
}

/* 幅の狭いスマホでは「- AIインストラクターズ」を2行目に回す */
@media (max-width: 420px) {
  .header-logo {
    flex-wrap: wrap;
    row-gap: 0;
  }

  .header-logo-sub {
    flex-basis: 100%;
    font-size: 11px;
    line-height: 1.4;
  }

  .related-thumb {
    width: 128px;
  }
}
