/* main への padding-top は付けない。.site-header は position: sticky で
   通常のレイアウトフローに残るため、ヘッダー分の余白は既に自然に確保
   されている。以前 padding-top: 74px を追加していたが、これは二重の
   余白（ヘッダー下に不要な空白）を生む原因だったため削除した。 */

h3.region-header {
  scroll-margin-top: 80px;
}

/* 地方セクション（都道府県カードグリッドの入れ子バグを修正するための
   明示的な構造固定。region-section は必ず縦積みで、内部に地方見出し
   region-title と、その地方のカードだけを囲む prefectures-grid を
   1つずつ持つ。region-section 自体を grid/flex の横並びコンテナに
   してはならない — 過去に .prefectures-grid が二重ネストされ、
   カード幅が1/4以下に潰れる不具合が発生したため、この構造を基準として
   固定する。） */
.region-section {
  width: 100%;
  margin: 0 0 2.5rem;
}

.region-section:last-of-type {
  margin-bottom: 0;
}

/* 北海道地方と東北地方の間だけ、他の地方間より余白を詰める
   （関東地方の次に北海道地方、その直後に東北地方という並びを
   1つの地理的まとまりとして視覚的に近づけるための例外。他の
   地方間隔（2.5rem）はこの指定では変更しない）。
   注: region-hokkaido / region-tohoku クラスは地方カード側にも
   色分け用に付与されているため、セクション要素に限定するセレクタ
   （.region-section.region-hokkaido）を用いる。 */
.region-section.region-hokkaido {
  margin-bottom: 1rem;
}

.region-title {
  display: block;
  width: 100%;
  margin: 0 0 1rem;
}

/* Ban.Tai 全国学校データベース CSS (assets/css/school-database.css) */

/* ヒーロー領域（全国ポータル・都道府県版共通のコンパクト化）
   既存の .page-hero（assets/style.css, min-height:260px）はサイト全体で
   共有されているため、ここでは学校データベース系ページ限定の上書きクラスとして
   .page-hero--compact を用意する。他ページの .page-hero には影響しない。 */
.page-hero--compact {
  min-height: 110px;
  padding: 12px 0;
}

.page-hero--compact .kicker {
  font-size: 0.72rem;
  margin-bottom: 2px;
}

.page-hero--compact h1 {
  /* サイト共通の.page-hero h1はclamp(1.8rem,3.5vw,3rem)と大きく、
     47都道府県ページで繰り返し使う見出しとしては縦方向に大きすぎる
     ため、コンパクト版専用に縮小する。 */
  font-size: clamp(1.3rem, 2.2vw, 1.7rem);
  line-height: 1.25;
  margin: 0.1em 0;
}

.page-hero--compact .lead {
  font-size: 0.86rem;
  line-height: 1.5;
  margin: 3px 0 0;
}

.hero-back-link {
  margin-top: 4px;
}

@media (max-width: 480px) {
  .page-hero--compact {
    min-height: 0;
    padding: 16px 0;
  }
}

.search-section {
  background: var(--ivory, #fbfaf5);
  padding: 20px 0;
  border-bottom: 1px solid rgba(7, 27, 54, 0.04);
}

.search-box {
  background: #ffffff;
  border: 1px solid rgba(7, 27, 54, 0.08);
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(7, 27, 54, 0.05);
  margin-bottom: 12px;
}

.search-title {
  font-size: 1.4rem;
  color: var(--navy, #0c1b33);
  margin-top: 0;
  margin-bottom: 10px;
  border-bottom: 2px solid var(--gold, #c5a059);
  padding-bottom: 6px;
}

/* 検索フォーム */
.search-form-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 12px;
  margin-bottom: 10px;
}

@media (max-width: 768px) {
  .search-form-grid {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--navy, #0c1b33);
}

.form-control {
  padding: 12px 16px;
  border: 1px solid rgba(7, 27, 54, 0.15);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink, #2d3748);
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}

.form-control:focus {
  outline: none;
  border-color: var(--gold, #c5a059);
  box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.15);
}

/* 設置区分＋学校種の2カラム配置（狭い設置区分＋広い学校種）
   PC・タブレットでは横並び、640px以下では自然に縦並びへ戻す。 */
.filter-columns {
  display: grid;
  grid-template-columns: minmax(170px, 220px) 1fr;
  column-gap: 20px;
  row-gap: 10px;
  margin-bottom: 10px;
}

@media (max-width: 640px) {
  .filter-columns {
    grid-template-columns: 1fr;
    row-gap: 12px;
  }
}

/* 学校種・設置区分チェックボックス */
.checkbox-group {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  padding: 0;
}

.filter-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink, #2d3748);
  cursor: pointer;
  user-select: none;
  background: #fdfdfd;
  padding: 6px 12px;
  min-height: 40px;
  line-height: 1.2;
  border-radius: 20px;
  border: 1px solid rgba(7, 27, 54, 0.1);
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.filter-chip:hover {
  border-color: var(--gold, #c5a059);
  background: #fffdf5;
}

.filter-chip input {
  width: 16px;
  height: 16px;
  accent-color: var(--gold, #c5a059);
  cursor: pointer;
}

/* 敬称セレクター */
.honorific-section {
  margin-bottom: 12px;
  background: #fffdf8;
  border: 1px solid rgba(197, 160, 89, 0.25);
  border-radius: 12px;
  padding: 12px 14px;
}

.honorific-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy, #0c1b33);
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.honorific-title-note {
  font-weight: 500;
  font-size: 0.76rem;
  color: var(--muted, #718096);
}

.honorific-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.honorific-radio {
  display: none;
}

.honorific-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 14px;
  min-height: 40px;
  line-height: 1.2;
  box-sizing: border-box;
  border: 1px solid rgba(7, 27, 54, 0.12);
  border-radius: 99px;
  background: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted, #718096);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.honorific-radio:checked + .honorific-label {
  background: var(--navy, #0c1b33);
  color: #fff;
  border-color: var(--navy, #0c1b33);
  box-shadow: 0 4px 10px rgba(12, 27, 51, 0.15);
}

.honorific-label:hover:not(.honorific-radio:checked + .honorific-label) {
  border-color: var(--gold, #c5a059);
  color: var(--navy, #0c1b33);
  background: #fffdf5;
}

/* 検索結果 */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.results-count {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--muted, #718096);
}

.results-count span {
  color: var(--gold, #c5a059);
  font-size: 1.3rem;
  margin: 0 4px;
}

.results-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.school-card {
  background: #ffffff;
  border: 1px solid rgba(7, 27, 54, 0.08);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(7, 27, 54, 0.04);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.school-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(7, 27, 54, 0.08);
  border-color: rgba(197, 160, 89, 0.3);
}

@media (max-width: 768px) {
  .school-card {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.school-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.school-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.school-badge-type {
  background: #f0f4f8;
  color: #2b5c8f;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.76rem;
  font-weight: 700;
}

.school-badge-est-public {
  background: #e6f4ea;
  color: #137333;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.76rem;
  font-weight: 700;
  border: 1px solid rgba(19, 115, 51, 0.2);
}

.school-badge-est-private {
  background: #fce8e6;
  color: #c5221f;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.76rem;
  font-weight: 700;
  border: 1px solid rgba(197, 34, 31, 0.2);
}

.school-badge-city {
  background: #fff9e6;
  color: #8c6b00;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.76rem;
  font-weight: 700;
  border: 1px solid rgba(197, 160, 89, 0.2);
}

.school-name {
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--navy, #0c1b33);
  margin: 4px 0 0;
}

.school-address-row {
  display: flex;
  gap: 12px;
  font-size: 0.88rem;
  color: var(--ink, #2d3748);
  line-height: 1.5;
  flex-wrap: wrap;
  align-items: center;
}

.school-address-row .zip {
  font-weight: 700;
  color: var(--muted, #718096);
}

.school-tel-row {
  font-size: 0.85rem;
  color: var(--muted, #718096);
}

/* アクションボタン（コピー & Google Maps） */
.school-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
  min-width: 220px;
}

@media (max-width: 768px) {
  .school-actions {
    min-width: 100%;
  }
}

.action-buttons-group {
  display: flex;
  gap: 8px;
}

.btn-copy {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border: 1px solid var(--gold, #c5a059);
  border-radius: 6px;
  background: #fffdf8;
  color: var(--navy, #0c1b33);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-copy:hover {
  background: var(--gold, #c5a059);
  color: #fff;
}

.btn-copy svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.btn-map {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border: 1px solid #4285f4;
  border-radius: 6px;
  background: #f8faff;
  color: #1a73e8;
  font-weight: 700;
  font-size: 0.84rem;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-map:hover {
  background: #1a73e8;
  color: #ffffff;
  border-color: #1a73e8;
}

.btn-map svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.btn-website {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  min-height: 40px;
  border: 1px solid rgba(12, 27, 51, 0.2);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--navy, #0c1b33);
  font-weight: 700;
  font-size: 0.84rem;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-website:hover {
  background: var(--navy, #0c1b33);
  color: #ffffff;
  border-color: var(--navy, #0c1b33);
}

.btn-website svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.btn-back-portal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-back-portal:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  border-color: #ffffff;
}

.copy-preview {
  background: rgba(7, 27, 54, 0.03);
  border: 1px dashed rgba(7, 27, 54, 0.12);
  border-radius: 6px;
  padding: 8px 12px;
  font-family: monospace;
  font-size: 0.76rem;
  color: #555;
  line-height: 1.4;
  white-space: pre-line;
  text-align: left;
}

/* 全国入口ページ用スタイル */
/* 都道府県カードグリッド: 〜640px=1列, 641〜900px=2列, 901〜1199px=3列,
   1200px以上=4列。固定列数＋minmax(0,1fr)なので、auto-fit系のような
   最小幅による横あふれは発生しない。

   注意（過去の経緯）: 4列のしきい値はかつて1024pxまで引き下げられていた
   （PR #63）。理由は、1366×768等の一般的なノートPCでWindowsの推奨拡大率
   （125%など）が適用されると実効幅（window.innerWidth）が1100px前後まで
   下がるケースがあり、1200pxのままだと3列になってしまうため。今回、
   本番で発生したカード幅崩壊（.prefectures-grid の二重ネスト）の修正に
   あたり、しきい値を要求仕様どおり1200px（max-width:1199pxで3列）に
   統一した。上記のWindows拡大率環境では再び3列表示に戻る可能性がある点は
   既知のトレードオフとして残る。 */
.prefectures-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 24px;
  width: 100%;
  align-items: start;
  grid-auto-rows: auto;
}

@media (max-width: 640px) {
  .prefectures-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 641px) and (max-width: 900px) {
  .prefectures-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 901px) and (max-width: 1199px) {
  .prefectures-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  .prefectures-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* 大画面（拡大率100%相当で幅に余裕がある場合）ではカード領域をやや
   広げ、4列時のカード幅に余裕を持たせる。ヘッダー・フッターの
   .container には影響しないよう検索セクション配下に限定。 */
@media (min-width: 1267px) {
  .search-section .container {
    width: min(1320px, 90vw);
  }
}

.pref-card {
  background: #ffffff;
  border: 1.5px solid rgba(7, 27, 54, 0.15);
  border-top: 5px solid var(--gold, #c5a059);
  border-radius: 16px;
  padding: 18px 20px 20px;
  box-shadow: 0 4px 20px rgba(7, 27, 54, 0.08);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
  position: relative;
  overflow: hidden;
  /* .pref-card はカード全体を<a>にする都道府県版で使われるため、
     アンカーの既定装飾（下線・リンク色）を打ち消しておく。 */
  text-decoration: none;
  color: #0f172a;
  /* グリッドセルいっぱいに広がることを明示（幅がコンテンツに収縮する
     不具合の再発防止）。実際の高さはコンテンツに応じて自然に決まる。 */
  width: 100%;
  min-width: 0;
  height: auto;
  min-height: 0;
  max-height: none;
  align-self: start;
  cursor: pointer;
}

/* prefecture-card は .pref-card のエイリアスクラス（同一要素に併記）。
   都道府県名等のテキストが縦書きや1文字ずつの折り返しにならないよう、
   横書き・自然な折り返しを明示的に固定する。 */
.pref-card.prefecture-card,
.prefecture-card {
  min-width: 0;
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: none;
  box-sizing: border-box;
  align-self: start;
  overflow-wrap: normal;
  word-break: normal;
  writing-mode: horizontal-tb;
}

.pref-card h2,
.prefecture-card h2,
.pref-card .prefecture-name,
.prefecture-card .prefecture-name {
  writing-mode: horizontal-tb;
  word-break: keep-all;
  overflow-wrap: normal;
  white-space: normal;
}

.pref-card.active-card {
  border-color: rgba(7, 27, 54, 0.15);
  border-top-color: var(--gold, #c5a059);
  padding-bottom: 34px;
}

.pref-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(7, 27, 54, 0.14), 0 0 0 2px rgba(197, 160, 89, 0.4);
  border-color: var(--gold, #c5a059);
  background: #ffffff;
}

.pref-card:focus-within {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(7, 27, 54, 0.14), 0 0 0 2px rgba(197, 160, 89, 0.4);
  border-color: var(--gold, #c5a059);
  background: #ffffff;
}

/* カード全体がリンクの場合のキーボードフォーカス表示 */
.pref-card:focus-visible {
  outline: 3px solid var(--gold, #c5a059);
  outline-offset: 3px;
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(7, 27, 54, 0.14);
  border-color: var(--gold, #c5a059);
}

.pref-card.active-card::after {
  content: "→";
  position: absolute;
  right: 16px;
  bottom: 12px;
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  background: #0c1b33;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #0c1b33;
  opacity: 0.9;
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.pref-card.active-card:hover::after,
.pref-card.active-card:focus-visible::after,
.pref-card.active-card:focus-within::after {
  opacity: 1;
  background: var(--gold, #c5a059);
  color: #ffffff;
  border-color: var(--gold, #c5a059);
  transform: translateX(2px);
}

.pref-card-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 6px;
}

.pref-edition-badge {
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f172a;
  background: #f1f5f9;
  border: 1.5px solid #94a3b8;
  padding: 3px 12px;
  border-radius: 14px;
  letter-spacing: 0.02em;
}

.pref-badge {
  background: var(--navy, #0c1b33);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 99px;
}

.pref-card h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--navy, #0c1b33);
  margin: 0;
  letter-spacing: 0.02em;
}

.education-profile-summary {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1.5px solid #cbd5e1;
  border-left: 5px solid var(--gold, #c5a059);
  border-radius: 12px;
  background: linear-gradient(135deg, #f0f6fc 0%, #e2ecf8 100%);
  line-height: 1.4;
  box-shadow: 0 2px 8px rgba(7, 27, 54, 0.03);
}

.education-profile-metric-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f172a;
  white-space: normal;
  overflow-wrap: break-word;
}

.education-profile-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--navy, #0c1b33);
  white-space: nowrap;
}

.education-profile-value span {
  margin-left: 3px;
  font-size: 0.85rem;
  font-weight: 700;
}

.education-profile-average-value {
  font-size: 0.78rem;
  font-weight: 700;
  color: #0f172a;
  background: #ffffff;
  padding: 3px 10px;
  border-radius: 10px;
  border: 1.5px solid #cbd5e1;
  white-space: nowrap;
  display: inline-block;
  margin-top: 3px;
}

.pref-profile-source {
  margin: 5px 0 0;
  font-size: 0.74rem;
  font-weight: 600;
  color: #334155;
  line-height: 1.4;
}

/* 都道府県地域マーク（シルエット）。大サイズ化・高視認性デザイン */
.pref-card-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 10px;
}

.pref-silhouette-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #fffdf8 0%, #f7ebd5 100%);
  border: 2px solid rgba(197, 160, 89, 0.6);
  box-shadow: 0 3px 10px rgba(197, 160, 89, 0.22);
  flex-shrink: 0;
}

.pref-card-title-row h2 {
  margin: 0;
}

.pref-silhouette {
  display: inline-block;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  background-color: #b8860b;
  -webkit-mask-image: var(--silhouette-url);
  mask-image: var(--silhouette-url);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.pref-card:hover .pref-silhouette {
  background-color: #966b04;
}

/* Meta Data Grid (高コントラスト・くっきりカード) */
.pref-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.pref-meta-grid .meta-row {
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.pref-meta-grid .meta-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #334155;
}

.pref-meta-grid .meta-value {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0c1b33;
  margin-top: 2px;
}

.pref-meta-grid .meta-unit {
  font-size: 0.8rem;
  font-weight: 700;
  color: #334155;
  margin-left: 2px;
}

/* 人口データ枠（温かみ・高視認性） */
.population-summary {
  background: #fffdf5;
  border: 1.5px solid #d97706;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
}

.population-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.population-summary-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f172a;
}

.population-summary-row strong {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0c1b33;
}

.population-inline-share {
  font-size: 0.82rem;
  font-weight: 700;
  color: #b45309;
  margin-left: 4px;
}

.population-source-line {
  margin: 6px 0 0;
  font-size: 0.74rem;
  font-weight: 600;
  color: #334155;
  line-height: 1.4;
}

.population-footer-note {
  margin: 4px 0 0;
  font-size: 0.74rem;
  font-weight: 600;
  color: #334155;
  line-height: 1.4;
}

.population-age-details summary {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0c1b33;
  padding: 6px 0;
  cursor: pointer;
}

.population-age-details dt,
.population-age-details dd {
  font-size: 0.82rem;
  font-weight: 700;
  color: #1e293b;
}

.population-note {
  font-size: 0.74rem;
  font-weight: 600;
  color: #334155;
}

@media (max-width: 900px) {
  .pref-silhouette {
    width: 30px;
    height: 30px;
  }
}

@media (max-width: 640px) {
  .pref-silhouette {
    width: 28px;
    height: 28px;
  }
}

/* 都道府県別ページのタイトル帯（<h1>）にも同じ地域マークを表示する。 */
.hero-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hero-title-row h1 {
  margin: 0;
}

.hero-silhouette {
  width: 40px;
  height: 40px;
}

@media (max-width: 640px) {
  .hero-silhouette {
    width: 34px;
    height: 34px;
  }
}

.pref-count {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold, #c5a059);
  margin-bottom: 10px;
}

.pref-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 0;
  margin: 0;
  font-size: 0.86rem;
  color: var(--ink, #2d3748);
}

.pref-features li {
  display: flex;
  align-items: center;
  gap: 7px;
  line-height: 1.45;
}

.pref-features li::before {
  content: "✓";
  color: #27ae60;
  font-weight: 800;
  flex-shrink: 0;
}

/* 「順次拡張予定」プレースホルダーカード（<div>のまま、非リンク）専用。
   実カードから下部ボタン風要素は削除したが、このクラス自体は
   プレースホルダーの無効ボタンで引き続き使用しているため残す。 */
.pref-action-btn {
  display: block;
  text-align: center;
  padding: 14px 24px;
  background: var(--navy, #0c1b33);
  color: #ffffff;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(12, 27, 51, 0.15);
}

.pref-action-btn:hover {
  background: var(--gold, #c5a059);
  color: #0c1b33;
}

/* トースト通知 */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #0c1b33;
  color: #fffdf5;
  padding: 12px 28px;
  border-radius: 99px;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--gold, #c5a059);
  opacity: 0;
  z-index: 1000;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* 上に戻るボタン */
.back-to-top {
  position: fixed;
  bottom: 28px;
  right: 20px;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 45px;
  box-sizing: border-box;
  background: var(--navy, #0c1b33);
  color: #fff;
  border: 2px solid var(--gold, #c5a059);
  border-radius: 99px;
  padding: 10px 17px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(7, 27, 54, 0.35);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  white-space: nowrap;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--gold, #c5a059);
  color: var(--navy, #0c1b33);
  border-color: var(--gold, #c5a059);
}

/* 教育情報ポータル（都道府県共通） */
.edu-portal-section {
  background: #ffffff;
  padding: 24px 0 28px;
}

.edu-portal-heading {
  font-size: 1.3rem;
  color: var(--navy);
  margin: 0 0 6px;
}

.edu-portal-lead {
  font-size: 0.86rem;
  color: var(--muted);
  margin: 0 0 14px;
  line-height: 1.6;
}

.edu-portal-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.edu-portal-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 18px 18px 20px;
  background: #ffffff;
  border: 1px solid rgba(7, 27, 54, 0.1);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(7, 27, 54, 0.04);
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.edu-portal-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(7, 27, 54, 0.1);
  border-color: var(--gold);
}

.edu-portal-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--navy);
  color: var(--gold2, #edd996);
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 1rem;
  margin-bottom: 12px;
  font-family: "Noto Serif JP", serif;
  flex-shrink: 0;
}

.edu-portal-card-title {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 6px;
  line-height: 1.4;
}

.edu-portal-card-desc {
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--muted);
}

@media (max-width: 860px) {
  .edu-portal-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .edu-portal-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .edu-portal-section {
    padding: 32px 0 40px;
  }
}

/* 都道府県個別ページの統計サマリー（人口・教育統計・学校数・校種構成・
   設置区分）。ポータルカードの population-summary / education-profile-
   summary と同じ配色・出典表記の作法を踏襲しつつ、個別ページでは横並び
   の4枚カードとして表示する。 */
.pref-summary-section {
  background: #ffffff;
  padding: 20px 0 8px;
}

.pref-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.pref-summary-card {
  padding: 14px 16px;
  background: #f4f6fa;
  border: 1px solid rgba(12, 27, 51, 0.14);
  border-radius: 10px;
  box-sizing: border-box;
  min-width: 0;
}

.pref-summary-label {
  font-size: 0.78rem;
  color: #5d6675;
  white-space: normal;
  overflow-wrap: break-word;
  margin-bottom: 2px;
}

.pref-summary-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--navy, #0c1b33);
  white-space: nowrap;
}

.pref-summary-value span {
  margin-left: 3px;
  font-size: 0.82rem;
  font-weight: 500;
}

.pref-summary-sub {
  font-size: 0.74rem;
  color: #8a8f98;
  margin-top: 3px;
  overflow-wrap: break-word;
}

.pref-summary-source {
  margin: 6px 0 0;
  font-size: 0.66rem;
  color: #5d6675;
  line-height: 1.35;
}

.pref-summary-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.pref-summary-chip {
  font-size: 0.7rem;
  color: var(--navy, #0c1b33);
  background: #ffffff;
  border: 1px solid rgba(197, 160, 89, 0.35);
  border-radius: 99px;
  padding: 2px 9px;
  white-space: nowrap;
}

.pref-summary-chips-large .pref-summary-chip {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 4px 12px;
}

.pref-summary-note {
  margin: 12px 0 0;
  font-size: 0.68rem;
  color: #8a8f98;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .pref-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .pref-summary-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .pref-summary-section {
    padding: 16px 0 4px;
  }
}

/* Pilot Metadata Grid */
.pref-meta-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(7, 27, 54, 0.1);
}
.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  line-height: 1.3;
}
.meta-label {
  font-size: 0.75rem;
  color: #718096;
}
.meta-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--navy, #0c1b33);
}
.meta-unit {
  font-size: 0.7rem;
  font-weight: 400;
  margin-left: 2px;
  color: #718096;
}

.pref-card:has(.population-summary) .pref-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 12px;
  margin-top: 4px;
  padding-top: 6px;
}

.pref-card:has(.population-summary) .meta-row {
  display: grid;
  gap: 1px;
  line-height: 1.18;
}

.pref-card:has(.population-summary) .meta-label {
  font-size: 0.68rem;
}

.pref-card:has(.population-summary) .meta-value {
  font-size: 0.78rem;
}

@media (max-width: 860px) {
  .site-header .nav:has(.menu-toggle) .menu {
    width: auto;
  }
}

.prefecture-card-root {
  display: grid;
  gap: 0;
}

.prefecture-card-loading {
  margin: 0;
  color: #5d6675;
}

/* Prefecture card population metadata */
.pref-card:has(.population-summary) {
  gap: 4px;
  padding: 12px 18px 26px;
  overflow: visible;
  max-height: none;
}

.population-summary {
  display: grid;
  gap: 2px;
  margin-top: 2px;
  padding: 6px 7px;
  border: 1px solid rgba(197, 160, 89, 0.28);
  border-radius: 8px;
  background: #fffaf0;
  line-height: 1.15;
}

.population-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  align-items: baseline;
}

.population-summary-label {
  font-size: 0.66rem;
  color: #5d6675;
  white-space: nowrap;
}

.population-summary strong {
  font-size: 0.78rem;
  color: var(--navy, #0c1b33);
  white-space: nowrap;
}

.population-summary strong span {
  margin-left: 2px;
  font-size: 0.66rem;
  font-weight: 500;
}

.population-inline-share {
  color: #5d6675;
}

.population-source-line {
  margin: 3px 0 0;
  font-size: 0.62rem;
  color: #5d6675;
  line-height: 1.3;
}

.population-footer-note {
  margin: 1px 0 0;
  font-size: 0.62rem;
  color: #8a8f99;
  line-height: 1.3;
}

.population-age-details {
  border-top: 1px dashed rgba(7, 27, 54, 0.12);
  padding-top: 6px;
  overflow: visible;
}

.population-age-details summary {
  cursor: pointer;
  color: var(--navy, #0c1b33);
  font-size: 0.82rem;
  font-weight: 700;
}

.population-age-details dl {
  display: grid;
  gap: 5px;
  margin: 8px 0 0;
}

.population-age-details dl div {
  display: grid;
  gap: 2px;
}

.population-age-details dt,
.population-age-details dd,
.population-note {
  margin: 0;
  font-size: 0.74rem;
  line-height: 1.45;
}

.population-age-details dt,
.population-note {
  color: #5d6675;
}

.population-age-details dd {
  color: var(--navy, #0c1b33);
  font-weight: 700;
}

/* 都道府県個別ページ: 視覚的パンくずリスト */
.pref-breadcrumb {
  background: #f4f6fa;
  border-bottom: 1px solid rgba(7, 27, 54, 0.08);
  padding: 10px 0;
}

.pref-breadcrumb .container {
  font-size: 0.8rem;
  color: #5d6675;
  overflow-wrap: break-word;
}

.pref-breadcrumb a {
  color: #5d6675;
  text-decoration: none;
}

.pref-breadcrumb a:hover {
  text-decoration: underline;
}

.pref-breadcrumb [aria-current="page"] {
  color: var(--navy, #0c1b33);
  font-weight: 600;
}

/* 都道府県個別ページ: 隣接・同地方の都道府県への内部リンク */
.related-prefectures-section {
  background: #ffffff;
  padding: 36px 0 44px;
  border-top: 1px solid rgba(7, 27, 54, 0.08);
}

.related-prefectures-heading {
  margin: 0 0 12px;
  font-size: 1rem;
  color: var(--navy, #0c1b33);
}

.related-prefectures-heading:not(:first-child) {
  margin-top: 24px;
}

.related-pref-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.related-pref-chip {
  display: inline-block;
  font-size: 0.82rem;
  color: var(--navy, #0c1b33);
  background: #f4f6fa;
  border: 1px solid rgba(197, 160, 89, 0.35);
  border-radius: 99px;
  padding: 5px 14px;
  text-decoration: none;
  transition: background 0.15s ease;
}

.related-pref-chip:hover {
  background: #fffaf0;
}

/* 都道府県個別ページ: 「このデータベースについて」SEOコンテンツ
   （紹介文・人口/教育統計解説・できること・利用例・FAQ） */
.pref-seo-content {
  background: #ffffff;
  padding: 36px 0;
  border-top: 1px solid rgba(7, 27, 54, 0.08);
}

.pref-seo-content-heading {
  font-size: 1.3rem;
  color: var(--navy, #0c1b33);
  margin: 0 0 14px;
}

.pref-seo-content-subheading {
  font-size: 1.05rem;
  color: var(--navy, #0c1b33);
  margin: 26px 0 10px;
}

.pref-seo-content-text {
  font-size: 0.88rem;
  line-height: 1.8;
  color: #3a4457;
  margin: 0 0 12px;
}

.pref-feature-list,
.pref-usecase-list {
  margin: 0;
  padding-left: 1.4em;
  font-size: 0.86rem;
  line-height: 1.9;
  color: #3a4457;
}

.pref-feature-list li,
.pref-usecase-list li {
  margin-bottom: 4px;
}

.pref-faq {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pref-faq-item {
  background: #f4f6fa;
  border: 1px solid rgba(12, 27, 51, 0.1);
  border-radius: 10px;
  padding: 4px 16px;
}

.pref-faq-item summary {
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--navy, #0c1b33);
  padding: 12px 0;
  list-style: none;
}

.pref-faq-item summary::-webkit-details-marker {
  display: none;
}

.pref-faq-item summary::before {
  content: "Q. ";
  color: var(--gold, #c5a059);
}

.pref-faq-item summary::after {
  content: "+";
  float: right;
  font-weight: 400;
  color: var(--gold, #c5a059);
}

.pref-faq-item[open] summary::after {
  content: "－";
}

.pref-faq-item p {
  margin: 0 0 14px;
  font-size: 0.84rem;
  line-height: 1.8;
  color: #3a4457;
}

@media (max-width: 480px) {
  .pref-seo-content {
    padding: 28px 0;
  }
}


/* ==========================================================================
   Analytics Dashboard - Ranking Bar Chart (.bar-row) Styles & Responsive Grid
   ========================================================================== */
#bar-chart-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bar-row {
  display: grid;
  grid-template-columns: 48px 90px 1fr 110px;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  box-sizing: border-box;
  transition: all 0.2s ease-in-out;
}

.bar-row:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transform: translateY(-1px);
}

.bar-row .bar-rank {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  font-size: 0.85rem;
  font-weight: 700;
}

.bar-row .bar-pref {
  font-weight: 700;
  font-size: 0.92rem;
  color: #0c1b33;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-row .bar-track {
  background: #e2e8f0;
  height: 22px;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.bar-row .bar-fill {
  background: linear-gradient(90deg, #1e3a8a, #3182ce);
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease-out;
}

.bar-row .bar-value {
  text-align: right;
  font-weight: 800;
  font-size: 0.92rem;
  color: #1e293b;
  white-space: nowrap;
}

.bar-row .bar-unit {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
}

/* Tablet (<= 768px) */
@media (max-width: 768px) {
  .bar-row {
    grid-template-columns: 42px 75px 1fr 95px;
    gap: 8px;
    padding: 6px 10px;
  }
  .bar-row .bar-pref {
    font-size: 0.88rem;
  }
  .bar-row .bar-value {
    font-size: 0.88rem;
  }
}

/* Mobile (<= 480px) */
@media (max-width: 480px) {
  .bar-row {
    grid-template-columns: 36px 62px 1fr 85px;
    gap: 6px;
    padding: 6px 8px;
  }
  .bar-row .bar-pref {
    font-size: 0.82rem;
  }
  .bar-row .bar-value {
    font-size: 0.82rem;
  }
  .bar-row .bar-track {
    height: 18px;
  }
}

/* Small Mobile (<= 375px) */
@media (max-width: 375px) {
  .bar-row {
    grid-template-columns: 34px 56px 1fr 80px;
    gap: 5px;
    padding: 5px 6px;
  }
  .bar-row .bar-pref {
    font-size: 0.78rem;
  }
  .bar-row .bar-value {
    font-size: 0.78rem;
  }
}

/* Micro Mobile (<= 320px) */
@media (max-width: 320px) {
  .bar-row {
    grid-template-columns: 30px 50px 1fr 72px;
    gap: 4px;
    padding: 4px 4px;
  }
  .bar-row .bar-pref {
    font-size: 0.74rem;
  }
  .bar-row .bar-value {
    font-size: 0.74rem;
  }
  .bar-row .bar-track {
    height: 16px;
  }
}
