/**
 * SC Manga Viewer 共通スタイル
 */

/* 共通コンテナ */
.mmv-common-style {
	padding: 1rem 0;
	background-color: #fcfcfc;
	/* min-height: 80vh; */
	margin-bottom: 2rem;
	border: 1px solid #eee;
	border-radius: 20px;
	overflow: hidden;
}

.mmv-common-style .inner {
	max-width: 1140px;
	margin: 0 auto;
	padding: 0 20px;
}

/* --- セクションヘッダー --- */
.section-header-flex {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 30px;
	border-bottom: 2px solid #00BFA5;
	padding-bottom: 12px;
}

.section-title {
	font-size: 24px;
	font-weight: bold;
	color: #333;
	margin: 0;
	display: flex;
	align-items: baseline;
	gap: 12px;
}

.section-title-jp {
	font-size: 12px;

}

.view-all-link {
	display: inline-block;
	font-size: 12px;
	color: #00BFA5;
	text-decoration: none;
	font-weight: bold;
	border: 1px solid #00BFA5;
	padding: 4px 18px;
	border-radius: 20px;
	background: #fff;
	transition: all 0.3s ease;
}

/* --- 共通グリッド & カード (PC: 縦型 / SP: 横型) --- */
.manga-grid {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 20px;
}

/* PC用：縦型カードスタイル */
.manga-card-item .card-inner {
	align-items: flex-start;
	display: flex;
	flex-direction: column;
	height: 100%;
}

.card-thumb {
	position: relative;
	aspect-ratio: 2 / 3;
	border-radius: 12px;
	background: #fff;
	padding: 4px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
	margin-bottom: 12px;
	transition: transform 0.3s ease;
	display: block;
	overflow: hidden;
}

.card-thumb img {
	width: 100% !important;
	height: 100% !important;
	object-fit: contain !important;
	/* これが重要：比率を維持して枠を埋める */
	/* object-position: center top; */
}

.badge-new {
	position: absolute;
	top: -6px;
	right: -6px;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	font-size: 11px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: bold;
	z-index: 2;
	border: 2px solid #fff;
	background: #00BFA5;
	color: #fff;
}

.card-content {
	display: flex;
	flex-direction: column;
	flex: 1;
}

.card-catch-copy {
	font-size: 10px;
	color: var(--navy);
	margin: 0;
	padding: 0.2rem 0;
}

.card-title {
	font-size: 13px;
	font-weight: bold;
	margin: 0 0 4px;
	line-height: 1.4;
}

.card-title a {
	text-decoration: none;
	color: #333;
}

.card-ep-name {
	font-size: 11px;
	color: #777;
	margin-bottom: 4px;
}

.oneshot-label {
	display: inline-block;
	background: #333;
	color: #fff;
	padding: 0px 6px;
	border-radius: 4px;
	font-size: 10px;
}

.card-author {
	font-size: 11px;
	color: #999;
	margin-bottom: 6px;
}

.card-date {
	font-size: 10px;
	color: #bbb;
}

/* --- 共通タグ --- */
.manga-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-top: auto;
	/* 下部に寄せる */
}

.manga-tag {
	display: inline-block;
	font-size: 10px;
	color: #666 !important;
	background: #fff;
	border: 1px solid #ddd;
	padding: 2px 8px;
	border-radius: 20px;
	text-decoration: none !important;
}

.br-sp {
	display: none;
}

/*検索*/
.manga-search-container {
	width: 100%;
	max-width: 600px;
	margin: 20px auto;
}

.search-input-group {
	display: flex;
	gap: 8px;
}

.search-field {
	flex: 1;
	padding: 12px 16px;
	border: 2px solid #eee;
	border-radius: 30px;
	font-size: 16px;
	transition: border-color 0.3s;
}

.search-field:focus {
	outline: none;
	border-color: #00BFA5;
}

.search-submit {
	padding: 0 24px;
	background: #00BFA5;
	color: #fff;
	border: none;
	border-radius: 30px;
	font-weight: bold;
	cursor: pointer;
	transition: opacity 0.3s;
	white-space: nowrap;
}

.search-submit:hover {
	opacity: 0.8;
}

.logo-link {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-decoration: none;
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	opacity: 0.6;
	/* 通常時は少し薄くして控えめに */
}

/* ロゴ画像自体のスタイル調整（テーマのロゴ出力に合わせて） */
.logo-link img,
.logo-link .custom-logo {
	max-width: 120px;
	height: auto;
	filter: grayscale(100%);
	/* モノトーンにするとより上品 */
	transition: filter 0.3s ease, transform 0.3s ease;
}

.footer-logo img {
	height: 20px;
	width: auto;
	filter: brightness(0) invert(1);
	vertical-align: middle;
}

/* --- モバイル対応 (ここが肝) --- */
@media (max-width: 767px) {
	.br-sp {
		display: block;
	}

	.manga-grid {
		grid-template-columns: 1fr;
		/* 1列にする */
		gap: 15px;
	}

	/* 横型カードに切り替え */
	.manga-card-item .card-inner {
		flex-direction: row;
		background: #fff;
		border-radius: 12px;
		padding: 10px;
		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
		border: 1px solid #efefef;
	}

	.card-thumb {
		width: 80px;
		/* 横型時の書影幅 */
		margin-bottom: 0;
		/* margin-right: 15px; */
		flex-shrink: 0;
	}

	.card-content {
		justify-content: flex-start;
	}

	.card-title {
		font-size: 14px;
		margin-bottom: 4px;
	}

	.card-ep-name {
		font-size: 12px;
		margin-bottom: 8px;
	}

	.card-tags {
		margin-top: 5px;
	}
}

/* --- エピソード詳細 / 作品詳細 2カラムレイアウト --- */

.manga-detail-flex {
	display: flex;
	gap: 40px;
	margin-top: 40px;
	margin-bottom: 40px;
}

/* 左カラム: 作品メイン情報 */
.manga-side-info {
	width: 320px;
	flex-shrink: 0;
}

.series-main-visual {
	margin-bottom: 24px;
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.series-main-visual img {
	width: 100%;
	height: auto;
	display: block;
}

.series-meta-title {
	font-size: 26px;
	font-weight: bold;
	margin: 0 0 10px;
	color: #111;
	line-height: 1.3;
}

.series-meta-author {
	font-size: 15px;
	color: #666;
	margin-bottom: 20px;
	display: block;
}

.series-meta-synopsis {
	font-size: 14px;
	line-height: 1.8;
	color: #555;
	margin-bottom: 24px;
	text-align: justify;
}

/* 右カラム: リストエリア */
.manga-main-content {
	flex: 1;
	min-width: 0;
}

/* エピソードリストのコンテナ */
.episode-list-container {
	background: #fff;
	border-radius: 8px;
	border: 1px solid #e0e0e0;
	overflow: hidden;
	margin-bottom: 0;
}

.ep-list-header {
	padding: 18px 20px;
	font-weight: bold;
	background: #fcfcfc;
	border-bottom: 1px solid #eee;
	font-size: 16px;
	color: #333;
}

/* .ep-item {
	display: flex;
	align-items: center;
	padding: 15px 20px;
	border-bottom: 1px solid #f5f5f5;
	text-decoration: none;
	color: inherit;
	transition: background 0.2s;
} */
.ep-item {
	display: flex;
	align-items: flex-start;
	/* 上揃え（中央ならcenter） */
	gap: 15px;
	/* 画像とテキストの間隔 */
	padding: 15px;
	border-bottom: 1px solid #eee;
}

.ep-item:last-child {
	border-bottom: none;
}

.ep-item:hover {
	background-color: #f9fdfc;
}

.ep-item.is-current {
	background-color: #f0faf8;
	border-left: 4px solid #00BFA5;
}

.ep-item-thumb {
	width: 110px;
	aspect-ratio: 16 / 9;
	background: #f0f0f0;
	border-radius: 4px;
	overflow: hidden;
	margin-right: 20px;
	flex-shrink: 0;
}

.ep-item-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ep-item-body {
	flex-grow: 1;
	/* 残りの幅をすべて使う */
	display: flex;
	flex-direction: column;
	/* 縦に並べる */
	justify-content: space-between;
	/* 上下に振り分けたい場合 */
	min-height: 100px;
	/* 画像の高さに合わせると綺麗です */
}

/* 右側エリア：縦並びにする */
.ep-item-right {
	flex-grow: 1;
	/* 残りの幅をすべて占有 */
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	min-height: 110px;
	/* 画像の高さに合わせるとバランスが良いです */
}

.ep-item-info {
	flex: 1;
}

.ep-item-title {
	font-size: 15px;
	font-weight: bold;
	margin-bottom: 4px;
	color: #333;
}

.ep-item-date {
	font-size: 12px;
	color: #999;
}

/* ★ボタンエリア：ここを右寄せにする */
.ep-item-actions {
	display: flex;
	/*justify-content: flex-end; */
	/* 中のボタンを右に寄せる */
	margin-top: 10px;
}

/* --- コミックスセクション --- */
.comics-section {
	margin-top: 50px;
	padding-top: 40px;
	border-top: 1px solid #e0e0e0;
}

.comics-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 20px;
	margin-top: 20px;
}

.comic-card {
	text-decoration: none;
	color: inherit;
	display: block;
}

.comic-thumb {
	aspect-ratio: 2 / 3;
	border-radius: 6px;
	overflow: hidden;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	margin-bottom: 10px;
	background: #fff;
	transition: transform 0.2s;
}

.comic-card:hover .comic-thumb {
	transform: translateY(-4px);
}

.comic-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.comic-title {
	font-size: 13px;
	font-weight: bold;
	line-height: 1.4;
	color: #333;
}

/* --- 共通タグ --- */
.manga-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 4px;
	margin-top: 10px;
	position: relative;
	z-index: 5;
}

.manga-tag {
	display: inline-block;
	font-size: 11px;
	color: #666 !important;
	background: #fff;
	border: 1px solid #ddd;
	padding: 3px 12px;
	border-radius: 20px;
	line-height: 1.2;
	text-decoration: none !important;
	transition: all 0.2s ease;
}

.manga-tag:hover {
	background: #f0f0f0;
	border-color: #ccc;
	color: #333 !important;
}

/* ナビゲーション */
.archive-nav {
	margin-bottom: 50px;
	border-bottom: 1px solid #eee;
	padding-bottom: 20px;
}

.archive-nav-list {
	display: flex;
	justify-content: center;
	gap: 10px;
	list-style: none;
	padding: 0;
	margin: 0;
	flex-wrap: wrap;
}

.archive-nav-list a {
	text-decoration: none;
	color: #333;
	font-weight: bold;
	font-size: 13px;
	padding: 6px 20px;
	border-radius: 30px;
	background: #fff;
	border: 1px solid #ddd;
	transition: all 0.3s ease;
	display: inline-block;
}

.archive-nav-list a:hover {
	background: #00BFA5;
	color: #fff;
	border-color: #00BFA5;
}

.category-divider {
	margin-top: 1rem;
	font-size: 18px;
	font-weight: bold;
	margin-bottom: 24px;
	color: #333;
	display: flex;
	align-items: center;
}

.category-divider::after {
	content: '';
	flex: 1;
	height: 1px;
	background: #ddd;
	margin-left: 15px;
}

/* --- モバイル対応 --- */
@media (max-width: 900px) {
	.manga-detail-flex {
		flex-direction: column;
	}

	.manga-side-info {
		width: 100%;
	}

	.ep-item-thumb {
		width: 90px;
	}
}

@media (max-width: 767px) {
	.mmv-common-style {
		border-radius: 10px;
		/* スマホでは角丸を少し抑える */
		margin-bottom: 1rem;
		border-left: none;
		border-right: none;

	}

	.section-header-flex {
		flex-direction: row;
		/* タイトルと「もっと見る」は横並びを維持 */
		align-items: center;
		margin-bottom: 20px;
	}

	.section-title {
		font-size: 18px;
	}

	/* 1列表示を保証 */
	.manga-grid {
		grid-template-columns: 1fr !important;
		/* 必ず1列 */
		gap: 12px !important;
	}

	.manga-card-item .card-inner {
		flex-direction: row !important;
		/* 横並び */
		border-radius: 0 !important;
		/* カード外枠の角丸なし */
		border-left: none;
		border-right: none;
		box-shadow: none;
		border-bottom: 1px solid #eee;
		padding: 10px 0;
		background: transparent;
	}

	.card-thumb {
		width: 100px !important;
		/* 書影幅を固定 */
		flex-shrink: 0;
		aspect-ratio: 3 / 4 !important;
		/* 細長くなりすぎないよう調整 */
		border-radius: 0 !important;
		/* サムネイルの角丸なし */

	}

	.card-thumb img {
		border-radius: 0 !important;
		/* 画像自体の角丸なし */
	}

	.card-content {
		padding: 0 15px !important;
		justify-content: center;
	}

	.card-title {
		font-size: 15px !important;
		margin-bottom: 4px;
	}

	.card-author,
	.card-ep-name {
		font-size: 12px !important;
	}

	.ep-item {
		padding: 12px;
	}

	.ep-item-thumb {
		width: 80px;
		margin-right: 12px;
	}
}

.read-button {
	padding: 8px 24px;
	border-radius: 20px;
	text-decoration: none;
	font-size: 0.85rem;
	font-weight: bold;
	white-space: nowrap;
	background: #00BFA5;
	color: #fff;
	border: none;
	margin-right: 0.5rem;
}

.buy-button-small {
	padding: 8px 16px;
	border-radius: 20px;
	text-decoration: none;
	font-size: 0.85rem;
	font-weight: bold;
	white-space: nowrap;
	background: #ffffff;
	color: #00BFA5;
	border: 1px solid #00BFA5;
	margin-right: 0.5rem;
}

.news-flex-container {
	display: flex;
	gap: 50px;
	align-items: flex-start;
	padding: 40px 1rem;
}

.news-main-content {
	flex: 1;
	min-width: 0;
	border: 1px solid #eee;
	border-radius: 20px;
	overflow: hidden;
}

.footer-logo img {
	height: 20px;
	/* PC版ではかなり小さくして高さを抑える */
	width: auto;
	filter: brightness(0) invert(1);
	vertical-align: middle;
}