/* =====================================================================
 * HowHowVideo — レッスン/トピック フルページ・アプリ枠 CSS
 * 対象: learndash-lesson-app.php（template_include で差し替えた自前フルページ）
 * 出所デザイン: docs/design/claude_design_20260615/howhow-learndash.html
 * トークンは howhow-tokens.css (--hh-*) を使用。
 * ===================================================================== */

body.hh-lesson-app {
	margin: 0;
	background: var(--hh-bg, #F5F6FA);
	font-family: var(--hh-font-ja, "Sawarabi Gothic", "Noto Sans JP", system-ui, sans-serif);
	color: var(--hh-ink, #1A1A2E);
}

.hh-app { min-height: 100vh; display: flex; flex-direction: column; padding-bottom: 72px; }

/* 共通キッズ下部ナビ（functions.php が wp_footer で出力する .hh-bnav）を
 * アプリ枠でもビューポート下に全幅固定する。
 * body クラスが hhv-kids-* ではないため learndash-skin.css の固定ルールが当たらず、
 * 既定の display:flex のまま左寄せ＝幅が内容なりになるのを補正する。 */
body.hh-lesson-app .hh-bnav {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	width: 100%;
	justify-content: space-around;
	z-index: 40;
}
/* kids-chrome.css の PC ルール（min-width:900px で flex-start＋flex:0 0 auto）を打ち消し、
 * アプリ枠では常にビューポート全幅で項目を均等配置する（左寄せ解消）。 */
body.hh-lesson-app .hh-bnav a,
body.hh-lesson-app .hh-bnav button {
	flex: 1 1 0;
}

/* ---------- 上バー ---------- */
.hh-app-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 18px;
	background: var(--hh-surface, #fff);
	border-bottom: 1px solid var(--hh-border, #E8ECF1);
	position: sticky;
	top: 0;
	z-index: 30;
}
.hh-app-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.hh-app-brand img { border-radius: 8px; display: block; }
.hh-app-brand-name { font-weight: 900; color: var(--hh-ink, #1A1A2E); font-size: var(--hh-text-md, 16px); }
.hh-app-user { font-size: var(--hh-text-sm, 13px); color: var(--hh-ink-muted, #6B7280); }

/* ---------- 本体 ---------- */
.hh-app-body {
	width: 100%;
	max-width: 1100px;
	margin: 0 auto;
	padding: 18px;
	box-sizing: border-box;
	flex: 1;
}

/* パンくず */
.hh-bc {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	font-size: var(--hh-text-sm, 13px);
	color: var(--hh-ink-muted, #6B7280);
	margin-bottom: 16px;
}
.hh-bc__link { color: var(--hh-ink-muted, #6B7280); text-decoration: none; }
.hh-bc__link:hover { color: var(--hh-primary, #E8473D); text-decoration: underline; }
.hh-bc__sep { color: var(--hh-ink-subtle, #9CA3AF); }
.hh-bc__cur { color: var(--hh-ink, #1A1A2E); font-weight: 700; }

/* グリッド（本文 + トピックサイド） */
.hh-lesson-grid {
	display: grid;
	grid-template-columns: 1fr 280px;
	gap: 20px;
	align-items: start;
}

/* ---------- 本文 ---------- */
.hh-lesson-content {
	background: var(--hh-surface, #fff);
	border: 1px solid var(--hh-border, #E8ECF1);
	border-radius: var(--hh-radius-card, 18px);
	box-shadow: var(--hh-shadow-card, 0 1px 4px rgba(0, 0, 0, .07));
	padding: 22px;
	min-width: 0;
}
.hh-lesson-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 16px;
}
.hh-lesson-h1 {
	margin: 0;
	font-size: var(--hh-text-xl, 24px);
	line-height: 1.3;
	/* .hh-lesson-head は skin.css で教科色グラデ帯になるため、見出しは白で可読性を確保。 */
	color: #fff;
}
.hh-lesson-status {
	flex: none;
	display: inline-flex;
	align-items: center;
	padding: 4px 12px;
	border-radius: var(--hh-radius-pill, 999px);
	font-size: var(--hh-text-xs, 11px);
	font-weight: 700;
}
.hh-lesson-status--done { background: var(--hh-keisan-light, #F0FDF4); color: var(--hh-keisan-dark, #14532D); }
.hh-lesson-status--todo { background: var(--hh-primary-light, #FFF0EF); color: var(--hh-primary-dark, #C13028); }

/* 本文の箇条書き：[hoho_lesson]/[hoho_sec] ラップ外の素の <ul> も含め、
 * 教科カラーの ● に統一する（既定の灰色ディスク・位置ズレ＝「●がへん」を解消）。
 * .hh-rt / .hh-lesson-body 内の li も同一 ::before を後勝ちで上書きするため二重化しない。 */
.hh-lesson-content ul { list-style: none; margin: 0 0 1em; padding: 0; }
.hh-lesson-content ul li {
	position: relative;
	padding-left: 1.4em;
	margin: 0 0 .5em;
	line-height: 1.7;
}
.hh-lesson-content ul li::before {
	content: "●";
	position: absolute;
	left: 0;
	top: 0;
	color: var(--hh-course, var(--hh-ondoku, #22A39F));
	font-size: .7em;
	line-height: 2.45;
}
.hh-lesson-content ol { margin: 0 0 1em; padding-left: 1.5em; }
.hh-lesson-content ol li { margin: 0 0 .5em; line-height: 1.7; }

/* コンテナレッスン（トピックを束ねるだけで本体が空のレッスン）用：本文側トピック一覧。
 * 本文が空でも導線が出るようにする。 */
.hh-lesson-topics { margin-top: 20px; border-top: 1px solid var(--hh-border, #E8ECF1); padding-top: 16px; }
.hh-lesson-topics-hd { font-size: var(--hh-text-sm, 13px); font-weight: 700; color: var(--hh-ink, #1A1A2E); margin-bottom: 10px; }
.hh-lesson-topics-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.hh-lesson-topic { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--hh-border, #E8ECF1); border-radius: var(--hh-radius-md, 14px); text-decoration: none; transition: background .12s ease, border-color .12s ease; }
.hh-lesson-topic:hover { background: var(--hh-bg, #F5F6FA); border-color: var(--hh-border-strong, #D1D5DB); }
.hh-lesson-topic-ic { width: 22px; height: 22px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; }
.hh-lesson-topic-ic.is-done { background: var(--hh-ondoku, #22A39F); }
.hh-lesson-topic-ic.is-todo { background: transparent; border: 2px solid var(--hh-border-strong, #D1D5DB); }
.hh-lesson-topic-name { flex: 1; min-width: 0; font-size: var(--hh-text-sm, 14px); font-weight: 700; color: var(--hh-ink, #1A1A2E); line-height: 1.4; }
.hh-lesson-topic-arrow { color: var(--hh-ink-subtle, #9CA3AF); font-size: 18px; flex: none; }

/* ---------- トピックサイドバー ---------- */
.hh-lesson-side {
	background: var(--hh-surface, #fff);
	border: 1px solid var(--hh-border, #E8ECF1);
	border-radius: var(--hh-radius-card, 18px);
	box-shadow: var(--hh-shadow-card, 0 1px 4px rgba(0, 0, 0, .07));
	overflow: hidden;
	position: sticky;
	top: 72px;
}
.hh-side-hd {
	padding: 14px 16px;
	border-bottom: 1px solid var(--hh-border, #E8ECF1);
	font-size: var(--hh-text-sm, 13px);
	font-weight: 700;
	color: var(--hh-ink, #1A1A2E);
}
.hh-topic-list { list-style: none; margin: 0; padding: 8px 0; }
.hh-topic-link {
	display: flex;
	align-items: center;
	gap: 11px;
	padding: 10px 16px;
	border-left: 3px solid transparent;
	text-decoration: none;
	transition: background .12s ease;
}
.hh-topic-link:hover { background: var(--hh-bg, #F5F6FA); }
.hh-topic-item.is-current .hh-topic-link { background: var(--hh-primary-light, #FFF0EF); border-left-color: var(--hh-primary, #E8473D); }
.hh-topic-ic {
	width: 20px; height: 20px; border-radius: 50%;
	flex: none;
	display: flex; align-items: center; justify-content: center;
	font-size: 11px; font-weight: 700; color: #fff;
}
.hh-topic-ic--done { background: var(--hh-ondoku, #22A39F); }
.hh-topic-ic--current { background: var(--hh-primary, #E8473D); }
.hh-topic-ic--todo { background: transparent; border: 2px solid var(--hh-border-strong, #D1D5DB); }
.hh-topic-name { font-size: var(--hh-text-sm, 13px); font-weight: 700; color: var(--hh-ink, #1A1A2E); line-height: 1.35; }
.hh-topic-item.is-current .hh-topic-name { color: var(--hh-primary-dark, #C13028); }

.hh-side-prog { padding: 14px 16px; border-top: 1px solid var(--hh-border, #E8ECF1); }
.hh-side-prog__hd { font-size: var(--hh-text-xs, 11px); font-weight: 700; color: var(--hh-ink, #1A1A2E); margin-bottom: 8px; }
.hh-side-prog__row { display: flex; justify-content: space-between; font-size: var(--hh-text-xs, 11px); color: var(--hh-ink-muted, #6B7280); margin-bottom: 5px; }
.hh-side-prog__pct { font-weight: 700; color: var(--hh-ondoku, #22A39F); }
.hh-side-prog__track { height: 8px; background: var(--hh-border, #E8ECF1); border-radius: var(--hh-radius-pill, 999px); overflow: hidden; }
.hh-side-prog__bar { height: 100%; background: var(--hh-primary, #E8473D); border-radius: inherit; }
.hh-side-back { display: inline-block; margin-top: 10px; font-size: var(--hh-text-sm, 12px); font-weight: 700; color: var(--hh-primary, #E8473D); text-decoration: none; }
.hh-side-back:hover { text-decoration: underline; }

/* ---------- レスポンシブ ---------- */
@media (max-width: 820px) {
	.hh-lesson-grid { grid-template-columns: 1fr; }
	.hh-lesson-side { position: static; order: 2; }
	.hh-app-body { padding: 14px; }
	.hh-lesson-content { padding: 16px; }
	.hh-lesson-h1 { font-size: var(--hh-text-lg, 20px); }
}

/* =====================================================================
 * コース詳細（learndash-course-app.php / ClaudeDesign PAGE 2）
 * ===================================================================== */
.hh-back-link { display: inline-flex; align-items: center; gap: 6px; font-size: var(--hh-text-sm, 13px); font-weight: 700; color: var(--hh-ink-muted, #6B7280); text-decoration: none; margin-bottom: 16px; }
.hh-back-link:hover { color: var(--hh-ink, #1A1A2E); }

.ld-course-hero { background: var(--hh-surface, #fff); border: 1px solid var(--hh-border, #E8ECF1); border-radius: var(--hh-radius-card, 18px); box-shadow: var(--hh-shadow-card, 0 1px 4px rgba(0, 0, 0, .07)); overflow: hidden; margin-bottom: 20px; }
.ld-hero-top { display: grid; grid-template-columns: 220px 1fr; gap: 0; }
.ld-hero-thumb { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; background: linear-gradient(135deg, var(--hh-course, #22A39F), var(--hh-course-d, #1A7A77)); color: #fff; }
.ld-hero-thumb-emoji { font-size: 48px; line-height: 1; }
.ld-hero-thumb-label { font-size: 14px; font-weight: 700; color: rgba(255, 255, 255, .92); }
.ld-hero-body { padding: 22px 24px; display: flex; flex-direction: column; justify-content: space-between; gap: 16px; min-width: 0; }
.ld-hero-cat { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: var(--hh-text-xs, 11px); font-weight: 700; margin-bottom: 10px; background: var(--hh-course-light, #E8F6F5); color: var(--hh-course-d, #1A7A77); align-self: flex-start; }
.ld-hero-title { font-size: var(--hh-text-lg, 20px); font-weight: 800; color: var(--hh-ink, #1A1A2E); margin-bottom: 8px; line-height: 1.3; }
.ld-hero-meta { display: flex; gap: 16px; font-size: var(--hh-text-xs, 12px); color: var(--hh-ink-muted, #6B7280); flex-wrap: wrap; }
.ld-hero-meta span { display: flex; align-items: center; gap: 4px; }
.ld-hero-progress { margin-bottom: 14px; }
.ld-hero-prog-row { display: flex; justify-content: space-between; margin-bottom: 6px; }
.ld-hero-prog-label { font-size: var(--hh-text-xs, 12px); color: var(--hh-ink-muted, #6B7280); font-weight: 600; }
.ld-hero-prog-pct { font-size: var(--hh-text-sm, 13px); font-weight: 700; color: var(--hh-ink, #1A1A2E); }
.ld-prog-bg { height: 8px; background: var(--hh-border, #E8ECF1); border-radius: 999px; overflow: hidden; }
.ld-prog-fill { height: 100%; border-radius: 999px; background: var(--hh-course, #22A39F); }
.ld-hero-cta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hh-btn-continue { display: inline-flex; align-items: center; gap: 10px; background: var(--hh-course, #22A39F); color: #fff; border: none; border-radius: var(--hh-radius-md, 14px); padding: 13px 28px; font-size: var(--hh-text-md, 16px); font-weight: 700; text-decoration: none; box-shadow: 0 4px 16px rgba(0, 0, 0, .12); transition: filter .15s ease; }
.hh-btn-continue:hover { filter: brightness(.95); }

/* コース冒頭：アプリ枠（漢字辞典など）への誘導カード */
.hh-course-app-cta { display: flex; align-items: center; gap: 14px; margin: 16px 0; padding: 16px 18px; background: var(--hh-course-light, #FFF1E2); border: 1px solid var(--hh-course, #F0922E); border-radius: var(--hh-radius-card, 18px); text-decoration: none; box-shadow: var(--hh-shadow-card, 0 1px 4px rgba(0, 0, 0, .07)); transition: filter .15s ease, transform .15s ease; }
.hh-course-app-cta:hover { filter: brightness(.98); transform: translateY(-1px); }
.hh-course-app-cta .hh-cta-icon { flex-shrink: 0; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; font-size: 26px; background: var(--hh-course, #F0922E); border-radius: 14px; }
.hh-course-app-cta .hh-cta-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.hh-course-app-cta .hh-cta-title { font-size: var(--hh-text-md, 16px); font-weight: 700; color: var(--hh-course-d, #B46018); }
.hh-course-app-cta .hh-cta-sub { font-size: var(--hh-text-xs, 12px); font-weight: 600; color: var(--hh-ink-sub, #7A6A5D); line-height: 1.5; }
.hh-course-app-cta .hh-cta-arrow { flex-shrink: 0; font-size: 24px; font-weight: 700; color: var(--hh-course, #F0922E); }

.ld-lesson-section { background: var(--hh-surface, #fff); border: 1px solid var(--hh-border, #E8ECF1); border-radius: var(--hh-radius-card, 18px); box-shadow: var(--hh-shadow-card, 0 1px 4px rgba(0, 0, 0, .07)); overflow: hidden; }
.ld-lesson-sec-hd { padding: 15px 20px; border-bottom: 1px solid var(--hh-border, #E8ECF1); display: flex; align-items: center; justify-content: space-between; }
.ld-lesson-sec-title { font-size: var(--hh-text-md, 15px); font-weight: 700; color: var(--hh-ink, #1A1A2E); }
.ld-lesson-sec-meta { font-size: var(--hh-text-xs, 12px); color: var(--hh-ink-muted, #6B7280); }
.ld-lesson-list { list-style: none; margin: 0; padding: 0; }
.ld-lesson-item { display: flex; align-items: center; gap: 14px; padding: 13px 20px; border-bottom: 1px solid var(--hh-border, #E8ECF1); text-decoration: none; transition: background .12s ease; }
.ld-lesson-list li:last-child .ld-lesson-item { border-bottom: none; }
.ld-lesson-item:hover { background: var(--hh-bg, #F5F6FA); }
.ld-lesson-item.ld-current { background: var(--hh-primary-light, #FFF0EF); }
.ld-lesson-item.ld-done { opacity: .7; }
.ld-state-icon { width: 24px; height: 24px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; }
.ld-state-icon.state-done { background: var(--hh-ondoku, #22A39F); }
.ld-state-icon.state-current { background: var(--hh-primary, #E8473D); }
.ld-state-icon.state-todo { background: transparent; border: 2px solid var(--hh-border-strong, #D1D5DB); }
.ld-lesson-body { flex: 1; min-width: 0; }
.ld-lesson-name { font-size: var(--hh-text-sm, 14px); font-weight: 700; color: var(--hh-ink, #1A1A2E); line-height: 1.4; }
.ld-lesson-item.ld-current .ld-lesson-name { color: var(--hh-primary-dark, #C13028); }
.ld-lesson-sub { font-size: var(--hh-text-xs, 11px); color: var(--hh-ink-muted, #6B7280); margin-top: 2px; display: flex; gap: 8px; }
.ld-lesson-dur { font-size: var(--hh-text-xs, 11px); color: var(--hh-ink-subtle, #9CA3AF); flex: none; }
.ld-now-badge { background: var(--hh-primary, #E8473D); color: #fff; font-size: 10px; font-weight: 700; border-radius: 999px; padding: 3px 10px; flex: none; }

@media (max-width: 820px) {
	.ld-hero-top { grid-template-columns: 1fr; }
	.ld-hero-thumb { height: 120px; }
}
