@charset "UTF-8";

/* -----------------------------------------
   比較表用CSS (インラインスタイルからの移行)
   ----------------------------------------- */

/* テーブル基本 */
.compare-table {
  border-collapse: collapse;
  width: 100%;
  border: 1px solid #ccc;
}
.compare-table th,
.compare-table td {
  border: 1px solid #ccc !important; /* テーマCSSの上書きが必要な場合あり */
  text-align: center;
  padding: 12px 8px;
  vertical-align: middle;
}

/* ヘッダー共通 */
.compare-th-label {
  background-color: #f0f0f0;
  color: #333;
}
.compare-th-service {
  font-weight: bold;
  font-size: 1.1em;
}

/* サービス別ヘッダー色 */
.th-techgo { background-color: #efffe6; color: #006400; }
.th-midworks { background-color: #fff8e6; color: #b8860b; }
.th-se-nav { background-color: #e6f7ff; color: #005a8f; }
.th-winschool { background-color: #e6f7ff; color: #00008b; }
.th-aidemy { background-color: #f0fff0; color: #006400; }

/* 行ラベル */
.compare-td-label {
  font-weight: bold;
}

/* セル背景色 */
.bg-tech-light { background-color: #f7fff2; } /* 薄い緑 (TechGo, Aidemy) */
.bg-mid-light { background-color: #fffceb; }  /* 薄い黄色 (Midworks) */
.bg-blue-light { background-color: #f9fdff; } /* 薄い青 (社内SE, Winスクール) */
.bg-pink-light { background-color: #fff0f5; } /* おすすめ度 (ピンク) */

/* 評価・アイコン装飾 */
.rating-s { color: #e03e2d; font-weight: bold; font-size: 1.3em; }
.rating-a { color: #e03e2d; font-size: 1.2em; }
.rating-b { color: #ffcc00; font-size: 1.2em; }
.rating-c { color: #333; font-size: 1.2em; }

/* 補足テキスト */
.sub-text {
  font-size: 0.8em;
  color: #666;
  display: block;
  margin-top: 4px;
}

/* -----------------------------------------
   比較表のモバイル表示とCTAボタン（#1615）
   - 列幅を em で決め、狭い画面では表全体を横スクロールさせて列を潰さない
     （has-fixed-layout の table-layout: fixed は、1行目のセル幅の合計が 100% を超えると表を広げる）
   - 第1列（比較項目）を固定し、右の3〜4社目を見ているときも比較軸が分かるようにする
   - 公式サイト列の広告リンクは、SWELL のボタンブロック CSS（.swell-block-button 前提・
     ブロックがあるページだけ出力）に頼らず、ここで直接ボタンにする
   ----------------------------------------- */
.scrollable-table {
  -webkit-overflow-scrolling: touch;
}
/* SWELL の .post_content table { max-width: 100% } を外さないと列幅の合計で表が広がらない */
.post_content .compare-table {
  table-layout: fixed;
  max-width: none;
}
.compare-table th,
.compare-table td {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.5;
}
.compare-table thead th {
  width: 9.5em;
}
.compare-table thead th:first-child {
  width: 6em;
}
/* 見出し行の背景は SWELL の thead 配色（不透明）をそのまま使い、本文行だけ不透明の背景を敷く */
.compare-table tr > :first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.08);
}
.compare-table tbody tr > :first-child {
  background-color: #f7f7f7;
}
@media (max-width: 599px) {
  .compare-table th,
  .compare-table td {
    padding: 10px 6px;
    font-size: 0.9em;
  }
  /* 3列以上の表だけ、右に続きがあることを示す */
  .scrollable-table:has(thead th:nth-child(3))::before {
    content: "横にスクロールして比べられます →";
    display: block;
    position: sticky;
    left: 0;
    margin-bottom: 4px;
    font-size: 0.75em;
    color: #666;
    text-align: right;
  }
}

.compare-table a[rel~="sponsored"] {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  padding: 0.45em 1.4em 0.45em 0.5em;
  position: relative;
  background: #c2410c;
  border-radius: 6px;
  box-shadow: 0 3px 0 #7c2d12;
  color: #fff !important;
  font-weight: 700;
  font-size: 0.85em;
  line-height: 1.4;
  text-align: center;
  text-decoration: none !important;
  white-space: normal;
  overflow-wrap: anywhere;
  text-wrap: balance;
  transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}
.compare-table a[rel~="sponsored"]::after {
  content: "";
  position: absolute;
  right: 0.6em;
  top: 50%;
  width: 0.45em;
  height: 0.45em;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: translateY(-50%) rotate(45deg);
}
.compare-table a[rel~="sponsored"]:hover,
.compare-table a[rel~="sponsored"]:focus-visible {
  background: #9a3412;
  color: #fff !important;
  opacity: 1;
}
.compare-table a[rel~="sponsored"]:focus-visible {
  outline: 3px solid #1c7ed6;
  outline-offset: 2px;
}
.compare-table a[rel~="sponsored"]:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #7c2d12;
}

/* -----------------------------------------
   テーブル横スクロール用CSS
   ----------------------------------------- */
.scrollable-table {
  overflow-x: auto;
  white-space: nowrap;
}
