/* Mitsukeru Footer CTA 1.1.0-mitsukeru.8
 * 画面下の固定メニュー：左「目次」／右「CTA」をアイコン＋文字（縦積み）で均等に並べる
 */
:root{
  --mfc-offset: 0px;      /* 帯の高さ（JSが実測して更新） */
  --mfc-bottom: 0px;      /* SWELL下部固定メニューの高さ（JSが実測して更新） */
}

.mfc.mfc,
.mfc-toc{
  --mfc-bg: #FFFFFF;
  --mfc-line: #E8E8E8;
  --mfc-text: #444444;
  --mfc-sub: #D6D6D6;               /* 目次ボタンの枠線 */
  --mfc-cta: #E63535;
  --mfc-on-cta: #FFFFFF;
  --mfc-cta-hover: #CF2E2E;
  --mfc-current: #8C8C8C;           /* 目次パネル「今読んでいる見出し」の左線（サイトの色に合わせて変更可） */
  --mfc-current-bg: #F5F5F5;        /* 同・背景 */
  --mfc-current-text: #222222;      /* 同・文字 */
  --mfc-focus: #1A73E8;
  --mfc-shine: rgba(255,255,255,.45);
  --mfc-radius: 10px;
}

/* ── 帯 ── */
.mfc.mfc{
  position: fixed;
  left: 0;
  right: 0;
  bottom: var(--mfc-bottom);
  z-index: 1000;
  margin: 0;
  padding: 6px 10px calc(8px + env(safe-area-inset-bottom, 0px));
  background: var(--mfc-bg);
  border-top: 1px solid var(--mfc-line);
  box-sizing: border-box;
}

.mfc.mfc .mfc__inner{
  display: flex;
  gap: 8px;
  max-width: 480px;
  margin: 0 auto;
}

/* ── ボタン共通（縦積み：アイコン上・文字下） ── */
.mfc.mfc .mfc__item.mfc__item{
  flex: 1 1 0 !important;
  min-width: 0;
  width: auto !important;
  max-width: none !important;
  min-height: 44px !important;   /* 指で押しやすい最小サイズ（Appleの基準 44pt） */
  margin: 0 !important;
  padding: 3px 4px !important;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  box-sizing: border-box;
  border-radius: var(--mfc-radius) !important;
  box-shadow: none !important;
  font-family: inherit;
  font-size: 12px !important;
  font-weight: 700;
  line-height: 1.3 !important;
  letter-spacing: .04em;
  text-align: center;
  text-decoration: none !important;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  animation: none !important;
  transform: none !important;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .15s ease, border-color .15s ease;
}
.mfc.mfc .mfc__item.mfc__item[hidden]{
  display: none !important;
}

.mfc.mfc .mfc__icon{
  display: block;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.mfc.mfc .mfc__label{
  display: block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 子要素はクリックを素通し（クリック計測が常にボタン本体を拾うように） */
.mfc.mfc .mfc__item.mfc__item > *{
  pointer-events: none;
  position: relative;
  z-index: 1;
}

/* ── 目次ボタン（白地＋枠線） ── */
.mfc.mfc .mfc__item--toc.mfc__item--toc{
  background: var(--mfc-bg) !important;
  color: var(--mfc-text) !important;
  border: 1px solid var(--mfc-sub) !important;
  -webkit-appearance: none;
  appearance: none;
}
.mfc.mfc .mfc__item--toc.mfc__item--toc:hover,
.mfc.mfc .mfc__item--toc.mfc__item--toc[aria-expanded="true"]{
  background: #F6F6F6 !important;
}

/* ── CTAボタン（赤の塗りつぶし） ── */
.mfc.mfc .mfc__item--cta.mfc__item--cta{
  background: var(--mfc-cta) !important;
  color: var(--mfc-on-cta) !important;
  border: 1px solid var(--mfc-cta) !important;
}
.mfc.mfc .mfc__item--cta.mfc__item--cta:hover{
  background: var(--mfc-cta-hover) !important;
  border-color: var(--mfc-cta-hover) !important;
}

/* ミツケルの広告クラス（.custom-label / .jump）がテーマ側で持つ疑似要素の打ち消し */
.mfc.mfc .mfc__item.mfc__item::before{
  content: none !important;
}
.mfc.mfc .mfc__item.mfc__item:not(.mfc__btn--shine)::after{
  content: none !important;
}

.mfc.mfc .mfc__item.mfc__item:focus-visible{
  outline: 2px solid var(--mfc-focus);
  outline-offset: 2px;
}

/* ── シャイン：光の帯がボタンを横切る ── */
.mfc.mfc .mfc__btn--shine.mfc__btn--shine::after{
  content: "" !important;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 60%;
  background: linear-gradient(100deg, rgba(255,255,255,0) 0%, var(--mfc-shine) 50%, rgba(255,255,255,0) 100%);
  transform: translateX(-170%);
  pointer-events: none;
}
.mfc.mfc .mfc__btn--shine.mfc-shine-loop::after{
  animation: mfc-shine 7s ease-in-out infinite;
}
.mfc.mfc .mfc__btn--shine.mfc-shine-once.is-shine::after{
  animation: mfc-shine-once 4s ease-in-out 1;
}
@keyframes mfc-shine{
  0%   { transform: translateX(-170%); }
  57%  { transform: translateX(270%); }
  100% { transform: translateX(270%); }
}
@keyframes mfc-shine-once{
  0%   { transform: translateX(-170%); }
  100% { transform: translateX(270%); }
}

/* 帯で本文末尾・フッターが隠れないための余白 */
.mfc-spacer{
  height: var(--mfc-offset);
}

/* SWELLの右下固定ボタン（目次・ページトップ）を帯の上へ逃がす */
body.mfc-active .p-fixBtnWrap{
  bottom: calc(var(--mfc-offset) + var(--mfc-bottom) + 12px) !important;
}

/* ── 目次パネル（下から開く） ── */
.mfc-toc{
  position: fixed;
  inset: 0;
  z-index: 999;              /* 帯（1000）の下。帯の「目次」で開閉できる */
}
.mfc-toc[hidden]{
  display: none;
}
.mfc-toc__backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.4);
  opacity: 0;
  transition: opacity .2s ease;
}
.mfc-toc__sheet{
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--mfc-offset) + var(--mfc-bottom));
  max-width: 480px;
  max-height: min(70vh, calc(100vh - var(--mfc-offset) - var(--mfc-bottom) - 40px));
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--mfc-bg);
  color: var(--mfc-text);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 16px rgba(0,0,0,.08);
  transform: translateY(calc(100% + var(--mfc-offset) + var(--mfc-bottom)));
  transition: transform .25s ease;
  box-sizing: border-box;
}
.mfc-toc.is-open .mfc-toc__backdrop{ opacity: 1; }
.mfc-toc.is-open .mfc-toc__sheet{ transform: translateY(0); }

.mfc-toc__grip{
  width: 36px;
  height: 4px;
  margin: 10px auto 4px;
  border-radius: 2px;
  background: #DDDDDD;
  flex: 0 0 auto;
}
.mfc-toc__head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 12px 6px 18px;
  flex: 0 0 auto;
}
.mfc-toc .mfc-toc__title{
  margin: 0;
  padding: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
}
.mfc-toc .mfc-toc__close{
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 50%;
  color: #666666;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.mfc-toc .mfc-toc__close svg{ width: 20px; height: 20px; }
.mfc-toc .mfc-toc__close:focus-visible{
  outline: 2px solid var(--mfc-focus);
  outline-offset: 2px;
}

.mfc-toc .mfc-toc__list{
  list-style: none;
  margin: 0;
  padding: 0 18px 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.mfc-toc .mfc-toc__item{
  margin: 0;
  padding: 0;
  border-bottom: 1px solid #F0F0F0;
}
.mfc-toc .mfc-toc__item::before,
.mfc-toc .mfc-toc__item::marker{
  content: none;
}
.mfc-toc .mfc-toc__link{
  display: block;
  padding: 12px 4px;
  color: var(--mfc-text);
  font-size: 14px;
  line-height: 1.6;
  text-decoration: none;
}
.mfc-toc .mfc-toc__item--sub .mfc-toc__link{
  padding: 9px 4px 9px 18px;
  color: #777777;
  font-size: 13px;
}
.mfc-toc .mfc-toc__link.is-current{
  color: var(--mfc-current-text);
  font-weight: 700;
  background: var(--mfc-current-bg);
  box-shadow: inset 3px 0 0 var(--mfc-current);
  border-radius: 0 6px 6px 0;
  padding-left: 12px;
}
.mfc-toc .mfc-toc__item--sub .mfc-toc__link.is-current{
  padding-left: 24px;
}
.mfc-toc .mfc-toc__link:focus-visible{
  outline: 2px solid var(--mfc-focus);
  outline-offset: -2px;
}

/* パネルを開いている間は本文をスクロールさせない */
body.mfc-toc-open{
  overflow: hidden;
}

/* スマホのみ設定時、PC幅（SWELLの960px）では非表示 */
@media (min-width: 960px){
  .mfc.mfc[data-device="sp"],
  .mfc.mfc[data-device="sp"] ~ .mfc-toc{
    display: none;
  }
}

@media (prefers-reduced-motion: reduce){
  .mfc.mfc .mfc__item.mfc__item,
  .mfc-toc__backdrop,
  .mfc-toc__sheet{
    transition: none;
  }
  .mfc.mfc .mfc__btn--shine.mfc__btn--shine::after{
    animation: none !important;
    display: none !important;
  }
}
