@charset "UTF-8";

/* ============================
   学習コース詳細ページ
   ============================ */

body {
    background-color: #f4f6f8; /* 目に優しい薄いグレー */
}

/* ヘッダー */
.course-header {
    background: #fff;
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid #ddd;
    position: fixed;
    top: 0; left: 0; width: 100%;
    z-index: 100;
}

.back-link {
    font-size: 0.9rem;
    color: #666;
    margin-right: 30px;
    font-weight: bold;
}

.back-link:hover {
    color: #00b4d8;
}

.course-title {
    font-weight: bold;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* レイアウトコンテナ */
.course-container {
    display: flex;
    margin-top: 60px; /* ヘッダー分空ける */
    height: calc(100vh - 60px); /* 画面いっぱいの高さ */
}

/* 左サイドバー (目次) */
.course-sidebar {
    width: 350px;
    background: #fff;
    border-right: 1px solid #ddd;
    overflow-y: auto;
    padding: 20px 0;
    flex-shrink: 0;
}

.course-sidebar h3 {
    font-size: 0.9rem;
    color: #888;
    padding: 0 20px 15px;
    margin-bottom: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.chapter-list {
    list-style: none;
    padding: 0;
}

.chapter-item {
    padding: 15px 20px;
    border-bottom: 1px solid #f9f9f9;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chapter-item:hover {
    background: #f0fbff;
}

.chapter-item.active {
    background: #eefbff;
    border-left: 4px solid #00b4d8;
}

.chapter-num {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.8rem;
    color: #aaa;
}

.chapter-title {
    font-size: 0.9rem;
    font-weight: bold;
    color: #444;
    flex-grow: 1;
}

.chapter-item.active .chapter-title {
    color: #00b4d8;
}

.time {
    font-size: 0.7rem;
    color: #999;
    background: #eee;
    padding: 2px 6px;
    border-radius: 4px;
}

.chapter-item.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

/* メインコンテンツ */
.course-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 40px;
}

.video-area {
    width: 100%;
    max-width: 900px;
    aspect-ratio: 16 / 9;
    background: #000;
    margin-bottom: 30px;
    border-radius: 8px;
    overflow: hidden;
}

.video-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    background: #222;
    font-weight: bold;
}

.text-area {
    max-width: 900px;
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.text-area h1 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: #333;
}

.text-area h2 {
    font-size: 1.3rem;
    margin-top: 30px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f4f6f8;
}

.text-area p {
    line-height: 1.8;
    color: #555;
    margin-bottom: 20px;
}

.text-area ul {
    list-style: disc;
    padding-left: 20px;
    margin-bottom: 20px;
    color: #555;
}

.text-area li {
    margin-bottom: 10px;
}

.tips-box {
    background: #fffbe6;
    border: 1px solid #ffe58f;
    padding: 20px;
    border-radius: 6px;
    margin: 30px 0;
}

.tips-box strong {
    color: #d48806;
    display: block;
    margin-bottom: 10px;
}

.tips-box p {
    margin: 0;
    font-size: 0.95rem;
}

.action-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.btn-prev, .btn-next {
    padding: 12px 25px;
    border-radius: 6px;
    font-weight: bold;
    text-decoration: none;
    font-size: 0.9rem;
}

.btn-prev {
    background: #eee;
    color: #888;
}

.btn-prev.disabled {
    opacity: 0.5;
    cursor: default;
}

.btn-next {
    background: #00b4d8;
    color: #fff;
}

.btn-next:hover {
    background: #0096c7;
}

/* スマホ対応 */
@media (max-width: 900px) {
    .course-container {
        flex-direction: column;
        height: auto;
    }
    .course-sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #ddd;
    }
    .course-content {
        padding: 20px;
    }
    .text-area {
        padding: 20px;
    }
}
/* サイドバー内のダウンロードエリア */
.sidebar-download {
    padding: 20px;
    background: #eefbff;
    border-bottom: 1px solid #bce6f5;
    text-align: center;
}

.sidebar-download p {
    font-size: 0.8rem;
    font-weight: bold;
    color: #0077b6;
    margin-bottom: 10px;
}

.btn-download {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 2px solid #00b4d8;
    color: #00b4d8;
    padding: 10px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 0.9rem;
    transition: all 0.3s;
    line-height: 1.4;
}

.btn-download .icon {
    font-size: 1.2rem;
    margin-right: 10px;
}

.btn-download:hover {
    background: #00b4d8;
    color: #fff;
    box-shadow: 0 5px 10px rgba(0, 180, 216, 0.2);
}

/* ===== course reader (WP) ===== */
.course-sidebar{
    position: sticky; top:80px; align-self: start;
    display:flex; flex-direction:column; max-height: calc(100vh - 96px);
}
.sub-category-badges{
    padding: 0 25px 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.sub-category-badges .badge{
    display: inline-block;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    background: #f0f0f0;
    color: #666;
    border: 1px solid #ddd;
}
.sub-category-badges .badge:hover{
    background: #e0e0e0;
    border-color: #bbb;
}
.sub-category-badges .badge.active{
    background: #00b4d8;
    color: #fff;
    border-color: #00b4d8;
}
.sub-category-badges .badge.loading,
.sub-category-badges .badge.error{
    cursor: default;
    background: #f9f9f9;
    color: #999;
    border-color: #eee;
}
.scratch-list{
    list-style:none; margin:12px 0 0; padding:0 5px;
    display:flex; flex-direction:column; gap:8px;
    flex:1 1 auto; overflow:auto; -webkit-overflow-scrolling: touch;
}
.scratch-list li{
    border:1px solid #e9ecef; border-radius:10px; background:#fff;
    padding:10px 12px; cursor:pointer; line-height:1.4;
    transition: background .2s, border-color .2s, box-shadow .2s;
}
.scratch-list li:hover{ background:#f7fbff; border-color:#cfeaf4; box-shadow:0 6px 16px rgba(0,0,0,.04); }
.scratch-list li.is-active{ background:#eaf8ff; border-color:#bfe9f7; }
.scratch-list li .title{ font-weight:700; }
.scratch-list li .date{ font-size:.8rem; color:#667085; }
.scratch-article{
    background:#fff; border:1px solid #e9ecef; border-radius:12px;
    box-shadow:0 6px 18px rgba(0,0,0,.04);
    padding:18px 20px; min-height:260px; max-width:900px;
    max-height: calc(100vh - 96px); overflow:auto; -webkit-overflow-scrolling: touch;
}
.article-title{ font-weight:900; font-size:1.4rem; margin:0 0 8px; }
.article-meta{ font-size:.9rem; color:#667085; margin-bottom:16px; }
.article-empty, .article-loading, .article-error{ color:#667085; }
.wp-content img, .wp-content figure{ max-width:100%; height:auto; }
.wp-content iframe { width: 100%; height: auto; aspect-ratio: 16/9; max-width: 100%; }
.wp-content figure{ margin: 12px 0; }
.wp-content figcaption{ font-size:.85rem; color:#777; text-align:center; }
.wp-content h2{ font-size:1.25rem; margin:1.2em 0 .6em; }
.wp-content h3{ font-size:1.1rem; margin:1em 0 .5em; }
.wp-content p{ margin:.6em 0; line-height:1.8; }
.wp-content ul, .wp-content ol{ padding-left: 1.4em; margin:.6em 0; }
.wp-content pre{ background:#0f172a; color:#e2e8f0; padding:12px; border-radius:8px; overflow:auto; }
.wp-content code{ background:#f6f8fa; padding:.1em .35em; border-radius:6px; }
/* Prism.js コードブロックのフォントをシャープに */
.wp-content pre[class*="language-"],
.wp-content code[class*="language-"],
.wp-content .hcb_wrap pre,
.wp-content .hcb_wrap code,
.wp-content .hcb_wrap pre code {
    font-family: 'Consolas', 'Monaco', 'Courier New', 'Menlo', monospace !important;
    font-size: 14px;
    line-height: 1.6;
    font-weight: 400 !important;
    -webkit-font-smoothing: subpixel-antialiased !important;
    -moz-osx-font-smoothing: auto !important;
    text-rendering: optimizeSpeed !important;
    letter-spacing: 0;
    text-shadow: none !important;
    -webkit-text-stroke: 0 !important;
    font-variant-ligatures: none !important;
    font-feature-settings: normal !important;
}
/* コードブロック内のすべての要素からテキストシャドウとアウトラインを削除 */
.wp-content pre[class*="language-"] *,
.wp-content code[class*="language-"] *,
.wp-content .hcb_wrap pre *,
.wp-content .hcb_wrap code * {
    -webkit-font-smoothing: subpixel-antialiased !important;
    -moz-osx-font-smoothing: auto !important;
    text-rendering: optimizeSpeed !important;
    text-shadow: none !important;
    -webkit-text-stroke: 0 !important;
    font-weight: 400 !important;
}
/* Prism.jsのテーマが適用しているスタイルを上書き */
.wp-content .token,
.wp-content pre[class*="language-"] .token {
    text-shadow: none !important;
    -webkit-text-stroke: 0 !important;
    font-weight: 400 !important;
}
@media (max-width: 900px){
    .course-sidebar{ position: static; max-height: none; }
    .scratch-list{ overflow: visible; }
    .scratch-article{ max-height: none; overflow: visible; }
}
