dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 1000px;
  background: #fff;
  border: none;
  padding: 20px;
  border-radius: 10px;
}
dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.75);
}

.pages_button {
    /* 書籍のサンプルページを表示するためのボタン */
    cursor:pointer;
}

/* カルーセル本体 */
.carousel {
  position: relative;
  overflow: hidden;
  width: 100%;
  margin-top: 10px;
}

.carousel-track {
  display: flex;
  transition: transform 0.5s ease;
}

.carousel-item {
  min-width: 100%;
  display: flex;
  justify-content: center;
}

.carousel-item img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 8px;
}

/* 矢印ボタン */
.carousel button.prev,
.carousel button.next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.4);
  color: white;
  border: none;
  font-size: 2rem;
  padding: 10px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
}
.carousel button.prev { left: 10px; }
.carousel button.next { right: 10px; }

/* サムネイル */
/* スマホ用の配置*/
@media (min-width: 520px) {
    .thumbnails {
      display: flex;
      justify-content: flex-start !important;
      flex-wrap: wrap;
      gap: 8px;
      margin: 15px 0;
    }
    
    .thumbnails img {
      position: static;
      width: 80px;
      height: 80px;
      object-fit: cover;
      cursor: pointer;
      border-radius: 6px;
      transition: outline-color 0.3s, transform 0.2s;
      outline: 2px solid transparent;
      margin: 0!important;
    }
    
    .thumbnails img:hover {
      transform: scale(1.05);
    }
    
    .thumbnails img.active {
      outline: 3px solid #007bff; /* 枠線で現在の画像を強調 */
      outline-offset: 2px;
    }

    .close {
        /* 書籍のモーダルウインドウに配置される閉じるボタン */
    display: block;
    margin-left: 46%;
    margin-bottom: 3px;
    background: #787878;
    color: #FFF;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    float: right;
    font-size: 14px;
    }
    .close_character {
        /* 閉じるボタンの×文字　*/
        font-size: 24px;
        vertical-align: middle;
        padding-right: 4px;
    }
    .page_index {
        display: none;
    }
}
@media (max-width: 519px) {
    .thumbnails {
        display: none;
    }
    .close {
        /* 書籍のモーダルウインドウに配置される閉じるボタン */
        display: block;
        margin-left: 46%;
        margin-bottom: 3px;
        background: #787878;
        color: #FFF;
        border: none;
        padding: 5px 10px;
        border-radius: 6px;
        cursor: pointer;
        float: right;
        font-size: 10px;
    }
    .close_character {
        /* 閉じるボタンの×文字　*/
        font-size: 15px;
        vertical-align: middle;
        padding-right: 4px;
    }
}