/**
 * Front MV (first viewport) layout — loaded synchronously from header.php (front only).
 * to avoid layout shift before deferred top.css.
 *
 * @package komono
 */

.c-mv {
	position: relative;
	overflow: hidden;
	min-height: calc(100vh - 74px);
	min-height: calc(100dvh - 74px);
	padding: 49px 40px 40px 76px;
}

/* SP ではギャラリー＋コピーをまとめて中央寄せ。PC は display:contents で従来の2カラムを維持 */
.c-mv__stack {
	display: contents;
}

.c-mv__inner {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: row-reverse;
	align-items: center;
	justify-content: space-between;
	gap: 40px;
	min-height: calc(100vh - 74px - 89px);
	min-height: calc(100dvh - 74px - 89px);
}

.c-mv__copy {
	display: inline-block;
	background: #fff;
	padding: 8px 0;
	font-family: "Noto Serif JP", serif;
	font-size: 38px;
	font-weight: 400;
	letter-spacing: 0.2em;
	line-height: 1.32;
	overflow-wrap: normal;
}

.c-mv__copy-line {
	display: inline;
}

@media (min-width: 1016px) {
	.c-mv__copy {
		white-space: nowrap;
	}
}

@media (max-width: 1015px) and (min-width: 768px) {
	.c-mv__copy-line--first,
	.c-mv__copy-line--second {
		display: block;
		white-space: nowrap;
	}
}

.c-mv__gallery {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 12px;
	flex: 0 0 489px;
	width: 489px;
	padding-bottom: 137px;
}

/* picture + display:contents breaks flex layout on Safari iOS — picture is the flex item */
.c-mv__gallery picture {
	display: block;
	flex: 0 0 155px;
	width: 155px;
	max-width: 100%;
	min-width: 0;
}

.c-mv__gallery picture img {
	position: relative;
	display: block;
	width: 100%;
	height: auto;
	max-width: 100%;
	object-fit: contain;
	transform: translateY(var(--mv-shift, 0));
}

.c-mv__gallery img.is-reveal-ready {
	opacity: 0;
	clip-path: inset(0 100% 0 0);
	transition: opacity 0.65s ease, clip-path 0.9s cubic-bezier(0.22, 1, 0.36, 1);
	will-change: opacity, clip-path;
}

.c-mv__gallery img.is-reveal-ready.is-visible {
	opacity: 1;
	clip-path: inset(0 0 0 0);
}

.c-mv__img--01 {
	width: 100%;
	aspect-ratio: 115 / 199;
	--mv-shift: 0px;
}

.c-mv__img--04 {
	width: 100%;
	aspect-ratio: 115 / 205;
	--mv-shift: 0px;
}

.c-mv__img--02 {
	width: 100%;
	aspect-ratio: 112 / 199;
	--mv-shift: 52px;
}

.c-mv__img--05 {
	width: 100%;
	aspect-ratio: 112 / 200;
	--mv-shift: 52px;
}

.c-mv__img--03 {
	width: 100%;
	aspect-ratio: 112 / 199;
	--mv-shift: 137px;
}

.c-mv__img--06 {
	width: 100%;
	aspect-ratio: 112 / 199;
	--mv-shift: 137px;
}

@media (max-width: 767px) {
	.c-mv {
		/* ヘッダー（59px）とブラウザUIを除いた縦幅いっぱいの箱で .c-mv__inner ブロックを上下中央 */
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: stretch;
		box-sizing: border-box;
		/* common.js が visualViewport から --mv-usable-height を入れる（フォールバックは svh） */
		min-height: calc(100dvh - 59px);
		min-height: var(--mv-usable-height, calc(100svh - 59px));
		padding: 0 20px;
	}

	.c-mv__stack {
		display: flex;
		flex-direction: column;
		align-items: stretch;
		width: 100%;
		flex: 0 0 auto;
	}

	.c-mv__inner {
		--mv-gap: clamp(8px, 2.99vw, 12px);
		--mv-col-w: calc((100% - (var(--mv-gap) * 2)) / 3);
		--mv-step: calc((var(--mv-col-w) * 0.35) + 40px);
		--mv-copy-h: calc(18.952px + 4px);
		position: relative;
		flex: 0 0 auto;
		width: 100%;
		display: flex;
		flex-direction: column;
		align-items: center;
		box-sizing: border-box;
	}

	.c-mv__copy {
		position: relative;
		align-self: flex-start;
		/* ベース＋ common.js が計測する --mv-copy-mt-adjust で mv-06 の描画下端とコピー下端を揃える */
		margin-top: calc(-0.92em + 4px + var(--mv-copy-mt-adjust, 0px));
		margin-bottom: 0;
		padding: 5px;
		color: #4d4d4d;
		font-size: clamp(16px, 4.73vw, 19px);
		letter-spacing: 0.2em;
		line-height: 1;
		white-space: nowrap;
		overflow-wrap: normal;
	}

	.c-mv__gallery {
		position: relative;
		flex: 0 0 auto;
		display: flex;
		flex-wrap: wrap;
		align-content: flex-start;
		align-items: flex-start;
		justify-content: center;
		gap: var(--mv-gap);
		width: 100%;
		max-width: 362px;
		margin-inline: auto;
		padding-bottom: calc(var(--mv-step) * 2);
	}

	.c-mv__gallery picture {
		display: block;
		flex: 0 0 var(--mv-col-w);
		width: var(--mv-col-w);
		max-width: 100%;
		min-width: 0;
	}

	.c-mv__gallery picture img {
		position: relative;
		display: block;
		width: 100%;
		height: auto;
		max-width: 100%;
		object-fit: cover;
		transform: translateY(var(--mv-shift, 0));
	}

	.c-mv__img--01 {
		--mv-shift: 0px;
		aspect-ratio: 115 / 199;
	}

	.c-mv__img--02 {
		--mv-shift: var(--mv-step);
		aspect-ratio: 112 / 199;
	}

	.c-mv__img--03 {
		--mv-shift: calc(var(--mv-step) * 2);
		aspect-ratio: 112 / 199;
	}

	.c-mv__img--04 {
		--mv-shift: 0px;
		aspect-ratio: 115 / 205;
	}

	.c-mv__img--05 {
		--mv-shift: var(--mv-step);
		aspect-ratio: 112 / 200;
	}

	.c-mv__img--06 {
		--mv-shift: calc(var(--mv-step) * 2);
		aspect-ratio: 112 / 199;
	}
}
