/* ============================================
   TOC（目次）チップ化スタイル
   modules/toc/toc-style.css
   2026-01-24 完全版（空チップ対応）
   ============================================ */

/* TOC 全体 */
.t8-toc {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    counter-reset: toc-cat;
}

/* カテゴリ（H2 相当） */
.t8-toc .toc-category {
    margin-bottom: 6px;
    counter-increment: toc-cat;
}

/* カテゴリラベル（左揃え + 幅を持たせる） */
.t8-toc .toc-category-label {
    font-weight: 600;
    font-size: 15px;
    color: #bcd4ff;
    text-decoration: none;
    display: inline-block;
    margin-bottom: 6px;
    text-align: left;
    min-width: 140px;
}

/* カテゴリ番号付与 */
.t8-toc .toc-category-label::before {
    content: counter(toc-cat) ". ";
    font-weight: 700;
    margin-right: 4px;
    color: #e6e6ff;
}

/* カテゴリヘッダー（ラベル + 開閉ボタン） */
.t8-toc .toc-category-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

/* ============================================
   CSS三角形アイコン（フォント依存ゼロ）
   ============================================ */
.t8-toc .toc-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 16px;
    height: 16px;
    position: relative;
}

/* ▶（閉じている状態） */
.t8-toc .toc-toggle::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, calc(-50% - 2px));
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 8px solid #bcd4ff;
    transition:
        border-left 0.25s ease,
        border-right 0.25s ease,
        border-top 0.25s ease,
        border-bottom 0.25s ease;
}

/* ▼（開いている状態） */
.t8-toc .toc-toggle.open::before {
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid #bcd4ff;
}

/* ============================================
   スライド開閉 + 4列グリッド
   ============================================ */
.t8-toc .toc-starts {
    list-style: none;
    padding: 0;
    margin: 0;

    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-4px);
    transition:
        max-height 0.28s ease,
        opacity 0.28s ease,
        transform 0.28s ease;

    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px 10px;
}

/* 開いているとき */
.t8-toc .toc-starts.is-open {
max-height: 999px; /* とりあえず大きく */
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   チップ化（ダークモード最適化）
   ============================================ */
.t8-toc .toc-chip {
    display: inline-block;
    padding: 4px 10px;
    background: #2a2f45;
    border-radius: 12px;
    font-size: 13px;
    color: #dbe4ff;
    text-decoration: none;
    border: 1px solid #3f4a6b;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    white-space: nowrap;
}

.t8-toc .toc-chip:hover {
    background: #343c5a;
    border-color: #7d8cff;
    transform: translateY(-1px);
}

/* ★ 空チップ（空行 → スペーサー） */
.t8-toc .toc-chip.empty {
    visibility: hidden;      /* 見えない */
    pointer-events: none;    /* クリック不可 */
    border: none;            /* 枠線も消す */
    padding: 4px 10px;       /* 高さは通常チップと揃える */
display: inline-block;
	height: 22px; 	/* ← これが最重要 */ 
	min-height: 22px; /* ← 保険として */
}

/* スマホ対応（2列） */
@media (max-width: 600px) {
    .t8-toc .toc-starts {
        grid-template-columns: repeat(2, 1fr);
    }
    .t8-toc .toc-chip {
        font-size: 12px;
        padding: 4px 8px;
    }
}

/* 目次タイトル */
.t8-toc-title {
  display: block;
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  margin: 6px 0 10px;
  opacity: 0.85;
}
