/* =================================================================
 * 動画（reel）一覧グリッド ＋ 再生モーダル
 * ================================================================= */

/* ---- グリッド ---- */
.reel-grid {
	display: grid;
	grid-template-columns: repeat(var(--reel-cols, 3), 1fr);
	gap: 16px;
	margin: 0 auto;
	padding: 0;
	list-style: none;
}

@media (max-width: 767px) {
	.reel-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 10px;
	}
}

/* ---- カード ---- */
.reel-card {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 0;
	margin: 0;
	border: none;
	background: none;
	cursor: pointer;
	text-align: left;
	font: inherit;
	color: inherit;
	-webkit-appearance: none;
	appearance: none;
}

.reel-thumb {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 9 / 16; /* リール（縦型）比率 */
	overflow: hidden;
	border-radius: 12px;
	background: #111;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.reel-card:hover .reel-thumb,
.reel-card:focus-visible .reel-thumb {
	transform: translateY(-3px);
	box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}

.reel-thumb_media {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* 再生アイコン */
.reel-play {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 54px;
	height: 54px;
	transform: translate(-50%, -50%);
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.45);
	backdrop-filter: blur(2px);
	transition: background 0.2s ease;
}

.reel-play::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 54%;
	transform: translate(-50%, -50%);
	border-style: solid;
	border-width: 10px 0 10px 17px;
	border-color: transparent transparent transparent #fff;
}

.reel-card:hover .reel-play {
	background: rgba(0, 0, 0, 0.65);
}

.reel-title {
	display: block;
	font-size: 14px;
	line-height: 1.5;
	color: #333;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.reel-empty {
	text-align: center;
	color: #888;
	padding: 40px 0;
}

/* ---- モーダル ---- */
.reel-modal {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease, visibility 0.25s ease;
}

.reel-modal.is-open {
	opacity: 1;
	visibility: visible;
}

.reel-modal_overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.85);
}

.reel-modal_inner {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	max-width: 100%;
	max-height: 100%;
}

.reel-modal_video {
	max-width: min(440px, 92vw);
	max-height: 82vh;
	width: auto;
	height: auto;
	border-radius: 12px;
	background: #000;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.reel-modal_title {
	margin: 14px 0 0;
	color: #fff;
	font-size: 15px;
	text-align: center;
	max-width: 440px;
}

.reel-modal_close {
	position: absolute;
	top: -44px;
	right: 0;
	width: 40px;
	height: 40px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.2s ease;
}

.reel-modal_close:hover {
	background: rgba(255, 255, 255, 0.3);
}

@media (max-width: 767px) {
	.reel-modal_close {
		top: 0;
		right: 0;
	}
}

/* モーダル表示中は背面スクロールを止める */
body.reel-modal-open {
	overflow: hidden;
}
