/*!
 * Hard Piston Toolkit - 共通カルーセル（HPT.Carousel）
 *
 * レイアウト・スクロール挙動（トラックの横スクロール・ドラッグ・表示枚数の
 * レスポンシブ）のみを担当する共通スタイル。data-hpt-carousel-* 属性の
 * セレクタのみで構成しており、BEMクラス名（.hpt-timeline__gallery 等）には
 * 依存しない。画像自体の見た目（角丸・アスペクト比等）は各コンポーネントの
 * 専用CSS（例: timeline.css）側で担当する。
 */

[data-hpt-carousel] {
	position: relative;
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
}

[data-hpt-carousel-track] {
	display: flex;
	flex: 1 1 auto;
	gap: 10px;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	cursor: grab;
	touch-action: pan-y pinch-zoom;
}

[data-hpt-carousel-track]::-webkit-scrollbar {
	display: none;
}

[data-hpt-carousel-track].is-dragging {
	cursor: grabbing;
	scroll-snap-type: none;
}

[data-hpt-carousel-item] {
	flex: 0 0 auto;
	scroll-snap-align: start;
	width: 31%;
}

[data-hpt-carousel-prev],
[data-hpt-carousel-next] {
	flex: 0 0 auto;
	width: 34px;
	height: 34px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	line-height: 1;
	color: #ececec;
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: 50%;
	cursor: pointer;
	z-index: 2;
	transition: background 0.2s ease-out, border-color 0.2s ease-out, color 0.2s ease-out;
}

[data-hpt-carousel-prev]:hover,
[data-hpt-carousel-next]:hover,
[data-hpt-carousel-prev]:focus-visible,
[data-hpt-carousel-next]:focus-visible {
	background: #ff1493;
	border-color: #ff1493;
	color: #fff;
	outline: none;
}

[data-hpt-carousel-prev][disabled],
[data-hpt-carousel-next][disabled] {
	opacity: 0.3;
	cursor: default;
	pointer-events: none;
}

/* =========================================================
 * レスポンシブ表示枚数
 * PC: 約3〜4枚表示 / タブレット: 約2枚 / スマホ: 約1〜2枚
 * ========================================================= */

@media (max-width: 768px) {
	[data-hpt-carousel-item] {
		width: 47%;
	}
}

@media (max-width: 480px) {
	[data-hpt-carousel-item] {
		width: 82%;
	}

	[data-hpt-carousel-prev],
	[data-hpt-carousel-next] {
		width: 30px;
		height: 30px;
		font-size: 16px;
	}
}
