/**
 * CDN画像スライダーの公開ページ・共通スタイル。
 */

.jy-cdn-image-slider {
	--jy-cdn-image-slider-radius: 12px;
	--jy-cdn-image-slider-control-size: 40px;
	max-width: 767px;
	margin: 24px auto;
}

.jy-cdn-image-slider.alignwide {
	max-width: 960px;
}

.jy-cdn-image-slider.alignfull {
	max-width: none;
}

.jy-cdn-image-slider__media {
	position: relative;
}

.jy-cdn-image-slider__viewport {
	display: flex;
	width: 100%;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.jy-cdn-image-slider__viewport::-webkit-scrollbar {
	display: none;
}

.jy-cdn-image-slider__slide {
	position: relative;
	flex: 0 0 100%;
	width: 100%;
	margin: 0;
	overflow: hidden;
	aspect-ratio: 3 / 4;
	background: #f5f5f5;
	border-radius: var(--jy-cdn-image-slider-radius);
	scroll-snap-align: start;
	scroll-snap-stop: always;
}

.jy-cdn-image-slider__slide img {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: inherit;
	object-fit: contain;
}

.jy-cdn-image-slider__overlay-controls {
	position: absolute;
	z-index: 2;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 8px;
	pointer-events: none;
}

.jy-cdn-image-slider__overlay-controls .jy-cdn-image-slider__button {
	pointer-events: auto;
}

.jy-cdn-image-slider__controls {
	display: flex;
	align-items: center;
	justify-content: center;
	margin-top: 10px;
}

.jy-cdn-image-slider__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: var(--jy-cdn-image-slider-control-size);
	min-width: var(--jy-cdn-image-slider-control-size);
	max-width: var(--jy-cdn-image-slider-control-size);
	height: var(--jy-cdn-image-slider-control-size);
	min-height: var(--jy-cdn-image-slider-control-size);
	max-height: var(--jy-cdn-image-slider-control-size);
	flex: 0 0 var(--jy-cdn-image-slider-control-size);
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.55);
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.3);
	color: rgba(255, 255, 255, 0.92);
	cursor: pointer;
	font-size: 24px;
	line-height: 1;
}

.jy-cdn-image-slider__button:hover:not(:disabled) {
	background: rgba(0, 0, 0, 0.42);
}

.jy-cdn-image-slider__button:disabled {
	cursor: default;
	border-color: rgba(255, 255, 255, 0.25);
	background: rgba(0, 0, 0, 0.12);
	color: rgba(255, 255, 255, 0.42);
	opacity: 1;
}

.jy-cdn-image-slider__counter {
	min-width: 60px;
	color: var(--jy-color-muted, #666);
	font-size: 14px;
	text-align: center;
}

.jy-cdn-image-slider__dots {
	position: absolute;
	z-index: 2;
	right: 0;
	bottom: 12px;
	left: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

.jy-cdn-image-slider__dot {
	display: block;
	width: 8px;
	height: 8px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: currentColor;
	color: rgba(0, 0, 0, 0.22);
	cursor: pointer;
}

.jy-cdn-image-slider__dot.is-active {
	color: var(--jy-color-text, #222);
}

.jy-cdn-image-slider__dot:focus-visible,
.jy-cdn-image-slider__button:focus-visible,
.jy-cdn-image-slider__viewport:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
	.jy-cdn-image-slider__viewport {
		scroll-behavior: auto;
	}
}
