:root{ /* 下記色を指定する際に、代入可能な変数 ページ全体で利用可能 */
    --main-color: #1a3d8c;
    --text-color: #333;
}

html{
    overflow-x: hidden;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #ffffff; /* 白に近い背景色 */
}
header {
    display: flex;
    width: 100%;
    font-family:'Courier New', Courier, monospace;
    text-align: center;
    justify-content: center; /* 横方向センター */
    padding: 20px 0;
    border-bottom: 1px solid #cccccc;
}

header img{
    max-width: 500px;
    width: 100%;
}

.header-link {
    text-decoration: none;    /* 下線を消す */
    color: inherit;           /* リンクカラーを元の色に */
    display: flex;            /* 画像とテキストを横並びにする */
    align-items: center;      /* 縦中央揃え */
    gap: 15px;                /* 画像とテキストの間の余白 */
    max-width: 100%;
}

.header-link:hover,
.header-link:visited,
.header-link:focus {
    text-decoration: none;
    color: inherit;
}

.heading {
    display: grid;
    max-width: 80%;
    padding-top: 0px;
    padding-bottom: 20px;
    margin-bottom: 1.5vh; 
    margin-left: auto;
    margin-right: auto;
}

.heading ul{
    display: flex;
    gap: 0 20px;
    padding: 2px 0;
    justify-content: center;
    list-style: none;
}

.heading a{
    display: block;
    width: 45px;
    height: 20px;
    font-size: 14px;
    font-weight: bold;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    background-color: #E7E6E6;
}

.column1{
    position: relative;
    margin-left: 8vw;
    margin-bottom: 25px;
    padding-left: 15px;
    border-left: 5px solid var(--main-color);
    font-size: 2em;
    font-weight: bold;
    text-align: left;
    color: var(--text-color);
}


.column2{
    position: relative;
    margin-bottom: 25px;
    margin-left: 5vw;
    padding-left: 15px;
    border-left: 5px solid var(--main-color);
    text-align: left;
    color: var(--text-color);
}

.column2::before{
    content: '';
    position: absolute;
    background-color: var(--main-color);
    width: 100%;
    height: 2px;
    left: -25px;
    top: -15px;
}

.book-container{
    display: flex;
    justify-content: center;
    flex-direction: column-reverse;
    width: 90%;
    padding-left: 5vw;
}

.book-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    direction: rtl;
    width: 90%;
    gap: 5vw;
    padding: 20px;
    justify-content: center;
    margin: 0 auto;
}

.new-book-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    direction: ltr;
    width: 90%;
    gap: 5vw;
    padding: 20px;
    justify-content: center;
    margin: 0 auto;
}

.book {
    display: flex;
    flex-direction: column;
    max-width: 400px;
    padding: 0;
    margin-right: 0;
    box-shadow: none;
    text-align: center;
    border-radius: 0;
    transition: transform 0.8s;
    position: relative;
    margin: 0 auto;
}

.book_vacant{
    background-image: url('img/vacant.png');
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 0;
    margin-right: 0;
    box-shadow: none;
    border-radius: 0;
    position: relative;
    margin: 0 auto;
}

.volume {
    font-size: 28px;
    font-weight: bold;
}

.book::after {
    font-size: 24px;
    content: attr(data-caption);
    white-space: pre-line; /* 空白文字の統合処理を防ぐ */
}

.book img {
    width: 100%;
    border: 1px solid #cccccc;
    max-width: fit-content;
}

#scrollToBottom {
    display: none; /* 初期状態では非表示 */
    z-index: 2;
}

#scrollToTop {
    display: none; /* 初期状態では非表示 */
    z-index: 2;
}

footer {
    display: flex;
    width: 100%;
    background-color:#e0e0e0;
    font-family:'Courier New', Courier, monospace;
    color: black; /* 補色 */
    text-align: center;
    align-items: center;
    justify-content: center; /* 横方向センター */
    gap: 15px;
    margin-top: 40px;
    padding: 20px 0;
    border-top: var(--main-color) 1px solid;
    font-size: 16px;
    font-weight: bold;
}

@media (max-width: 1023px) { /* 画面サイズが通常のノートPCより小さい場合に適用 */
    #scrollToBottom {
        position: fixed;
        width: 50px;
        height: 50px;
        bottom: 30px;
        right: 30px;
        padding: 10px 15px;
        background-color: #007bff;
        color: white;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        font-size: 24px;
    }

    #scrollToTop{
        position: fixed;
        width: 50px;
        height: 50px;
        top: 30px;
        right: 30px;
        padding: 10px 15px;
        background-color: #007bff;
        color: white;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        font-size: 24px;
    }

    .book::after{
        font-size: 14px;
    }
}
@media (max-width: 767px) { /* 画面サイズが通常のタブレットより小さい場合に適用 */
    .column1{
        font-size: 1.3em;
    }

    .book-container{
        width: 95%;
    }
    .book-grid {
        width: 95%;
        padding: 2px;
    }

    .volume {
        font-size: 16px;
        font-weight: bold;
    }

}