/* =========================================
   Kumamoto Forum 2026 Popup Banner
   全ページ右下固定表示。第29回熊本フォーラム特設ページへの導線。

   2026-08-07: デザイン画像(1200x600、比2:1)を採用したため、表示領域を
   画像の比率に合わせて変更(旧: 幅8:高さ5のCSS文字組み → 新: 画像の比2:1)。
   その後、オーナー指示によりサイズを拡大(開いた瞬間に目に入る大きさ)し、
   角丸(border-radius)を撤廃した。画像自体が長方形のネイビー枠を含んでおり、
   CSSの角丸で丸めると画像内の枠線が不自然に見切れるため。

   Specificity note:
   親テーマ系の ui-framework.css に `#douyu-wrapper * { padding/margin/border: 0 }`
   という id スコープのリセット (specificity 1,0,0) があり、素の `.kf-banner`
   (0,1,0) では負けて padding 等が潰れる（notice-banner.css と同じ回避パターン）。
   `:is(#douyu-wrapper, body)` を前置して id 相当の specificity (1,1,0) を借りる。
   ========================================= */

:is(#douyu-wrapper, body) .kf-banner {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  width: 440px;
  height: 220px; /* 画像比2:1 */
  box-sizing: border-box;
  box-shadow: 0 6px 20px rgba(11, 26, 51, 0.35);
  animation: kf-banner-fade-in 0.4s ease-out;
}

:is(#douyu-wrapper, body) .kf-banner__close {
  position: absolute;
  top: 0;
  right: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: #0b1a33;
  font-size: 24px;
  line-height: 44px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(11, 26, 51, 0.4);
  z-index: 1;
}

:is(#douyu-wrapper, body) .kf-banner__close:hover {
  background: #c9a961;
}

:is(#douyu-wrapper, body) .kf-banner__link {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

:is(#douyu-wrapper, body) .kf-banner__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

:is(#douyu-wrapper, body) .kf-banner.is-closed {
  display: none;
}

@keyframes kf-banner-fade-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============ レスポンシブ（サイト共通ブレークポイント 768px / 480px） ============ */

@media (max-width: 768px) {
  :is(#douyu-wrapper, body) .kf-banner {
    right: 12px;
    bottom: 12px;
    width: 340px;
    height: 170px; /* 画像比2:1 を維持 */
  }
}

@media (max-width: 480px) {
  :is(#douyu-wrapper, body) .kf-banner {
    right: 8px;
    bottom: 8px;
    width: 260px;
    height: 130px; /* 画像比2:1 を維持 */
  }
}

/* 動きを減らす設定にしている利用者には、フェードインを行わない */
@media (prefers-reduced-motion: reduce) {
  :is(#douyu-wrapper, body) .kf-banner {
    animation: none;
  }
}
