/* DokoMiru - ダークテーマ。フレームワーク不使用の軽量CSS */
:root {
  --bg: #0f1014;
  --bg2: #181a21;
  --bg3: #22242e;
  --text: #e8e8ee;
  --text-dim: #9a9aa8;
  --accent: #f5c518;
  --radius: 8px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "BIZ UDPGothic", Meiryo, sans-serif;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ヘッダー */
.site-header {
  background: var(--bg2);
  border-bottom: 1px solid #2a2c36;
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.logo { font-size: 1.5rem; font-weight: 800; letter-spacing: .5px; }
.logo span { color: var(--accent); }
.search-form { display: flex; flex: 1; min-width: 220px; max-width: 480px; position: relative; }

/* 検索サジェスト（base.html末尾のJSが /api/suggest の結果を流し込む） */
.suggest {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg2);
  border: 1px solid #3a3c48;
  border-radius: var(--radius);
  overflow: hidden;
  z-index: 60;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
.suggest a {
  display: block;
  padding: 9px 14px;
  font-size: .92rem;
  border-bottom: 1px solid #2a2c36;
}
.suggest a:last-child { border-bottom: none; }
.suggest a:hover, .suggest a.active { background: var(--bg3); }
.suggest small { color: var(--text-dim); }

.header-nav { display: flex; gap: 14px; font-size: .92rem; font-weight: 600; }
.header-nav a:hover { color: var(--accent); }
.search-form input {
  flex: 1;
  padding: 9px 14px;
  border: 1px solid #3a3c48;
  border-radius: var(--radius) 0 0 var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
}
.search-form input:focus { outline: 2px solid var(--accent); }
.search-form button {
  padding: 9px 18px;
  border: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--accent);
  color: #111;
  font-weight: 700;
  cursor: pointer;
  font-size: 1rem;
}

main { max-width: 1280px; margin: 0 auto; padding: 20px 16px 48px; }

/* サービス別・ジャンル別ページの見出し */
.listing-head { margin-bottom: 16px; }
.listing-head h1 { font-size: 1.4rem; line-height: 1.4; }
.listing-lead { color: var(--text-dim); font-size: .9rem; margin-top: 4px; }

/* 関連作品 */
.related { margin-top: 36px; }

/* フィルター */
.filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.filters form { display: flex; gap: 10px; flex-wrap: wrap; }
.filters select {
  padding: 8px 10px;
  background: var(--bg3);
  color: var(--text);
  border: 1px solid #3a3c48;
  border-radius: var(--radius);
  font-size: .95rem;
  cursor: pointer;
}
.result-count { color: var(--text-dim); font-size: .9rem; margin-left: auto; }
.avail-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .88rem;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}
.avail-toggle input { accent-color: var(--accent); cursor: pointer; }

/* 作品グリッド（UXの核心：1画面に多数の作品） */
.grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}
@media (max-width: 1100px) { .grid { grid-template-columns: repeat(5, 1fr); } }
@media (max-width: 900px)  { .grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 700px)  { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 480px)  { .grid { grid-template-columns: repeat(2, 1fr); } }

.card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg3);
  aspect-ratio: 2 / 3;
  transition: transform .15s ease;
}
.card:hover { transform: scale(1.03); }
.card img { width: 100%; height: 100%; object-fit: cover; }
.noposter {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 10px; text-align: center;
  color: var(--text-dim); font-size: .9rem;
}

/* ホバーオーバーレイ（PCのみ。タッチ端末はタップで詳細ページへ） */
.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(8,8,12,.96) 0%, rgba(8,8,12,.82) 60%, rgba(8,8,12,.4) 100%);
  opacity: 0;
  transition: opacity .18s ease;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
}
@media (hover: hover) {
  .card:hover .card-overlay { opacity: 1; }
}
.card-title { font-weight: 700; font-size: .95rem; line-height: 1.35; }
.card-meta { color: var(--text-dim); font-size: .78rem; }
.card-desc { color: #c8c8d2; font-size: .76rem; line-height: 1.45; }
.card-providers { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.badge {
  font-size: .68rem;
  font-weight: 700;
  color: #fff;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}
.badge small { font-weight: 400; opacity: .85; }
.badge-none { background: #3a3c48; color: var(--text-dim); }

/* ページネーション */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin-top: 28px;
}
.pagination a {
  background: var(--bg3);
  padding: 9px 18px;
  border-radius: var(--radius);
  font-weight: 600;
}
.pagination a:hover { background: #2e313d; }
.page-info { color: var(--text-dim); }

/* 検索ヒットなし */
.empty { text-align: center; padding: 48px 16px 24px; font-size: 1.1rem; }
.empty .sub { color: var(--text-dim); font-size: .9rem; margin-top: 8px; }
.empty a { color: var(--accent); }
.section-title { margin: 20px 0 14px; font-size: 1.2rem; }

/* 詳細ページ */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: .82rem;
  color: var(--text-dim);
  margin-bottom: 14px;
}
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .current { color: var(--text); }

/* 配信なし作品のDVD・Blu-ray物販導線 */
.purchase { margin-top: 18px; }
.purchase-lead { color: var(--text-dim); font-size: .88rem; margin-bottom: 10px; }

.detail-main {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 28px;
}
@media (max-width: 700px) {
  .detail-main { grid-template-columns: 1fr; }
  .detail-poster { max-width: 240px; margin: 0 auto; }
}
.detail-poster img, .noposter.big {
  border-radius: var(--radius);
  width: 100%;
}
.noposter.big { aspect-ratio: 2/3; background: var(--bg3); }
.detail-info h1 { font-size: 1.6rem; line-height: 1.4; margin-bottom: 10px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tag {
  background: var(--bg3);
  font-size: .8rem;
  padding: 3px 10px;
  border-radius: 99px;
  color: #c8c8d2;
}
.tag.score { background: #3d3613; color: var(--accent); font-weight: 700; }
.detail-desc { color: #c8c8d2; margin-bottom: 22px; max-width: 720px; }

.watch-heading {
  font-size: 1.15rem;
  border-left: 4px solid var(--accent);
  padding-left: 10px;
  margin-bottom: 14px;
}
.offer-group { margin-bottom: 16px; }
.offer-label { font-size: .85rem; color: var(--text-dim); margin-bottom: 8px; }
.offer-label.flatrate { color: #4cd97b; }
.offer-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.offer-btn {
  background: var(--brand, #555);
  color: #fff;
  font-weight: 700;
  padding: 11px 20px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: filter .15s, transform .15s;
}
.offer-btn:hover { filter: brightness(1.15); transform: translateY(-1px); }
.offer-btn small { font-weight: 400; opacity: .8; font-size: .75rem; }
.no-offers { color: var(--text-dim); }
.updated { color: var(--text-dim); font-size: .8rem; margin-top: 18px; }
.backlink { margin-top: 28px; }
.backlink a { color: var(--accent); }

/* フッター */
.site-footer {
  border-top: 1px solid #2a2c36;
  color: var(--text-dim);
  font-size: .82rem;
  text-align: center;
  padding: 24px 16px 36px;
}
.site-footer .services { margin-top: 6px; }
.footer-nav { margin-bottom: 14px; line-height: 2; }
.footer-nav a { color: #b8b8c4; }
.footer-nav a:hover { color: var(--accent); }

/* スタッフ・キャスト（詳細ページ。OMDb補完データの表示と人物・制作国ページへの内部リンク） */
.staff { margin: 14px 0 18px; font-size: .9rem; line-height: 1.9; }
.staff p { margin: 2px 0; }
.staff-label {
  display: inline-block;
  min-width: 4.5em;
  color: var(--text-dim);
  font-size: .8rem;
}
.staff a { color: #b8c4e8; }
.staff a:hover { color: var(--accent); text-decoration: underline; }
