/* お気に入りリスト（inc/emdb_favorites.php） */
.emdb-fav { --fav-pink: #f25076; --fav-pink-soft: #fde6ec; --fav-ink: #333; --fav-muted: #777; --fav-line: #e6e6e6; margin: 0 0 2em; }
.emdb-fav *, .emdb-fav *::before, .emdb-fav *::after { box-sizing: border-box; }

/* ヘッダー */
.emdb-fav__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .4em 1em; margin-bottom: .8em; }
.emdb-fav__summary { font-size: 1.05em; }
.emdb-fav__summary .fa { color: #f5b301; }
.emdb-fav__total { font-size: 1.5em; color: var(--fav-pink); margin: 0 .1em; }
.emdb-fav__storage { font-size: .82em; color: var(--fav-muted); }
.emdb-fav__storage a { color: var(--fav-pink); text-decoration: underline; }

/* ツールバー */
.emdb-fav__toolbar { background: #fafafa; border: 1px solid var(--fav-line); border-radius: 8px; padding: .6em .8em; margin-bottom: 1em; display: flex; flex-direction: column; gap: .6em; }
.emdb-fav__tabs { display: flex; flex-wrap: wrap; gap: .4em; }
.emdb-fav__tab { appearance: none; border: 1px solid var(--fav-line); background: #fff; color: var(--fav-ink); border-radius: 999px; padding: .3em .9em; font-size: .9em; cursor: pointer; line-height: 1.4; transition: background .15s, color .15s, border-color .15s; }
.emdb-fav__tab:hover { border-color: var(--fav-pink); color: var(--fav-pink); }
.emdb-fav__tab.is-active { background: var(--fav-pink); border-color: var(--fav-pink); color: #fff; }
.emdb-fav__tab.is-zero { opacity: .5; }
.emdb-fav__n { display: inline-block; min-width: 1.6em; padding: 0 .4em; margin-left: .2em; border-radius: 999px; background: rgba(0,0,0,.06); font-size: .85em; text-align: center; }
.emdb-fav__tab.is-active .emdb-fav__n { background: rgba(255,255,255,.25); }

.emdb-fav__controls { display: flex; flex-wrap: wrap; align-items: center; gap: .5em .8em; }
.emdb-fav__control { display: inline-flex; align-items: center; gap: .4em; margin: 0; font-size: .9em; }
.emdb-fav__label { color: var(--fav-muted); white-space: nowrap; }
.emdb-fav__sort, .emdb-fav__q { font-size: .95em; padding: .35em .5em; border: 1px solid #ccc; border-radius: 6px; background: #fff; color: var(--fav-ink); height: 2.3em; }
.emdb-fav__sort:focus, .emdb-fav__q:focus { outline: none; border-color: var(--fav-pink); box-shadow: 0 0 0 2px rgba(242,80,118,.2); }
.emdb-fav__control--q { flex: 1 1 14em; }
.emdb-fav__q { flex: 1 1 auto; min-width: 0; width: 100%; }
.emdb-fav__view { display: inline-flex; border: 1px solid #ccc; border-radius: 6px; overflow: hidden; }
.emdb-fav__view-btn { appearance: none; border: 0; background: #fff; color: var(--fav-muted); padding: .35em .7em; cursor: pointer; height: 2.3em; }
.emdb-fav__view-btn + .emdb-fav__view-btn { border-left: 1px solid #ccc; }
.emdb-fav__view-btn.is-active { background: var(--fav-pink); color: #fff; }
.emdb-fav__copy { appearance: none; border: 1px solid #ccc; background: #fff; color: var(--fav-ink); border-radius: 6px; padding: .35em .7em; font-size: .9em; cursor: pointer; height: 2.3em; white-space: nowrap; }
.emdb-fav__copy:hover { border-color: var(--fav-pink); color: var(--fav-pink); }
.emdb-fav__status { font-size: .85em; color: var(--fav-muted); margin: -.4em 0 .6em; min-height: 1em; }
.emdb-fav__status:empty { display: none; }

/* リスト（カード表示） */
.emdb-fav__list { display: grid; gap: 14px; margin: 0; }
.emdb-fav__list--card { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.emdb-fav__list--list { grid-template-columns: minmax(0, 1fr); gap: 0; border-top: 1px solid var(--fav-line); }
.emdb-fav__item { position: relative; display: flex; flex-direction: column; min-width: 0; background: #fff; border: 1px solid var(--fav-line); border-radius: 8px; overflow: hidden; transition: box-shadow .15s, transform .15s, opacity .2s; }
.emdb-fav__item[hidden] { display: none !important; }
.emdb-fav__list--card .emdb-fav__item:hover { box-shadow: 0 4px 14px rgba(0,0,0,.1); transform: translateY(-2px); }
.emdb-fav__card { flex: 1 1 auto; display: flex; flex-direction: column; }

/* Cocoon のエントリーカードを縦型に強制（.list のクラスは使わない） */
.emdb-fav__card .entry-card-wrap { width: 100% !important; margin: 0 !important; padding: 0 !important; border: 0 !important; display: block; height: 100%; }
.emdb-fav__card .entry-card { display: flex; flex-direction: column; height: 100%; }
.emdb-fav__card .entry-card-thumb { width: 100% !important; float: none !important; margin: 0 !important; }
.emdb-fav__card .entry-card-thumb img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.emdb-fav__card .entry-card-content { margin: 0 !important; padding: .6em .7em .4em !important; display: flex; flex-direction: column; flex: 1 1 auto; }
.emdb-fav__card .entry-card-title { font-size: .95em !important; line-height: 1.45; margin: 0 0 .3em !important; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.emdb-fav__card .entry-card-snippet { font-size: .78em !important; line-height: 1.5; color: #555; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0 0 .3em !important; }
.emdb-fav__card .entry-card-meta { margin-top: auto !important; padding-top: .3em; position: static !important; font-size: .75em !important; }
.emdb-fav__card .entry-card-meta .post-date { margin-right: 0; }
.emdb-fav__card .entry-card-categorys { display: none; }

/* 簡易カード（creator / brand） */
.emdb-fav__simple { display: flex; flex-direction: column; gap: .3em; padding: 1em .8em; min-height: 6em; text-decoration: none; color: var(--fav-ink); background: linear-gradient(135deg, #fff 0%, var(--fav-pink-soft) 100%); height: 100%; }
.emdb-fav__simple-label { font-size: .75em; color: var(--fav-pink); }
.emdb-fav__simple-title { font-weight: bold; line-height: 1.4; }

/* フッター（種別バッジ + 解除ボタン） */
.emdb-fav__foot { display: flex; align-items: center; justify-content: space-between; gap: .5em; padding: .4em .7em .6em; border-top: 1px dashed var(--fav-line); }
.emdb-fav__type { display: inline-block; font-size: .72em; line-height: 1.6; padding: 0 .6em; border-radius: 4px; background: #eee; color: #555; white-space: nowrap; }
.emdb-fav__type--video { background: #e8f1fb; color: #2a6db5; }
.emdb-fav__type--music { background: #f3e9fb; color: #7b3fa3; }
.emdb-fav__type--game  { background: #e9f7ea; color: #2f8a3c; }
.emdb-fav__type--creator { background: #fff3e0; color: #b36b00; }
.emdb-fav__type--brand { background: #fde6ec; color: #c13d5f; }
.emdb-fav__btn { flex: 0 1 auto; min-width: 0; }
.emdb-fav .emdb-fav__btn .simplefavorite-button { width: auto !important; font-size: .78em !important; padding: .3em .8em !important; border-radius: 999px !important; background: #fff !important; color: var(--fav-pink) !important; border: 1.5px solid var(--fav-pink) !important; box-shadow: none !important; line-height: 1.5 !important; white-space: nowrap; cursor: pointer; }
.emdb-fav .emdb-fav__btn .simplefavorite-button i { color: var(--fav-pink) !important; margin: 0 .25em 0 0 !important; }
.emdb-fav .emdb-fav__btn .simplefavorite-button.active { background: var(--fav-pink) !important; color: #fff !important; }
.emdb-fav .emdb-fav__btn .simplefavorite-button.active i { color: #ffdd33 !important; }
.emdb-fav .emdb-fav__btn .simplefavorite-button:hover { opacity: .8; }

/* 解除済み */
.emdb-fav__item.is-removed .emdb-fav__card, .emdb-fav__item.is-removed .emdb-fav__row { opacity: .35; filter: grayscale(.6); }
.emdb-fav__undo { position: absolute; left: 0; right: 0; top: 40%; margin: 0 .8em; padding: .6em .8em; background: rgba(51,51,51,.92); color: #fff; font-size: .85em; border-radius: 6px; text-align: center; z-index: 2; }
.emdb-fav__undo[hidden] { display: none; }
.emdb-fav__undo-btn { appearance: none; border: 1px solid #fff; background: transparent; color: #fff; border-radius: 999px; padding: .2em .9em; margin-left: .5em; cursor: pointer; font-size: .95em; }
.emdb-fav__undo-btn:hover { background: #fff; color: #333; }

/* リスト表示 */
.emdb-fav__row { display: none; }
.emdb-fav__list--list .emdb-fav__item { flex-direction: row; align-items: center; border-radius: 0; border-width: 0 0 1px; }
.emdb-fav__list--list .emdb-fav__card { display: none; }
.emdb-fav__list--list .emdb-fav__row { display: flex; flex: 1 1 auto; min-width: 0; align-items: center; gap: .8em; padding: .5em .4em; text-decoration: none; color: var(--fav-ink); }
.emdb-fav__list--list .emdb-fav__row:hover .emdb-fav__row-title { color: var(--fav-pink); }
.emdb-fav__row-thumb { flex: 0 0 96px; width: 96px; aspect-ratio: 16 / 9; background: #f0f0f0; border-radius: 4px; overflow: hidden; }
.emdb-fav__row-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.emdb-fav__row-body { display: flex; flex-direction: column; gap: .2em; min-width: 0; }
.emdb-fav__row-title { font-weight: bold; font-size: .95em; line-height: 1.4; overflow-wrap: anywhere; }
.emdb-fav__row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .3em .8em; font-size: .78em; color: var(--fav-muted); }
.emdb-fav__list--list .emdb-fav__foot { border: 0; padding: .4em .4em .4em 0; flex: 0 0 auto; }
.emdb-fav__list--list .emdb-fav__foot .emdb-fav__type { display: none; }
.emdb-fav__list--list .emdb-fav__undo { top: auto; bottom: .3em; }

/* もっと見る / 空 */
.emdb-fav__more { text-align: center; margin: 1.2em 0 0; }
.emdb-fav__more-btn { appearance: none; border: 1.5px solid var(--fav-pink); background: #fff; color: var(--fav-pink); border-radius: 999px; padding: .5em 1.6em; font-size: .95em; cursor: pointer; }
.emdb-fav__more-btn:hover { background: var(--fav-pink); color: #fff; }
.emdb-fav__more[hidden] { display: none; }
.emdb-fav__empty { text-align: center; padding: 2.5em 1em; color: var(--fav-muted); border: 1px dashed var(--fav-line); border-radius: 8px; margin-top: 1em; }
.emdb-fav__empty[hidden] { display: none; }
.emdb-fav__empty-main { font-size: 1.05em; color: var(--fav-ink); }
.emdb-fav__empty-main .fa { color: #f5b301; }
.emdb-fav__empty-sub { font-size: .9em; margin-top: .5em; }
.emdb-fav__empty-links { display: flex; flex-wrap: wrap; justify-content: center; gap: .5em; margin-top: 1em; }
.emdb-fav__empty-links a { display: inline-block; padding: .4em 1.2em; border: 1.5px solid var(--fav-pink); border-radius: 999px; color: var(--fav-pink); text-decoration: none; font-size: .9em; }
.emdb-fav__empty-links a:hover { background: var(--fav-pink); color: #fff; }

/* レスポンシブ */
@media screen and (max-width: 1023px) {
	.emdb-fav__list--card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media screen and (max-width: 640px) {
	.emdb-fav__toolbar { padding: .5em .6em; }
	.emdb-fav__controls { gap: .4em .5em; }
	.emdb-fav__control--sort .emdb-fav__label { display: none; }
	.emdb-fav__list--card { gap: 10px; }
	.emdb-fav__card .entry-card-title { font-size: .85em !important; }
	.emdb-fav__card .entry-card-snippet { display: none; }
	.emdb-fav__foot { padding: .3em .5em .5em; }
	.emdb-fav .emdb-fav__btn .simplefavorite-button { font-size: .72em !important; padding: .25em .6em !important; }
	.emdb-fav__row-thumb { flex-basis: 72px; width: 72px; }
}
@media screen and (max-width: 400px) {
	.emdb-fav__list--card { grid-template-columns: minmax(0, 1fr); }
}
