/* engagement.css — エンゲージメント強化UIのスタイル
 * engagement.js が生成する要素 + 一覧ページの絞り込みUI。
 */

/* ===== 1. YouTube facade（クリックで読み込むサムネ） ===== */
.yt-facade {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: none;
  border-radius: 8px;
  background-color: #000;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  cursor: pointer;
  overflow: hidden;
}
.yt-facade::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.15);
  transition: background 0.2s ease;
}
.yt-facade:hover::after,
.yt-facade:focus-visible::after {
  background: rgba(0, 0, 0, 0.3);
}
.yt-facade__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 68px;
  height: 48px;
  border-radius: 12px;
  background: #f00;
  z-index: 1;
  transition: transform 0.15s ease, background 0.15s ease;
}
.yt-facade__play::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-40%, -50%);
  border-style: solid;
  border-width: 11px 0 11px 19px;
  border-color: transparent transparent transparent #fff;
}
.yt-facade:hover .yt-facade__play {
  transform: translate(-50%, -50%) scale(1.1);
  background: #f00;
}

/* ===== 2. 自動目次 ===== */
.auto-toc {
  margin: 0 0 1.6rem;
  padding: 14px 18px;
  background: #f7f9fb;
  border: 1px solid #e2e8ee;
  border-radius: 8px;
  font-size: 0.95rem;
}
.auto-toc__title {
  margin: 0 0 8px;
  font-weight: 700;
  color: #2e7d32;
}
.auto-toc ul {
  margin: 0;
  padding-left: 1.2em;
  list-style: none;
}
.auto-toc li {
  margin: 4px 0;
  position: relative;
}
.auto-toc li::before {
  content: "›";
  position: absolute;
  left: -1em;
  color: #4caf50;
}
.auto-toc__sub {
  margin-left: 1em;
  font-size: 0.92em;
  opacity: 0.85;
}
.auto-toc a {
  text-decoration: none;
}
.auto-toc a:hover {
  text-decoration: underline;
}

/* ===== 3. 本文中盤「あわせて読みたい」 ===== */
.inline-related {
  margin: 2rem 0;
  padding: 14px 18px;
  background: #fff8f0;
  border: 1px solid #f0ddc8;
  border-left: 5px solid #ff9800;
  border-radius: 8px;
}
.inline-related__label {
  margin: 0 0 8px;
  font-weight: 700;
  color: #e65100;
}
.inline-related ul {
  margin: 0;
  padding-left: 1.2em;
}
.inline-related li {
  margin: 6px 0;
}

/* ===== 4. 読了プログレスバー & トップへ戻る ===== */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  width: 0;
  background: linear-gradient(90deg, #4caf50, #ff9800);
  z-index: 9999;
  transition: width 0.1s linear;
}
.to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(76, 175, 80, 0.92);
  color: #fff;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 9998;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.to-top:hover {
  background: #43a047;
}

/* ===== 5. 一覧ページの絞り込み（List.js相当のクライアントフィルタ） ===== */
.list-filter {
  margin: 1rem 0 1.4rem;
}
.list-filter__input {
  width: 100%;
  max-width: 420px;
  padding: 10px 14px;
  font-size: 1rem;
  border: 1px solid #cfd8dc;
  border-radius: 8px;
  box-sizing: border-box;
}
.list-filter__count {
  margin: 6px 2px 0;
  font-size: 0.85rem;
  opacity: 0.7;
}
.list-filter__empty {
  margin: 1rem 0;
  padding: 12px;
  text-align: center;
  opacity: 0.7;
}
