/*
 * EROPORTA（Muum 子テーマ）の作品表示。
 * 親テーマの見た目は変えず、ep- で始まる部品だけを整える。
 * 配色は試作（app/server.py）と同じ系統。スマホ（〜599px）・iPad（600〜1023px）・PC（1024px〜）。
 * 0.2.0 の画像つきカードの列: スマホ 2 列（〜699px）・iPad 縦 4 列（700〜999px）・iPad 横 5 列（1000〜1279px）・PC 6 列（1280px〜）。
 */
.ep-main,
.ep-saved,
.ep-services,
.ep-tabs {
	--ep-ink: #23231f;
	--ep-sub: #6b6b64;
	--ep-line: #e3e3e0;
	--ep-bg: #f7f7f5;
	--ep-accent: #23231f;
	--ep-warn-ink: #7a5e00;
	--ep-warn-bg: #fcf9e8;
	--ep-err-ink: #b32020;
	--ep-err-bg: #fdf0f0;
	--ep-ok-ink: #1d6b33;
	--ep-ok-bg: #f0f8f2;
	color: var(--ep-ink);
}

.ep-main *,
.ep-saved *,
.ep-services *,
.ep-tabs * {
	box-sizing: border-box;
}

.ep-container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 16px 16px 48px;
}

/* ---------------------------------------------------------------- 見出し・文字 */
.ep-page-head {
	margin: 8px 0 16px;
}

.ep-page-label {
	margin: 0;
	font-size: 12px;
	color: var(--ep-sub);
	letter-spacing: .06em;
}

.ep-page-title {
	margin: 2px 0 6px;
	font-size: 22px;
	line-height: 1.45;
	word-break: break-word;
}

.ep-h2 {
	margin: 28px 0 8px;
	font-size: 17px;
	line-height: 1.5;
}

.ep-h3 {
	margin: 22px 0 6px;
	font-size: 15px;
	line-height: 1.5;
}

.ep-h2 .ep-note,
.ep-h3 .ep-note {
	margin-left: 8px;
	font-weight: normal;
}

.ep-lead {
	margin: 4px 0 14px;
	font-size: 14px;
	line-height: 1.8;
	color: var(--ep-sub);
}

.ep-note {
	font-size: 12px;
	line-height: 1.7;
	color: var(--ep-sub);
}

p.ep-note {
	margin: 4px 0 8px;
}

.ep-unknown {
	color: var(--ep-sub);
}

.ep-err {
	margin: 8px 0;
	padding: 8px 12px;
	font-size: 13px;
	color: var(--ep-err-ink);
	background: var(--ep-err-bg);
	border-left: 3px solid var(--ep-err-ink);
}

/* 保存一覧の「削除しました」などの完了の知らせ（保存領域への書き込みが成功した後だけ出す） */
.ep-okmsg {
	margin: 8px 0;
	padding: 8px 12px;
	font-size: 13px;
	color: var(--ep-ok-ink);
	background: var(--ep-ok-bg);
	border-left: 3px solid var(--ep-ok-ink);
}

.ep-tz {
	font-size: 11px;
	color: var(--ep-sub);
}

.ep-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.ep-back,
.ep-more {
	margin: 12px 0;
	font-size: 13px;
}

.ep-back a,
.ep-more a {
	color: var(--ep-sub);
}

/* ---------------------------------------------------------------- 検索 */
.ep-search {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 8px 10px;
	margin: 0 0 14px;
	padding: 12px;
	background: var(--ep-bg);
	border: 1px solid var(--ep-line);
	border-radius: 6px;
}

.ep-field {
	display: flex;
	flex: 1 1 220px;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.ep-field-label {
	font-size: 11px;
	color: var(--ep-sub);
}

.ep-search input[type="search"],
.ep-search input[type="text"] {
	width: 100%;
	min-height: 42px;
	padding: 8px 10px;
	font-size: 16px; /* iOS の自動拡大を防ぐ */
	color: var(--ep-ink);
	background: #fff;
	border: 1px solid #c8c8c2;
	border-radius: 4px;
}

.ep-link-saved {
	align-self: center;
	font-size: 13px;
	color: var(--ep-sub);
}

.ep-count {
	margin: 4px 0 10px;
	font-size: 14px;
	font-weight: bold;
}

.ep-count .ep-note {
	margin-left: 6px;
	font-weight: normal;
}

/* ---------------------------------------------------------------- ボタン */
.ep-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 42px;
	padding: 0 16px;
	font-size: 14px;
	line-height: 1.2;
	color: #fff;
	background: var(--ep-accent);
	border: 1px solid var(--ep-accent);
	border-radius: 4px;
	cursor: pointer;
}

.ep-btn-sub {
	min-height: 36px;
	padding: 0 12px;
	font-size: 13px;
	color: var(--ep-ink);
	background: #fff;
}

.ep-btn.is-saved {
	color: var(--ep-ok-ink);
	border-color: var(--ep-ok-ink);
	background: var(--ep-ok-bg);
}

.ep-save-status {
	display: block;
	margin-top: 4px;
	font-size: 12px;
	color: var(--ep-ok-ink);
}

.ep-save-status.is-error {
	color: var(--ep-err-ink);
}

/* ---------------------------------------------------------------- 作品カード（保存した条件の一覧でも使う） */
.ep-card {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
	padding: 12px 14px;
	background: #fff;
	border: 1px solid var(--ep-line);
	border-radius: 6px;
}

.ep-card.is-past {
	background: var(--ep-bg);
}

.ep-card-title {
	margin: 0;
	font-size: 15px;
	line-height: 1.5;
	word-break: break-word;
}

.ep-card-title a {
	color: var(--ep-ink);
	text-decoration: none;
}

.ep-card-title a:hover,
.ep-card-title a:focus {
	text-decoration: underline;
}

.ep-meta {
	margin: 0;
	font-size: 12px;
	line-height: 1.8;
	color: var(--ep-sub);
	word-break: break-all;
}

.ep-vendor {
	display: inline-block;
	margin-right: 4px;
	padding: 0 7px;
	font-size: 11px;
	line-height: 1.7;
	color: #4d5661;
	border: 1px solid currentColor;
	border-radius: 3px;
}

.ep-id,
.ep-code {
	font-family: Menlo, Consolas, "Liberation Mono", monospace;
	font-size: 12px;
}

.ep-id {
	margin-right: 10px;
}

.ep-facts {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 2px 12px;
	margin: 0;
	font-size: 13px;
	line-height: 1.6;
}

.ep-fact {
	display: flex;
	gap: 6px;
	min-width: 0;
}

.ep-fact-wide {
	grid-column: 1 / -1;
}

.ep-facts dt {
	flex: 0 0 auto;
	min-width: 3.5em;
	color: var(--ep-sub);
}

.ep-facts dd {
	min-width: 0;
	margin: 0;
	word-break: break-word;
}

.ep-price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 2px 8px;
	margin: 2px 0 0;
	font-size: 14px;
}

.ep-price-label {
	font-size: 12px;
	color: var(--ep-sub);
}

.ep-price-value {
	font-weight: bold;
}

.ep-tag {
	display: inline-block;
	padding: 0 6px;
	font-size: 11px;
	line-height: 1.7;
	border: 1px solid currentColor;
	border-radius: 3px;
}

.ep-meta .ep-tag {
	margin-left: 6px;
}

.ep-tag-un {
	color: var(--ep-warn-ink);
	background: var(--ep-warn-bg);
}

.ep-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 2px 0 0;
}

.ep-chip {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	max-width: 100%;
	padding: 2px 9px;
	font-size: 12px;
	line-height: 1.6;
	color: var(--ep-ink);
	text-decoration: none;
	background: var(--ep-bg);
	border: 1px solid var(--ep-line);
	border-radius: 999px;
	word-break: break-all;
}

a.ep-chip:hover,
a.ep-chip:focus {
	border-color: var(--ep-sub);
}

.ep-chip-more {
	color: var(--ep-sub);
}

.ep-chip-count {
	font-size: 11px;
	color: var(--ep-sub);
}

.ep-empty {
	padding: 24px 0;
}

/* ---------------------------------------------------------------- 表（作品詳細） */
.ep-table-wrap {
	width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.ep-table {
	width: 100%;
	margin: 6px 0 10px;
	border-collapse: collapse;
	font-size: 14px;
}

.ep-table th,
.ep-table td {
	padding: 9px 10px;
	text-align: left;
	vertical-align: top;
	border-bottom: 1px solid var(--ep-line);
}

.ep-table th {
	font-size: 12px;
	font-weight: 600;
	color: var(--ep-sub);
	white-space: nowrap;
}

.ep-facts-table th {
	width: 11em;
	white-space: normal;
}

.ep-facts-table td a {
	color: var(--ep-ink);
}

.ep-past td,
.ep-past td .ep-code {
	color: var(--ep-sub);
	background: var(--ep-bg);
}

.ep-save-cell {
	min-width: 9em;
}

.ep-btn {
	white-space: nowrap;
}

.ep-offers time {
	white-space: nowrap;
}

.ep-offers .ep-tz {
	display: block;
}

/* iPad・PC: 価格・画質・視聴期限は折り返さない（表の幅は ep-table-wrap の横スクロールで吸収） */
@media (min-width: 600px) {
	.ep-offers td:nth-child(2),
	.ep-offers td:nth-child(3),
	.ep-offers td:nth-child(4) {
		white-space: nowrap;
	}
}

.ep-src {
	margin: 14px 0 6px;
	padding-top: 10px;
	font-size: 12px;
	line-height: 1.8;
	color: var(--ep-sub);
	border-top: 1px dashed var(--ep-line);
}

.ep-src p {
	margin: 0 0 4px;
}

.ep-listing + .ep-listing {
	margin-top: 32px;
	padding-top: 12px;
	border-top: 2px solid var(--ep-line);
}

/* スマホでは購入条件の表を「行ごとのカード」に組み替える */
@media (max-width: 599px) {
	.ep-page-title {
		font-size: 19px;
	}

	.ep-offers thead {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
	}

	.ep-offers,
	.ep-offers tbody,
	.ep-offers tr,
	.ep-offers td {
		display: block;
		width: 100%;
	}

	.ep-offers tr {
		margin-bottom: 10px;
		padding: 6px 10px;
		border: 1px solid var(--ep-line);
		border-radius: 6px;
	}

	/* 項目名を左、値（コード・注記・日時など）を右に縦に積む */
	.ep-offers td {
		display: grid;
		grid-template-columns: 6.5em minmax(0, 1fr);
		column-gap: 10px;
		align-items: start;
		padding: 6px 0;
		border-bottom: 1px dashed var(--ep-line);
	}

	.ep-offers td:last-child {
		border-bottom: 0;
	}

	.ep-offers td[data-label]::before {
		content: attr(data-label);
		grid-column: 1;
		grid-row: 1 / span 3;
		font-size: 12px;
		color: var(--ep-sub);
	}

	.ep-offers td[data-label] > * {
		grid-column: 2;
	}

	.ep-offers td[colspan],
	.ep-offers td.ep-save-cell {
		display: block;
	}

	.ep-facts-table th {
		width: 7.5em;
	}
}

/* ---------------------------------------------------------------- トップ */
.ep-hero {
	margin: 8px 0 8px;
}

.ep-section {
	margin: 12px 0 28px;
}

.ep-browse-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 8px 24px;
}

@media (min-width: 768px) {
	.ep-browse-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* ---------------------------------------------------------------- 一覧のページ送り（WordPress 標準の出力） */
.ep-main .navigation.pagination {
	margin: 20px 0;
}

.ep-main .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.ep-main .nav-links .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	min-height: 40px;
	padding: 0 10px;
	font-size: 14px;
	color: var(--ep-ink);
	text-decoration: none;
	border: 1px solid var(--ep-line);
	border-radius: 4px;
}

.ep-main .nav-links .page-numbers.current {
	color: #fff;
	background: var(--ep-accent);
	border-color: var(--ep-accent);
}

/* ---------------------------------------------------------------- 保存した条件（ブラウザ内保存） */
.ep-saved-notice {
	margin: 0 0 14px;
	padding: 10px 14px;
	font-size: 13px;
	line-height: 1.8;
	color: var(--ep-warn-ink);
	background: var(--ep-warn-bg);
	border-left: 3px solid #dba617;
}

.ep-saved-notice p,
.ep-saved-notice ul {
	margin: 0;
}

.ep-saved-notice ul {
	padding-left: 1.2em;
}

.ep-saved-hint {
	margin-top: 0;
}

.ep-saved-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin: 6px 0 10px;
}

.ep-saved .ep-card {
	margin-bottom: 10px;
}

.ep-saved .ep-offer-line {
	margin: 0;
	font-size: 13px;
}

.ep-saved .ep-code {
	margin-right: 6px;
}

.ep-saved .ep-remove {
	align-self: flex-start;
	margin-top: 4px;
}

/* ================================================================ 0.2.0: 画像つきの一覧・入口・絞り込み・掲載元への導線 */

/* ---------------------------------------------------------------- 画像つきカードの格子（スマホ 2・iPad 縦 4 / 横 5・PC 6 列） */
.ep-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px 10px;
}

@media (min-width: 700px) {
	.ep-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: 16px 12px;
	}
}

@media (min-width: 1000px) {
	.ep-grid {
		grid-template-columns: repeat(5, minmax(0, 1fr));
	}
}

@media (min-width: 1280px) {
	.ep-grid {
		grid-template-columns: repeat(6, minmax(0, 1fr));
	}
}

.ep-grid .ep-card {
	gap: 0;
	padding: 6px 6px 0;
}

.ep-grid .ep-card:hover {
	border-color: #c8c8c2;
}

/* 画像: 販売元の画像を切り抜かず、縦横比を保って枠に収める（縮小だけ。FANZA の案内: 画像の加工は拡大・縮小のみ）。
   枠は販売元の大きい画像（パッケージ。横 800・縦 538 前後）の比率。比率が違う画像は余白をつけて全体を見せる。
   画像の上に文字・印を重ねない（サービス名などは画像の下） */
.ep-go {
	display: block;
	color: inherit;
	text-decoration: none;
}

.ep-thumb {
	position: relative;
	display: block;
	aspect-ratio: 400 / 269;
	background: #eeeeeb;
}

@supports not (aspect-ratio: 1 / 1) {
	.ep-thumb {
		height: 0;
		padding-top: 67.25%;
	}
}

.ep-thumb img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: 50% 50%;
}

.ep-go-cap {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0 6px;
	margin: 4px 2px 0;
	font-size: 11px;
	line-height: 1.5;
	color: var(--ep-sub);
}

.ep-go-cap .ep-go-name {
	font-weight: bold;
	color: var(--ep-ink);
}

.ep-go-cap .ep-go-ext {
	margin-left: 0;
}

a.ep-go:hover .ep-go-name,
a.ep-go:focus .ep-go-name {
	text-decoration: underline;
}

a.ep-go:focus-visible {
	outline: 3px solid #2d6cdf;
	outline-offset: 2px;
}

.ep-thumb-none {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 4px;
	font-size: 11px;
	color: var(--ep-sub);
	text-align: center;
}

.ep-go-ext {
	margin-left: 3px;
}

.ep-pr {
	margin-right: 4px;
	padding: 0 4px;
	font-size: 10px;
	font-weight: bold;
	color: #fff;
	background: #7a5e00;
	border-radius: 2px;
}

.ep-card-body {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
	padding: 4px 2px 8px;
}

.ep-grid .ep-card-title {
	display: -webkit-box;
	min-height: 2.9em;
	overflow: hidden;
	font-size: 12.5px;
	line-height: 1.45;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.ep-card-sub {
	margin: 0;
	overflow: hidden;
	font-size: 11px;
	color: var(--ep-sub);
	white-space: nowrap;
	text-overflow: ellipsis;
}

.ep-card-price {
	margin: 0;
	font-size: 12.5px;
	font-weight: bold;
	line-height: 1.5;
}

.ep-card-price .ep-note,
.ep-card-price .ep-unknown,
.ep-card-price .ep-code {
	font-size: 10.5px;
	font-weight: normal;
}

.ep-card-price .ep-note {
	margin-left: 4px;
}

.ep-card-foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 2px 8px;
	margin: 2px 0 0;
	font-size: 11px;
	color: var(--ep-sub);
}

.ep-main a.ep-card-info {
	display: inline-flex;
	align-items: center;
	min-height: 28px;
	padding: 0 8px;
	font-size: 11.5px;
	color: var(--ep-ink);
	text-decoration: none;
	background: var(--ep-bg);
	border: 1px solid var(--ep-line);
	border-radius: 4px;
}

.ep-main a.ep-card-info:hover,
.ep-main a.ep-card-info:focus {
	border-color: var(--ep-sub);
}

.ep-card-foot .ep-tag {
	font-size: 10px;
}

/* ---------------------------------------------------------------- トップの上部（検索・ジャンル・サービス） */
.ep-top-title {
	margin: 4px 0 8px;
	font-size: 15px;
	line-height: 1.4;
}

.ep-top-title .ep-note {
	margin-left: 8px;
	font-size: 11px;
	font-weight: normal;
}

.ep-finder {
	margin: 0 0 14px;
	padding: 10px 12px;
	background: var(--ep-bg);
	border: 1px solid var(--ep-line);
	border-radius: 8px;
}

.ep-quick {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 10px;
}

.ep-quick input[type="search"] {
	flex: 1 1 220px;
	min-width: 0;
	min-height: 42px;
	padding: 8px 10px;
	font-size: 16px; /* iOS の自動拡大を防ぐ */
	color: var(--ep-ink);
	background: #fff;
	border: 1px solid #c8c8c2;
	border-radius: 4px;
}

.ep-quick-more,
.ep-finder-link {
	font-size: 13px;
	color: var(--ep-sub);
}

.ep-finder-row {
	display: grid;
	grid-template-columns: 4.5em minmax(0, 1fr);
	align-items: center;
	gap: 6px;
	margin-top: 8px;
}

.ep-finder-head {
	margin: 0;
	font-size: 12px;
	line-height: 1.3;
}

.ep-finder-head .ep-note {
	display: none;
}

.ep-finder-items {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 6px;
	overflow-x: auto;
	padding-bottom: 2px;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
}

.ep-finder-items > * {
	flex: 0 0 auto;
	white-space: nowrap;
}

.ep-svc {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 32px;
	padding: 2px 12px;
	font-size: 13px;
	font-weight: bold;
	color: var(--ep-ink);
	text-decoration: none;
	background: #fff;
	border: 1px solid var(--ep-ink);
	border-radius: 6px;
}

.ep-svc.is-off {
	font-weight: normal;
	color: var(--ep-sub);
	background: transparent;
	border: 1px dashed #c8c8c2;
	cursor: default;
}

.ep-svc-state {
	font-size: 11px;
}

.ep-finder-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 16px;
	margin-top: 8px;
	font-size: 13px;
}

.ep-main a.ep-finder-go {
	font-weight: bold;
	color: var(--ep-ink);
}

.ep-finder-go .ep-note {
	margin-left: 4px;
	font-size: 11px;
	font-weight: normal;
}

/* ---------------------------------------------------------------- 作品一覧・サービス案内・保存した条件の切り替え */
.ep-tabs {
	display: flex;
	gap: 2px;
	margin: 0 0 12px;
	overflow-x: auto;
	border-bottom: 1px solid var(--ep-line);
	-webkit-overflow-scrolling: touch;
}

.ep-tabs a.ep-tab {
	flex: 0 0 auto;
	margin-bottom: -1px;
	padding: 10px 14px 8px;
	font-size: 14px;
	color: var(--ep-sub);
	text-decoration: none;
	border-bottom: 2px solid transparent;
}

.ep-tabs a.ep-tab.is-current {
	font-weight: bold;
	color: var(--ep-ink);
	border-bottom-color: var(--ep-ink);
}

/* ---------------------------------------------------------------- 絞り込み（作品一覧） */
.ep-filter {
	margin: 0 0 12px;
	padding: 12px;
	background: var(--ep-bg);
	border: 1px solid var(--ep-line);
	border-radius: 8px;
}

.ep-filter-words,
.ep-filter-selects {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px 10px;
}

.ep-filter-selects {
	margin-top: 8px;
}

@media (min-width: 700px) {
	.ep-filter-selects {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (min-width: 1200px) {
	.ep-filter-selects {
		grid-template-columns: repeat(6, minmax(0, 1fr));
	}
}

.ep-filter input[type="search"],
.ep-filter input[type="text"],
.ep-filter select {
	width: 100%;
	min-height: 42px;
	padding: 6px 8px;
	font-size: 16px; /* iOS の自動拡大を防ぐ */
	color: var(--ep-ink);
	background: #fff;
	border: 1px solid #c8c8c2;
	border-radius: 4px;
}

.ep-check {
	display: flex;
	align-items: center;
	align-self: end;
	gap: 6px;
	min-height: 42px;
	font-size: 13px;
	line-height: 1.4;
}

.ep-check input {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	margin: 0;
}

.ep-filter-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 14px;
	margin-top: 10px;
}

.ep-filter-clear,
.ep-active-clear {
	font-size: 13px;
	color: var(--ep-sub);
}

.ep-filter p.ep-note {
	margin: 8px 0 0;
	font-size: 11px;
}

.ep-active {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin: 0 0 8px;
}

.ep-active-label {
	font-size: 12px;
	color: var(--ep-sub);
}

.ep-chip-on {
	background: #fff;
	border-color: var(--ep-ink);
}

.ep-chip-x {
	margin-left: 2px;
	font-size: 13px;
	line-height: 1;
}

/* ---------------------------------------------------------------- 作品詳細の上部（画像・掲載元へのリンク） */
.ep-detail-head {
	display: grid;
	grid-template-columns: 1fr;
	gap: 12px;
	margin: 6px 0 18px;
}

@media (min-width: 700px) {
	.ep-detail-head {
		grid-template-columns: minmax(0, 11fr) minmax(0, 10fr);
		gap: 20px;
		align-items: start;
	}
}

.ep-detail-img {
	position: relative;
	display: block;
	min-height: 120px;
	color: inherit;
	text-decoration: none;
}

/* 作品情報の画像も切り抜かず、縦横比を保って縮小して表示する（画像の上に文字を重ねない） */
.ep-detail-img img {
	display: block;
	width: 100%;
	height: auto;
	background: #eeeeeb;
}

.ep-detail-main .ep-page-title {
	margin-top: 0;
}

.ep-detail-facts {
	display: grid;
	gap: 2px;
	margin: 8px 0;
	font-size: 14px;
	line-height: 1.6;
}

.ep-detail-facts div {
	display: flex;
	gap: 8px;
}

.ep-detail-facts dt {
	flex: 0 0 4.5em;
	padding-top: 2px;
	font-size: 12px;
	color: var(--ep-sub);
}

.ep-detail-facts dd {
	min-width: 0;
	margin: 0;
	word-break: break-word;
}

.ep-detail-facts a {
	color: var(--ep-ink);
}

.ep-detail-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 12px 0 6px;
}

.ep-ext {
	margin-left: 4px;
}

.ep-main a.ep-btn,
.ep-saved a.ep-btn,
.ep-services a.ep-btn {
	color: #fff;
	text-decoration: none;
}

.ep-main a.ep-btn-sub,
.ep-saved a.ep-btn-sub,
.ep-services a.ep-btn-sub {
	color: var(--ep-ink);
}

/* ---------------------------------------------------------------- 保存した条件: 画像と掲載元へのリンク */
.ep-saved .ep-saved-card {
	display: grid;
	grid-template-columns: 120px minmax(0, 1fr);
	align-items: start;
	gap: 12px;
	padding: 10px;
}

@media (min-width: 700px) {
	.ep-saved .ep-saved-card {
		grid-template-columns: 180px minmax(0, 1fr);
	}
}

/* 保存一覧の画像も切り抜かず、縦横比を保って縮小して表示する */
.ep-saved-thumb {
	position: relative;
	display: block;
	aspect-ratio: 400 / 269;
	background: #eeeeeb;
}

@supports not (aspect-ratio: 1 / 1) {
	.ep-saved-thumb {
		height: 0;
		padding-top: 67.25%;
	}
}

.ep-saved-thumb img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.ep-saved-body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.ep-saved-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 4px 0 0;
}

.ep-saved .ep-saved-actions .ep-remove {
	margin-top: 0;
}

/* ---------------------------------------------------------------- サービス案内 */
.ep-services .ep-service-list {
	display: grid;
	grid-template-columns: 1fr;
	gap: 12px;
	margin: 12px 0;
}

@media (min-width: 1000px) {
	.ep-services .ep-service-list {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.ep-services .ep-service {
	padding: 12px 14px;
	background: #fff;
	border: 1px solid var(--ep-line);
	border-radius: 8px;
}

.ep-services .ep-service.is-off {
	background: var(--ep-bg);
	border-style: dashed;
}

.ep-services .ep-service-name {
	margin: 0 0 4px;
	padding: 0;
	font-size: 18px;
	line-height: 1.4;
	background: none;
	border: 0;
}

.ep-services .ep-state {
	display: inline-block;
	margin: 0 0 8px;
	padding: 0 8px;
	font-size: 12px;
	line-height: 1.8;
	border: 1px solid currentColor;
	border-radius: 3px;
}

.ep-services .ep-state-live {
	color: var(--ep-ok-ink);
	background: var(--ep-ok-bg);
}

.ep-services .ep-state-data {
	color: var(--ep-warn-ink);
	background: var(--ep-warn-bg);
}

.ep-services .ep-state-ready,
.ep-services .ep-state-off {
	color: var(--ep-sub);
}

.ep-services .ep-service-facts {
	margin: 0 0 8px;
	font-size: 13px;
	line-height: 1.6;
}

.ep-services .ep-service-facts div {
	display: flex;
	gap: 8px;
	padding: 4px 0;
	border-bottom: 1px dashed var(--ep-line);
}

.ep-services .ep-service-facts dt {
	flex: 0 0 7.5em;
	margin: 0;
	font-size: 12px;
	font-weight: normal;
	color: var(--ep-sub);
}

.ep-services .ep-service-facts dd {
	min-width: 0;
	margin: 0;
}

.ep-services .ep-service-go {
	margin: 10px 0 0;
}

/* ---------------------------------------------------------------- 親テーマのブログ用の表示（EROPORTA の画面だけ隠す） */
/* Muum のヘッダーの記事の枠（最新のブログ記事）。写真の一覧を押し下げるため、EROPORTA の画面では出さない（親テーマは変えない） */
body.ep-site .header_carousel {
	display: none !important;
}

/* Muum のヘッダーは PC 幅で、グローバルメニューが無くてもメニューの分の高さ（160px）を取る。
   EROPORTA の画面では、メニューが無いときだけヘッダーの高さを中身（ロゴの行）に合わせる（親テーマは変えない。
   幅ごとの高さを決め打ちしない: iPad 幅の 60px・PC 幅の 100px はロゴの行の高さのまま） */
@media only screen and (min-width: 751px) {
	body.ep-site #header:not(:has(#global_menu)) {
		height: auto;
	}
}

/* ---------------------------------------------------------------- 固定ページ（サービス案内・保存した条件）の下地 */
/* 親テーマの固定ページの配色（初期設定では暗い背景）に左右されないよう、EROPORTA の部品に白い下地を付ける */
body.ep-site .post_content .ep-tabs {
	margin-bottom: 0;
	padding: 0 6px;
	background: #fff;
	border-radius: 8px 8px 0 0;
}

body.ep-site .post_content .ep-services,
body.ep-site .post_content .ep-saved {
	padding: 12px;
	color: var(--ep-ink);
	background: #fff;
	border-radius: 0 0 8px 8px;
}

body.ep-site .post_content .ep-services .ep-lead,
body.ep-site .post_content .ep-saved .ep-count {
	color: var(--ep-ink);
}

/* Muum の固定ページの見出しの帯（#page_header）は、背景色が未設定だと白地に白文字で見えない。EROPORTA の画面でだけ色を付ける */
body.ep-site #page_header {
	background-color: #23231f;
}

/* ---------------------------------------------------------------- EROPORTA の案内（運営案内・年齢・広告・クレジット・関連サイト） */
.ep-site-foot {
	margin: 32px 0 8px;
	padding: 14px 0 0;
	font-size: 12px;
	line-height: 1.8;
	color: var(--ep-sub);
	border-top: 1px solid var(--ep-line);
}

.ep-site-foot-links {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 16px;
	margin: 0 0 6px;
	font-size: 13px;
}

.ep-main .ep-site-foot-links a,
.post_content .ep-site-foot-links a {
	color: var(--ep-ink);
}

.ep-site-foot .ep-note,
.ep-site-foot .ep-credit {
	margin: 0 0 4px;
}

.ep-partners {
	margin: 0 0 14px;
}

.ep-partners-head {
	margin: 0 0 6px;
	font-size: 13px;
	color: var(--ep-ink);
}

.ep-partner-list {
	display: grid;
	grid-template-columns: 1fr;
	gap: 8px;
}

@media (min-width: 700px) {
	.ep-partner-list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.ep-main a.ep-partner,
.post_content a.ep-partner {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	color: var(--ep-ink);
	text-decoration: none;
	background: #fff;
	border: 1px solid var(--ep-line);
	border-radius: 8px;
}

.ep-partner-logo {
	flex: 0 0 auto;
	width: 120px;
	height: auto;
}

.ep-partner-text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
	font-size: 12px;
	color: var(--ep-sub);
}

.ep-partner-text strong {
	font-size: 14px;
	color: var(--ep-ink);
}

.ep-partner-note {
	font-size: 11px;
}

/* 運営案内のページ（このサイトについて・プライバシーポリシー） */
body.ep-site .post_content .ep-info {
	padding: 12px;
	color: var(--ep-ink);
	background: #fff;
	border-radius: 0 0 8px 8px;
}

.ep-info-dl div {
	display: flex;
	gap: 12px;
	padding: 4px 0;
	border-bottom: 1px dashed var(--ep-line);
}

.ep-info-dl dt {
	flex: 0 0 7em;
	color: var(--ep-sub);
}

.ep-info-dl dd {
	margin: 0;
}

/* 作品詳細の下部カードだけ、画面に近づくまで描画を省く。
   本文・リンク・画像lazyは維持。高さは最大6/8カードの幅別目安で、表示後はautoが実寸を記憶する。 */
@media screen {
@supports (content-visibility: auto) and (contain-intrinsic-block-size: auto 1px) and (overflow-clip-margin: 16px) {
	body.single-ep_work .ep-related,
	body.single-ep_work .ep-same-site {
		content-visibility: auto;
		overflow-clip-margin: 16px;
		margin-top: 30px;
	}
	/* 保持していた見出しの外側marginをsection側へ移し、containmentで余白を増やさない。 */
	body.single-ep_work .ep-related > .ep-h2,
	body.single-ep_work .ep-same-site > .ep-h2 { margin-top: 0; }
	body.single-ep_work .ep-related { contain-intrinsic-block-size: auto 1100px; }
	body.single-ep_work .ep-same-site { contain-intrinsic-block-size: auto 1500px; }
	@media (min-width: 700px) {
		body.single-ep_work .ep-related { contain-intrinsic-block-size: auto 750px; }
		body.single-ep_work .ep-same-site { contain-intrinsic-block-size: auto 800px; }
	}
	@media (min-width: 1000px) {
		body.single-ep_work .ep-related { contain-intrinsic-block-size: auto 800px; }
		body.single-ep_work .ep-same-site { contain-intrinsic-block-size: auto 1000px; }
	}
	@media (min-width: 1280px) {
		body.single-ep_work .ep-related { contain-intrinsic-block-size: auto 420px; }
	}
}
}

/* Only the clearer SOKMIL main CTA label wraps; existing buttons keep their styles. */
.ep-work-purchase-label{min-width:0;white-space:normal;overflow-wrap:anywhere}

/* 作品詳細の主CTAだけ折り返し、長い販売元名とPR・外部リンク記号を枠内に収める。 */
.ep-detail-actions > a.ep-btn-go {
	white-space: normal;
}
