/**
 * No.25 フッター。
 *
 * PC: ナビ 2 列（右列は HOME 分だけ下げる）＋正方形ギャラリー。
 * SP: ギャラリー全幅 → ナビ 1 列 → copyright / Member Login。
 * hover: ナビ・ログインは text-move through-up。ギャラリーは scale + saturate（hover.css）。
 */

.footer {
	box-sizing: border-box;
	width: 100%;
	color: var(--wp--preset--color--base-white);
	background-color: var(--wp--preset--color--base-black);
	border-top: 1px solid var(--wp--preset--color--line-grey);
}

.footer a {
	color: inherit;
	text-decoration: none;
}

.footer__body {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: var(--wp--custom--molecule--xl);
	padding: var(--wp--custom--molecule--rg) var(--wp--custom--molecule--rg) var(--wp--custom--molecule--xl);
}

.footer__nav {
	display: flex;
	flex: 65 1 0;
	flex-wrap: wrap;
	align-items: flex-start;
	min-width: 0;
	container-type: inline-size;
	container-name: footer-nav;
}

.footer__nav-col {
	display: flex;
	flex: 1 1 16rem;
	flex-direction: column;
	align-items: stretch;
	min-width: 0;
}

.footer__item-inner {
	display: flex;
	flex-direction: column;
	gap: var(--wp--custom--atom--xxl);
	padding: var(--wp--custom--atom--xxl);
}

.footer__sublist {
	display: flex;
	flex-direction: column;
	gap: var(--wp--custom--atom--xs);
	margin: 0;
	/* 下層リストは親リンクから atom--rg だけインデント（SP ガッターとは別） */
	padding: 0 0 0 var(--wp--custom--atom--rg);
	list-style: none;
}

.footer__subitem {
	margin: 0;
	padding: 0;
}

.footer__link {
	display: inline-flex;
	align-items: center;
	gap: var(--wp--custom--atom--xxs);
	color: inherit;
	font-family: var(--wp--preset--font-family--jp-sans);
	font-weight: var(--wp--custom--font-weight--regular);
	line-height: var(--wp--custom--line-height--narrow);
	letter-spacing: var(--wp--custom--letter-spacing--none);
}

.footer__link--parent {
	font-size: var(--wp--preset--font-size--text-sm);
}

.footer__link--child {
	font-size: var(--wp--preset--font-size--text-xs);
}

.footer__link .icon {
	inline-size: 1.125rem;
	block-size: 1.125rem;
	color: inherit;
}

.footer__gallery {
	position: relative;
	flex: 35 1 0;
	box-sizing: border-box;
	width: auto;
	min-width: 300px;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background-color: var(--wp--preset--color--base-black);
}

.footer__gallery-link {
	position: absolute;
	inset: 0;
	display: block;
	overflow: hidden;
	opacity: 0;
	pointer-events: none;
	transition: opacity 2s ease;
}

.footer__gallery-link[data-state="active"] {
	opacity: 1;
	pointer-events: auto;
	z-index: 1;
}

.footer__gallery-link img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

.footer__foot {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 2.75rem;
	padding: var(--wp--custom--atom--lg) var(--wp--custom--molecule--rg);
	border-top: 1px solid var(--wp--preset--color--base-white);
}

.footer__login {
	position: absolute;
	left: var(--wp--custom--molecule--rg);
	display: inline-flex;
	align-items: center;
	gap: var(--wp--custom--atom--xs);
	color: inherit;
	font-family: var(--wp--preset--font-family--jp-sans);
	font-size: var(--wp--preset--font-size--text-xs);
	font-weight: var(--wp--custom--font-weight--regular);
	line-height: var(--wp--custom--line-height--narrow);
}

.footer__login .icon {
	inline-size: 1.125rem;
	block-size: 1.125rem;
	color: inherit;
}

.footer__copyright {
	margin: 0;
	font-family: var(--wp--preset--font-family--en-sans);
	font-size: var(--wp--preset--font-size--text-xs);
	font-weight: var(--wp--custom--font-weight--regular);
	line-height: var(--wp--custom--line-height--narrow);
	letter-spacing: var(--wp--custom--letter-spacing--none);
	color: inherit;
}

.footer__foot {
	position: relative;
}

@media (min-width: 768px) {
	/* HOME 1 グループ分（inner 上下 + 親リンク 1 行）だけ下げて「について」と揃える */
	.footer__nav-col--sub {
		padding-top: calc(
			(var(--wp--custom--atom--xxl) * 2)
			+ (var(--wp--preset--font-size--text-sm) * var(--wp--custom--line-height--narrow))
		);
	}
}

@container footer-nav (max-width: 36rem) {
	.footer__nav-col--sub {
		padding-top: 0;
	}
}

@media (max-width: 767px) {
	.footer__body {
		flex-direction: column;
		flex-wrap: nowrap;
		align-items: stretch;
		gap: var(--wp--custom--molecule--xl);
		padding: 0 0 var(--wp--custom--molecule--xl);
	}

	.footer__gallery {
		order: -1;
		flex: 0 0 auto;
		width: 100%;
		min-width: 0;
		max-width: none;
		aspect-ratio: 1 / 1;
	}

	.footer__nav {
		flex: 1 1 auto;
		flex-direction: column;
		flex-wrap: nowrap;
		width: 100%;
	}

	.footer__nav-col {
		flex-basis: auto;
		width: 100%;
	}

	.footer__nav-col--sub {
		padding-top: 0;
	}

	.footer__item-inner {
		padding-inline: var(--wp--custom--molecule--rg);
	}

	.footer__link--parent {
		font-size: var(--wp--preset--font-size--text-xs);
	}

	.footer__foot {
		flex-direction: column;
		gap: var(--wp--custom--atom--xs);
		padding: var(--wp--custom--atom--lg) var(--wp--custom--molecule--rg);
	}

	.footer__login {
		position: static;
		left: auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	.footer__gallery-link {
		transition: none;
	}
}
