/* contractor-comparison.css */

/* ===== Base ===== */
:root{
  --bg: #0b0f17;
  --panel: #111827;
  --panel2:#0f172a;
  --text: #e5e7eb;
  --muted:#9ca3af;
  --line: rgba(255,255,255,.10);
  --line2: rgba(255,255,255,.16);
  --accent:#60a5fa;
  --accent2:#34d399;
  --danger:#fb7185;
  --shadow: 0 16px 48px rgba(0,0,0,.35);
  --radius: 18px;
}

*{ box-sizing:border-box; }
html, body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 500px at 10% 10%, rgba(96,165,250,.18), transparent 60%),
    radial-gradient(800px 520px at 90% 20%, rgba(52,211,153,.14), transparent 55%),
    radial-gradient(700px 520px at 50% 90%, rgba(251,113,133,.10), transparent 60%),
    var(--bg);
  line-height:1.6;
}

a{ color:inherit; text-decoration:none; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible{
  outline: 2px solid rgba(96,165,250,.8);
  outline-offset: 3px;
}

/* ===== Layout ===== */
.cc-wrap{
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 18px 56px;
}

/* ===== Hero ===== */
.cc-hero{
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(17,24,39,.82), rgba(15,23,42,.72));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
}

.cc-hero__inner{
  padding: 26px 22px;
}

.cc-badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  margin:0 0 10px;
  padding: 6px 10px;
  border: 1px solid var(--line2);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
}

.cc-title{
  margin: 0 0 10px;
  font-size: clamp(22px, 3.2vw, 34px);
  letter-spacing:.01em;
}
.cc-title span{
  color: rgba(96,165,250,.95);
}

.cc-lead{
  margin: 0 0 14px;
  color: rgba(229,231,235,.90);
  max-width: 80ch;
}

.cc-note{
  border: 1px dashed rgba(255,255,255,.18);
  background: rgba(0,0,0,.18);
  border-radius: 14px;
  padding: 12px 12px;
  color: rgba(229,231,235,.86);
  font-size: 13px;
}

/* ===== Panel / Filters ===== */
.cc-panel{
  margin-top: 16px;
  border: 1px solid var(--line);
  background: rgba(17,24,39,.55);
  border-radius: var(--radius);
}

.cc-panel__inner{ padding: 14px 14px; }

.cc-filters{
  display:grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr 2fr auto;
  align-items:end;
}

.cc-filter{ min-width: 0; }
.cc-filter--wide{ min-width: 0; }
.cc-filter--actions{ display:flex; justify-content:flex-end; }

.cc-label{
  display:block;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 6px;
}

.cc-select, .cc-input{
  width:100%;
  border-radius: 12px;
  border: 1px solid var(--line2);
  background: rgba(0,0,0,.20);
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
}

.cc-input::placeholder{ color: rgba(156,163,175,.7); }

/* ===== Buttons ===== */
.cc-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid transparent;
  cursor:pointer;
  user-select:none;
  white-space:nowrap;
}

.cc-btn--primary{
  background: linear-gradient(90deg, rgba(96,165,250,.95), rgba(52,211,153,.85));
  color: #071019;
  font-weight: 700;
}
.cc-btn--primary:hover{ filter: brightness(1.03); }

.cc-btn--ghost{
  background: rgba(0,0,0,.18);
  border-color: var(--line2);
  color: var(--text);
}
.cc-btn--ghost:hover{ background: rgba(255,255,255,.06); }

.cc-btn--link{
  background: transparent;
  border-color: transparent;
  color: rgba(96,165,250,.95);
  padding-left: 0;
  padding-right: 0;
}
.cc-btn--link:hover{ text-decoration: underline; }

/* ===== Cards ===== */
.cc-grid{
  margin-top: 16px;
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.cc-card{
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(17,24,39,.70), rgba(15,23,42,.55));
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0,0,0,.25);
  padding: 16px 16px 14px;
  display:flex;
  flex-direction:column;
  min-height: 340px;
}

.cc-card__head{ margin-bottom: 10px; }
.cc-card__title{
  margin: 0;
  font-size: 16px;
  letter-spacing:.01em;
}
.cc-card__sub{
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.cc-points{
  list-style:none;
  padding:0;
  margin: 12px 0 10px;
  display:flex;
  flex-direction:column;
  gap: 8px;
}
.cc-dot{
  width: 8px; height: 8px;
  border-radius: 999px;
  background: rgba(96,165,250,.9);
  display:inline-block;
  margin-right: 8px;
  transform: translateY(-1px);
}
.cc-points li{
  display:flex;
  align-items:flex-start;
  color: rgba(229,231,235,.92);
  font-size: 13px;
}

.cc-meta{
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  display:flex;
  flex-direction:column;
  gap: 8px;
}
.cc-meta__row{
  display:flex;
  gap: 10px;
}
.cc-meta__k{
  width: 92px;
  flex: 0 0 92px;
  color: var(--muted);
  font-size: 12px;
}
.cc-meta__v{
  color: rgba(229,231,235,.92);
  font-size: 12px;
}

.cc-cta{
  margin-top: 12px;
  display:flex;
  gap: 10px;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
}

/* ===== Table ===== */
.cc-tableSection{
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(17,24,39,.55);
  overflow:hidden;
}

.cc-tableHead{
  padding: 16px 16px 10px;
  border-bottom: 1px solid var(--line);
}

.cc-h2{
  margin:0 0 6px;
  font-size: 18px;
}
.cc-muted{
  margin:0;
  color: var(--muted);
  font-size: 13px;
}

.cc-tableWrap{
  overflow:auto;
  -webkit-overflow-scrolling: touch;
}

.cc-table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  min-width: 980px;
}

.cc-table thead th{
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(15,23,42,.92);
  border-bottom: 1px solid var(--line);
  text-align:left;
  padding: 12px 12px;
  font-size: 12px;
  color: rgba(229,231,235,.92);
}

.cc-table tbody td{
  border-bottom: 1px solid var(--line);
  padding: 12px 12px;
  vertical-align: top;
  font-size: 13px;
  color: rgba(229,231,235,.92);
}

.cc-table tbody tr:hover{
  background: rgba(255,255,255,.04);
}

.cc-small{
  display:inline-block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.cc-linkBtn{
  display:inline-flex;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--line2);
  background: rgba(0,0,0,.20);
  color: rgba(96,165,250,.95);
}
.cc-linkBtn:hover{
  background: rgba(255,255,255,.05);
  text-decoration: none;
}

/* ===== FAQ ===== */
.cc-faq{
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(17,24,39,.55);
  padding: 16px 16px;
}

.cc-qa{
  border-top: 1px solid var(--line);
  padding: 10px 0;
}
.cc-qa:first-of-type{ border-top:none; padding-top: 6px; }

.cc-qa summary{
  cursor:pointer;
  list-style:none;
  font-weight: 600;
  color: rgba(229,231,235,.92);
}
.cc-qa summary::-webkit-details-marker{ display:none; }

.cc-qa__a{
  margin-top: 10px;
  color: rgba(229,231,235,.86);
  font-size: 13px;
}

/* ===== Footer ===== */
.cc-footer{
  margin-top: 18px;
  text-align:center;
  color: rgba(156,163,175,.85);
}

/* ===== Responsive ===== */
@media (max-width: 980px){
  .cc-filters{
    grid-template-columns: 1fr 1fr;
  }
  .cc-filter--wide{
    grid-column: 1 / -1;
  }
  .cc-filter--actions{
    grid-column: 1 / -1;
    justify-content:flex-start;
  }

  .cc-grid{
    grid-template-columns: 1fr;
  }
  .cc-card{ min-height: auto; }
}

/* ===== Table alignment hard-fix (WPテーマ干渉/thead-tbodyズレ対策) ===== */
.cc-tableWrap { overflow-x: auto; }

/* テーマ側の table レイアウトを潰す（このページ範囲だけ） */
.cc-wrap table,
.cc-wrap thead,
.cc-wrap tbody,
.cc-wrap tfoot,
.cc-wrap tr,
.cc-wrap th,
.cc-wrap td{
  box-sizing: border-box;
}

/* 列ズレの根本対策：固定レイアウト + 幅100% */
.cc-table{
  width: 100% !important;
  table-layout: fixed !important; /* これが最重要 */
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

/* sticky の見た目が崩れないように背景と境界を固定 */
.cc-table thead th{
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(15,23,42,.96) !important;
}

/* 1セル内の長文で列幅が崩れないよう制御 */
.cc-table th, .cc-table td{
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;   /* 日本語長文対策 */
  white-space: normal;      /* 折り返し許可 */
}

/* WPテーマで th/td に display:block などが当たってるとズレるので明示 */
.cc-table th, .cc-table td{ display: table-cell !important; }

/* テーマ側で padding/line-height が極端だとズレるので固定 */
.cc-table thead th,
.cc-table tbody td{
  padding: 12px 12px !important;
  line-height: 1.5 !important;
}


/* =========================
   WP(テーマ)の横幅制限を回避
========================= */

/* Gutenberg の constrained が子要素に max-width を当てるのを上書き */
.wp-block-post-content.is-layout-constrained > .cc-wrap.alignwide{
  max-width: none !important;
  width: 100% !important;
}

/* 自前のページ幅（左右余白も確保） */
.cc-wrap{
  max-width: 1200px !important;
  width: min(1200px, calc(100% - 48px)) !important; /* 余白を確保 */
  margin: 0 auto !important;
  padding: 36px 0 64px !important; /* 縦の余白増 */
}

/* セクション間の余白（詰まり感の解消） */
.cc-hero{ margin-bottom: 18px !important; }
.cc-panel{ margin: 18px 0 18px !important; }
.cc-tableSection{ margin-top: 22px !important; }
.cc-faq{ margin-top: 22px !important; }

/* =========================
   カード：3列→2列、崩れ防止
========================= */

.cc-grid{
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important; /* 2列 */
  gap: 18px !important; /* 余白増 */
}

/* カード内の余白も増やす */
.cc-card{
  padding: 18px 18px 16px !important;
  min-height: 0 !important; /* 縦詰まり回避 */
}

/* ボタンが潰れないように */
.cc-cta{
  gap: 12px !important;
  justify-content: flex-start !important;
}

/* =========================
   スマホは1列（既存より余白重視）
========================= */
@media (max-width: 820px){
  .cc-wrap{
    width: calc(100% - 28px) !important;
    padding: 24px 0 48px !important;
  }
  .cc-grid{
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
}

/* =========================
   ページ最上部ヒーローの過剰余白を除去
========================= */

/* ページタイトル（業者比較）の無駄な高さを殺す */
.wp-block-post-title{
  min-height: auto !important;
  padding-top: 40px !important;
  padding-bottom: 24px !important;
  margin-bottom: 0 !important;
}

/* ヒーロー的な full-height 指定があれば無効化 */
.wp-site-blocks > .wp-block-group:first-child{
  min-height: auto !important;
}

/* 比較ページは“情報ページ”なので中央寄せも解除 */
.wp-block-post-title{
  text-align: left !important;
}

/* =========================
   カラム崩れの最終対策
========================= */

/* Gutenberg の横幅制限を完全解除（比較ページのみ） */
.wp-block-post-content.is-layout-constrained > .cc-wrap{
  max-width: none !important;
  width: 100% !important;
}

/* 実際のコンテンツ幅をここで定義 */
.cc-wrap{
  max-width: 1200px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* 2カラムを強制・安定化 */
.cc-grid{
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  align-items: stretch !important;
}

/* カードが勝手に横に寄らないように */
.cc-card{
  margin: 0 !important;
  width: 100% !important;
}