/* お気に入り（public/fav.js）と、ヘッダーの検索欄。色は style.css の変数を使う。
   ogp.py が style.css より前に読み込むので、style.css と同じ強さのセレクタでは負ける。上書きするところは .ranking を付けて強くする。 */

/* カードの ♡（カードのリンクの外側。カードと重ねて右に置く） */
.fav-host { position: relative; }
.ranking .fav-host > .item, .ranking .fav-host > .tags { padding-right: 56px; }
.fav-btn { position: absolute; top: 50%; right: 10px; transform: translateY(-50%); display: grid; place-items: center;
  width: 40px; height: 40px; padding: 0; border-radius: 50%; border: 1px solid var(--border); background: var(--card);
  color: var(--muted); font: inherit; font-size: 1.3rem; line-height: 1; cursor: pointer; }
.fav-btn:hover, .fav-btn:focus-visible { border-color: var(--accent); color: var(--accent); }
.fav-btn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-weak); color: var(--accent); }
.fav-btn.fav-del { font-size: .78rem; font-weight: 700; }
.ranking .fav-at { display: block; font-size: .75rem; }

/* 「▶ サンプル」（data-sample のあるカード）。年齢確認が済むまでは出さない。♡ と同じ右の列の下に置く */
.fav-play { display: none; }
html.age-ok .fav-play { position: absolute; right: 8px; bottom: 10px; display: grid; place-items: center; gap: 0;
  width: 44px; padding: 4px 0; border-radius: 12px; border: 1px solid var(--accent); background: var(--card);
  color: var(--accent); font: inherit; line-height: 1.2; cursor: pointer; }
html.age-ok .fav-play:hover, html.age-ok .fav-play:focus-visible { background: var(--accent); color: var(--on-accent); }
.fav-play-icon { font-size: .9rem; }
.fav-play-label { font-size: .6rem; font-weight: 700; letter-spacing: -.02em; }
.ranking .fav-has-play > .item { min-height: 112px; }
html.age-ok .fav-has-play > .fav-btn { top: 10px; transform: none; right: 10px; }

/* サンプル動画の重ね表示 */
.fav-modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px;
  background: rgba(10, 6, 14, .82); }
.fav-modal[hidden] { display: none; }
.fav-modal-box { width: min(760px, 100%); max-height: 100%; overflow: auto; padding: 12px; border-radius: 16px;
  background: var(--card); border: 1px solid var(--border); box-shadow: 0 10px 40px rgba(0, 0, 0, .45); }
.fav-modal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.fav-modal-title { flex: 1; min-width: 0; font-size: .9rem; line-height: 1.5; overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.fav-modal-close { flex: none; width: 40px; height: 40px; padding: 0; border-radius: 50%; border: 1px solid var(--border);
  background: var(--card); color: var(--text); font: inherit; font-size: 1.1rem; cursor: pointer; }
.fav-modal-close:hover, .fav-modal-close:focus-visible { border-color: var(--accent); color: var(--accent); }
.fav-modal-frame { width: 100%; max-height: 70vh; aspect-ratio: 720 / 480; background: #000; border-radius: 10px; overflow: hidden; }
.fav-modal-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.fav-modal-info { margin: 8px 0 0; color: var(--muted); font-size: .85rem; line-height: 1.5; text-align: center; }
.fav-modal-info[hidden], .fav-modal-nav[hidden] { display: none; }
.fav-modal-cta { display: block; margin-top: 10px; padding: 14px 16px; text-align: center; font-size: 1.05rem; }
.fav-modal-nav { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; }
.fav-modal-nav button { flex: 1; min-height: 40px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); color: var(--accent); font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer; }
.fav-modal-nav button:hover, .fav-modal-nav button:focus-visible { border-color: var(--accent); background: var(--accent-weak); }
html.fav-modal-open, html.fav-modal-open body { overflow: hidden; }

/* ヘッダーの検索欄とお気に入りへのリンク */
header.fav-header { flex-wrap: wrap; gap: 8px 12px; }
.fav-nav { display: flex; align-items: center; gap: 12px; margin-left: auto; min-width: 0; }
.fav-search { display: flex; min-width: 0; }
.fav-search input { width: 13em; min-width: 0; margin: 0; padding: 6px 12px; border: 1px solid var(--border); border-right: 0;
  border-radius: 999px 0 0 999px; background: var(--card); color: var(--text); font: inherit; font-size: 16px; line-height: 1.4; }
.fav-search input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.fav-search button { flex: none; margin: 0; padding: 6px 14px; border: 1px solid var(--accent); border-radius: 0 999px 999px 0;
  background: var(--accent); color: var(--on-accent); font: inherit; font-size: .85rem; font-weight: 700; line-height: 1.4;
  cursor: pointer; }
.fav-link { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; font-size: .9rem; font-weight: 700;
  text-decoration: none; }
.fav-count:not(:empty) { min-width: 1.4em; padding: 0 6px; border-radius: 999px; background: var(--accent-weak); color: var(--accent);
  font-size: .75rem; line-height: 1.6; text-align: center; }

/* 検索のページの本文の検索欄 */
.fav-search-main { margin: 16px 0 8px; }
.fav-search-main input { flex: 1; width: auto; padding: 10px 16px; }
.fav-search-main button { padding: 10px 20px; font-size: 1rem; }

@media (max-width: 520px) {
  .fav-nav { width: 100%; margin-left: 0; }
  .fav-search { flex: 1; }
  .fav-search input { flex: 1; width: auto; }
  .ranking .fav-host > .item, .ranking .fav-host > .tags { padding-right: 50px; }
  .fav-btn { right: 6px; width: 38px; height: 38px; }
  html.age-ok .fav-play { right: 4px; }
  html.age-ok .fav-has-play > .fav-btn { right: 6px; }
}

/* /videos の大きなカード（div.entry.vcard。見た目は style.css）。「▶ サンプル」のボタンを、サムネイル全体に重ねる
   （ボタンは広告リンクの外。押すとページ内で再生。サムネイルの ▶ や割引率は、透けて見える）。♡ はサムネイルの右上 */
html.age-ok .ranking .vcard > .fav-play { top: 0; right: auto; bottom: auto; left: 0; z-index: 1; width: 100%; aspect-ratio: 8 / 5;
  padding: 0; border: 0; border-radius: 0; background: transparent; color: transparent; }
html.age-ok .ranking .vcard > .fav-play:hover { background: rgba(10, 6, 14, .18); color: transparent; }
html.age-ok .ranking .vcard > .fav-play:focus-visible { background: rgba(10, 6, 14, .18); color: transparent;
  outline: 3px solid var(--accent); outline-offset: -3px; }
.ranking .vcard > .fav-play .fav-play-icon, .ranking .vcard > .fav-play .fav-play-label { position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ranking .vcard:has(> .fav-play:hover) .vplay, .ranking .vcard:has(> .fav-play:focus-visible) .vplay { background: var(--accent); }
.ranking .vcard > .fav-btn, html.age-ok .ranking .vcard.fav-has-play > .fav-btn { top: 6px; right: 6px; z-index: 2; width: 34px; height: 34px;
  transform: none; }
.ranking .vcard > .fav-btn { border-color: transparent; background: rgba(255, 255, 255, .92); color: #7a6470; font-size: 1.1rem; }
.ranking .vcard > .fav-btn:hover, .ranking .vcard > .fav-btn:focus-visible, .ranking .vcard > .fav-btn[aria-pressed="true"] {
  border-color: #d6336c; background: #fff; color: #d6336c; }
