/* --- modal --- */
html.modal-open {
	overflow: hidden;
}

.modal-open-img {
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;

	img {
		display: block;
		object-fit: cover;
		transition: transform 0.2s;
	}

	&:hover {
		img {
			transform: scale(1.02);
		}
	}
}
.modal-open-btn {
	cursor: pointer;
	display: flex;
	align-items: center;
	padding: .5em 2em;
	font-size: 1em;
	letter-spacing: 0.14em;
	color: #fff;
	background-color: #013895;
	transition: opacity .3s;

	.tpl-figure & {
		margin: 1em auto 0;
	}

	&::before {
		content: "";
		width: 6px;
    height: 6px;
		margin-right: 1em;
		border-top: 1px solid white;
    border-right: 1px solid white;
		transform: rotate(45deg);
	}

	&:hover {
		opacity: .5;
	}
}

.modal[aria-hidden="true"] {
  display: none;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0 0 0 / .5);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: auto;
  overscroll-behavior: contain;

	@media screen and (max-width: 959px) {
		align-items: flex-start;
	}
}

.modal-dialog {
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;

	img {
		max-width: calc(95vw - 40px);
		max-height: calc(85vh - 40px);
		object-fit: contain;
		border: 20px solid #f0f0f0;
		border-radius: 15px;
	}

	@media screen and (max-width: 959px) {
		max-width: none;
		max-height: none;
		width: 100%;
		height: calc(100vh - 40px);
		overflow: auto;
		justify-content: flex-start;

		img {
			max-width: none;
			width: auto;
			height: 100%;
		}
	}
}

.modal-close {
  position: fixed;
  top: 20px;
  right: 25px;
  color: #FFFFFF;
	font-family: "ヒラギノ角ゴ Pro W3", "Hiragino Kaku Gothic Pro", "メイリオ", "Meiryo", "Osaka", "ＭＳ Ｐゴシック", "MS P Gothic", Verdana, Arial, Helvetica, sans-serif;
  font-size: 36px;
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
  transition: opacity 0.2s;
  padding: 0;
  z-index: 2001;

	@media screen and (max-width: 750px) {
		top: 15px;
	  right: 17px;
	}
}

.modal-close:hover {
  opacity: 0.7;
}
