/* =========================================================
   Funakoshi Image Zoom
   Lightbox2 / jQuery / external CDN are not required.
   ========================================================= */

/* 拡大対象画像 */
.js-image-zoom {
  cursor: zoom-in;
}

/* Modal overlay */
.fk-image-zoom-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  inset: 0;
  align-items: center;
  justify-content: center;
  padding: 40px;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.85);
}

/* Open state */
.fk-image-zoom-modal.is-open {
  display: flex;
}

/* Enlarged image */
.fk-image-zoom-modal__image {
  display: block;

  /* PCでは一定サイズで表示 */
  width: 380px;
  height: 280px;

  /* 縦横比を維持 */
  object-fit: contain;

  /* 構造式向け */
  background: #fff;

  /* 画面からはみ出さない */
  max-width: 90vw;
  max-height: 80vh;

  box-sizing: border-box;
}

/* Close button */
.fk-image-zoom-modal__close {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 40px;
  line-height: 1;
  text-align: center;
  cursor: pointer;
}

/* Focus visibility */
.fk-image-zoom-modal__close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

/* Prevent background scroll */
body.fk-image-zoom-open {
  overflow: hidden;
}

/* Smartphone */
@media (max-width: 767px) {
  .fk-image-zoom-modal {
    padding: 20px;
  }

  .fk-image-zoom-modal__image {
    width: 85vw;
    height: 55vh;
    max-width: 85vw;
    max-height: 55vh;
  }

  .fk-image-zoom-modal__close {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    font-size: 36px;
  }
}
