/* ==================================================================
case-cta-panel｜導入事例ページ用 CTAパネル
------------------------------------------------------------------

・すべて .m-case-cta-panel 配下にスコープ
→ テーマ共通CSS（template_layout-case.css 等）に依存しない／波及しない
・罫線は「外周1px＋ブロック間1px」構成。境界が二重にならない
・基本幅は width:100% / max-width:336px
・PC時のみ300px
・PC：左CTA＋右本文の2カラム
・980px以下：ボトムシート
================================================================== */

.m-case-cta-panel {
  width: 100%;
  max-width: 336px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 8px rgba(0, 0, 0, .1);
  overflow: hidden;
  font-family: "Noto Sans JP", sans-serif;
}

.m-case-cta-panel,
.m-case-cta-panel *,
.m-case-cta-panel *::before,
.m-case-cta-panel *::after {
  box-sizing: border-box;
}

.m-case-cta-panel img {
  display: block;
  max-width: none;
  height: auto;
}

.m-case-cta-panel a {
  text-decoration: none;
}

/* ---------- ヘッダー ---------- */
.m-case-cta-panel__head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  margin: 0;
  padding: 8px 20px;
  background: #0d9fc5;
  border: 1px solid #0d9fc5;
  border-bottom: 0;
  border-radius: 16px 16px 0 0;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  line-height: 23px;
}

.m-case-cta-panel__chevron {
  flex: 0 0 auto;
  width: 9px;
  height: 14px;
}

/* ---------- CTAブロック ---------- */
.m-case-cta-panel__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 20px;
  background: #fff;
  border-left: 1px solid #ccc;
  border-right: 1px solid #ccc;
}

.m-case-cta-panel__item + .m-case-cta-panel__item {
  border-top: 1px solid #ccc;
}

.m-case-cta-panel__item:last-child {
  padding-bottom: 24px;
  border-bottom: 1px solid #ccc;
  border-radius: 0 0 16px 16px;
}

.m-case-cta-panel__item--1 {
  background: #e4f4fd;
}

/* ---------- 対象者ラベル ---------- */
.m-case-cta-panel__label {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-height: 23px;
  margin: 0;
  padding: 3px 16px;
  background: #e4f4fd;
  border-radius: 100px;
  color: #0d9fc5;
  font-size: 12px;
  font-weight: 700;
  line-height: 17px;
}

.m-case-cta-panel__item--1 .m-case-cta-panel__label {
  background: #fff;
}

/* ---------- 見出し ---------- */
.m-case-cta-panel__title {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 6px 0 0;
  padding: 0;
  color: #333;
  font-size: 20px;
  font-weight: 700;
  line-height: 28px;
}

.m-case-cta-panel__icon {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
}

.m-case-cta-panel__title span {
  min-width: 0;
}

/* ---------- 説明文 ---------- */
.m-case-cta-panel__desc {
  width: 100%;
  margin: 6px 0 0;
  padding: 0;
  color: #595757;
  font-size: 13px;
  font-weight: 400;
  line-height: 20px;
}

/* ---------- ボタン ---------- */
.m-case-cta-panel__btnwrap {
  width: 100%;
  margin: 12px 0 0;
  padding: 0;
}

.m-case-cta-panel__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  min-height: 48px;
  padding: 8px 10px;
  border: 2px solid #0d9fc5;
  border-radius: 100px;
  font-size: 16px;
  font-weight: 700;
  line-height: 23px;
  text-align: center;
  transition: opacity .2s ease;
}

.m-case-cta-panel__btn:hover,
.m-case-cta-panel__btn:focus {
  opacity: .75;
}

.m-case-cta-panel__btntext {
  min-width: 0;
}

.m-case-cta-panel__arrow {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
}

.m-case-cta-panel__btn--solid,
.m-case-cta-panel__btn--solid:hover,
.m-case-cta-panel__btn--solid:focus {
  background: #0d9fc5;
  color: #fff;
}

.m-case-cta-panel__btn--outline,
.m-case-cta-panel__btn--outline:hover,
.m-case-cta-panel__btn--outline:focus {
  background: #fff;
  color: #0d9fc5;
}


/* ==================================================================
▼ テンプレート配置用レイアウト
PC：CTA 300px + 40px + 本文860px
================================================================== */

/* ---------- PC ---------- */
@media (min-width: 981px) {

  .case-article .row-fluid {
    display: grid;
    grid-template-columns: 300px 860px;
    column-gap: 40px;
    align-items: start;

    width: 1200px;
    max-width: none;
    margin-left: 50%;
    transform: translateX(-50%);
  }

  .case-article .row-fluid .g-contents {
    grid-column: 2;
    grid-row: 1;

    float: none;
    width: 860px;
    max-width: 860px;
    margin: 0 !important;
  }

  .case-cta-col {
    grid-column: 1;
    grid-row: 1;

    width: 300px;
    position: sticky;
    top: 105px;
    align-self: start;
  }

  .m-case-cta-panel {
    max-width: 300px;
  }

  /* 今回の先方修正：PCのみ説明文の行間を22px */
  .m-case-cta-panel__desc {
    line-height: 22px;
  }
}


/* ---------- タブレット / SP ---------- */
@media (max-width: 980px) {

  .case-article .row-fluid {
    display: block;
    width: auto;
    max-width: none;
    margin-left: 0;
    transform: none;
  }

  .case-article .row-fluid .g-contents {
    float: none;
    width: 100%;
    max-width: 860px;
    margin: 0 auto !important;
  }

  .case-cta-col {
    float: none;
    position: static;
    width: 100%;
    max-width: 336px;
    margin: 60px auto 0;
  }
}


/* ==================================================================
▼ 980px以下：ボトムシート
================================================================== */

@media (max-width: 980px) {

  .m-case-cta-panel.is-sheet {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 0;
    z-index: 90;

    display: flex;
    flex-direction: column;
    width: auto;
    max-width: 100%;
    max-height: calc(100vh - 50px);
    margin: 0 auto;

    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, .15);

    transform: translateY(calc(100% - 48px));
    transition: transform .3s ease;
  }

  .m-case-cta-panel.is-sheet.is-open {
    transform: translateY(0);
  }

  .case-cta-col.is-sheet-host {
    margin: 0;
    min-height: 0;
  }

  .m-case-cta-panel.is-sheet .m-case-cta-panel__head {
    flex: 0 0 auto;
    cursor: pointer;
    border-radius: 16px 16px 0 0;
    -webkit-tap-highlight-color: transparent;
  }

  .m-case-cta-panel.is-sheet .m-case-cta-panel__head:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -4px;
  }

  .m-case-cta-panel.is-sheet .m-case-cta-panel__chevron {
    transform: rotate(-90deg);
    transition: transform .3s ease;
  }

  .m-case-cta-panel.is-sheet.is-open .m-case-cta-panel__chevron {
    transform: rotate(90deg);
  }

  .m-case-cta-panel.is-sheet .m-case-cta-panel__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  .m-case-cta-panel.is-sheet .m-case-cta-panel__item:last-child {
    border-radius: 0;
  }

  /* SP時だけコンパクト化 */
  .m-case-cta-panel.is-sheet .m-case-cta-panel__item {
    padding: 14px 16px;
  }

  .m-case-cta-panel.is-sheet .m-case-cta-panel__item:last-child {
    padding-bottom: 14px;
  }

  .m-case-cta-panel.is-sheet .m-case-cta-panel__label {
    min-height: 20px;
    padding: 2px 12px;
    font-size: 11px;
    line-height: 16px;
  }

  .m-case-cta-panel.is-sheet .m-case-cta-panel__title {
    margin-top: 4px;
    font-size: 18px;
    line-height: 24px;
  }

  .m-case-cta-panel.is-sheet .m-case-cta-panel__desc {
    margin-top: 4px;
    font-size: 13px;
    line-height: 18px;
  }

  .m-case-cta-panel.is-sheet .m-case-cta-panel__btnwrap {
    margin-top: 8px;
  }

  .m-case-cta-panel.is-sheet .m-case-cta-panel__btn {
    min-height: 42px;
    padding: 6px 16px;
    font-size: 14px;
    line-height: 20px;
  }
}


/* iOS Safari等：実表示領域に合わせる */
@supports (height: 100dvh) {
  @media (max-width: 980px) {
    .m-case-cta-panel.is-sheet {
      max-height: calc(100dvh - 50px);
    }
  }
}


/* タッチ端末でhoverが残るのを防ぐ */
@media (hover: none) {
  .m-case-cta-panel__btn:hover,
  .m-case-cta-panel__btn:focus {
    opacity: 1;
  }
}