
*, *:before, *:after {
    box-sizing: border-box;
}
body{
    background-color: #ffffff;
}

main {
    display: flex;
    justify-content: space-between; 
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 1em;
    position: relative;
}
h1{
    font-size: 100px;
    font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
    text-align: center;
}
h2{
    font-size: 40px;
    font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
    font-weight: bold;
}
h3{
    font-size: 20px;
    font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
    font-weight: bold;
}
p{
    font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
    font-size: 18px;
    margin-top: 2vw;
}
p1{
    font-size: 15px;
    font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
    color: #ababab;
}
p2{
    font-size: 14px;
    font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
    color: #0000ff;
}
p3{
    font-size: 14px;
    font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
}
.pan_list{
    margin: 2em 0;
}
.img{
    max-width: 50vw;
    height: 35vw;
    margin-top: 2vw;
    margin-left: 5vw;
    object-fit: contain;
}
pre{
    white-space: pre-wrap;
    font-family: 'BIZ UDPMincho', serif;
    font-size: 18px;
    line-height: 40px;
    letter-spacing: 3px;
}


.amazon.amzn-ad-container{
    display: flex;
    width: 18vw;
}
.amzn-ad-image-holder{
    text-align: left;
}

iframe{
    width: 100%;
    aspect-ratio: 16/9;
}

.repost{
    width: 60vw;
    display: flex;
    margin-top: 1vh;
}
.repost_img{
    width: 20vw;
    height: 14vw;
    object-fit: contain;
    outline: solid 1px #36a6a6;
}
.repost_list{
    width: 60vw;
    display: grid;
}
.repost_right{
    margin-top: 2vw;
    margin-left: 2vw;
    width: 38vw;
}
.repost p1{
    font-size: 20px;
}

#content{ /*新記事*/
    white-space: pre-wrap;
    font-family: 'BIZ UDPMincho', serif;
    font-size: 18px;
    line-height: 40px;
    letter-spacing: 3px;
}
.markdown-body table{
    display: inline-table;
}

.markdown-body img{
    max-width: 50vw;
    height: 35vw;
    margin-top: 2vw;
    margin-left: 5vw;
    object-fit: contain;
}

#toc_container {
    background: #f7f7f7;
    border: 1px solid #e0e0e0;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    float: left;
    margin: 0 auto;
}

#left-sidebar {
    position: absolute;
    top: 25vh;
    left: 1em; 
    width: 20%;
    padding-right: 2em;
    transition: top 0.3s ease;
}
/* JavaScrip「上部固定」用*/
#left-sidebar.sidebar-fixed-top {
    position: fixed;
    top: 20px;
}

.main-content {
    flex-basis: 60%;
    width: 60%;
    margin-left: 20%; 
}

#right-sidebar {
    flex-basis: 20%;
    position: sticky;
    top: 20px;
    align-self: flex-start;
    padding-left: 10em;
    min-height: 300px;
}

/* 目次タイトル */
.toc_title {
    font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
    font-weight: bold;
    font-size: 1.2em;
    text-align: left;
    margin: 0 0 1em 0;
    padding-bottom: 0.5em;
    border-bottom: 1px solid #ccc;
}

/* 目次リスト*/
#toc {
    padding-left: 10px;
    margin: 0;
    text-align: left;
}

#toc li {
    display: list-item !important;
    list-style-type: decimal !important;
    list-style-position: inside !important;
}
#toc li::marker {
    all: revert !important;
}

#toc a {
    text-decoration: none;
    color: #337ab7;
    font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
    font-size: 16px;
}

#toc a:hover {
    text-decoration: underline;
}

/* 記事内画像の中央寄せ */
.markdown-body img {
    display: block;
    margin: 0 auto;
    max-width: 90%;
    height: auto;
}

/* ジャンプ先が見出しで隠れないように調整 */
h4[id] {
    scroll-margin-top: 80px;
}

.repost_list, .add {
    clear: both;
}

.markdown-body hr {
    height: 1px !important;
    background-color: #000000 !important;
    border: none !important; /* github-markdown.cssのborderを打ち消す */
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.markdown-body strong, .markdown-body b {
    font-weight: 775;
}

/* ======== スマートフォン表示用（画面幅が768px以下の場合に適用） ======== */
@media screen and (max-width: 1024px) {
    main {
        flex-direction: column;
        justify-content: flex-start;  /* 縦並びに変更 */
        padding: 0;
    }

    #left-sidebar {
        display: block !important;
        position: static !important;
        width: 100% !important;
        padding: 0 !important;
        margin-top: 2em;
        margin-bottom: 2em;
    }

    #left-sidebar { order: 1; }
    .main-content {
        width: 100%;
        margin-left: 0;
    }

    #toc_container {
        width: 100%;
        margin-bottom: 1em;
        float: none;
    }

    #right-sidebar {
        width: 100%;
        position: static;
        padding: 0;
        margin-bottom: 2em;
        order: 3;
    }

    #left-sidebar,
    .main-content,
    #right-sidebar {
        flex-basis: auto;
        width: 100%;
        position: static; /* スクロール追従を解除 */
        padding: 0;
        margin-bottom: 2em;
        margin-left: 0;
    }

    .markdown-body img {
        display: block;
        margin: 1.5em auto;
        max-width: 95%;
        height: auto;
    }
        #content {
        font-size: 15px;
        line-height: 1.7;
        letter-spacing: 1px;
    }
}

