.bookshelf {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 20px;
    background: #f5f0e1 repeat; 
    border: 5px solid #d4c2a6;
    border-radius: 10px;
    justify-content: left;
    align-items: end;
}
.spine-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* アニメーションの時間指定 */
.book-nav-items a, .book-nav-items, .book-nav-items::before, .book-nav-items:hover a span {
  transition: all .4s;
}

/* 本体の装飾 */
.book-nav {
  font-size: 16px;
  display: -webkit-flex;
  display:         flex;
  margin: 0;
  padding: 5px 0 1px 0;
  border: 10px solid #967848;
  background-color: #564934;
  box-shadow: 0 -1px 0 0 #bfb19c, 0 5px 2px 0 rgba(0,0,0,.4),0 1px 0 0 #443721,0 -1px 0 0 #bfb19c inset;
}
.book-nav-items {
  position: relative;
  list-style: none;
  flex-basis: 32px;
}
.book-nav-items:nth-of-type(1) {
  border-top: 1px solid #d4a373;
  border-right: 2px solid #7f5539;
  border-bottom: 1px solid #7f5539;
  border-left: 2px solid #d4a373;
  background-color: #a47148;
}
.book-nav-items:nth-of-type(2) {
  border-top: 1px solid #c2b280;
  border-right: 2px solid #8d775f;
  border-bottom: 1px solid #8d775f;
  border-left: 2px solid #c2b280;
  background-color: #a99985;
}
.book-nav-items:nth-of-type(3) {
  border-top: 1px solid #dbc79f;
  border-right: 2px solid #83714c;
  border-bottom: 1px solid #83714c;
  border-left: 2px solid #dbc79f;
  background-color: #bfa974;
}
.book-nav-items:nth-of-type(4) {
  border-top: 1px solid #9cad84;
  border-right: 2px solid #5e6f50;
  border-bottom: 1px solid #5e6f50;
  border-left: 2px solid #9cad84;
  background-color: #78866b;
}
.book-nav-items:nth-of-type(5) {
  border-top: 1px solid #9db8b1;
  border-right: 2px solid #5a6f6c;
  border-bottom: 1px solid #5a6f6c;
  border-left: 2px solid #9db8b1;
  background-color: #7a9e99;
}
.book-nav-items:nth-of-type(6) {
  border-top: 1px solid #8fa3bf;
  border-right: 2px solid #46576c;
  border-bottom: 1px solid #46576c;
  border-left: 2px solid #8fa3bf;
  background-color: #6c7c93;
}

.book-nav-items:nth-of-type(1)::before {
  border-right: 2px solid #7f5539;
  border-left: 2px solid #d4a373;
}
.book-nav-items:nth-of-type(2)::before {
  border-right: 2px solid #8d775f;
  border-left: 2px solid #c2b280;
}
.book-nav-items:nth-of-type(3)::before {
  border-right: 2px solid #83714c;
  border-left: 2px solid #dbc79f;
}
.book-nav-items:nth-of-type(4)::before {
  border-right: 2px solid #5e6f50;
  border-left: 2px solid #9cad84;
}
.book-nav-items:nth-of-type(5)::before {
  border-right: 2px solid #5a6f6c;
  border-left: 2px solid #9db8b1;
}
.book-nav-items:nth-of-type(6)::before {
  border-right: 2px solid #46576c;
  border-left: 2px solid #8fa3bf;
}


.book-nav-items::before {
  position: absolute;
  z-index: -1;
  top: 0;
  display: block;
  width: 100%;
  height: 0;
  content: '';
  background-color: #e8e6dc;
}

.book-nav-items a {
  display: block;
  height: 150px;
  padding: 1px 3px 0 3px;
  transition: all .4s ;
  text-decoration: none;
}
.book-nav-items a span {
  display: inline-block;
  padding: 5px 1px;
  -ms-writing-mode: tb-rl;
  -webkit-writing-mode: vertical-rl;
  writing-mode: vertical-rl;
  /* background-color: #e8e6dc; */
}

/* hover時の挙動 */
.book-nav-items:hover {
  transform: translateY(5px) scale(1,.95);
  transform-origin: center bottom 0;
  box-shadow: 0 20px 2px 0 rgba(0,0,0,.4);
  border-left-color: rgba(0,0,0,.2);
}
.book-nav-items:hover::before {
  top: -10px;
  height: 11px;
}
.book-nav-items:hover a {
  background-color: rgba(0,0,0,.1);
}
.book-nav-items a::before{
    content: "";
    display: block;
    width: 100%;
    height: 100%;
    background: #000000;
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    transition: all .3s ease-in-out;
}
.book-nav-items a:hover::before{
    opacity: .2;
}