/*
 * EROPORTA の装飾（0.3.0）。見せ場（トップの特集）に絞り、通常の一覧（.ep-grid）の密度は変えない。
 *
 * 差し替え: 配色は下の「配色」の変数（--ep-skin-*）、背景・質感・枠・見出しの飾りは「素材」の変数（--ep-deco-*）だけで行う。
 *   素材は assets/img/deco/ の SVG（light・grain・corner・rule）。同じ名前のファイルを置き換えるか、変数の URL を別のファイルに変える。
 *   写真調の背景（画像生成サービスなどで作った PNG・WebP）に替えるときも --ep-deco-light の URL を変えるだけ（文字を入れない素材にする）。
 *   枠の角と見出しの飾りは「形」だけの素材で、色は --ep-skin-gold・--ep-skin-accent で塗る（配色を変えると飾りの色も変わる）。
 * 守ること:
 *   - 素材は作品画像の外側（背景・質感・枠・見出しの飾り）にだけ使う。作品画像の加工・文字の重ね合わせはしない
 *   - 文字とボタンは HTML のまま（素材に焼き込まない）。大きな看板で最初の画面を埋めない
 * 変数と、それを使う指定は、このファイルの中だけに置く（url() の相対パスをこのファイルの場所から解決させるため）。
 */
.ep-main,
.ep-saved,
.ep-services,
.ep-tabs {
	/* 配色 */
	--ep-skin-ink: #2b1b28;
	--ep-skin-accent: #b0275b;
	--ep-skin-accent-ink: #fff;
	--ep-skin-gold: #c39146;
	--ep-skin-soft: #fbf3f6;
	--ep-skin-frame: #ebd0da;
	--ep-skin-shadow: rgba(92, 28, 60, .22);
	/* 素材 */
	--ep-deco-light: url("../img/deco/light.svg");
	--ep-deco-grain: url("../img/deco/grain.svg");
	--ep-deco-corner: url("../img/deco/corner.svg");
	--ep-deco-rule: url("../img/deco/rule.svg");
	/* ボタン・ページ送りの色（既存の --ep-accent）を配色に合わせる */
	--ep-accent: var(--ep-skin-ink);
}

/* ---------------------------------------------------------------- トップの特集（見せ場: 見出しの飾り・画像群の外枠・背景） */
.ep-feature {
	position: relative;
	isolation: isolate;
	margin: 14px 0 22px;
	padding: 12px 14px 12px;
	overflow: hidden;
	background-color: var(--ep-skin-soft);
	background-image: var(--ep-deco-light);
	background-position: center;
	background-size: cover;
	background-repeat: no-repeat;
	border-radius: 16px;
}

/* 質感（細かな粒子）を背景の上・内容の下に薄く重ねる */
.ep-feature::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background-image: var(--ep-deco-grain);
	background-size: 180px 180px;
	opacity: .28;
	pointer-events: none;
}

.ep-feature-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 10px;
	margin: 0 0 10px;
}

.ep-feature-label {
	display: inline-block;
	padding: 2px 11px;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.7;
	letter-spacing: .14em;
	color: var(--ep-skin-accent-ink);
	background: var(--ep-skin-accent);
	border-radius: 999px;
}

.ep-main .ep-feature-title {
	margin: 0;
	font-size: 18px;
	line-height: 1.4;
	color: var(--ep-skin-ink);
}

/* 見出しの右の飾り（形は rule.svg・色は配色） */
.ep-feature-title::after {
	content: "";
	display: inline-block;
	width: 72px;
	height: 12px;
	margin-left: 10px;
	vertical-align: middle;
	background-color: var(--ep-skin-gold);
	-webkit-mask: var(--ep-deco-rule) left center / contain no-repeat;
	mask: var(--ep-deco-rule) left center / contain no-repeat;
}

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

.ep-main a.ep-feature-more {
	margin-left: auto;
	font-size: 13px;
	color: var(--ep-skin-accent);
}

/* 画像群の外枠（半透明の白・細い線・角の飾り） */
.ep-feature-frame {
	position: relative;
	padding: 10px;
	background: rgba(255, 255, 255, .8);
	border: 1px solid var(--ep-skin-frame);
	border-radius: 12px;
	box-shadow: 0 12px 26px -20px var(--ep-skin-shadow);
}

.ep-feature-frame::before,
.ep-feature-frame::after {
	content: "";
	position: absolute;
	width: 28px;
	height: 28px;
	background-color: var(--ep-skin-gold);
	-webkit-mask: var(--ep-deco-corner) center / contain no-repeat;
	mask: var(--ep-deco-corner) center / contain no-repeat;
	pointer-events: none;
}

.ep-feature-frame::before {
	top: -7px;
	left: -7px;
}

.ep-feature-frame::after {
	right: -7px;
	bottom: -7px;
	transform: rotate(180deg);
}

/* 特集の画像は 1 段で並べ、続きは横に送る（列の数は通常の一覧と同じ: スマホ 2・iPad 縦 4 / 横 5・PC 6）。
   最初の画面を特集で埋めないため、段を増やさない */
.ep-main .ep-grid.ep-grid-strip {
	--ep-strip-cols: 2;
	--ep-strip-gap: 10px;
	grid-template-columns: none;
	grid-auto-flow: column;
	grid-auto-columns: calc((100% - (var(--ep-strip-cols) - 1) * var(--ep-strip-gap)) / var(--ep-strip-cols));
	column-gap: var(--ep-strip-gap);
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: thin;
	padding-bottom: 4px;
}

.ep-grid-strip > .ep-card {
	scroll-snap-align: start;
}

@media (min-width: 700px) {
	.ep-main .ep-grid.ep-grid-strip {
		--ep-strip-cols: 4;
		--ep-strip-gap: 12px;
	}
}

@media (min-width: 1000px) {
	.ep-main .ep-grid.ep-grid-strip {
		--ep-strip-cols: 5;
	}
}

@media (min-width: 1280px) {
	.ep-main .ep-grid.ep-grid-strip {
		--ep-strip-cols: 6;
	}
}

/* ---------------------------------------------------------------- 通常の一覧・入口（色の気配だけ。大きさと密度は変えない） */

/* 節の見出しの左に細い印 */
.ep-main .ep-h2::before {
	content: "";
	display: inline-block;
	width: 4px;
	height: 1em;
	margin-right: 8px;
	vertical-align: -2px;
	background: linear-gradient(var(--ep-skin-accent), var(--ep-skin-gold));
	border-radius: 2px;
}

/* トップの題名・作品一覧などのページの題名の下に、見出しの飾り */
.ep-main .ep-top-title,
.ep-main .ep-page-title {
	color: var(--ep-skin-ink);
}

.ep-main .ep-page-title::after {
	content: "";
	display: block;
	width: 120px;
	height: 12px;
	margin-top: 2px;
	background-color: var(--ep-skin-gold);
	-webkit-mask: var(--ep-deco-rule) left center / contain no-repeat;
	mask: var(--ep-deco-rule) left center / contain no-repeat;
}

/* トップの入口・作品一覧の絞り込み: 枠の色と、ごく薄い地の色（高さは変えない） */
.ep-main .ep-finder,
.ep-main .ep-filter {
	background: linear-gradient(135deg, #fff 0%, var(--ep-skin-soft) 100%);
	border-color: var(--ep-skin-frame);
}

/* ジャンル・サービスの選択肢: 触れたときに配色の色 */
.ep-main a.ep-chip:hover,
.ep-main a.ep-chip:focus,
.ep-main a.ep-svc:hover,
.ep-main a.ep-svc:focus {
	color: var(--ep-skin-accent);
	border-color: var(--ep-skin-accent);
}

/* 分類から探す: ごく薄い地の色 */
.ep-main .ep-browse {
	padding: 4px 14px 10px;
	background: var(--ep-skin-soft);
	border-radius: 14px;
}

/* 作品一覧のタブ: 選んでいるタブの下線を配色の色に */
.ep-tabs a.ep-tab.is-current {
	border-bottom-color: var(--ep-skin-accent);
}

@media (prefers-reduced-motion: reduce) {
	.ep-main .ep-grid.ep-grid-strip {
		scroll-behavior: auto;
	}
}
