/*
 * Smart Image Carousel — フロント側のスタイル
 * 色や大きさは CSS 変数で上書きできます。
 * 例）.sic { --sic-nav-bg: #111; --sic-nav-color: #fff; }
 */

.sic {
	--sic-pv: var(--sic-pv-mobile, 1);
	--sic-gap: 16px;
	--sic-radius: 12px;
	--sic-ratio: 4/3;
	--sic-fit: cover;
	--sic-nav-size: 40px;
	--sic-nav-bg: #ffffff;
	--sic-nav-color: #1f2937;
	--sic-nav-top: 50%;
	--sic-dot: #cbd5e1;
	--sic-dot-active: #1f2937;
	--sic-focus: #2563eb;
	--sic-placeholder: #f1f5f9;

	position: relative;
	margin: 1.75em 0;
}

@media (min-width: 768px) {
	.sic {
		--sic-pv: var(--sic-pv-tablet, 2);
	}
}

@media (min-width: 1024px) {
	.sic {
		--sic-pv: var(--sic-pv-desktop, 3);
	}
}

/* ---------- スライド領域 ---------- */

.sic__stage {
	position: relative;
}

.sic__viewport {
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	overscroll-behavior-x: contain;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.sic__viewport::-webkit-scrollbar {
	width: 0;
	height: 0;
	display: none;
}

.sic__viewport:focus-visible {
	outline: 2px solid var(--sic-focus);
	outline-offset: 3px;
	border-radius: calc(var(--sic-radius) + 3px);
}

.sic__track {
	display: flex;
	gap: var(--sic-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

.sic__slide {
	flex: 0 0 calc((100% - (var(--sic-pv) - 1) * var(--sic-gap)) / var(--sic-pv));
	min-width: 0;
	margin: 0;
	padding: 0;
	list-style: none;
	scroll-snap-align: start;
}

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

.sic__img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: var(--sic-ratio);
	object-fit: var(--sic-fit);
	border-radius: var(--sic-radius);
	background-color: var(--sic-placeholder);
}

.sic__link,
.sic__zoom {
	display: block;
	width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	box-shadow: none;
	line-height: 0;
	cursor: pointer;
	border-radius: var(--sic-radius);
}

.sic__zoom {
	cursor: zoom-in;
}

.sic__link:focus-visible,
.sic__zoom:focus-visible {
	outline: 2px solid var(--sic-focus);
	outline-offset: 3px;
}

.sic__link .sic__img,
.sic__zoom .sic__img {
	transition: transform 0.35s ease, opacity 0.35s ease;
}

@media (hover: hover) {
	.sic__link:hover .sic__img,
	.sic__zoom:hover .sic__img {
		transform: scale(1.03);
		opacity: 0.92;
	}
}

.sic__link,
.sic__zoom {
	overflow: hidden;
}

.sic__caption {
	margin: 0.6em 0 0;
	font-size: 0.85em;
	line-height: 1.6;
	opacity: 0.8;
}

/* ---------- 左右の矢印 ---------- */

.sic__nav {
	position: absolute;
	top: var(--sic-nav-top);
	transform: translateY(-50%);
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--sic-nav-size);
	height: var(--sic-nav-size);
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--sic-nav-bg);
	color: var(--sic-nav-color);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
	cursor: pointer;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.sic__nav svg {
	width: 55%;
	height: 55%;
}

.sic__nav--prev {
	left: 8px;
}

.sic__nav--next {
	right: 8px;
}

@media (min-width: 768px) {
	.sic {
		--sic-nav-size: 46px;
	}

	.sic__nav--prev {
		left: -14px;
	}

	.sic__nav--next {
		right: -14px;
	}
}

@media (hover: hover) {
	.sic__nav:hover {
		transform: translateY(-50%) scale(1.08);
	}
}

.sic__nav:focus-visible {
	outline: 2px solid var(--sic-focus);
	outline-offset: 2px;
}

.sic__nav[disabled] {
	opacity: 0.35;
	cursor: default;
	pointer-events: none;
}

/* JSが「スクロールの必要なし」と判断したら操作UIを隠す */
.sic.is-static .sic__nav,
.sic.is-static .sic__controls {
	display: none;
}

/* ---------- ドットと再生ボタン ---------- */

.sic__controls {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	margin-top: 14px;
}

.sic__dots {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

.sic__dot {
	width: 9px;
	height: 9px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--sic-dot);
	cursor: pointer;
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.sic__dot[aria-current="true"] {
	background: var(--sic-dot-active);
	transform: scale(1.35);
}

.sic__dot:focus-visible,
.sic__play:focus-visible {
	outline: 2px solid var(--sic-focus);
	outline-offset: 3px;
}

.sic__dot[hidden] {
	display: none;
}

.sic__play {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: none;
	color: var(--sic-dot-active);
	cursor: pointer;
}

.sic__play-pause,
.sic__play-start {
	display: none;
	width: 10px;
	height: 11px;
	background: currentColor;
}

.sic__play-pause {
	box-sizing: border-box;
	background: none;
	border-left: 3px solid currentColor;
	border-right: 3px solid currentColor;
}

.sic__play-start {
	clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.sic__play .sic__play-pause {
	display: block;
}

.sic__play.is-paused .sic__play-pause {
	display: none;
}

.sic__play.is-paused .sic__play-start {
	display: block;
}

/* ---------- 拡大表示（ライトボックス） ---------- */

.sic-lightbox {
	max-width: 96vw;
	max-height: 96vh;
	padding: 0;
	border: 0;
	background: transparent;
	overflow: visible;
}

.sic-lightbox::backdrop {
	background: rgba(0, 0, 0, 0.85);
}

.sic-lightbox__inner {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
}

.sic-lightbox__img {
	display: block;
	max-width: 92vw;
	max-height: 84vh;
	width: auto;
	height: auto;
	border-radius: 6px;
	background: #000;
}

.sic-lightbox__caption {
	margin: 0;
	max-width: 92vw;
	color: #fff;
	font-size: 0.9rem;
	line-height: 1.6;
	text-align: center;
}

.sic-lightbox__close,
.sic-lightbox__nav {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	color: #111;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}

.sic-lightbox__close {
	top: -14px;
	right: -14px;
	width: 38px;
	height: 38px;
}

.sic-lightbox__nav {
	top: 50%;
	transform: translateY(-50%);
}

.sic-lightbox__nav--prev {
	left: 8px;
}

.sic-lightbox__nav--next {
	right: 8px;
}

/* ---------- その他 ---------- */

.sic-notice {
	padding: 10px 14px;
	border: 1px dashed #f0b429;
	border-radius: 6px;
	background: #fffbeb;
	color: #92400e;
	font-size: 0.9em;
}

@media (prefers-reduced-motion: reduce) {
	.sic__viewport {
		scroll-behavior: auto;
	}

	.sic__link .sic__img,
	.sic__zoom .sic__img,
	.sic__nav,
	.sic__dot {
		transition: none;
	}

	.sic__link:hover .sic__img,
	.sic__zoom:hover .sic__img {
		transform: none;
	}
}
