/* =============================================================
   トップページ（index.html）の料金表 専用CSS

   概要：
   - 「『無料』で運用が始められます－料金プラン－」の中身を、
     料金カード4枚 → 押すと開く機能比較の表 → 押すと開くエンタープライズ
     の順に表示する。
   主な仕様：
   - クラス名はすべて top-plan__ で始め、#plan（.top-plan）の中だけに効かせる。
   - 料金ページ（plan.html など）と共有している smart02.css / style02.css は触らない。
   - 機能比較の表は、スマホ幅（640px以下）では「選んだ1プラン＋プロ」の2列だけを表示する。
     どの2列を見せるかは、index.html 下部のJSが表に is-show-{プラン名} のクラスを付けて決める。
   - 機能比較の表の見出し行（機能／フリー…）は、下へスクロールしても
     サイト上部の固定ヘッダーのすぐ下に付いてくる（position: sticky）。
   - 使えるマスは緑の●（.top-plan__dot）、使えないマスは薄い「－」で見せる。
   - 「利用可」「利用不可」は .visually-hidden で画面からは隠し、HTMLには残す。
   制限事項：
   - 見出し行を付いてこさせるため、表の外枠に横スクロール（overflow）を付けない。
     表の親要素に overflow を足すと、見出し行が付いてこなくなる。
   - 固定ヘッダーの高さ（PC 70px／スマホ 60px）が変わったら、見出し行の top も合わせて直す。
   - 開閉は <details> を使うため、開くときの動き（アニメーション）はない。
   - 機能名を押すと開く説明の窓（.popup）の見た目は、共有CSSのものをそのまま使う。
   ============================================================= */


/* -------------------------------------------------------------
   共通：画面には出さず、読み上げソフト・検索エンジンには読ませる文字
   （Bootstrap の .visually-hidden と同じ考え方。1pxに縮めて切り取る）
   ------------------------------------------------------------- */
.top-plan .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* -------------------------------------------------------------
   料金表全体の囲み
   style02.css の「.contents_page_1080 は overflow: hidden」があると、
   機能比較の表の見出し行が付いてこない（sticky が効かない）ので、料金表だけ外す。
   中の回り込み（float）を囲む役目は display: flow-root で代わりに持たせる。
   ------------------------------------------------------------- */
.top-plan.contents_page_1080 {
  display: flow-root;
  overflow: visible;
}


/* -------------------------------------------------------------
   見出しまわり：上の余白を少し詰める（夏川さんの依頼）
   ------------------------------------------------------------- */
.top-plan .subject {
  margin-top: 20px;
}

/* カード上の一文（初期費用0円・初月料金0円） */
.top-plan .top-plan__lead {
  margin-top: 0;
  line-height: 1.7;
  text-align: center;
  font-size: 15px;
  color: #555;
}


/* -------------------------------------------------------------
   料金カード（4枚）
   ------------------------------------------------------------- */
.top-plan__cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 36px;
  background: #fff;
  border: 1px solid #ddd;
}

/* カード1枚 */
.top-plan__card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 26px 18px 22px 18px;
  border-left: 1px solid #ddd;
}

.top-plan__card:first-child {
  border-left: 0;
}

/* おすすめ（プロプラン）：今のHPの赤で枠と背景を付ける */
.top-plan__card.is-recommend {
  z-index: 1;
  background: #fff6f5;
  outline: 3px solid #be0200;
  outline-offset: -3px;
}

/* おすすめの吹き出し「1番人気のおすすめプラン」 */
.top-plan__badge {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 14px 9px 14px;
  background: #be0200;
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  white-space: nowrap;
  clip-path: polygon(0 0, 100% 0, 100% 80%, 52% 80%, 50% 100%, 48% 80%, 0 80%);
}

/* ひとこと（どんな方向けか） */
.top-plan .top-plan__catch {
  min-height: 38px;
  margin-top: 0;
  font-size: 12px;
  line-height: 1.5;
  color: #555;
}

/* プラン名 */
.top-plan__name {
  margin-top: 8px;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.3;
}

/* 月額 */
.top-plan .top-plan__price {
  margin-top: 6px;
  font-size: 30px;
  font-weight: 900;
  line-height: 1.3;
}

.top-plan .top-plan__price small {
  font-size: 13px;
  font-weight: normal;
  color: #555;
}

/* 月間配信数 */
.top-plan .top-plan__vol {
  margin-top: 0;
  line-height: 1.5;
  font-size: 13px;
  color: #555;
}

/* 50,000通の横の (*) */
.top-plan__mark {
  color: #be0200;
}

/* 主な機能3つ */
.top-plan__items {
  flex: 1;
  margin-top: 14px;
  padding-left: 0;
  list-style: none;
  font-size: 14px;
}

.top-plan__items li {
  position: relative;
  padding: 6px 0 6px 22px;
  border-top: 1px dashed #ddd;
}

/* 機能の頭のチェック印 */
.top-plan__items li::before {
  content: "";
  position: absolute;
  top: 13px;
  left: 2px;
  width: 10px;
  height: 6px;
  border-left: 2px solid #00c853;
  border-bottom: 2px solid #00c853;
  transform: rotate(-45deg);
}

/* 申込ボタン（フリー・スタート・スタンダード）：白地に緑の枠 */
.top-plan__btn,
.top-plan__btn:link,
.top-plan__btn:visited {
  display: block;
  margin-top: 16px;
  padding: 12px 8px;
  border: 2px solid #00c853;
  border-radius: 40px;
  background: #fff;
  color: #00a046;
  font-size: 15px;
  font-weight: bold;
  text-align: center;
  text-decoration: none;
  transition: opacity 0.3s ease;
}

/* 申込ボタン（プロ）：赤地に白文字で目立たせる */
.top-plan__card.is-recommend .top-plan__btn,
.top-plan__card.is-recommend .top-plan__btn:link,
.top-plan__card.is-recommend .top-plan__btn:visited {
  border-color: #be0200;
  background: #be0200;
  color: #fff;
}

@media (any-hover: hover) {
  .top-plan__btn:hover {
    opacity: 0.8;
  }
}


/* -------------------------------------------------------------
   注記（大量送信プランへのリンク、LINE公式アカウントの費用など）
   ------------------------------------------------------------- */
.top-plan__note {
  margin-top: 16px;
  font-size: 12px;
  line-height: 1.7;
  color: #555;
}

/* 「＊50,001通以上の大量送信を…」の行：赤字で残す */
.top-plan__note-strong {
  font-size: 15px;
  font-weight: bold;
  line-height: 1.5;
  color: #e00;
}


/* -------------------------------------------------------------
   機能比較（押すと開く）
   ------------------------------------------------------------- */
.top-plan__compare {
  margin-top: 24px;
  background: #fff;
  border: 1px solid #ddd;
}

/* 「すべての機能を比較する」の行 */
.top-plan__compare-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  list-style: none;
}

/* ブラウザ標準の三角印を消す */
.top-plan__compare-summary::-webkit-details-marker {
  display: none;
}

/* 右端の「＋」（開いているときは「－」） */
.top-plan__compare-summary::after {
  content: "＋";
  font-size: 20px;
  color: #00a046;
}

.top-plan__compare[open] .top-plan__compare-summary::after {
  content: "－";
}

/* 開いたときの中身 */
.top-plan__compare-body {
  padding: 0 24px 24px 24px;
}

/* 比べるプランを選ぶボタン：PC・タブレットでは出さない（スマホだけ表示） */
.top-plan__switch {
  display: none;
}

/* 表の外枠：見出し行を付いてこさせるため、横スクロール（overflow）は付けない */
.top-plan__table-wrap {
  margin-top: 0;
}

/* 表 */
.top-plan__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.5;
}

.top-plan__table th,
.top-plan__table td {
  padding: 10px 8px;
  border-bottom: 1px solid #e5e5e5;
  text-align: center;
  vertical-align: middle;
  background: #fff;
  /* style02.css の「th は白文字」を打ち消す */
  color: #333;
}

/* 見出し行（機能／フリー／スタート／スタンダード／プロ）
   下へスクロールしても、サイト上部の固定ヘッダー（PCは高さ70px）のすぐ下に付いてくる */
.top-plan__table thead th {
  position: sticky;
  top: 70px;
  z-index: 2;
  font-size: 14px;
  font-weight: bold;
  /* 付いてきている間も下線が消えないよう、border ではなく影で線を引く */
  border-bottom: 0;
  box-shadow: inset 0 -2px 0 #ccc;
}

/* 左端の機能名の列 */
.top-plan__table .top-plan__feature-head,
.top-plan__table .top-plan__feature {
  width: 32%;
  text-align: left;
  font-weight: normal;
}

/* 分類の帯（マーケティングの自動化・効率化機能 など） */
.top-plan__table .top-plan__cat th {
  background: #eefaf2;
  color: #00a046;
  font-weight: bold;
  text-align: left;
}

/* 機能名：押すと説明の窓が開くことが分かるよう、点線の下線を付ける */
/* style02.css の「a.td_feature_link.popup-trigger は濃い灰色の背景に白文字」を打ち消すため、同じ書き方で強くする */
.top-plan__table a.td_feature_link.popup-trigger,
.top-plan__table a.td_feature_link.popup-trigger:link,
.top-plan__table a.td_feature_link.popup-trigger:visited {
  background: transparent;
  color: #333;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}

/* 使えるマスの緑の●（CSSで円を描く。画面に見えない「利用可」の文字は同じマスの .visually-hidden に入れている） */
.top-plan__dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #00cd3f;
  vertical-align: middle;
}

/* 使えないマスの「－」 */
.top-plan__none {
  color: #bbb;
}


/* -------------------------------------------------------------
   エンタープライズ（押すと開く）
   ------------------------------------------------------------- */
.top-plan__ent {
  margin-top: 24px;
}

/* 濃い紺色の帯 */
.top-plan__ent-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 22px 28px;
  background: #22313a;
  color: #fff;
  cursor: pointer;
  list-style: none;
}

.top-plan__ent-summary::-webkit-details-marker {
  display: none;
}

/* 帯の左の文言 */
.top-plan .top-plan__ent-text {
  margin-top: 0;
  line-height: 1.6;
  color: #fff;
  font-size: 16px;
  font-weight: bold;
}

.top-plan .top-plan__ent-text span {
  display: block;
  font-size: 13px;
  font-weight: normal;
  opacity: 0.8;
}

/* 帯の右のボタン：別ページへ行くボタンに見えないよう、「開く」の文言と下向きの矢印を付ける。
   閉じているとき「プラン詳細を開く ∨」、開いているとき「閉じる ∧」（矢印は上向きに回る） */
.top-plan__ent-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 10px 24px;
  border: 2px solid #fff;
  border-radius: 40px;
  font-size: 14px;
  font-weight: bold;
}

/* ボタンの文言 */
.top-plan__ent-btn::before {
  content: "プラン詳細を開く";
}

.top-plan__ent[open] .top-plan__ent-btn::before {
  content: "閉じる";
}

/* ボタンの矢印（四角の右下の線2本を45度回して「∨」に見せる） */
.top-plan__ent-btn::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg);
  transition: transform 0.2s;
}

/* 開いているときは矢印を上向き「∧」にする */
.top-plan__ent[open] .top-plan__ent-btn::after {
  margin-top: 4px;
  transform: rotate(-135deg);
}

@media (any-hover: hover) {
  .top-plan__ent-summary:hover .top-plan__ent-btn {
    background: rgba(255, 255, 255, 0.15);
  }
}

/* 開いたときの中身（今のエンタープライズの説明） */
.top-plan__ent-body {
  padding: 24px 0 0 0;
  text-align: left;
}


/* -------------------------------------------------------------
   タブレット幅（900px以下）：料金カードを2列にする
   ------------------------------------------------------------- */
@media (max-width: 900px) {
  .top-plan__cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .top-plan__card {
    border-top: 1px solid #ddd;
  }

  /* 1段目の2枚は上の線を消す */
  .top-plan__card:nth-child(-n + 2) {
    border-top: 0;
  }

  /* 2列の左側（1枚目・3枚目）は左の線を消す */
  .top-plan__card:nth-child(odd) {
    border-left: 0;
  }
}


/* -------------------------------------------------------------
   スマホ幅（640px以下）：機能比較の表を「選んだ1プラン＋プロ」の2列にする
   ------------------------------------------------------------- */
@media (max-width: 640px) {
  .top-plan__compare-summary {
    padding: 14px 16px;
    font-size: 15px;
  }

  .top-plan__compare-body {
    padding: 0 12px 16px 12px;
  }

  /* 比べるプランを選ぶボタン（スマホだけ表示） */
  .top-plan__switch {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 4px;
  }

  .top-plan .top-plan__switch-label {
    width: 100%;
    margin-top: 0;
    font-size: 12px;
    color: #555;
  }

  .top-plan__switch-btn {
    flex: 1;
    padding: 8px 0;
    white-space: nowrap;
    border: 1px solid #00c853;
    border-radius: 4px;
    background: #fff;
    color: #00a046;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
  }

  /* 選んでいるプランのボタン */
  .top-plan__switch-btn.is-active {
    background: #00c853;
    color: #fff;
  }

  /* プロのボタン：おすすめなので、赤い枠・赤い文字にする */
  .top-plan__switch-btn.is-pro {
    border-color: #be0200;
    color: #be0200;
  }

  /* プロを選んでいるとき：赤い背景に白い文字 */
  .top-plan__switch-btn.is-pro.is-active {
    background: #be0200;
    color: #fff;
  }

  .top-plan__table-wrap {
    margin-top: 12px;
  }

  /* 2列だけを表示する */
  .top-plan__table {
    font-size: 12px;
  }

  /* 見出し行は、スマホの固定ヘッダー（高さ60px）のすぐ下に付いてくる */
  .top-plan__table thead th {
    top: 60px;
  }

  .top-plan__table th,
  .top-plan__table td {
    padding: 8px 4px;
  }

  .top-plan__table .top-plan__feature-head,
  .top-plan__table .top-plan__feature {
    width: 40%;
  }

  /* 選んでいないプランの列を隠す（表に is-show-{プラン名} が付いていない列） */
  .top-plan__table:not(.is-show-free) .is-free,
  .top-plan__table:not(.is-show-start) .is-start,
  .top-plan__table:not(.is-show-standard) .is-standard,
  .top-plan__table:not(.is-show-pro) .is-pro {
    display: none;
  }

  /* エンタープライズの帯 */
  .top-plan__ent-summary {
    padding: 18px 16px;
  }

  .top-plan__ent-btn {
    width: 100%;
    text-align: center;
  }
}


/* -------------------------------------------------------------
   スマホ幅（560px以下）：料金カードを縦1列にする（相談C-1）
   ------------------------------------------------------------- */
@media (max-width: 560px) {
  .top-plan__cards {
    grid-template-columns: 1fr;
  }

  .top-plan__card,
  .top-plan__card:nth-child(odd) {
    border-left: 0;
  }

  .top-plan__card:nth-child(2) {
    border-top: 1px solid #ddd;
  }

  /* 縦1列ではプロのカードの吹き出しが上のカードに重なるので、上に余白を取る */
  .top-plan__card.is-recommend {
    margin-top: 20px;
  }
}
