/* DPC症例数集計（/search_dpc/）固有のスタイル
   ヘッダー・フッター・パンくず・.wrap/.wfcontent・h1/h2 等のコーポレートサイト共通部分は
   ../assets/css/style.css（本体と共通ファイル）を参照。このファイルは本体CSSの後に読み込むこと。
   フォーム部品・ボタン・ページ送りは search_medical（WDBデータ検証）と同じ見た目（独立してデプロイできるよう、必要分をここに持つ）。 */

/* 本文先頭のh2は上の余白を調整 */
.wfcontent h2 { margin-top: 48px; }

/* ダミーデータ使用中の表示（開発用） */
.wfcontent .dpc-dummy {
  margin: 0 0 20px;
  padding: 10px 16px;
  border: 1px dashed #c0651e;
  color: #c0651e;
  font-size: 14px;
}

/* ---- 条件フォーム ---- */
.dpc-form {
  border: 1px solid var(--line2);
  background: var(--bg2);
  border-radius: 4px;
  padding: 28px 28px 24px;
  margin: 20px 0 8px;
}
.dpc-form .form-row { margin-bottom: 18px; }
.dpc-form .field-label {
  display: block;
  font-weight: 700;
  color: var(--sub);
  margin-bottom: 8px;
  font-size: 16px;
}
.dpc-form .checkbox-group { display: flex; gap: 10px 24px; flex-wrap: wrap; }
.dpc-form .checkbox-group label { display: flex; align-items: center; gap: 6px; font-size: 14.5px; cursor: pointer; }
.dpc-form .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 640px) {
  .dpc-form { padding: 22px 16px 18px; }
  .dpc-form .grid-2 { grid-template-columns: 1fr; }
}
.dpc-form select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line2);
  border-radius: 4px;
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  background-color: #fff;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 36px;
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 11px 7px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'><path d='M1 1l4.5 4.5L10 1' stroke='%2351605F' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}
.dpc-form select:disabled { background-color: var(--bg2); color: var(--muted); cursor: not-allowed; }
.dpc-form select:focus { outline: none; border-color: var(--teal); }
.dpc-form .actions { margin-top: 8px; display: flex; gap: 12px; }

/* ボタン・ページ送り */
.dpc-form button,
.pagebtn {
  cursor: pointer;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 700;
  border-radius: 2px;
  padding: 0 24px;
  height: 48px;
  border: 1px solid var(--line2);
  background: #fff;
  color: var(--primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, border-color .2s, transform .2s;
}
.dpc-form button.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.dpc-form button.primary:hover { background: var(--primary-d); border-color: var(--primary-d); transform: translateY(-1px); }
.wfcontent .pagebtn { text-decoration: none; height: 40px; padding: 0 18px; }
.wfcontent .pagebtn:hover { border-color: var(--teal); background: var(--bg2); }

.pagination { display: flex; justify-content: center; align-items: center; gap: 4px; margin: 24px 0 8px; flex-wrap: wrap; }
.pagebtn-arrow { margin: 0 8px; }
.wfcontent .pagebtn-num {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 32px; padding: 0 6px;
  font-size: 14px; color: var(--primary); text-decoration: none; border-radius: 2px; transition: background .2s;
}
.wfcontent .pagebtn-num:hover { background: var(--bg2); }
.pagebtn-current {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 32px; padding: 0 6px;
  font-size: 14px; font-weight: 700; color: #fff; background: var(--primary); border-radius: 2px;
}
.pagebtn-ellipsis { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; font-size: 14px; color: var(--muted); }

/* ---- 結果の見出し・メッセージ ---- */
.wfcontent .result-summary { margin: 28px 0 12px; color: var(--ink); font-weight: 700; font-size: 16px; }
@media (min-width: 901px) { .wfcontent .result-summary { font-size: 20px; } }
.state-message { text-align: center; padding: 48px 20px; color: var(--sub); }

/* ---- 集計表 ---- */
.dpc-table-wrap { overflow-x: auto; }
.wfcontent table.dpc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 12px;
  font-size: 15px;
}
.wfcontent table.dpc-table th,
.wfcontent table.dpc-table td {
  padding: 9px 11px;   /* 施設数集計（/facilities/hospital2/ など）の表と同じ余白 */
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  text-align: left;
  font-weight: 500;
  background: transparent;
  width: auto;
}
.wfcontent table.dpc-table thead th {
  background: var(--bg2);
  color: var(--sub);
  font-size: 13.5px;
  font-weight: 700;
  border-top: 1px solid var(--line2);
  border-bottom: 1px solid var(--line2);
  white-space: nowrap;
  text-align: center;   /* 見出しのラベルは中央（コード・名称・アイコンの列をまたいだ中央） */
}
.wfcontent table.dpc-table td:first-child { background: transparent; font-weight: 500; }
.wfcontent table.dpc-table .c-code { width: 84px; font-family: var(--mono); color: var(--sub); white-space: nowrap; }
.wfcontent table.dpc-table .c-num { text-align: right; white-space: nowrap; width: 96px; }
.wfcontent table.dpc-table .c-mark { text-align: center; width: 76px; color: var(--teal); }
.wfcontent table.dpc-table .c-bar { width: 22%; min-width: 120px; }
.wfcontent table.dpc-table thead th.c-num { text-align: center; }   /* 見出しは中央（本体の数値は右寄せのまま） */
.wfcontent table.dpc-table tbody tr:hover td { background: var(--bg2); }
.wfcontent table.dpc-table a { color: var(--primary); text-decoration: none; }
.wfcontent table.dpc-table a:hover { color: var(--teal); text-decoration: underline; }

/* 並べ替えボタン（見出しの文字そのものがボタン。▽＝未選択、▲▼＝選択中） */
.wfcontent table.dpc-table .sortbtn {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--sub);
}
.wfcontent table.dpc-table .sortbtn:hover { color: var(--primary); }
.wfcontent table.dpc-table .sortbtn:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.wfcontent table.dpc-table .sortbtn .mark { font-size: 11px; color: var(--muted); }
.wfcontent table.dpc-table th[aria-sort] .sortbtn { color: var(--primary); }
.wfcontent table.dpc-table th[aria-sort] .mark { color: var(--teal); }

/* 棒グラフ（最大値を100%とした長さ。装飾） */
.dpc-bar { display: block; height: 10px; background: var(--bg2); border-radius: 1px; }
.dpc-bar i { display: block; height: 100%; background: var(--teal); border-radius: 1px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 表の下の凡例・注記 */
.wfcontent .dpc-legend { font-size: 13.5px; color: var(--sub); margin: 6px 0 0; }
.wfcontent ul.dpc-notes { margin: 20px 0 0; padding-left: 1.3em; font-size: 13.5px; color: var(--sub); }
.wfcontent ul.dpc-notes li { margin: 4px 0; font-size: 13.5px; }

@media (max-width: 700px) {
  .wfcontent table.dpc-table { font-size: 14px; }
  .wfcontent table.dpc-table th,
  .wfcontent table.dpc-table td { padding: 9px 8px; }
  .wfcontent table.dpc-table .c-bar { display: none; }
}

/* ======================================================================
   2026-11-30 リンク構造の見直し：切替タブ・フィルター・アイコン・凡例（.wfcontent 配下のリンクは、サイト共通の下線指定に負けないよう .wfcontent を付ける）
   ====================================================================== */

/* ---- アイコン（PNGをmaskにして、文字色で塗る。虫眼鏡はインラインSVG） ---- */
.dpc-ico { display: inline-block; width: 22px; height: 22px; flex: none; vertical-align: middle; }
span.dpc-ico { background-color: currentColor; -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; }
.dpc-ico-pref { --ico: url("../img/ico-pref.png"); }
.dpc-ico-dz { --ico: url("../img/ico-dz.png"); }
.dpc-ico-hosp { --ico: url("../img/ico-hosp.png"); }

/* トップの見出し（アイコン＋タイトル）。各集計トップへのリンクは共通の .pagelinks > a.dbrow（style.css） */
/* 見出し帯は search_medical と共通の .bhead（style.css）。中のアイコン（マスク画像）を、検索条件の虫眼鏡（34px・primary色）と同じ大きさ・色にする */
.bhead .icbox .dpc-ico-bhead { width: 34px; height: 34px; color: var(--primary); }

/* h1の下の「術式：…」 */
.pg .dpc-procline { margin: 10px 0 0; font-size: 16px; color: var(--ink); }
@media (min-width: 901px) { .pg .dpc-procline { font-size: 20px; } }   /* PCは20px（SP＝900px以下は16pxのまま） */
.pg .dpc-procline .lb { font-weight: 700; color: var(--sub); }

/* ---- 切替タブ ---- */
.wfcontent .dpc-tabs ul { display: flex; flex-wrap: wrap; list-style: none; margin: 20px 0 0; padding: 0; border-bottom: 1px solid var(--line2); }
.wfcontent .dpc-tabs li { margin: 0; padding: 0; }
.wfcontent .dpc-tabs li::before { content: none; }
.wfcontent .dpc-tabs a,
.wfcontent .dpc-tabs span[aria-current] {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; margin-bottom: -1px;
  font-size: 15px; font-weight: 700; color: var(--primary); text-decoration: none; border-bottom: 3px solid transparent;
}
.wfcontent .dpc-tabs a:hover { color: var(--teal); }
.wfcontent .dpc-tabs li.is-current span[aria-current] { color: var(--ink); border-bottom-color: var(--teal); }
.wfcontent .dpc-tabs .dpc-ico { width: 20px; height: 20px; }
.wfcontent p.dpc-toplink { margin: 16px 0 0; }

/* ---- 医療機関区分のフィルター ---- */
.dpc-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 0; }
.dpc-filter button {
  cursor: pointer; font-family: inherit; font-size: 14.5px; font-weight: 700; padding: 0 18px; height: 42px;
  border: 1px solid var(--line2); border-radius: 2px; background: #fff; color: var(--primary); transition: background .2s, border-color .2s;
}
.dpc-filter button:hover { border-color: var(--teal); background: var(--bg2); }
.dpc-filter button[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---- 表：名称の右のアイコン（位置はページ種ごとに固定。該当しない行は空きスロット） ---- */
.wfcontent table.dpc-table .nmwrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wfcontent table.dpc-table .nmwrap .nm { min-width: 0; }
.dpc-icons { display: inline-flex; gap: 2px; flex: none; }
/* アイコンは凡例と同じ18px。タップ領域は28px四方にして、上下のマイナス余白で行の高さを増やさない（施設数集計の虫眼鏡リンクと同じ作り） */
.dpc-slot { display: inline-block; width: 28px; height: 28px; margin: -4px 0; }
.wfcontent a.dpc-iconlink, .wfcontent table.dpc-table a.dpc-iconlink {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin: -4px 0; border-radius: 2px;
  color: var(--primary); text-decoration: none;
}
.wfcontent table.dpc-table .dpc-iconlink .dpc-ico { width: 18px; height: 18px; }
.wfcontent a.dpc-iconlink:hover, .wfcontent table.dpc-table a.dpc-iconlink:hover { color: var(--teal); background: var(--bg2); text-decoration: none; }
.wfcontent a.dpc-iconlink:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }
.wfcontent table.dpc-table .c-code { width: 70px; }
.wfcontent table.dpc-table .c-mark { text-align: center; width: 44px; color: var(--teal); font-weight: 700; }

/* アイコンの凡例（表の上） */
.dpc-iconlegend { display: flex; flex-wrap: wrap; gap: 6px 20px; list-style: none; margin: 20px 0 0; padding: 0; font-size: 13.5px; color: var(--sub); }
.dpc-iconlegend li { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 0; }
.dpc-iconlegend li::before { content: none; }
.dpc-iconlegend .dpc-ico { width: 18px; height: 18px; color: var(--primary); }

/* 差し替え中 */
.dpc-result.is-loading { opacity: .5; pointer-events: none; }

@media (max-width: 700px) {
  /* アイコンは名称の下（2段目）に回す。タップ領域は44px以上 */
  .wfcontent table.dpc-table .nmwrap { flex-wrap: wrap; justify-content: flex-start; gap: 2px 8px; }
  .wfcontent table.dpc-table .nmwrap .nm { flex: 1 1 100%; }
  .wfcontent a.dpc-iconlink, .wfcontent table.dpc-table a.dpc-iconlink, .dpc-slot { width: 32px; height: 32px; margin: -2px 0; }
  .wfcontent .dpc-tabs a, .wfcontent .dpc-tabs span[aria-current] { padding: 10px 10px; font-size: 13.5px; }
}

/* ---- 表の追加調整（2026-12-01）---- */
/* 左端のコード（順位）は右寄せ */
.wfcontent table.dpc-table td.c-code { text-align: right; }
/* 見出しのラベルがまたぐ列（コード｜（○｜）名称・アイコン／症例数｜棒グラフ）の間は、縦罫線を引かない */
.wfcontent table.dpc-table td.c-code,
.wfcontent table.dpc-table td.c-mark,
.wfcontent table.dpc-table td.c-name,
.wfcontent table.dpc-table td.c-bar { border-left: 0; }
.wfcontent table.dpc-table td.c-code,
.wfcontent table.dpc-table td.c-mark { border-right: 0; }
.wfcontent table.dpc-table td.c-num:nth-last-child(2) { border-right: 0; }   /* 症例数の数値（棒グラフの左隣） */
/* 左端の列・名称列は、表の外枠・構成比との境目の線を残す */
.wfcontent table.dpc-table td.c-code:first-child { border-left: 1px solid var(--line); }
.wfcontent table.dpc-table td.c-name { border-right: 1px solid var(--line); }
@media (max-width: 700px) {
  /* 棒グラフを隠すスマホでは、症例数の列の右側の外枠線を残す */
  .wfcontent table.dpc-table td.c-num:nth-last-child(2) { border-right: 1px solid var(--line); }
}

/* h1末尾の「（○○のDPC症例数集計）」は小さく出す（/search_medical/list/ の「の検索結果」と同じ方式。PC＝20px／SP＝11px） */
.pgh1 .h1-suffix { font-size: 11px; font-weight: 500; color: var(--sub); }
@media (min-width: 901px) { .pgh1 .h1-suffix { font-size: 20px; } }
