/* 目次の外枠 */
#main #toc_container {
    background: #f9f9f9;
    border: 1px solid #aaa;
    padding: 10px;
    margin-bottom: 1em;
    width: auto;
    display: block;
    box-sizing: border-box;
    font-size: 95%;
}

/* 開閉ボタン */
#main #toc_container .toc_title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 !important;
    padding: 6px;
    text-align: left;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

/* ブラウザ標準のマーカーを非表示 */
#main #toc_container .toc_title::-webkit-details-marker {
    display: none;
}

#main #toc_container .toc_title::marker {
    content: "";
}

/* 操作案内 */
#main #toc_container .toc_hint {
    margin-left: auto;
    font-size: 12px;
    font-weight: normal;
    color: #666;
}

#main #toc_container ul li.link-wrapper.h2 a{
    font-weight: bold;
}

/* 開閉用の矢印 */
#main #toc_container .toc_title::after {
    content: "";
    position: static;
    flex-shrink: 0;
    box-sizing: content-box;
    width: 7px;
    height: 7px;
    margin: -4px 3px 0 0;
    padding: 0;
    background: none;
    border: 0;
    border-right: 2px solid #524229;
    border-bottom: 2px solid #524229;
    transform: rotate(45deg);
}

/* 開いているときの矢印 */
#main #toc_container .toc_accordion[open] > .toc_title::after {
    margin-top: 4px;
    transform: rotate(225deg);
}

/* キーボード操作時のフォーカス表示 */
#main #toc_container .toc_title:focus-visible {
    outline: 2px solid #524229;
    outline-offset: 3px;
}

/* 目次リスト */
#main #toc_container ul.toc_list {
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}

/* 各項目 */
#main #toc_container ul li.link-wrapper {
    position: relative;
    background: none;
    font-size: 16px;
    line-height: 1.5;
    margin: 7px 0 0;
    padding: 0 0 0 18px;
    width: auto;
    list-style: none;
}

/* 見出し階層ごとの字下げ */
#main #toc_container ul li.link-wrapper.h3 {
    margin-left: 1.5em;
}

#main #toc_container ul li.link-wrapper.h4 {
    margin-left: 2.5em;
}

/* 各項目の左側の三角形 */
#main #toc_container ul li.link-wrapper::before {
    content: "";
    position: absolute;
    top: 8px;
    left: 0;
    box-sizing: content-box;
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
    background: none;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 6px solid #524229;
    border-right: 0;
}

/* 既存のリスト装飾との重複を防止 */
#main #toc_container ul li.link-wrapper::after {
    content: none;
}

/* 目次リンク */
#main #toc_container a {
    display: inline-block;
    width: fit-content;
    max-width: 100%;
    color: #524229;
    text-decoration: underline;
    overflow-wrap: anywhere;
}

#main #toc_container .link-wrapper.h3 a{
  font-size: 14px;
}

#main #toc_container .link-wrapper.h4 a{
  font-size: 12px;
}
