/* ================================================================
   i-mobile Ad Styles
   ================================================================ */

/* ── Sticky bottom bar (728x90) – デスクトップのみ表示 ───────────── */
.ad-sticky-bar {
  display: none; /* mobile: 非表示 */
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9990;
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 -2px 16px rgba(0, 0, 0, .10);
  text-align: center;
  padding: 8px 40px 6px;
}

.ad-sticky-bar__label {
  font-size: 9px;
  color: #9ca3af;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 4px;
  display: block;
}

.ad-sticky-bar__close {
  position: absolute;
  top: 6px;
  right: 10px;
  background: #f3f4f6;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 14px;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}
.ad-sticky-bar__close:hover {
  background: #e5e7eb;
  color: #111827;
}

/* PC のみ表示 + body に余白を追加 */
@media (min-width: 769px) {
  .ad-sticky-bar { display: block; }
  body.has-sticky-ad { padding-bottom: 112px; }
}

/* ── Sidebar rectangle (336x280) ─────────────────────────────── */
/* サイドバー列は 320px しかないため、ネガティブマージンで 336px を確保する。
   親 .sidebar-widget の装飾（枠線・背景・影・角丸）も打ち消して、広告だけが
   浮いて見えるようにする */
.sidebar-widget--ad {
  text-align: center;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  overflow: visible !important;
  /* 320px サイドバー → 336px 広告を入れるため左側を 16px はみ出させる
     （右側はサイドバー右端に揃える。ギャップ 28px なので左はみ出しは
     コンテンツとの間に 12px 残る）
     margin ショートハンド: top right bottom left */
  margin: 0 0 18px -16px !important;
  width: calc(100% + 16px);
  min-height: 280px; /* 読込中の高さを確保してレイアウトシフト防止 */
}
.sidebar-widget--ad > div {
  display: inline-block;
  max-width: 100%;
}

/* ── Mobile sticky bar (468x60) – スマホのみ表示 ────────────── */
.ad-sticky-bar-mobile {
  display: block; /* mobile: 表示 */
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9990;
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 -2px 16px rgba(0, 0, 0, .10);
  text-align: center;
  padding: 6px 30px 4px;
}
.ad-sticky-bar-mobile .ad-sticky-bar__label {
  font-size: 9px;
  color: #9ca3af;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 3px;
  display: block;
}
.ad-sticky-bar-mobile .ad-sticky-bar__close {
  position: absolute;
  top: 4px;
  right: 8px;
  background: #f3f4f6;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 12px;
  color: #6b7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}
.ad-sticky-bar-mobile .ad-sticky-bar__close:hover {
  background: #e5e7eb;
  color: #111827;
}

body.has-sticky-ad-mobile { padding-bottom: 78px; }

/* PC では非表示 */
@media (min-width: 769px) {
  .ad-sticky-bar-mobile { display: none !important; }
  body.has-sticky-ad-mobile { padding-bottom: 0; }
}

/* ── In-content 300x250 ──────────────────────────────────────── */
.ad-unit--300x250 {
  text-align: center;
  margin: 28px auto;
  overflow: hidden;
  clear: both;
  max-width: 300px;
}
.ad-unit--300x250-wrap {
  border-top: 1px solid #f3f4f6;
  border-bottom: 1px solid #f3f4f6;
  padding: 20px 0;
  margin: 28px 0;
  background: #fafafa;
}
.ad-unit--300x250-wrap .ad-label {
  font-size: 10px;
  color: #9ca3af;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 8px;
  display: block;
  text-align: center;
}
