@charset "utf-8";

/* ==== 意味から検索ページ ==== */

/* ページ内アンカーへのスムーズスクロール */
html {
  scroll-behavior: smooth;
}

/* 説明文（格パターン検索ページの pattern-instruction を踏襲。表と幅を揃える） */
.thematic-role-instruction {
  font-size: 14px;
  line-height: 1.8;
  color: #555;
  width: 92%;
  max-width: 730px;
  margin: 30px auto 20px;
  padding: 15px;
  background-color: #f9f9f9;
  border: 1px solid #dbdbdb;
  border-left: 4px solid #2d7a2d;
}

.thematic-role-instruction u {
  text-decoration: none;
  border-bottom: 2px solid currentColor;
  padding-bottom: 1px;
}

/* 大分類へのジャンプナビ（チップ） */
.tr-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  width: 92%;
  max-width: 730px;
  margin: 0 auto;
  scroll-margin-top: 12px;   /* 「分類一覧に戻る」でジャンプした際の着地位置調整 */
}

.tr-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #2d7a2d;
  background-color: #ffffff;
  border: 1.5px solid #a6d0a6;
  border-radius: 16px;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.tr-nav-btn:hover {
  background-color: #2d7a2d;
  border-color: #2d7a2d;
  color: #ffffff;
}

.tr-nav-btn i {
  font-size: 13px;
}

.thematic-role-container {
  width: 92%;
  max-width: 730px;
  margin: 30px auto 20px;
}

/* デスクトップ（960px以上）でも、表の内部スクロールではなくページ全体をスクロールさせる。
   search.css が html/body/#wrapper/.content に設定する固定高・overflow:hidden を打ち消す。 */
@media only screen and (min-width: 960px) {
  html, body {
    height: auto;
    overflow: visible;
  }

  #wrapper {
    height: auto;
    display: block;
  }

  .content {
    display: flow-root;   /* BFCを作り、子h1のmargin-top相殺を防ぐ（格パターン検索と同じ25pxに揃える） */
    flex: none;
    overflow: visible;
    margin: 15px 0 35px;
  }
}

/* 大分類セクション */
.tr-section {
  margin-bottom: 28px;
  scroll-margin-top: 12px;   /* アンカージャンプ時に見出しが上端に張り付きすぎないよう調整 */
}

.tr-category-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.05em;
  padding: 6px 12px;
  margin: 0;
  background-color: #5c9f5c;
}

.tr-category-name {
  font-size: 15px;
}

/* 各表ヘッダーの「ページトップに戻る」リンク */
.tr-back-to-nav {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: normal;
  color: #ffffff;
  text-decoration: none;
  padding: 3px 10px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 14px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.tr-back-to-nav:hover {
  background-color: #ffffff;
  color: #2d7a2d;
}

.tr-back-to-nav i {
  font-size: 11px;
}

.tr-category-title i.left {
  color: #ffffff;
  margin-right: 0.5em;
}

/* テーブル */
.tr-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 13.5px;
}

.tr-table th,
.tr-table td {
  border: 1px solid #b0ccb0;
  padding: 8px 10px;
  vertical-align: middle;
  text-align: left;
}

.tr-table thead th {
  background-color: #cae4ca;
  color: #1f4d1f;
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.05em;
  text-align: center;
  white-space: nowrap;
}

.tr-table .col-group { width: 120px; }
.tr-table .col-role { width: 22%; }
.tr-table .col-particle { width: 15%; }
.tr-table .col-example { width: 48%; }

/* 分類（中分類）セル */
.tr-group-cell {
  background-color: #f4faf4;
  color: #2b5e2b;
  font-weight: 600;
  text-align: center;
  width: 120px;
  min-width: 120px;
}

/* 意味役割セル */
.tr-role-cell {
  background-color: #fbfefb;
}

.tr-role-tag {
  display: inline-block;
  font-weight: 700;
  color: #176117;
  letter-spacing: 0.03em;
  line-height: 1.4;
  text-decoration: none;
}

/* クリック可能な意味役割 */
.tr-role-clickable {
  cursor: pointer;
  border-bottom: 2px dotted #5c9f5c;
  transition: color 0.15s ease, background-color 0.15s ease;
  padding: 1px 2px;
  border-radius: 3px;
}
.tr-role-clickable:hover,
.tr-role-clickable:focus {
  color: #0d4a0d;
  background-color: #eaf5ea;
  outline: none;
}

/* 格助詞バッジ */
.tr-particle-cell {
  text-align: center;
  white-space: nowrap;
}

.tr-particle-badge {
  display: inline-block;
  background-color: #2d7a2d;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  margin: 2px 2px;
  border-radius: 10px;
  letter-spacing: 0.08em;
  text-decoration: none;
}
.tr-particle-clickable {
  cursor: pointer;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}
.tr-particle-clickable:hover,
.tr-particle-clickable:focus {
  background-color: #5c9f5c;
  box-shadow: 0 0 0 2px #cfe9cf;
  outline: none;
}

/* 例文セル */
.tr-example-cell {
  color: #333;
}

.tr-example {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 1px 0;
  line-height: 1.6;
}

.tr-example-particle {
  flex-shrink: 0;
  display: inline-block;
  min-width: 2.4em;
  text-align: center;
  background-color: #e7fae7;
  color: #2b5e2b;
  border: 1px solid #a6d0a6;
  font-size: 10.5px;
  font-weight: 600;
  padding: 0 4px;
  border-radius: 6px;
}

.tr-example-text {
  flex: 1;
}

/* 結果ページから戻った際の該当行ハイライト（中分類セルは他の行と共有のため対象外） */
.tr-row-highlight td:not(.tr-group-cell) {
  background-color: #ffffcc !important;
  transition: background-color 0.3s ease;
}

/* 例文中の「名詞句＋対象の格助詞」ハイライト */
.tr-example-highlight {
  font-weight: 700;
  color: #176117;
}

/* ==== レスポンシブ（959px以下） ==== */
@media only screen and (max-width: 959px) {
  /* 説明文と表の幅をメニュー（style.css で左右 margin 15%）に揃える */
  .thematic-role-instruction,
  .tr-nav,
  .thematic-role-container {
    width: 70%;
  }

  .tr-table {
    font-size: 13px;
  }

  .tr-table th,
  .tr-table td {
    padding: 6px 6px;
  }

  .tr-table .col-group,
  .tr-group-cell {
    width: 120px;
    min-width: 120px;
  }

  .tr-particle-badge {
    padding: 2px 6px;
    margin: 1px;
  }
}

@media only screen and (max-width: 640px) {
  /* 説明文と表の幅をメニュー（style.css で左右 margin 7.5%）に揃える */
  .thematic-role-instruction,
  .tr-nav,
  .thematic-role-container {
    width: 85%;
  }

  .tr-table {
    font-size: 12.5px;
  }

  .tr-example {
    gap: 4px;
  }

  .tr-example-particle {
    min-width: 2.1em;
    font-size: 10px;
  }
}