/* モーダル（TOP用 imageOnly） */
#modal,
#top-modal {
  display: none;
}

.c-modal_inner {
  position: relative;
  max-width: 1024px;
  margin: auto;
  margin-top: 80px;
  margin-bottom: 80px;
  padding: 48px 32px;
  border: solid 1px #333;
  background-color: #fff;
}

.c-modal_close {
  font-size: 0;
  position: absolute;
  top: 12px;
  right: 30px;
  width: 32px;
  height: 32px;
}

.c-modal_body {
  margin-top: 24px;
}

[data-js-modal] {
  position: absolute;
  z-index: 5000;
  top: 0;
  left: 0;
  display: none;
  width: 100%;
  height: 100%;
}

[data-js-modal_bg] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(121, 121, 121, 0.5);
}

[data-js-modal_container] {
  position: relative;
  width: 75%;
  max-width: 1000px;
  margin: 0 auto;
  opacity: 0;
}

[data-js-modal_correct_right] {
  margin-right: 15px;
}

[data-js-modal_fixed] {
  overflow: hidden !important;
}

[data-js-modal_fixed] body,
[data-js-modal_fixed] button,
[data-js-modal_fixed] input,
[data-js-modal_fixed] option,
[data-js-modal_fixed] select,
[data-js-modal_fixed] textarea {
  overflow: hidden !important;
}

[data-js-modal_fixed] [data-js-modal_bg] {
  position: fixed;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

[data-js-modal]:has(.c-modal_inner--imageOnly) {
  overflow: hidden !important;
}

[data-js-modal_bg]:has(.c-modal_inner--imageOnly),
[data-js-modal_fixed] [data-js-modal_bg]:has(.c-modal_inner--imageOnly) {
  overflow: hidden !important;
  overflow-y: hidden !important;
  -webkit-overflow-scrolling: auto;
}

[data-js-modal_container]:has(.c-modal_inner--imageOnly) {
  display: flex;
  overflow: hidden !important;
  width: 100vw;
  max-width: none;
  height: 100vh;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.c-modal_inner--imageOnly {
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100vw;
  height: 100%;
  min-height: 0;
  max-height: 100vh;
  margin: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding: 0;
  border: none;
  background: transparent;
}

.c-modal_inner--imageOnly .p-topModal_bodyWrap {
  position: absolute;
  top: 50%;
  left: 50%;
  width: auto;
  max-width: calc(100vw - 130px);
  height: auto;
  transform: translate(-50%, -50%);
}

.c-modal_inner--imageOnly .c-modal_body {
  line-height: 0;
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  margin: 0;
  padding: 0;
  text-align: center;
}

.c-modal_inner--imageOnly .c-modal_body img,
.c-modal_inner--imageOnly .c-modal_body picture {
  display: block;
  margin-right: auto;
  margin-left: auto;
}

.c-modal_inner--imageOnly .p-topModal_img {
  display: block;
  width: auto !important;
  max-width: min(calc(100vw - 130px), calc((100vh - 160px) * 820 / 640));
  height: auto !important;
  max-height: min(calc(100vh - 160px), calc((100vw - 130px) * 640 / 820));
  margin-top: 0;
  vertical-align: top;
  object-fit: contain;
  aspect-ratio: 820 / 640;
}

.c-modal_inner--imageOnly .c-modal_close {
  font-size: 0;
  position: absolute;
  z-index: 1;
  top: 0;
  right: -50px;
  width: 50px;
  height: 50px;
}

.c-modal_inner--imageOnly .c-modal_close > a.p-topModal_closeBtn {
  position: relative;
  display: block;
  overflow: visible;
  width: 100%;
  height: 100%;
  text-indent: -9999px;
  border-radius: 0 3px 3px 0;
  background: #5b5b5b;
}

.c-modal_inner--imageOnly .c-modal_close > a.p-topModal_closeBtn::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 3px;
  margin-top: -1.5px;
  margin-left: -16px;
  content: '';
  transform: rotate(45deg);
  transform-origin: 50% 50%;
  opacity: 0.9;
  background: #fff;
}

.c-modal_inner--imageOnly .c-modal_close > a.p-topModal_closeBtn::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 3px;
  margin-top: -1.5px;
  margin-left: -16px;
  content: '';
  transform: rotate(-45deg);
  transform-origin: 50% 50%;
  opacity: 0.9;
  background: #fff;
}

@media screen and (max-width: 767px) {
  .c-modal_inner--imageOnly .p-topModal_bodyWrap {
    max-width: calc(100vw - 56px);
  }

  .c-modal_inner--imageOnly .p-topModal_img {
    max-width: min(calc(100vw - 56px), calc((100vh - 160px) * 320 / 550));
    max-height: min(calc(100vh - 160px), calc((100vw - 56px) * 550 / 320));
    aspect-ratio: 320 / 550;
  }

  .c-modal_inner--imageOnly .c-modal_close {
    top: -50px;
    right: 0;
  }

  .c-modal_inner--imageOnly .c-modal_close > a.p-topModal_closeBtn {
    border-radius: 3px 3px 0 0;
  }
}
