/* MGS Auto Plugin — フロント表示用スタイル */

/* サンプル画像グリッド（[sample-grid1] / [sample-grid2] / [sample-grid]） */
.mgs-gallery {
	display: grid;
	gap: 8px;
	margin: 1.4em 0;
}
.mgs-gallery-cols-1 {
	grid-template-columns: 1fr;
	gap: 12px;
	max-width: 900px;
	margin-left: auto;
	margin-right: auto;
}
.mgs-gallery-cols-2 { grid-template-columns: repeat( 2, 1fr ); }
.mgs-gallery-cols-3 { grid-template-columns: repeat( 3, 1fr ); }
.mgs-gallery-cols-4 { grid-template-columns: repeat( 4, 1fr ); }

.mgs-gallery-item {
	display: block;
	line-height: 0;
	border-radius: 4px;
	overflow: hidden;
	transition: opacity 0.15s ease;
}
.mgs-gallery-item:hover { opacity: 0.85; }
.mgs-gallery-item img {
	width: 100%;
	height: auto;
	display: block;
}

@media ( max-width: 600px ) {
	.mgs-gallery-cols-3,
	.mgs-gallery-cols-4 { grid-template-columns: repeat( 2, 1fr ); }
}

/* 動画サムネ風リンク（[sample-movie]）
   MGSのサンプルはCloudFront署名保護のため直接埋め込めない。
   プレイヤー風の見た目でMGS作品ページへ送客する。 */
.mgs-videolink {
	position: relative;
	display: block;
	max-width: 900px;
	margin: 1.4em auto;
	line-height: 0;
	border-radius: 8px;
	overflow: hidden;
	background: #000;
	text-decoration: none;
	box-shadow: 0 3px 12px rgba( 0, 0, 0, 0.3 );
	transition: transform 0.12s ease, box-shadow 0.2s ease;
}
.mgs-videolink:hover {
	transform: translateY( -2px );
	box-shadow: 0 6px 20px rgba( 0, 0, 0, 0.45 );
}
.mgs-videolink-poster {
	width: 100%;
	height: auto;
	display: block;
}
/* 暗転オーバーレイ */
.mgs-videolink-overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to bottom,
		rgba( 0, 0, 0, 0.15 ) 0%,
		rgba( 0, 0, 0, 0.35 ) 60%,
		rgba( 0, 0, 0, 0.7 ) 100%
	);
	transition: background 0.2s ease;
}
.mgs-videolink:hover .mgs-videolink-overlay {
	background: rgba( 0, 0, 0, 0.3 );
}
/* 中央の再生ボタン（CSSのみで描画） */
.mgs-videolink-play {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 74px;
	height: 74px;
	margin: -37px 0 0 -37px;
	border-radius: 50%;
	background: rgba( 195, 0, 0, 0.92 );
	box-shadow: 0 2px 12px rgba( 0, 0, 0, 0.5 );
	transition: transform 0.15s ease, background 0.15s ease;
}
/* ▶ の三角形 */
.mgs-videolink-play::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 0;
	height: 0;
	margin: -14px 0 0 -8px;
	border-style: solid;
	border-width: 14px 0 14px 23px;
	border-color: transparent transparent transparent #fff;
}
.mgs-videolink:hover .mgs-videolink-play {
	transform: scale( 1.1 );
	background: rgba( 195, 0, 0, 1 );
}
/* 下部ラベル */
.mgs-videolink-label {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 10px 14px;
	color: #fff;
	font-size: 0.9em;
	font-weight: 700;
	line-height: 1.4;
	text-align: center;
	text-shadow: 0 1px 3px rgba( 0, 0, 0, 0.9 );
}

@media ( max-width: 600px ) {
	.mgs-videolink-play {
		width: 58px;
		height: 58px;
		margin: -29px 0 0 -29px;
	}
	.mgs-videolink-play::after {
		margin: -11px 0 0 -6px;
		border-width: 11px 0 11px 18px;
	}
	.mgs-videolink-label { font-size: 0.8em; }
}

/* 横並びサムネイル（[sample-flex]） */
.mgs-flex {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 1em 0;
}
.mgs-flex-item {
	flex: 0 0 auto;
	width: calc( 25% - 6px );
	max-width: 150px;
}
.mgs-flex-item img {
	width: 100%;
	height: auto;
	display: block;
	border-radius: 4px;
}

/* [mgs] 単一表示カード */
.mgs-single {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	margin: 1.6em 0;
	padding: 16px;
	border: 1px solid rgba( 128, 128, 128, 0.25 );
	border-radius: 10px;
}
.mgs-single-media {
	flex: 0 0 280px;
	max-width: 100%;
}
.mgs-single-media img {
	width: 100%;
	height: auto;
	border-radius: 6px;
	display: block;
}
.mgs-single-body {
	flex: 1 1 300px;
	min-width: 0;
}
.mgs-single-title {
	margin: 0 0 0.6em;
	font-size: 1.15em;
	line-height: 1.4;
}
.mgs-single-caption {
	font-size: 0.92em;
	opacity: 0.85;
	margin: 0 0 1em;
}
.mgs-single-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 1em;
	font-size: 0.9em;
}
.mgs-single-table th,
.mgs-single-table td {
	border: 1px solid rgba( 128, 128, 128, 0.25 );
	padding: 6px 10px;
	text-align: left;
	vertical-align: top;
}
.mgs-single-table th {
	width: 6em;
	background: rgba( 128, 128, 128, 0.08 );
	white-space: nowrap;
}

/* [mgs_list] グリッド */
.mgs-grid {
	display: grid;
	gap: 14px;
	margin: 1.4em 0;
}
.mgs-cols-1 { grid-template-columns: repeat( 1, 1fr ); }
.mgs-cols-2 { grid-template-columns: repeat( 2, 1fr ); }
.mgs-cols-3 { grid-template-columns: repeat( 3, 1fr ); }
.mgs-cols-4 { grid-template-columns: repeat( 4, 1fr ); }
.mgs-cols-5 { grid-template-columns: repeat( 5, 1fr ); }
.mgs-cols-6 { grid-template-columns: repeat( 6, 1fr ); }

/* カードは画像を主役にし、文字は画像の上に重ねる */
.mgs-card {
	display: block;
	position: relative;
	text-decoration: none;
	color: inherit;
	border-radius: 6px;
	overflow: hidden;
	background: transparent;
	transition: box-shadow 0.15s ease, transform 0.08s ease;
}
.mgs-card:hover {
	box-shadow: 0 4px 14px rgba( 0, 0, 0, 0.35 );
	transform: translateY( -2px );
}
/* MGSのパッケージは横長 */
.mgs-card-thumb {
	display: block;
	position: relative;
	aspect-ratio: 16 / 11;
	background: #1c1c1c;
	overflow: hidden;
}
.mgs-card-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.mgs-noimg {
	display: block;
	width: 100%;
	height: 100%;
}
.mgs-card-body {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 2;
	padding: 24px 7px 6px;
	display: flex;
	flex-direction: column;
	gap: 2px;
	pointer-events: none;
	background: linear-gradient(
		to top,
		rgba( 0, 0, 0, 0.88 ) 0%,
		rgba( 0, 0, 0, 0.6 ) 45%,
		rgba( 0, 0, 0, 0 ) 100%
	);
}
.mgs-card-title {
	color: rgba( 255, 255, 255, 0.92 );
	font-size: 0.72em;
	line-height: 1.3;
	text-shadow: 0 1px 3px rgba( 0, 0, 0, 0.9 );
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.mgs-card-price {
	color: rgba( 255, 255, 255, 0.75 );
	font-weight: 700;
	font-size: 0.7em;
	text-shadow: 0 1px 3px rgba( 0, 0, 0, 0.9 );
}

/* 順位バッジ */
.mgs-badge-rank {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 3;
	min-width: 2.4em;
	padding: 3px 6px;
	font-size: 0.75em;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	color: #fff;
	background: rgba( 0, 0, 0, 0.7 );
	border-bottom-right-radius: 6px;
}
.mgs-badge-rank.mgs-badge-top { background: #c30000; }

.mgs-empty {
	opacity: 0.7;
	padding: 1em;
	text-align: center;
}

@media ( max-width: 782px ) {
	.mgs-cols-4,
	.mgs-cols-5,
	.mgs-cols-6 { grid-template-columns: repeat( 3, 1fr ); }
	.mgs-flex-item { width: calc( 33.333% - 6px ); }
	.mgs-single-media { flex-basis: 100%; }
}
@media ( max-width: 480px ) {
	.mgs-cols-3,
	.mgs-cols-4,
	.mgs-cols-5,
	.mgs-cols-6 { grid-template-columns: repeat( 2, 1fr ); }
}
