@charset "UTF-8";

div.modal-open {
  transition: .5s;
}
button:hover {
  opacity: .5;
}
.modal-bg {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10;
  width: 100%;
  height: auto;
  min-height: 100dvh;
  overflow: auto;
  background-color: rgba(0, 0, 0, .8);
}
.modal {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  min-height: 100dvh;
  gap: 5rem 0;
  margin: 0 auto;
  padding: 5rem;
}
.modal.comic {
  flex-direction: row-reverse;
  flex-wrap: wrap;
  justify-content: flex-start;
  max-width: calc(1200px + 10rem) !important;
}

.left::before {
  display: block;
  width: 100% !important;
  max-width: 600px !important;
  height: 0;
  content: "";
}

@media screen and (max-width: calc(1315px)) {
  .modal.comic {
    justify-content: center;
  }

  .left::before {
    content: none;
  }
}

.modal img {
  z-index: 1000;
  max-width: calc(100vw - 10rem);
  max-height: calc(100vh - 10rem);
}

.modal img.long {
  max-height: fit-content !important;
}

.modal.comic img {
  width: 100% !important;
  max-width: 600px !important;
  height: auto !important;
  max-height: 847px !important;
}

figure {
  display: table;
}

.modal figure img {
  max-height: calc(100vh - 14.5rem);
}

figcaption {
  display: table-caption;
  padding: 1.2rem 2rem;
  background-color: #ffffff;
  font-size: 1.4rem;
  line-height: 1.5;
  caption-side: bottom;
}

.modal-bg.active {
  display: block;
}
/* transition 追記*/
.fade-enter-active, .fade-leave-active {
  animation-name: fade;
  animation-duration: .5s;
}
.fade-leave-active {
  animation-direction: reverse;
}
@keyframes fade {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}




/*スクロールバー*/

.modal-bg::-webkit-scrollbar {
  width: 1.5rem;
}

.modal-bg::-webkit-scrollbar-track {
  background-color: rgb(179, 179, 179);
}

.modal-bg::-webkit-scrollbar-thumb {
  background-color: #000000;
}

@media screen and (max-width: 767px) {
  .modal {
    gap: 2.5rem 0;
    padding: 2.5rem;
  }

  .modal img {
    max-width: calc(100vw - 5rem);
    max-height: calc(100vh - 5rem);
  }

  .modal-bg::-webkit-scrollbar {
    width: .5rem;
  }

  figcaption {
    padding: .6rem 1rem;
    font-size: 1.2rem;
    line-height: 1.3;
  }
}
