/* 中学受験データ室 ブログ。色は design/tokens.css に合わせる。BEM。 */
:root {
  --ink: #1f2a38;
  --paper: #f7f5f0;
  --surface: #ffffff;
  --accent: #b38a4a;
  --accent-ink: #8a6630;
  --slate: #657181;
  --border: #d9d7d1;
  --soft: #f0eee8;
  --link: #2f5d8a;
  --radius: 6px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e6e3dc;
    --paper: #171c23;
    --surface: #1f262f;
    --accent: #c9a368;
    --accent-ink: #d8b882;
    --slate: #9aa4b1;
    --border: #364150;
    --soft: #262e39;
    --link: #8db8e3;
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

a {
  color: var(--link);
}

.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---- ヘッダー・フッター ---- */
.site-header {
  background: #1f2a38;
  color: #f7f5f0;
  border-bottom: 3px solid var(--accent);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
}

.site-header__brand {
  color: #f7f5f0;
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
  letter-spacing: 0.04em;
}

.site-header__nav a {
  color: #f7f5f0;
  font-size: 14px;
  text-decoration: none;
}

.site-header__nav a:hover,
.site-header__brand:hover {
  text-decoration: underline;
}

main.container {
  padding-top: 16px;
  padding-bottom: 48px;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--soft);
  color: var(--slate);
  font-size: 13px;
  padding: 24px 0;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-bottom: 8px;
}

.site-footer__copy {
  margin: 0;
}

/* ---- 見出し・本文 ---- */
h1 {
  font-size: 24px;
  line-height: 1.45;
  margin: 8px 0 16px;
}

h2 {
  font-size: 20px;
  line-height: 1.5;
  margin: 40px 0 16px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--accent);
}

h3 {
  font-size: 17px;
  margin: 28px 0 12px;
}

.lead {
  color: var(--ink);
}

.md p.notes {
  font-size: 14px;
  color: var(--slate);
  margin-top: 8px;
}

.md p.checked {
  display: inline-block;
  font-size: 14px;
  background: var(--soft);
  border-left: 3px solid var(--accent);
  padding: 4px 12px;
}

.md ul,
.md ol {
  padding-left: 1.4em;
}

/* ---- 表 ---- */
.table-wrap {
  overflow-x: auto;
  margin: 20px 0 8px;
  -webkit-overflow-scrolling: touch;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 480px;
  background: var(--surface);
  font-size: 14px;
  line-height: 1.6;
}

caption {
  caption-side: top;
  text-align: left;
  font-weight: 700;
  font-size: 15px;
  padding: 0 0 8px;
  color: var(--ink);
}

th,
td {
  border: 1px solid var(--border);
  padding: 6px 10px;
  vertical-align: top;
  text-align: left;
}

thead th {
  background: var(--soft);
  font-weight: 700;
  white-space: nowrap;
}

tbody th {
  font-weight: 500;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.center {
  text-align: center;
}

/* ---- 学校ページ ---- */
.school__header {
  margin-bottom: 8px;
}

.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 20px;
  margin: 24px 0;
}

.toc__title {
  font-weight: 700;
  margin: 0 0 4px;
}

.toc ol {
  margin: 0;
  padding-left: 1.4em;
}

.note-link {
  margin: 40px 0 0;
  padding: 16px 20px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
}

.note-link p {
  margin: 0 0 4px;
}

.note-link a {
  font-weight: 700;
}

.related {
  margin-top: 48px;
}

/* ---- パンくず ---- */
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  font-size: 13px;
  color: var(--slate);
}

.breadcrumb li + li::before {
  content: "›";
  margin: 0 8px;
}

/* ---- チップ・一覧 ---- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.chips li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 14px;
}

.chips--small li {
  font-size: 13px;
  padding: 2px 12px;
}

.count {
  color: var(--slate);
  font-size: 12px;
  margin-left: 6px;
}

.hero {
  padding: 16px 0 8px;
}

.hero__note {
  font-size: 14px;
  color: var(--slate);
}

.regions {
  display: grid;
  gap: 16px;
}

.region h3 {
  margin: 0 0 8px;
}

.school-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border);
}

.school-list li {
  border-bottom: 1px solid var(--border);
}

.school-list a {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 16px;
  padding: 12px 4px;
  text-decoration: none;
  color: var(--ink);
}

.school-list a:hover {
  background: var(--soft);
}

.school-list__name {
  font-weight: 700;
  color: var(--link);
}

.school-list__meta {
  grid-column: 1;
  font-size: 13px;
  color: var(--slate);
}

.school-list__date {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  font-size: 12px;
  color: var(--slate);
  white-space: nowrap;
}

.more {
  text-align: right;
  font-size: 14px;
}

/* ---- 絞り込み ---- */
.filter {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin: 16px 0;
}

.filter__item {
  display: grid;
  gap: 2px;
  font-size: 13px;
  color: var(--slate);
}

.filter select,
.filter button {
  font: inherit;
  font-size: 15px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
}

.filter button {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  padding: 6px 18px;
  cursor: pointer;
}

.filter__reset {
  font-size: 14px;
  align-self: center;
}

.result-count {
  font-size: 14px;
  color: var(--slate);
}

@media (min-width: 720px) {
  h1 {
    font-size: 28px;
  }

  .regions {
    grid-template-columns: 1fr 1fr;
  }
}
