.mihl-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
}
.mihl-layer {
  position: absolute;
  box-sizing: border-box;
  pointer-events: auto;
  line-height: 1.5;
  max-width: 100%;
}
/* リンク・ボタンは block / flex にしてレイヤー幅いっぱいを占有させる。
   背景色と余白はこれらの要素側に付くため、見た目の箱＝クリック範囲になる。 */
.mihl-link-wrap {
  display: block;
  box-sizing: border-box;
  color: inherit;
  text-decoration: none;
}
.mihl-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: inherit;
}
.mihl-text {
  box-sizing: border-box;
  color: inherit;
}
.mihl-button {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  text-align: center;
}
.mihl-preview-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 999999;
  padding: 5px 8px;
  background: #111;
  color: #fff;
  font: 700 11px/1.2 sans-serif;
  letter-spacing: .04em;
  pointer-events: none;
}
@keyframes mihlFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes mihlSlideUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes mihlZoom { from { opacity: 0; scale: .96; } to { opacity: 1; scale: 1; } }
.mihl-anim-fade { animation: mihlFade .45s ease both; }
.mihl-anim-slide-up > * { animation: mihlSlideUp .5s ease both; }
.mihl-anim-zoom > * { animation: mihlZoom .45s ease both; }
@media (prefers-reduced-motion: reduce) {
  .mihl-layer, .mihl-layer > * { animation: none !important; }
}

/* ------------------------------------------------------------------
 * お知らせパネル（テキスト＋バナー画像）
 * ヒーローは overflow:hidden のため、パネルは必ず内側に収める。
 * 高さが足りない場合は本文だけをパネル内でスクロールさせる。
 * ------------------------------------------------------------------ */
.mihl-panel-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: clamp(12px, 4vw, 48px);
  pointer-events: none;
}
.mihl-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: min(880px, 100%);
  max-height: 100%;
  padding: clamp(28px, 4.2vw, 56px) clamp(24px, 4.6vw, 64px);
  color: #fff;
  background: linear-gradient(145deg, rgba(16, 22, 34, .74) 0%, rgba(16, 22, 34, .56) 100%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: clamp(14px, 1.6vw, 22px);
  box-shadow:
    0 30px 70px rgba(0, 0, 0, .34),
    inset 0 1px 0 rgba(255, 255, 255, .14);
  pointer-events: auto;
  animation: mihlPanelIn .6s cubic-bezier(.2, .8, .2, 1) both;
}
/* 高さが足りないときは、front.js の fitPanel() が画像の高さを詰めて本文を優先的に見せる。
   画像が最小サイズ（56px）になってもまだ足りない場合だけ、本文がスクロールになる。 */
.mihl-panel-text {
  flex: 0 1 auto;
  min-height: 3.5em;
  overflow-y: auto;
  padding-right: 36px; /* 閉じるボタンと重ならないように */
  font-size: clamp(14px, 1.45vw, 17px);
  font-weight: 500;
  line-height: 1.95;
  letter-spacing: .03em;
  text-align: left;
  overscroll-behavior: contain;
}
.mihl-panel-text a {
  color: #8fd8ff;
  text-decoration: underline;
  text-decoration-color: rgba(143, 216, 255, .45);
  text-underline-offset: 4px;
  word-break: break-all;
  transition: color .2s, text-decoration-color .2s;
}
.mihl-panel-text a:hover {
  color: #fff;
  text-decoration-color: #fff;
}
.mihl-panel-text strong { font-weight: 700; }
.mihl-panel-media {
  flex: 0 0 auto;
  margin-top: clamp(18px, 2.6vw, 34px);
  text-align: center;
  line-height: 0;
}
.mihl-panel-media img {
  display: inline-block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(220px, 26vw);
  vertical-align: top;
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .38);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s;
}
.mihl-panel-link {
  display: inline-block;
  max-width: 100%;
  border-radius: 12px;
}
.mihl-panel-link:hover img {
  transform: translateY(-3px);
  box-shadow: 0 20px 44px rgba(0, 0, 0, .45);
}
.mihl-panel-link:focus-visible {
  outline: 2px solid #8fd8ff;
  outline-offset: 4px;
}
.mihl-panel-close {
  position: absolute;
  top: clamp(10px, 1.4vw, 18px);
  right: clamp(10px, 1.4vw, 18px);
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  color: #fff;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 50%;
  cursor: pointer;
  transition: background-color .2s, transform .2s;
}
.mihl-panel-close svg { width: 16px; height: 16px; }
.mihl-panel-close:hover {
  background: rgba(255, 255, 255, .2);
  transform: rotate(90deg);
}
.mihl-panel-close:focus-visible {
  outline: 2px solid #8fd8ff;
  outline-offset: 2px;
}
.mihl-panel-wrap.is-closing .mihl-panel {
  animation: mihlPanelOut .26s ease both;
}
@keyframes mihlPanelIn {
  from { opacity: 0; transform: translateY(16px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes mihlPanelOut {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(.97); }
}
/* スマホ: ヒーローが正方形で狭いため、余白と文字を詰める */
@media (max-width: 640px) {
  .mihl-panel {
    padding: 22px 18px 18px;
    border-radius: 14px;
  }
  .mihl-panel-text {
    padding-right: 30px;
    font-size: 13px;
    line-height: 1.75;
    letter-spacing: .01em;
  }
  .mihl-panel-media { margin-top: 14px; }
  .mihl-panel-media img {
    max-height: 30vw;
    border-radius: 8px;
  }
  .mihl-panel-close {
    top: 8px;
    right: 8px;
    width: 34px;
    height: 34px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .mihl-panel,
  .mihl-panel-wrap.is-closing .mihl-panel { animation: none !important; }
  .mihl-panel-close:hover { transform: none; }
}

.mihl-preview-error {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 9999999;
  max-width: min(560px, calc(100vw - 40px));
  padding: 12px 14px;
  background: #b32d2e;
  color: #fff;
  font: 700 13px/1.5 sans-serif;
  box-shadow: 0 8px 30px rgba(0,0,0,.22);
}
