/*
 * にこいち：Smart Slider 3 Pro の置き換え（inc/nicoichi-sliders.php）
 *
 * 数値はすべて旧スライダーの描画を実測して合わせたもの（DB変更メモ 37章）。
 * 動かすと旧と見た目がずれるので、変えるときは前後の画面を撮って比べること。
 *
 * 1. 共通
 * 2. メインビジュアル（トップ PC：旧 SS #12 ／ トップ スマホ：旧 SS #13）
 * 3. 左に文字・右に写真（HOME105：旧 SS #3 ／ Naturie：旧 SS #6）
 *
 * Elementor の CSS（e-swiper.css・.elementor-kit-6 a など）が後から読まれるので、
 * セレクタは .nicoichi-ss.swiper から始めて段を重ねてある。
 */

/* ==========================================================================
 * 1. 共通
 * ========================================================================== */
.nicoichi-ss {
	position: relative;
	width: 100%;
	overflow: hidden;
}

/* Swiper が動かない環境でも1枚目だけはきちんと見えるように。
   JS は Swiper を組む前に .swiper を付けるので、組み立て中（寸法を測る間）は全スライドが見えている。
   （.is-ready で判定すると、測る間も2枚目以降が消えていて「1枚しか無い」と判断され、点が消えた） */
.nicoichi-ss:not(.swiper) .swiper-wrapper {
	display: flex;
}

.nicoichi-ss:not(.swiper) .swiper-slide:not(:first-child) {
	display: none;
}

.nicoichi-ss.swiper .swiper-slide {
	height: auto;
}

/* 矢印（ボタンの見た目を消してから描く） */
.nicoichi-ss.swiper .nicoichi-ss__arrow {
	position: absolute;
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	line-height: 0;
	-webkit-appearance: none;
	appearance: none;
}

/* Swiper 既定の「‹ ›」の文字（::after）は使わない */
.nicoichi-ss.swiper .nicoichi-ss__arrow::after {
	content: none;
}

.nicoichi-ss.swiper .nicoichi-ss__arrow:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.nicoichi-ss.swiper .nicoichi-ss__arrow svg {
	display: block;
}

/* ==========================================================================
 * 2. メインビジュアル
 *    PC：画面の高さいっぱい（旧の fullpage）。スマホ：幅×1.238（1050:1300）。
 *    写真の上に、文字が読めるよう薄い暗幕（旧 nicoichi-design.css 6章と同じ）。
 * ========================================================================== */
.nicoichi-ss--mv-pc {
	height: 100vh;
	height: 100svh;
}

.nicoichi-ss--mv-sp {
	aspect-ratio: 1440 / 600;
}

@media (max-width: 700px) {
	.nicoichi-ss--mv-sp {
		aspect-ratio: 1050 / 1300;
	}
}

.nicoichi-ss--mv.swiper .swiper-wrapper,
.nicoichi-ss--mv.swiper .swiper-slide {
	height: 100%;
}

.nicoichi-ss--mv .swiper-slide {
	position: relative;
	overflow: hidden;
	background: #fff;
}

.nicoichi-ss--mv .nicoichi-ss__photo {
	position: absolute;
	inset: 0;
}

.nicoichi-ss--mv .nicoichi-ss__photo img.nicoichi-ss__bg {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: 50% 50%;
}

.nicoichi-ss--mv .nicoichi-ss__photo::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: linear-gradient(100deg,
			rgba(24, 32, 42, .58) 0%,
			rgba(24, 32, 42, .38) 38%,
			rgba(24, 32, 42, .06) 68%,
			rgba(24, 32, 42, 0) 88%);
}

@media (max-width: 768px) {
	.nicoichi-ss--mv-sp .nicoichi-ss__photo::after {
		background: linear-gradient(180deg,
				rgba(24, 32, 42, .48) 0%,
				rgba(24, 32, 42, .34) 55%,
				rgba(24, 32, 42, .12) 100%);
	}
}

/* 文字：上下中央、左右は 70px（旧：外枠 10px＋内側 60px） */
.nicoichi-ss--mv .nicoichi-ss__copy {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 20px 70px;
	pointer-events: none;
}

.nicoichi-ss--mv .nicoichi-ss__line {
	color: #fff;
	font-family: '游明朝', 'Yu Mincho', YuMincho, 'Hiragino Mincho Pro', serif;
	font-weight: 400;
	text-align: left;
	letter-spacing: normal;
	text-shadow: 0 1px 3px rgba(0, 0, 0, .45), 0 0 18px rgba(0, 0, 0, .25);
	margin: 0;
}

.nicoichi-ss--mv-pc .nicoichi-ss__line--1 {
	font-size: 5vw;
	line-height: 1.2;
}

.nicoichi-ss--mv-pc .nicoichi-ss__line--2 {
	font-size: 2.6vw;
	line-height: 1.5;
}

.nicoichi-ss--mv-sp .nicoichi-ss__copy {
	padding: 20px;
}

.nicoichi-ss--mv-sp .nicoichi-ss__line--1 {
	font-size: 6vw;
	line-height: 1.2;
}

.nicoichi-ss--mv-sp .nicoichi-ss__line--2 {
	font-size: 2.6vw;
	line-height: 1.5;
}

@media (max-width: 700px) {
	.nicoichi-ss--mv-sp .nicoichi-ss__line--1 {
		font-size: 8.4vw;
	}

	.nicoichi-ss--mv-sp .nicoichi-ss__line--2 {
		font-size: 6vw;
	}
}

/* PC：切り替わってから文字が下から出てくる（旧：切替 0.8 秒の後 2 秒・2行目は 0.6 秒遅れ・400px 下から） */
@keyframes nicoichi-ss-rise {
	from {
		opacity: 0;
		transform: translateY(400px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

.nicoichi-ss--mv-pc.is-ready .nicoichi-ss__line {
	opacity: 0;
}

.nicoichi-ss--mv-pc.is-ready .swiper-slide-active .nicoichi-ss__line {
	animation: nicoichi-ss-rise .65s cubic-bezier(.25, .46, .45, .94) both;
	animation-delay: 2.8s;
}

.nicoichi-ss--mv-pc.is-ready .swiper-slide-active .nicoichi-ss__line--2 {
	animation-delay: 3.4s;
}

/* 最初の1枚は切り替えが無いので、表示から 2 秒 */
.nicoichi-ss--mv-pc.is-ready.is-initial .swiper-slide-active .nicoichi-ss__line--1 {
	animation-delay: 2s;
}

.nicoichi-ss--mv-pc.is-ready.is-initial .swiper-slide-active .nicoichi-ss__line--2 {
	animation-delay: 2.6s;
}

@media (prefers-reduced-motion: reduce) {
	.nicoichi-ss--mv-pc.is-ready .nicoichi-ss__line {
		opacity: 1;
	}

	.nicoichi-ss--mv-pc.is-ready .swiper-slide-active .nicoichi-ss__line {
		animation: none;
	}
}

/* 矢印：細い山形 32px、左右 15px・上下中央 */
.nicoichi-ss--mv.swiper .nicoichi-ss__arrow {
	top: 50%;
	width: 32px;
	height: 32px;
	margin-top: -16px;
}

.nicoichi-ss--mv.swiper .nicoichi-ss__arrow--prev {
	left: 15px;
}

.nicoichi-ss--mv.swiper .nicoichi-ss__arrow--next {
	right: 15px;
}

/* ==========================================================================
 * 3. 左に文字・右に写真（HOME105 / Naturie）
 *    幅 1200px の枠を中央に置く。高さは 幅×5/12（最大 500px）、中身が多ければ伸びる。
 *    左の列は最大 585px、右の列の写真は下揃え。
 * ========================================================================== */
.nicoichi-ss--feature .swiper-slide {
	display: flex;
	min-height: min(41.6667vw, 500px);
}

.nicoichi-ss--feature .nicoichi-ss__inner {
	display: flex;
	align-items: stretch;
	width: 100%;
	max-width: 1200px;
	margin: auto;
	padding: 20px;
	box-sizing: border-box;
}

.nicoichi-ss--feature .nicoichi-ss__text {
	/* 旧：左列は 3/5、ただし最大 585px。右列は残り全部 */
	flex: 0 0 min(60%, 585px);
	max-width: 585px;
	padding: 10px 0 10px 10px;
	box-sizing: border-box;
	align-self: center;
}

.nicoichi-ss--feature .nicoichi-ss__media {
	flex: 1 1 0;
	min-width: 0;
	display: flex;
	align-items: flex-end;
	padding: 10px 10px 10px 30px;
	box-sizing: border-box;
}

.nicoichi-ss--feature .nicoichi-ss__media img.nicoichi-ss__img {
	display: block;
	width: auto;
	max-width: 100%;
	height: auto;
}

.nicoichi-ss--feature .nicoichi-ss__ttl {
	margin: 0;
	padding-left: 16px;
	border-left: 3px solid #3E4F63;
	color: #3E4F63;
	/* 旧スライダーの指定のまま（'游明朝' だけ）。Mac では該当が無く既定の書体（ゴシック）で出ていた */
	font-family: '游明朝';
	font-size: 30px;
	font-weight: 700;
	line-height: 1;
}

.nicoichi-ss--feature .nicoichi-ss__sub p,
.nicoichi-ss--feature .nicoichi-ss__detail p {
	margin: 0;
	color: #3E4F63;
	font-family: Roboto, Arial;
	letter-spacing: normal;
}

.nicoichi-ss--feature .nicoichi-ss__sub p {
	padding: 30px 0;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.8;
}

.nicoichi-ss--feature .nicoichi-ss__detail p {
	padding: 0;
	font-size: 15px;
	font-weight: 400;
	line-height: 1.8;
}

/* Naturie は小見出し（sub）が無く、本文の上に 20px あく */
.nicoichi-ss--naturie .nicoichi-ss__detail {
	padding-top: 20px;
}

@media (max-width: 768px) {
	.nicoichi-ss--feature .nicoichi-ss__ttl {
		font-size: 20px;
	}

	.nicoichi-ss--feature .nicoichi-ss__sub p {
		padding: 10px 0;
		font-size: 15px;
	}

	.nicoichi-ss--feature .nicoichi-ss__detail p {
		font-size: 12.1875px; /* 旧：13px × 15/16 */
	}
}

/* 幅 700px 以下：写真を文字の下へ回す */
@media (max-width: 700px) {
	.nicoichi-ss--feature .nicoichi-ss__inner {
		flex-wrap: wrap;
		padding: 10px;
	}

	.nicoichi-ss--feature .nicoichi-ss__text {
		flex: 0 0 100%;
		max-width: none;
	}

	.nicoichi-ss--feature .nicoichi-ss__media {
		flex: 0 0 100%;
		padding: 10px;
	}
}

/* 点：10px、間隔 18px、下から 4px。1080px 以上は左寄せ（旧 page.css の padding-right:1100px と同じ位置） */
.nicoichi-ss--feature.swiper > .swiper-pagination.swiper-pagination-bullets {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	top: auto;
	width: 100%;
	box-sizing: border-box;
	line-height: 0;
	text-align: center;
	transform: none;
}

.nicoichi-ss--feature.swiper > .swiper-pagination .swiper-pagination-bullet {
	width: 10px;
	height: 10px;
	margin: 4px;
	border-radius: 50%;
	background: #C6CBCE;
	opacity: 1;
}

.nicoichi-ss--feature.swiper > .swiper-pagination .swiper-pagination-bullet-active {
	background: #3E4F63;
}

@media (min-width: 1080px) {
	.nicoichi-ss--feature.swiper > .swiper-pagination.swiper-pagination-bullets {
		padding-right: 1100px;
	}
}

/* 矢印：幅 700px 以下だけ。黒い角丸の箱（36px）、左右 10px、下から 90px */
.nicoichi-ss--feature.swiper .nicoichi-ss__arrow {
	display: none;
}

@media (max-width: 700px) {
	.nicoichi-ss--feature.swiper .nicoichi-ss__arrow {
		display: flex;
		top: auto;
		bottom: 90px;
		width: 36px;
		height: 36px;
		margin: 0;
		border-radius: 5px;
		background: rgba(0, 0, 0, .67);
	}

	.nicoichi-ss--feature.swiper .nicoichi-ss__arrow:hover {
		background: rgba(0, 0, 0, .81);
	}

	.nicoichi-ss--feature.swiper .nicoichi-ss__arrow svg {
		width: 16px;
		height: 16px;
	}

	.nicoichi-ss--feature.swiper .nicoichi-ss__arrow--prev {
		left: 10px;
	}

	.nicoichi-ss--feature.swiper .nicoichi-ss__arrow--next {
		right: 10px;
	}
}

/* 横スライドの動き（旧：easeOutQuad 0.8 秒） */
.nicoichi-ss--feature.swiper .swiper-wrapper {
	transition-timing-function: cubic-bezier(.25, .46, .45, .94);
}
