/* style.css */
body {
    font-family: "ヒラギノ角ゴ Pro W3", "メイリオ", "Meiryo", "Hiragino Kaku Gothic Pro", Myriad Pro, Myriad, Arial, sans-serif;
    background-color: #f0f0f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100vh;
    margin: 0;
    overflow: hidden;
}

#container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

#flipbook {
    width: auto;
    height: auto;
}

#flipbook-container {
    width: 100%;
    height: calc(100vh - 50px);  /* フッターの高さ分だけ余白を確保 */
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 50px;  /* フッター分の余白 */
}

#footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #fff;
    padding: 5px;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;  /* フッターを常に最前面に表示 */
}

#footer span, #footer button, #footer a {
    margin: 0 5px;
    padding: 5px 10px;
    color: #333;
    border: none;
    border-radius: 5px;
    text-align: center;
    cursor: pointer;
    flex-shrink: 0;
}

#footer span {
    background-color: transparent;
    color: #000;
}

#pdf-link {
    background-color: #f0f0f0;
    text-decoration: none;
}

#toc {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    height: 100%;
    background-color: #fff;
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    z-index: 999;
}

#toc.visible {
    transform: translateX(0);
}

#toc h2 {
    margin-top: 0;
}

#toc ul {
    list-style: none;
    padding: 0;
}

#toc ul li {
    margin-bottom: 10px;
}

#toc ul li a {
    text-decoration: none;
    color: #007bff;
    cursor: pointer;
}

#close-toc {
    margin-top: 20px;
    padding: 10px 20px;
    background-color: #d15151;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.page {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

.page img {
    width: 100%;
    height: auto;
    max-width: 100%;  /* 画像の幅がページの幅を超えない */
    max-height: 100%; /* 画像が表示領域に収まるようにする */
    object-fit: contain;  /* アスペクト比を維持 */
    display: block;
    margin: 0 auto;
}

/* Responsive design for small devices */
@media (max-width: 768px) {
    #footer {
        flex-wrap: nowrap;
        justify-content: center;
    }

    #footer span, #footer button, #footer a {
        margin: 0 3px;
        padding: 10px;
        font-size: 0.8rem;
    }

    #flipbook {
        height: auto;
    }

    .page img {
        height: auto;
        max-width: 100%;
    }
}
