/* Asia/Tokyo, 2025-10-09 14:14(UTC+09:00) css/chuijikou.css
   - 「注意事項（#caution）」ページ専用スタイル
   - !important 縮退：ページ限定セレクタで上書き力を確保（機能は不変）
*/

/* ========== 0) Page-scope overrides（!important 縮退） ========== */
/* 本ページだけアンカースクロールを即時化（smooth を無効化） */
html.page-chuijikou {
  scroll-behavior: auto;
}
/* 互換策：#caution を持つページに限定（:has 対応ブラウザ） */
:root:has(#caution) {
  scroll-behavior: auto;
}

/* 共通のスクロールUI（擬似スクロールバー等）を #caution 配下では無効化 */
#caution .table-scroll-wrapper,
#caution .table-scroll-main,
#caution .table-scroll-bottom {
  display: contents;
}

/* ========== 1) Tokens / 基本レイアウト ========== */
#caution {
  --cj-brand: var(--brand, #117713);
  --cj-brand-ink: var(--brand-strong, #0c5d0f);
  --cj-danger: var(--danger, #c50f0f);
  --cj-border: var(--border, #e0e0e0);
  --cj-card-bg: #fff;
  --cj-sec-bg: var(--clr-bg-section, #fff);
  --cj-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --cj-fs-base: clamp(1.6rem, 1.5rem + 0.3vw, 1.8rem);
  --cj-fs-title: clamp(2rem, 1.6rem + 1.2vw, 2.6rem);
  --cj-radius: 0.6rem;
  --cj-gap-y: 1rem;
}
#caution.notice {
  background: var(--cj-sec-bg);
  padding: 2rem 0;
  margin-block-start: 0;
}
#caution .container {
  margin-inline: auto;
  margin-block-end: 1rem;
}

/* ========== 2) 見出し ========== */
#caution .notice-heading {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0 0 2rem;
}
#caution .notice-heading img {
  display: none;
}
#caution .notice-heading h2 {
  font: 700 var(--cj-fs-title) / 1.25 "Noto Sans JP", "Roboto", "Meiryo",
    sans-serif;
  margin: 0;
  padding-left: 1rem;
  border-left: 8px solid var(--cj-brand);
  color: #000;
  white-space: normal;
}

/* ========== 3) 注意事項テーブル（縦2列） ========== */
.notice-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--cj-card-bg);
  border: 1px solid #cfe1d9;
  border-radius: var(--cj-radius);
  font-size: var(--cj-fs-base);
  line-height: 1.6;
  box-shadow: var(--cj-shadow);
  overflow: clip;
}
.notice-table col.col-key {
  width: clamp(180px, 22vw, 240px);
}
.notice-table col.col-body {
  width: auto;
}

.notice-table thead th {
  background: var(--cj-brand);
  color: #fff;
  font-weight: 700;
  text-align: left;
  padding: 1rem 1rem;
  border-bottom: 1px solid var(--cj-border);
  white-space: normal;
}
.notice-table thead th:first-child {
  border-top-left-radius: var(--cj-radius);
}
.notice-table thead th:last-child {
  border-top-right-radius: var(--cj-radius);
}

.notice-table th,
.notice-table td {
  border-bottom: 1px solid #cfe1d9;
  border-right: 1px solid #cfe1d9;
  padding: 1rem;
  vertical-align: top;
  white-space: normal;
  word-break: break-word;
}
.notice-table th[scope="row"] {
  background: #eef7ee;
  font-weight: 700;
}
.notice-table tbody td {
  background: #fff;
}

.notice-table .cell-body p {
  margin: 0 0 var(--cj-gap-y);
  white-space: normal;
}
.notice-table .cell-body p:last-child {
  margin-bottom: 0;
}

.notice-table tbody tr:last-child th[scope="row"] {
  border-bottom-left-radius: var(--cj-radius);
}
.notice-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: var(--cj-radius);
}

/* ========== 3.1) レスポンシブ（注意事項テーブル） ========== */
@media (max-width: 900px) and (min-width: 601px) {
  .notice-table col.col-key {
    width: clamp(150px, 30vw, 220px);
  }
}
@media (max-width: 600px) {
  .notice-table {
    display: block;
    border: 0;
    box-shadow: none;
    background: transparent;
    overflow: visible;
  }
  .notice-table > thead {
    display: none;
  }
  .notice-table > tbody {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
  }
  .notice-table > tbody > tr {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    background: #fff;
    border: 1px solid #cfead3;
    border-left: 6px solid var(--cj-brand);
    border-radius: var(--cj-radius);
    box-shadow: var(--cj-shadow);
    padding: 0.8rem 1rem 1rem;
  }
  .notice-table > tbody > tr > th[scope="row"] {
    display: block;
    margin: 0 0 0.6rem;
    padding: 0.6rem 0.9rem;
    border: 0;
    border-radius: 0.45rem;
    background: linear-gradient(95deg, var(--cj-brand-ink), var(--cj-brand));
    color: #fff;
    font-weight: 700;
  }
  .notice-table > tbody > tr > td {
    display: block;
    padding: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }
  #caution .notice-table > tbody > tr:nth-of-type(7) > th[scope="row"] br {
    display: none;
  }
}

/* ========== 4) 付随要素 ========== */
#caution .note {
  font-size: var(--fs-small, 1.4rem);
  color: #383838;
  line-height: 1.4;
  white-space: normal;
  margin: 0.6rem 0 0;
  padding: 0.6rem 0.8rem;
  background: #fffaf0;
  border-left: 5px solid #f3c742;
}

/* フォーカスリング（アクセシビリティ） */
#caution a:focus-visible,
#caution th:focus-visible,
#caution td:focus-visible {
  outline: var(--focus-ring, 3px solid rgba(0, 117, 201, 0.6));
  outline-offset: 2px;
  border-radius: 0.2rem;
}

/* ========== 6) 印刷最適化 ========== */
@media print {
  .notice-table th,
  .notice-table td {
    border-color: #666;
  }
}

/* ========== 7) 細かな整形 ========== */
#caution .notice-table thead th {
  text-align: center;
  vertical-align: middle;
}
