/* ============================================
   資料ページ用アコーディオン（開閉式セクション）
   Windows(マウス)・iPad(タッチ)両対応
   ============================================ */
.section-toggle {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    display: flex;
    align-items: center;
    padding: 10px 6px;   /* タッチ操作しやすいよう縦方向に余白を確保 */
    margin: 0;
    border-radius: 6px;
    transition: background-color 0.15s ease;
}
.section-toggle:hover {
    background-color: rgba(132, 135, 255, 0.08);
}
.section-toggle:active {
    background-color: rgba(132, 135, 255, 0.16);
}
.section-toggle:focus {
    outline: 2px solid #8487FF;
    outline-offset: 2px;
}
.section-toggle-icon {
    display: inline-block;
    flex-shrink: 0;
    width: 1em;
    margin-right: 0.5em;
    transition: transform 0.2s ease;
    transform: rotate(0deg);   /* 展開状態：下向き（▼） */
}
.section-toggle-icon::before {
    content: "\25BC";
}
.section-toggle.collapsed .section-toggle-icon {
    transform: rotate(-90deg);    /* 折りたたみ状態：右向き相当 */
}
.section-body {
    padding-top: 4px;
}
.accordion-controls {
    margin-bottom: 12px;
}
.accordion-controls .btn {
    margin: 4px;
    min-width: 110px;
    min-height: 40px;  /* iPadでの誤タップ防止のためタップ領域を確保 */
}

/* 印刷時はすべて展開して表示する */
@media print {
    .collapse {
        display: block !important;
        height: auto !important;
    }
    .accordion-controls {
        display: none !important;
    }
    .section-toggle-icon {
        display: none !important;
    }
}

/* ============================================
   セクションの色分け（グループごと）
   タイトル（見出し）は Bootstrap の row > col-md-10 の中にあるため、
   画面幅によって左右に余白が入り、中央寄せの幅になります。
   左の太い線もこれと同じ幅・同じ位置に揃えるため、
   タイトルと全く同じ「row justify-content-center > col-md-10」の
   構造を使った装飾用レイヤー（.accordion-section-bg）を
   セクションの裏側に重ねて表示しています（クリックには反応しません）。
   背景の色付けはタイトル部分のみで、展開した本文には付けていません。
   1: 授業づくり支援・題材指導計画
   2: 生徒用説明書$301CUCJ-1（説明書・マニュアル系）
   3: Webアプリ$301Cメロディサンプルプログラム
   4: センサの役割$301CWord用テンプレート
   5: はんだ付け$301C双方向コンテンツ動画解説
   ============================================ */
.accordion-section {
    position: relative;
    margin-bottom: 6px;
}
.accordion-section-bg {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    pointer-events: none;  /* クリック・タップを妨げない */
    z-index: 0;
}
.accordion-section-bg-inner {
    height: 100%;
    border-left: 8px solid transparent;
}
/* 実際のコンテンツ（見出し・本文）を装飾レイヤーより手前に表示 */
.accordion-section > .row:not(.accordion-section-bg),
.accordion-section > .collapse {
    position: relative;
    z-index: 1;
}

.accordion-section.group-1 .accordion-section-bg-inner {
    border-left-color: #8487FF;
}
.accordion-section.group-2 .accordion-section-bg-inner {
    border-left-color: #2E9E63;
}
.accordion-section.group-3 .accordion-section-bg-inner {
    border-left-color: #F2994A;
}
.accordion-section.group-4 .accordion-section-bg-inner {
    border-left-color: #2F80ED;
}
.accordion-section.group-5 .accordion-section-bg-inner {
    border-left-color: #EB5757;
}

/* 背景色はタイトル部分だけに付ける（展開した本文には付けない） */
.accordion-section.group-1 .section-toggle { background-color: rgba(132, 135, 255, 0.18); }
.accordion-section.group-2 .section-toggle { background-color: rgba(46, 158, 99, 0.18); }
.accordion-section.group-3 .section-toggle { background-color: rgba(242, 153, 74, 0.20); }
.accordion-section.group-4 .section-toggle { background-color: rgba(47, 128, 237, 0.18); }
.accordion-section.group-5 .section-toggle { background-color: rgba(235, 87, 87, 0.18); }

/* ============================================
   6: 機械学習（新カテゴリ・紫）
   サムネイル画像付きのリンクボタン
   ============================================ */
.accordion-section.group-6 .accordion-section-bg-inner {
    border-left-color: #9B51E0;
}
.accordion-section.group-6 .section-toggle { background-color: rgba(155, 81, 224, 0.18); }

.ml-new-badge {
    display: inline-block;
    margin-left: 0.6em;
    padding: 2px 8px;
    font-size: 0.6em;
    font-weight: bold;
    color: #fff;
    background-color: #9B51E0;
    border-radius: 10px;
    vertical-align: middle;
}
.ml-link-btn {
    display: flex;
    align-items: center;
    min-height: 64px;          /* iPadでもタップしやすい高さ */
    padding: 8px 12px;
    color: #fff;
    font-weight: bold;
    background-color: #9B51E0;
    border: 2px solid #9B51E0;
    border-radius: 8px;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.ml-link-btn:hover,
.ml-link-btn:focus {
    color: #9B51E0;
    background-color: #fff;
    text-decoration: none;
}
.ml-link-thumb {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    object-fit: cover;
    margin-right: 12px;
    border-radius: 4px;
    background-color: #fff;
    border: 2px solid #fff;
}
.ml-link-btn span {
    flex: 1;
    text-align: center;
}
