/*
 * 丸竹書房 LP フロントエンドスタイル
 * - サムネイル / iframe
 * - ポップアップオーバーレイ
 * - ポップアップボタン
 */

/* ── サムネイル lazy-thumb ─────────────────────────────────────────────── */
.mx-lazy-thumb {
  position: relative;
  display: block;
  cursor: pointer;
  background: #000;
  overflow: hidden;
}
.mx-lazy-thumb:focus-visible {
  outline: 3px solid #2271b1;
  outline-offset: 2px;
}
.mx-lazy-thumb .mx-vol-thumb {
  width: 100%;
  display: block;
  transition: opacity .2s;
}
.mx-lazy-thumb:hover .mx-vol-thumb { opacity: .85; }

.mx-lazy-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 40px;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,.6);
  pointer-events: none;
  line-height: 1;
}
.mx-lazy-thumb:hover .mx-lazy-play { color: #ff0000; }

.mx-vol-iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  display: block;
}

/* ── ポップアップボタン ────────────────────────────────────────────────── */
.mx-vol-popup-btns {
  padding: 0 16px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.mx-popup-btn {
  font-size: 12px;
  padding: 5px 12px;
  border: 1px solid #d0d0d0;
  border-radius: 20px;
  background: #f8f8f8;
  cursor: pointer;
  color: #444;
  transition: background .15s, border-color .15s, color .15s;
  line-height: 1.4;
}
.mx-popup-btn:hover,
.mx-popup-btn:focus-visible {
  background: #e8f0fe;
  border-color: #4a90d9;
  color: #1a56a8;
  outline: none;
}

/* ── ポップアップオーバーレイ ──────────────────────────────────────────── */
#mx-popup-overlay {
  display: none; /* JS で flex に切り替え */
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .65);
  z-index: 99999;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
body.mx-popup-open { overflow: hidden; }

#mx-popup-box {
  background: #fff;
  border-radius: 10px;
  max-width: 640px;
  width: 100%;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 40px rgba(0, 0, 0, .35);
}

#mx-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}
#mx-popup-title {
  margin: 0;
  font-size: 1.05em;
  font-weight: 700;
  line-height: 1.4;
  color: #1a1a1a;
}
#mx-popup-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #888;
  padding: 4px 8px;
  border-radius: 4px;
  line-height: 1;
  flex-shrink: 0;
  margin-left: 12px;
}
#mx-popup-close:hover { background: #f0f0f0; color: #333; }

#mx-popup-body {
  padding: 16px 20px 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── ポップアップ内コンテンツ ──────────────────────────────────────────── */
.mx-popup-text {
  font-size: 14px;
  line-height: 1.85;
  color: #333;
  margin: 0;
}

/* 登場人物 */
.mx-popup-chars {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.mx-popup-char-item {
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f0f0;
}
.mx-popup-char-item:last-child { border-bottom: none; padding-bottom: 0; }
.mx-popup-char-name { font-size: 15px; color: #1a1a1a; }
.mx-popup-char-role { font-size: 12px; color: #888; }
.mx-popup-char-desc {
  font-size: 13px;
  color: #555;
  margin: 5px 0 0;
  line-height: 1.65;
}

/* 用語集 */
.mx-popup-glossary { margin: 0; }
.mx-popup-term {
  font-weight: 700;
  font-size: 14px;
  color: #1a1a1a;
  margin: 10px 0 3px;
}
.mx-popup-term:first-child { margin-top: 0; }
.mx-popup-term-desc {
  font-size: 13px;
  color: #555;
  margin: 0 0 0 10px;
  line-height: 1.65;
}

/* ── レスポンシブ ──────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  #mx-popup-box { max-height: 90vh; border-radius: 8px; }
  #mx-popup-header { padding: 14px 16px 10px; }
  #mx-popup-body  { padding: 12px 16px 20px; }
  .mx-vol-popup-btns { padding: 0 12px 10px; }
}
