/* ═══════════════════════════════════════════════════════
   不動産用語辞典 — dictionary.css
   guide.css のコンポーネントを再利用 + 辞典固有スタイル
═══════════════════════════════════════════════════════ */

/* ── サイドバーレイアウト ────────────────── */
.dict-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 16px 60px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  align-items: start;
}
.dict-sidebar {
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
}
.dict-sidebar-inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.dict-main {
  min-width: 0;
}

/* ── サイドバー フィルタ ────────────────── */
.dict-filter-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.dict-filter-title {
  font-size: .82rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.dict-filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  cursor: pointer;
  font-size: .84rem;
  color: var(--text);
  transition: color .15s;
}
.dict-filter-item:hover {
  color: var(--accent);
}
.dict-filter-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}
.dict-filter-label {
  flex: 1;
}
.dict-filter-count {
  font-size: .74rem;
  color: var(--text-muted);
  background: #f0f0f0;
  padding: 1px 7px;
  border-radius: 8px;
  min-width: 20px;
  text-align: center;
}
.dict-filter-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.dict-filter-btn {
  flex: 1;
  padding: 4px 0;
  font-size: .72rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-lt);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background .15s;
}
.dict-filter-btn:hover {
  background: var(--accent);
  color: #fff;
}

/* ── サイドバー 50音ナビ ────────────────── */
.dict-sidebar-aiueo {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}
.dict-sidebar-gyo-link {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  font-size: .78rem;
  font-weight: 600;
  border-radius: 4px;
  text-decoration: none;
  color: var(--accent);
  background: var(--accent-lt);
  transition: background .15s, color .15s;
}
.dict-sidebar-gyo-link:hover {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}
.dict-sidebar-gyo-link.is-disabled {
  color: var(--text-muted);
  background: #f5f5f5;
  cursor: default;
}
.dict-sidebar-gyo-link.is-disabled:hover {
  background: #f5f5f5;
  color: var(--text-muted);
}

/* ── サイドバー 統計 ────────────────────── */
.dict-sidebar-stat {
  font-size: .88rem;
  color: var(--text);
  text-align: center;
}
.dict-sidebar-stat span {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent);
}

/* ── カテゴリバナーカード ──────────────── */
.dict-cat-banners {
  display: grid;
  /* 6列固定はタブレット幅でmin-contentが溢れ横スクロールが出るためauto-fitで折返す (2026-07-09) */
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.dict-cat-banner-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 8px;
  border-radius: 12px;
  text-decoration: none;
  color: #fff;
  text-align: center;
  transition: transform .15s, box-shadow .15s, opacity .15s;
  box-shadow: var(--shadow);
  opacity: .92;
}
.dict-cat-banner-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  opacity: 1;
  text-decoration: none;
  color: #fff;
}
.dict-cat-banner-card.is-active {
  opacity: 1;
  box-shadow: 0 0 0 3px var(--accent), var(--shadow-hover);
  transform: translateY(-1px);
}
/* アイコン */
.dict-cat-banner-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}
.dict-cat-banner-icon img {
  width: 100%;
  height: 100%;
  border-radius: 8px;
}
/* テキスト */
.dict-cat-banner-label {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}
.dict-cat-banner-count {
  font-size: .75rem;
  opacity: .8;
  font-weight: 400;
}
/* カテゴリ別グラデーション */
.dict-cat-banner-card--rental     { background: linear-gradient(135deg, #2e7d32, #43a047); }
.dict-cat-banner-card--sales      { background: linear-gradient(135deg, #1565c0, #1e88e5); }
.dict-cat-banner-card--investment  { background: linear-gradient(135deg, #e65100, #ff9800); }
.dict-cat-banner-card--building   { background: linear-gradient(135deg, #6a1b9a, #9c27b0); }
.dict-cat-banner-card--law        { background: linear-gradient(135deg, #b71c1c, #e53935); }
.dict-cat-banner-card--contract   { background: linear-gradient(135deg, #00695c, #00897b); }

/* ── テキスト検索 ───────────────────────── */
.dict-search-wrap {
  margin-bottom: 20px;
  position: relative;
}
.dict-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: .9rem;
  pointer-events: none;
  opacity: .5;
}
.dict-search {
  width: 100%;
  padding: 10px 14px 10px 36px;
  font-size: .9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  transition: border-color .15s;
  box-sizing: border-box;
}
.dict-search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb, 180,120,60), .15);
}

/* ── 50音ナビバー（旧・非サイドバー版は残す） ── */
.dict-aiueo-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 12px 0 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}
.dict-aiueo-nav a,
.dict-aiueo-nav span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  font-size: .82rem;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.dict-aiueo-nav a {
  color: var(--accent);
  background: var(--accent-lt);
}
.dict-aiueo-nav a:hover {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}
.dict-aiueo-nav span {
  color: var(--text-muted);
  background: #f5f5f5;
  cursor: default;
}

/* ── カテゴリタブ ────────────────────────── */
.dict-cat-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.dict-cat-tab {
  display: inline-block;
  padding: 7px 16px;
  font-size: .82rem;
  font-weight: 600;
  border-radius: 20px;
  text-decoration: none;
  transition: background .15s, color .15s;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--card);
}
.dict-cat-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}
.dict-cat-tab.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ── カテゴリバッジ ──────────────────────── */
.dict-badge {
  display: inline-block;
  padding: 2px 10px;
  font-size: .7rem;
  font-weight: 700;
  border-radius: 10px;
  white-space: nowrap;
  line-height: 1.6;
}
.dict-badge--rental     { background: #e8f5e9; color: #2e7d32; }
.dict-badge--sales      { background: #e3f2fd; color: #1565c0; }
.dict-badge--investment { background: #fff3e0; color: #e65100; }
.dict-badge--building   { background: #f3e5f5; color: #7b1fa2; }
.dict-badge--law        { background: #fce4ec; color: #c62828; }
.dict-badge--contract   { background: #e0f2f1; color: #00695c; }

/* ── 用語カードグリッド ──────────────────── */
.dict-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 32px;
}
.dict-card {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  text-decoration: none;
  color: var(--text);
  transition: transform .15s, box-shadow .15s;
  box-shadow: var(--shadow);
}
.dict-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  text-decoration: none;
}
/* カテゴリアイコン（SVG画像） */
.dict-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  line-height: 1;
  overflow: hidden;
}
.dict-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 10px;
}
.dict-card-icon--rental     { background: #e8f5e9; }
.dict-card-icon--sales      { background: #e3f2fd; }
.dict-card-icon--investment  { background: #fff3e0; }
.dict-card-icon--building   { background: #f3e5f5; }
.dict-card-icon--law        { background: #fce4ec; }
.dict-card-icon--contract   { background: #e0f2f1; }
.dict-card-content {
  flex: 1;
  min-width: 0;
}
.dict-card-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 8px;
}
.dict-card-term {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}
.dict-card-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.dict-card-reading {
  font-size: .75rem;
  color: var(--text-muted);
}
.dict-card-summary {
  font-size: .82rem;
  color: var(--text-light);
  line-height: 1.7;
  margin: 0;
  flex: 1;
}

/* ── 50音セクション見出し ────────────────── */
.dict-gyo-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  border-left: 4px solid var(--accent);
  padding-left: 10px;
  margin: 28px 0 14px;
  scroll-margin-top: 60px;
}

/* ── 統計バー ────────────────────────────── */
.dict-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: .82rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.dict-stats strong {
  color: var(--ink);
}

/* ── 個別用語ページ ──────────────────────── */
.dict-term-header {
  margin-bottom: 28px;
}
.dict-term-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 6px;
  line-height: 1.4;
}
.dict-term-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .82rem;
  color: var(--text-muted);
}

.dict-related {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.dict-related-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 12px;
}
.dict-related-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;
}
.dict-related-list a {
  display: inline-block;
  padding: 6px 16px;
  background: var(--accent-lt);
  color: var(--accent);
  border-radius: 20px;
  font-size: .84rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s;
}
.dict-related-list a:hover {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}

/* ── 辞典バナー（ガイド一覧用） ──────────── */
.dict-banner {
  display: flex;
  align-items: center;
  gap: 18px;
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  color: #fff;
  border-radius: 12px;
  padding: 22px 26px;
  margin: 28px 0 8px;
  text-decoration: none;
  transition: transform .15s, box-shadow .15s;
  box-shadow: var(--shadow);
}
.dict-banner:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  text-decoration: none;
  color: #fff;
}
.dict-banner-icon {
  font-size: 2rem;
  flex-shrink: 0;
}
.dict-banner-body h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 700;
}
.dict-banner-body p {
  margin: 0;
  font-size: .84rem;
  opacity: .85;
  line-height: 1.6;
}

/* ── レスポンシブ ────────────────────────── */
@media (max-width: 900px) {
  .dict-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .dict-sidebar {
    position: static;
    max-height: none;
  }
  .dict-sidebar-inner {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
  }
  .dict-filter-section {
    flex: 1;
    min-width: 200px;
  }
  .dict-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dict-cat-banners {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 600px) {
  .dict-layout {
    padding: 0 14px 40px;
  }
  .dict-sidebar-inner {
    flex-direction: column;
  }
  .dict-filter-section {
    min-width: 0;
  }
  .dict-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .dict-cat-banners {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .dict-cat-banner-card {
    min-height: 44px;
  }
  .dict-card {
    padding: 16px;
  }
  .dict-card-title {
    font-size: .92rem;
  }
  .dict-card-desc {
    font-size: .82rem;
    line-height: 1.6;
  }
  .dict-term-title {
    font-size: 1.2rem;
  }
  .dict-term-body {
    font-size: .92rem;
    line-height: 1.9;
  }
  .dict-related-list a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  .dict-banner {
    flex-direction: column;
    text-align: center;
    padding: 18px 20px;
    gap: 10px;
  }
  /* 50音ナビ */
  .dict-kana-grid {
    gap: 3px;
  }
  .dict-kana-grid a,
  .dict-kana-grid button {
    min-height: 36px;
    font-size: .78rem;
  }
}

/* == 軽量索引行 (2026-07-09 P0-1: 索引1.8MB/24k DOMノード対策で dict-card から置換) ==
   dict-card 系は term.php の関連用語で使用中のため削除しない */
.dict-rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 14px; }
.dict-row { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 10px 8px 16px; border-radius: 8px; text-decoration: none; color: var(--text, #333); position: relative; background: #fff; border: 1px solid #eee; }
.dict-row::before { content: ""; position: absolute; left: 5px; top: 10px; bottom: 10px; width: 3px; border-radius: 2px; background: #cbd5e1; }
.dict-row:hover { background: #faf7f2; border-color: #d9cfc0; }
.dict-row:focus-visible { outline: 2px solid #a67c52; outline-offset: 2px; }
.dict-row-term { font-weight: 600; font-size: .95rem; flex-shrink: 0; }
.dict-row-reading { font-size: .75rem; color: var(--text-muted, #888); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* カテゴリ色は既存 dict-badge-- 系のパレットに揃える */
.dict-row--rental::before     { background: #2e7d32; }
.dict-row--sales::before      { background: #1565c0; }
.dict-row--investment::before { background: #e65100; }
.dict-row--building::before   { background: #7b1fa2; }
.dict-row--law::before        { background: #c62828; }
.dict-row--contract::before   { background: #00695c; }
.dict-gyo-count { font-size: .8rem; font-weight: 400; color: var(--text-muted, #888); margin-left: 8px; }
/* ビューポート外の50音セクションはレンダリングをスキップ (INP/LCP対策) */
.dict-gyo-section { content-visibility: auto; contain-intrinsic-size: auto 600px; }
@media (max-width: 600px) { .dict-rows { grid-template-columns: 1fr 1fr; } .dict-row-reading { display: none; } }
