/* 全画面写真ビューア */
.kan-viewer {
	position: fixed; inset: 0; z-index: 999999;
	background: #0d0d0d; color: #eee;
	opacity: 0; visibility: hidden;
	transition: opacity .35s ease, visibility 0s linear .35s;
	touch-action: none; overscroll-behavior: contain;
	-webkit-tap-highlight-color: transparent;
}
.kan-viewer.is-open { opacity: 1; visibility: visible; transition-delay: 0s; }
.kan-viewer__stage { position: absolute; inset: 0; overflow: hidden; }
.kan-viewer__slide {
	position: absolute; inset: 0; will-change: transform;
	display: flex; align-items: center; justify-content: center;
	padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.kan-viewer__slide.is-moving { transition: transform var(--kan-dur, .45s) cubic-bezier(.22, .61, .36, 1); }
.kan-viewer__img {
	display: block; width: 100%; height: 100%; object-fit: contain;
	user-select: none; -webkit-user-drag: none;
}
.kan-viewer__close {
	position: absolute; z-index: 3;
	top: calc(env(safe-area-inset-top, 0px) + 8px); right: calc(env(safe-area-inset-right, 0px) + 8px);
	width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
	background: rgba(0,0,0,.35); color: #f2f0ea; cursor: pointer;
	display: flex; align-items: center; justify-content: center;
}
.kan-viewer__close:hover { background: rgba(0,0,0,.6); }
.kan-viewer__close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.kan-viewer__close svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.6; fill: none; stroke-linecap: round; }

/* 前へ・次へ（左右の中央） */
.kan-viewer__nav {
	position: absolute; z-index: 3; top: 50%; margin-top: -24px;
	width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%;
	background: rgba(0,0,0,.35); color: #f2f0ea; cursor: pointer;
	display: flex; align-items: center; justify-content: center;
	transition: background-color .2s ease;
}
.kan-viewer__nav[hidden] { display: none; }
.kan-viewer__nav:hover { background: rgba(0,0,0,.65); }
.kan-viewer__nav:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.kan-viewer__nav svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 1.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.kan-viewer__nav--prev { left: calc(env(safe-area-inset-left, 0px) + 10px); }
.kan-viewer__nav--next { right: calc(env(safe-area-inset-right, 0px) + 10px); }
@media (max-width: 600px) { .kan-viewer__nav { width: 40px; height: 40px; margin-top: -20px; background: rgba(0,0,0,.28); } }

.kan-viewer__meta {
	position: absolute; z-index: 2; left: 0; right: 0; bottom: 0;
	padding: 84px clamp(18px, 5vw, 56px) calc(14px + env(safe-area-inset-bottom, 0px));
	text-align: center; pointer-events: none;
	background: linear-gradient(to top, rgba(0,0,0,.72) 0, rgba(0,0,0,.45) 55%, rgba(0,0,0,0));
}
.kan-viewer__meta.is-nocap { background: none; padding-top: 12px; }
/* キャプション：大きめ・ゆったりした行間。紀行文のように読める、やわらかな書体 */
.kan-viewer__caption {
	margin: 0 auto 12px; max-width: 30em;
	font-family: "Klee One", "Klee", "Hiragino Maru Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
	font-size: clamp(1.08rem, 2.9vw, 1.5rem);
	font-weight: 600; line-height: 1.95; letter-spacing: .05em;
	color: #fbf9f4;
	text-shadow: 0 1px 2px rgba(0,0,0,.55), 0 2px 14px rgba(0,0,0,.6);
	text-wrap: pretty; overflow-wrap: anywhere;
	transition: opacity .3s ease;
}
body.kan-cap-maru .kan-viewer__caption { font-family: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Yu Gothic", "Meiryo", sans-serif; font-weight: 500; }
body.kan-cap-system .kan-viewer__caption { font-family: "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif; font-weight: 500; }
.kan-viewer__caption:empty { display: none; }
.kan-viewer__count { margin: 0; font-size: 11px; letter-spacing: .24em; color: rgba(242,240,234,.75); font-variant-numeric: tabular-nums; }

html.kan-viewer-open, html.kan-viewer-open body { overflow: hidden; }
@media (prefers-reduced-motion: reduce) {
	.kan-viewer, .kan-viewer__caption { transition: none; }
	.kan-viewer__slide.is-moving { transition: none; }
}
