/* ============================================================
   legacy-content.css
   旧 twdesk.com（WordPress テーマ wp_twdesk）から移行した本文 HTML が
   使っているクラスのうち、新デザイン（ymd3）の CSS に定義が無いものを
   旧テーマの style.css から必要な分だけ移植した層。

   なぜ必要か:
     Contentful の本文（コラム・ヘルプ・機能ページ）には
     `.btn.btn-m`（資料請求ボタン）、`.row > .col.col-pc-*`（画像 + 説明の
     2 カラム）、`.box.bgclr-green > .box-tit`（目次などの囲み）といった
     旧テーマのクラスがそのまま残っている。新サイトは ymd3 の CSS しか
     読まないため、ボタンが素のリンクに、2 カラムが縦積みになっていた。

   方針:
     - すべて `.post-body` 配下に限定し、新デザインのテンプレート側には
       一切影響させない。
     - 旧テーマにあってもテンプレート側にしか使われないもの
       （#contact-block, #footer, .btn-square, .btn-l, .btn-more, .btn-arrow）は
       持ち込まない（.btn-arrow は ymd3 に同名クラスがあり衝突する）。
     - ベンダープレフィックスと IE 向け filter は落とした。
     - 本文 HTML（Contentful）側は書き換えない。
   出どころ: https://twdesk.com/wp-content/themes/wp_twdesk/assets/css/style.css
   ============================================================ */

/* --- ボタン（.btn / .btn-m / .btn-s） ------------------------------ */
.post-body .btn {
  position: relative;
  display: inline-block;
  vertical-align: middle;
  text-align: center;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, #e82855 0%, #e82855 50%, #fa3966 50%, #fa3966 100%);
  border-radius: 5px;
  box-shadow: 0 1px 6px 0 rgba(0, 0, 0, 0.3);
}
.post-body .btn:hover {
  color: #fff;
  opacity: 0.6;
}
.post-body .btn.blue {
  background: linear-gradient(135deg, #0667b9 0%, #0667b9 50%, #024985 50%, #024985 100%);
}
.post-body .btn.btn-m {
  min-width: 90%;
  max-width: 600px;
  height: 52px;
  line-height: 1.5;
  font-size: 24px;
  padding-top: 8px;
  background: linear-gradient(170deg, #26acf5 0%, #26acf5 50%, #0a99e8 50%, #0a99e8 100%);
}
.post-body .btn.btn-m.blue {
  background: linear-gradient(170deg, #0667b9 0%, #0667b9 50%, #024985 50%, #024985 100%);
}
.post-body .btn.btn-s {
  min-width: 100%;
  max-width: 260px;
  height: 46px;
  line-height: 46px;
  font-size: 24px;
}
.post-body .btn.btn-m::after,
.post-body .btn.btn-s::after {
  content: "";
  background-image: url("../img/legacy/icon-arrow-w.png");
  background-size: 10px 11px;
  position: absolute;
  width: 10px;
  height: 11px;
  bottom: 5px;
  right: 5px;
}
@media screen and (min-width: 640px) {
  .post-body .btn.btn-m {
    font-size: 24px;
    padding: 8px 2em;
    min-width: 480px;
  }
}
@media screen and (min-width: 769px) {
  .post-body .btn.btn-s {
    font-size: 24px;
    padding: 0 2em;
    min-width: 40%;
  }
}
.post-body .btn-center {
  padding: 30px 0 15px;
  text-align: center;
}
@media screen and (min-width: 769px) {
  .post-body .btn-center {
    padding: 50px 0 25px;
  }
}

/* --- グリッド（.row / .col / .col-{sp,tb,pc}-N） ------------------ */
.post-body .row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -15px;
  margin-left: -15px;
}
.post-body .row .col {
  padding-right: 15px;
  padding-left: 15px;
}
.post-body .col-sp-6 { flex: 0 0 50%; max-width: 50%; }
.post-body .col-sp-12 { flex: 0 0 100%; max-width: 100%; }
@media screen and (min-width: 769px) {
  .post-body .col + .col { margin-top: 0; }
  .post-body .col-tb-6 { flex: 0 0 50%; max-width: 50%; }
  .post-body .col-tb-8 { flex: 0 0 66.6666666667%; max-width: 66.6666666667%; }
}
@media screen and (min-width: 960px) {
  .post-body .col + .col { margin-top: 0; }
  .post-body .col-pc-3 { flex: 0 0 25%; max-width: 25%; }
  .post-body .col-pc-4 { flex: 0 0 33.3333333333%; max-width: 33.3333333333%; }
  .post-body .col-pc-5 { flex: 0 0 41.6666666667%; max-width: 41.6666666667%; }
  .post-body .col-pc-6 { flex: 0 0 50%; max-width: 50%; }
  .post-body .col-pc-7 { flex: 0 0 58.3333333333%; max-width: 58.3333333333%; }
  .post-body .col-pc-8 { flex: 0 0 66.6666666667%; max-width: 66.6666666667%; }
  .post-body .col-pc-9 { flex: 0 0 75%; max-width: 75%; }
}

/* --- 囲み（.box.border / .border2 / .bgclr-green + .box-tit） ------ */
.post-body .box {
  margin-top: 1.5em;
}
.post-body .box.border {
  border: 3px solid #eeeeee;
  box-shadow: none;
  padding: 1.5em 1em;
}
.post-body .box.border2 {
  border: 3px solid #c7eafa;
  box-shadow: none;
  padding: 1.5em 1em;
  border-radius: 0;
}
.post-body .box.bgclr-green {
  border: none;
  box-shadow: none;
  padding: 1.5em 1em;
  background-color: #f0f6e0;
}
@media screen and (min-width: 769px) {
  .post-body .box.border,
  .post-body .box.border2,
  .post-body .box.bgclr-green {
    padding: 2em 1.5em;
  }
}
.post-body .box .box-tit {
  font-size: 1.125rem;
  color: #414141;
  text-align: left;
  margin: 2em 0 0;
  padding: 0;
}
.post-body .box .box-tit::before {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  border: none;
}
.post-body .box .box-tit + p {
  margin-top: 1em;
}
.post-body .box p:first-child,
.post-body .box ul:first-child,
.post-body .box ol:first-child,
.post-body .box dl:first-child,
.post-body .box table:first-child,
.post-body .box h2:first-child,
.post-body .box h3:first-child,
.post-body .box h4:first-child,
.post-body .box h5:first-child,
.post-body .box .box-tit:first-child {
  margin-top: 0;
}
@media screen and (min-width: 769px) {
  .post-body .box .box-tit {
    font-size: 20px;
  }
}

/* --- 見出し・キャプション・表 ------------------------------------- */
.post-body .section-tit {
  font-size: 2rem;
  line-height: 1.4;
  border-bottom: 3px dotted #5c5c5c;
  text-align: left;
  padding: 0 4% 5px;
}
@media screen and (min-width: 769px) {
  .post-body .section-tit {
    padding: 0 5px 5px;
  }
}
.post-body .wp-caption-text,
.post-body .caption-text {
  font-size: 14px !important;
  color: #666666 !important;
  margin: 5px 0 0 0 !important;
}
.post-body th.th-clr1, .post-body td.th-clr1 { background-color: #024985; }
.post-body th.th-clr2, .post-body td.th-clr2 { background-color: #707070; }
.post-body th.th-clr3, .post-body td.th-clr3 { background-color: #0667b9; }

/* --- 余白ユーティリティ ------------------------------------------- */
.post-body .mt-0 { margin-top: 0 !important; }
.post-body .mt30 { margin-top: 30px !important; }
.post-body .mt35 { margin-top: 35px !important; }
.post-body .mt50 { margin-top: 50px !important; }
.post-body .mb30 { margin-bottom: 30px !important; }

/* --- 前後リンク（a.prev / a.next） ---------------------------------- */
.post-body a.prev,
.post-body a.next {
  border-color: #2980c4;
  color: #fff !important;
  background: #2980c4 !important;
}
.post-body a.prev:hover,
.post-body a.next:hover {
  border-color: #3399ff;
  color: #fff !important;
  background: #3399ff !important;
}

/* --- 画像の回り込み（WordPress の alignright / alignleft / aligncenter） --------
   issue #51: 旧テーマ detail.css の「フロート」を移植。機能ページ 19 本・ヘルプ 5 本などが
   「文章の右（左）に小さな画像」を div.alignright で組んでいる。これが無いと画像が全幅で縦に積まれる。
   旧サイトと同じく PC は回り込み、SP（768px 以下）は回り込まず中央に置く。 */
.post-body div.alignright,
.post-body img.alignright {
  float: right;
  width: auto;
  max-width: min(640px, 45%);
  margin: 0.5em 0 1.5em 30px;
}
.post-body div.alignleft,
.post-body img.alignleft {
  float: left;
  width: auto;
  max-width: min(640px, 45%);
  margin: 0.5em 30px 1.5em 0;
}
.post-body div.aligncenter,
.post-body img.aligncenter {
  display: block;
  width: 100%;
  max-width: 640px;
  margin: 1.5em auto 2em;
}
.post-body .mt-0 {
  margin-top: 0 !important;
}
/* 回り込みは項目・段落の中で閉じる（次の項目に食い込まない） */
.post-body li {
  clear: both;
}
.post-body li::after,
.post-body .post-body::after {
  content: "";
  display: block;
  clear: both;
}
@media screen and (max-width: 768px) {
  .post-body div.alignright,
  .post-body img.alignright,
  .post-body div.alignleft,
  .post-body img.alignleft {
    float: none;
    max-width: 100%;
    margin: 1em auto;
    text-align: center;
  }
  .post-body div.alignright img,
  .post-body div.alignleft img {
    margin-inline: auto;
  }
}

/* 手順の番号付きリスト（旧テーマの ol.cl）。issue #51: 新デザインの CSS は class 付きの ol の番号を出さないため、
   旧サイトと同じく青い「1.」「2.」を付ける。回り込み画像（alignright）と並ぶ手順で使われている */
.post-body ol.cl {
  counter-reset: cl-num;
  list-style: none;
  padding-left: 1.75em;
}
.post-body ol.cl > li {
  position: relative;
  counter-increment: cl-num;
}
.post-body ol.cl > li + li {
  margin-top: 20px;
}
.post-body ol.cl > li::before {
  content: counter(cl-num) ".";
  position: absolute;
  left: -1.75em;
  top: 0;
  width: 1.5em;
  color: #0a99e8;
  font-size: 1.125em;
  font-weight: 500;
  text-align: right;
}
