@charset "UTF-8";
/*
 * 記事の画像の拡大表示（image-lightbox.js が作る要素の見た目）
 */

/*
 * 拡大表示の間にうしろのページをスクロールさせない処理は、image-lightbox.js で行う。
 * html・body に overflow: hidden を付けると、このテーマは html・body の高さが 100% なので
 * ページの位置が先頭に戻ってしまう（閉じると最上部に飛ぶ）。そのため CSS では止めない。
 */

.yvh-lightbox {
	overscroll-behavior: contain;
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 56px 16px 24px;
	box-sizing: border-box;
	background-color: rgba( 0, 0, 0, 0.85 );
	cursor: zoom-out;
	animation: yvh-lightbox-fade 0.15s ease-out;
}

.yvh-lightbox[hidden] {
	display: none;
}

.yvh-lightbox__figure {
	margin: 0;
	max-width: 100%;
	max-height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.yvh-lightbox__img {
	display: block;
	max-width: min( 100%, 1600px );
	max-height: calc( 100vh - 120px );
	max-height: calc( 100dvh - 120px );
	width: auto;
	height: auto;
	object-fit: contain;
	background-color: #fff;
	box-shadow: 0 4px 24px rgba( 0, 0, 0, 0.4 );
}

.yvh-lightbox__caption {
	margin-top: 12px;
	max-width: 800px;
	color: #fff;
	font-size: 0.9em;
	line-height: 1.6;
	text-align: center;
	cursor: auto;
}

.yvh-lightbox__caption[hidden] {
	display: none;
}

.yvh-lightbox__close {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background-color: rgba( 255, 255, 255, 0.15 );
	color: #fff;
	font-size: 32px;
	line-height: 44px;
	text-align: center;
	cursor: pointer;
}

.yvh-lightbox__close:hover,
.yvh-lightbox__close:focus-visible {
	background-color: rgba( 255, 255, 255, 0.3 );
	outline: 2px solid #fff;
	outline-offset: 2px;
}

/* 拡大できる画像は、カーソルで分かるようにする */
article a[href$=".jpg"] img,
article a[href$=".jpeg"] img,
article a[href$=".png"] img,
article a[href$=".webp"] img,
article a[href$=".gif"] img,
article a[href$=".JPG"] img,
article a[href$=".PNG"] img {
	cursor: zoom-in;
}

@keyframes yvh-lightbox-fade {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.yvh-lightbox {
		animation: none;
	}
}
