/* =========================================================
   site-motion.css — v19 上質モーション拡張レイヤー
   ① ページ遷移オーバーレイ      ② 慣性スクロール（JS主体）
   ③ ヒーロー見出しマスク・ライズ ④ 画像カーテン・ワイプ
   ⑤ セクション索引（右側TOC）    ⑥ リンク下線ドロー＋矢印ナッジ
   - すべて prefers-reduced-motion 対応
   - 既存トーン（えんじ×クリーム×明朝）に追従
   ========================================================= */

:root {
	--hp-mt-red-1: #7a0a10;
	--hp-mt-red-2: #4e060b;
	--hp-mt-ease:  cubic-bezier(.76, 0, .24, 1);
	--hp-mt-ease2: cubic-bezier(.22, 1, .25, 1);
}

/* =========================================================
   ① ページ遷移オーバーレイ（カーテン）
   ========================================================= */
.hp-page-transition {
	position: fixed;
	inset: 0;
	z-index: 12000;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(180deg, var(--hp-mt-red-1), var(--hp-mt-red-2));
	transform: scaleY(0);
	transform-origin: bottom;
	transition: transform .6s var(--hp-mt-ease);
	visibility: hidden;
	pointer-events: none;
}

.hp-page-transition__mark {
	font-family: "Noto Serif JP", serif;
	font-size: 17px;
	letter-spacing: .46em;
	text-indent: .46em;
	color: #f3e7d8;
	opacity: 0;
	transform: translateY(10px);
	transition: opacity .4s ease, transform .4s ease;
}

.hp-page-transition__mark span {
	display: block;
	margin-top: 10px;
	font-size: 9px;
	letter-spacing: .34em;
	text-indent: .34em;
	color: rgba(243, 231, 216, .6);
}

/* 退場：クリック → 下から覆う */
.is-leaving .hp-page-transition {
	visibility: visible;
	transform: scaleY(1);
	transform-origin: bottom;
}
.is-leaving .hp-page-transition__mark {
	opacity: 1;
	transform: none;
	transition-delay: .16s;
}

/* 入場：読み込み直後は覆った状態（即時・トランジションなし） */
.is-entering .hp-page-transition {
	visibility: visible;
	transform: scaleY(1);
	transform-origin: top;
	transition: none;
}

/* 入場：上へ退いてコンテンツを見せる */
.hp-entered .hp-page-transition {
	visibility: visible;
	transform: scaleY(0);
	transform-origin: top;
	transition: transform .7s var(--hp-mt-ease);
}

/* =========================================================
   ③ ヒーロー見出しマスク・ライズ
   既存の .hp-story-hero.is-loaded 連動に上書きで真のマスクへ
   ========================================================= */
.hp-story-hero__title span.hp-mrise {
	display: inline-block;
	overflow: hidden;
	opacity: 1 !important;
	transform: none !important;
	vertical-align: bottom;
	padding-bottom: .04em; /* ディセンダの欠け防止 */
}

.hp-story-hero__title .hp-mrise__i {
	display: inline-block;
	transform: translateY(118%);
	transition: transform 1s var(--hp-mt-ease2);
	will-change: transform;
}

.hp-story-hero.is-loaded .hp-story-hero__title span:first-child .hp-mrise__i {
	transform: translateY(0);
	transition-delay: .35s;
}
.hp-story-hero.is-loaded .hp-story-hero__title span + span .hp-mrise__i {
	transform: translateY(0);
	transition-delay: .52s;
}

/* =========================================================
   ④ 画像カーテン・ワイプ（オーバーレイ板スライド方式）
   施設カード画像に適用（clip-path は使わず崩れ回避）
   ========================================================= */
.hp-wipe {
	position: relative;
	display: block;
	overflow: hidden;
	line-height: 0;
}

.hp-wipe > img {
	transition: transform 1.1s var(--hp-mt-ease2);
	will-change: transform;
}
.hp-wipe:not(.is-wiped) > img {
	transform: scale(1.08);
}
/* ワイプ完了後はホバーズーム（既存 .hp-facility-card:hover img）を復活 */
.hp-wipe.is-wiped > img {
	transition: transform .38s ease;
}

.hp-wipe__panel {
	position: absolute;
	inset: 0;
	z-index: 2;
	background: linear-gradient(180deg, var(--hp-mt-red-1), var(--hp-mt-red-2));
	transform: scaleX(1);
	transform-origin: right;
	transition: transform .9s var(--hp-mt-ease);
}
.hp-wipe.is-wiped .hp-wipe__panel {
	transform: scaleX(0);
}

/* =========================================================
   ⑤ セクション索引（右側・PCのみ）
   既存スクロール進捗ライン（right:0）の内側に配置
   ========================================================= */
.hp-section-index {
	position: fixed;
	top: 50%;
	right: 18px;
	z-index: 9001;
	transform: translateY(-50%);
	display: none;
	flex-direction: column;
	gap: 14px;
	pointer-events: auto;
}

.hp-section-index__item {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 10px;
	background: none;
	border: 0;
	padding: 2px 0;
	cursor: pointer;
	color: rgba(52, 37, 25, .42);
	font-family: var(--hp-roman, "Noto Serif JP", serif);
	transition: color .3s ease;
}

.hp-section-index__label {
	font-size: 10px;
	letter-spacing: .14em;
	white-space: nowrap;
	opacity: 0;
	transform: translateX(6px);
	transition: opacity .3s ease, transform .3s ease;
}

.hp-section-index__dot {
	position: relative;
	width: 8px;
	height: 8px;
	flex: 0 0 auto;
	border-radius: 50%;
	border: 1px solid rgba(122, 90, 55, .5);
	background: transparent;
	transition: background .3s ease, border-color .3s ease, transform .3s ease;
}

.hp-section-index__item:hover .hp-section-index__label,
.hp-section-index__item.is-current .hp-section-index__label {
	opacity: 1;
	transform: none;
}
.hp-section-index__item:hover {
	color: var(--hp-red, #b40000);
}

.hp-section-index__item.is-current {
	color: var(--hp-red, #b40000);
}
.hp-section-index__item.is-current .hp-section-index__dot {
	background: var(--hp-red, #b40000);
	border-color: var(--hp-red, #b40000);
	transform: scale(1.25);
	box-shadow: 0 0 0 4px rgba(180, 0, 0, .12);
}

@media (min-width: 1180px) {
	.hp-section-index { display: flex; }
}

/* =========================================================
   ⑥ リンク下線ドロー＋矢印ナッジ
   コンテンツ内の「→」付きリンクに JS で .hp-ln を付与
   ========================================================= */
.hp-ln {
	position: relative;
}
.hp-ln::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -2px;
	height: 1px;
	background: currentColor;
	opacity: .5;
	transform: scaleX(0);
	transform-origin: left;
	transition: transform .5s var(--hp-mt-ease2);
}
.hp-ln:hover::after,
.hp-ln:focus-visible::after {
	transform: scaleX(1);
}
.hp-ln span[aria-hidden] {
	display: inline-block;
	transition: transform .35s var(--hp-mt-ease2);
}
.hp-ln:hover span[aria-hidden],
.hp-ln:focus-visible span[aria-hidden] {
	transform: translateX(5px);
}

/* =========================================================
   アクセシビリティ：モーション抑制時は演出を無効化
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
	.hp-page-transition,
	.hp-page-transition__mark {
		transition: none !important;
	}
	.hp-story-hero__title .hp-mrise__i {
		transform: none !important;
		transition: none !important;
	}
	.hp-wipe > img {
		transform: none !important;
		transition: none !important;
	}
	.hp-wipe__panel {
		display: none !important;
	}
	.hp-ln::after,
	.hp-ln span[aria-hidden] {
		transition: none !important;
	}
}
