/*
  進学スコープ 読者向けデザイン（試作）
  方針：信頼感がある・AIっぽくない・古めかしくない。
  詳細は ../README.md と docs/cloudflare-media-requirements.html#design-direction。
  区切りは主に余白と背景の濃さの差でつける。線は灰色の細い線だけを、見出しの下・一覧の行の間・表に使う。
*/

/* ---------- 色と文字の決まり ---------- */
:root {
  --paper: #ffffff;
  --wash: #f1f4f7;
  --wash-2: #e6ebf0;
  --ink: #1d2633;
  --ink-2: #3f4a5a;
  --ink-3: #566173;
  --table-line: #d3d9e1;
  --rule: #d8dee6; /* 区切りの線。色は付けず、見出しの下と一覧の行の間にだけ使う */

  --brand: #1557cc; /* ロゴのブランドブルー */
  --brand-dark: #0f439f;
  --brand-wash: #e8effb;

  /* 分野の色。分野を足すときはここと data-field の対応を足す */
  --field-med: #a8343a;
  --field-den: #1d7480;
  --field-vet: #3c7533;
  --field-other: #545c78;

  --marker: #ffef9e;

  --font: "BIZ UDPGothic", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", sans-serif;

  /* 文字の大きさは6段だけ */
  --fs-s: 0.875rem;    /* 14px 日付・補足 */
  --fs-m: 1rem;        /* 16px 画面の基本 */
  --fs-l: 1.125rem;    /* 18px 記事本文 */
  --fs-xl: 1.375rem;   /* 22px 見出し・副題 */
  --fs-2xl: 2rem;      /* 32px 見出し */
  --fs-title: clamp(1.875rem, 1.2rem + 2vw, 2.75rem); /* 30〜44px 記事タイトル */
  --measure: calc(48 * var(--fs-l)); /* 本文と見出しの1行の幅（本文の字で48字） */
  --fs-display: clamp(2.25rem, 1.2rem + 3.2vw, 3.5rem); /* トップの主記事 */

  --wrap: 1320px;
  --gutter: 16px;
}

[data-field="med"] { --field: var(--field-med); --field-wash: #f7eaea; --field-tint: #f5dcdd; }
[data-field="den"] { --field: var(--field-den); --field-wash: #e5f1f2; --field-tint: #d3eaec; }
[data-field="vet"] { --field: var(--field-vet); --field-wash: #eaf2e7; --field-tint: #dbebd5; }
[data-field="other"] { --field: var(--field-other); --field-wash: #ebedf3; --field-tint: #dfe2eb; }

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

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

/* 中身の短いページでも、フッターを画面の下端に置く */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-m);
  line-height: 1.75;
  overflow-wrap: anywhere;
}

img { max-width: 100%; height: auto; display: block; }

/* display を指定した部品でも、hidden を付けたら隠す（絞り込みで使う） */
[hidden] { display: none !important; }

/* 見出しは語の途中で折り返さない（対応していないブラウザでは通常の折り返し） */
h1, h2, h3 {
  word-break: auto-phrase;
  text-wrap: pretty;
}
/* 大きく出すタイトルは、<wbr> の位置でだけ折り返す。本番では表示時に文節で <wbr> を入れる（BudouX など） */
.title-main, .title-sub { word-break: keep-all; }

a { color: var(--brand); text-underline-offset: 0.2em; }
a:hover { color: var(--brand-dark); }

:focus-visible {
  outline: 3px solid #f2a900;
  outline-offset: 2px;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- 試作であることの表示 ---------- */
.sample-banner {
  background: #303846;
  color: #fff;
  font-size: var(--fs-s);
  line-height: 1.6;
  padding: 6px 0;
}
/* プレビューで、プルリクエストの記事を番号順に見て回る欄（SiteLayout.astro）。白地に近い灰色で、記事より先に読む */
.review-band { background: var(--wash); color: var(--ink); font-size: var(--fs-m); line-height: 1.7; padding: 14px 0 16px; }
.review-band[hidden], .review-band-bottom[hidden] { display: none; }
.review-band .review-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.review-band .review-count { font-size: var(--fs-xl); font-weight: 700; margin-right: 4px; }
.review-band .review-version { font-size: var(--fs-s); color: var(--ink-2); }
.review-band .review-kind { font-weight: 700; margin-right: auto; }
.review-band .review-steps { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; }
.review-band .review-step { display: block; text-align: center; padding: 6px 14px; border: 1px solid var(--table-line); border-radius: 6px; background: var(--paper); color: var(--ink); text-decoration: none; font-weight: 700; }
.review-band .review-step:hover { background: var(--wash-2); }
.review-band .review-step[aria-disabled="true"] { color: var(--ink-3); font-weight: 400; }
.review-band select { font: inherit; font-size: var(--fs-s); padding: 6px 8px; border: 1px solid var(--table-line); border-radius: 6px; background: var(--paper); color: var(--ink); max-width: 100%; }
.review-band .review-next { margin-top: 6px; color: var(--ink-2); font-size: var(--fs-s); }
.review-band .review-notes { display: grid; gap: 10px; margin-top: 12px; max-width: var(--measure); }
.review-band details, .review-band .review-none { background: var(--paper); border-radius: 6px; padding: 10px 14px; }
.review-band summary { cursor: pointer; font-weight: 700; }
.review-band ul { margin: 6px 0 0; padding-left: 1.3em; }
.review-band li + li { margin-top: 6px; }
.review-band-bottom { margin-top: 40px; }
/* スマホ：番号と種類の行、前後のボタンの行、番号を選ぶ欄の行に分ける */
@media (max-width: 767px) {
  .review-band .review-steps, .review-band select { flex: 1 0 100%; }
}

/* ---------- ヘッダー ---------- */
/* 白地。1行目にロゴ・広告の表示・検索、2行目に学部とテーマのナビ。下に灰色の細い線 */
.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.header-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "brand notice tools";
  align-items: center;
  gap: 8px 24px;
  padding-top: 16px;
  padding-bottom: 14px;
}

.brand {
  grid-area: brand;
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--ink-2);
  text-decoration: none;
}
.brand-logo { width: 220px; height: auto; }


/* サイト全体の広告表示：ロゴと同じ行の右側。日付などと同じ大きさ・濃さで、強調はしない */
.site-notice {
  grid-area: notice;
  margin: 0;
  text-align: right;
  font-size: var(--fs-s);
  color: var(--ink-2);
  line-height: 1.6;
  word-break: keep-all;
}
.site-notice a { color: var(--ink-2); margin-left: 0.5em; white-space: nowrap; }

.header-tools { grid-area: tools; }

.search-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: var(--wash);
  color: var(--ink-2);
  font: inherit;
  font-size: var(--fs-s);
  padding: 7px 14px;
  text-decoration: none;
}
.search-link:hover { background: var(--wash-2); color: var(--ink); }
.search-link svg { width: 16px; height: 16px; }

/* ナビ：学部とテーマは種類が違うので、見た目を分ける。
   学部は分野の色の面を持つ入口として左に、テーマは学部をまたぐ文字のリンクとして右に置く */
.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 32px;
  padding-bottom: 14px;
}
.site-nav ul { display: flex; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.site-nav a { display: block; text-decoration: none; white-space: nowrap; }

.site-nav .nav-fields { gap: 6px; }
.nav-fields a {
  padding: 8px 18px;
  background: var(--field-tint);
  color: var(--field);
  font-weight: 700;
}
.nav-fields a:hover { background: var(--field); color: #fff; }
.nav-fields a[aria-current="page"] { background: var(--field); color: #fff; }

.site-nav .nav-topics { gap: 2px 22px; }
.nav-topics a { padding: 6px 0; color: var(--ink-2); }
.nav-topics a:hover { color: var(--brand); text-decoration: underline; }
.nav-topics a[aria-current="page"] { color: var(--ink); font-weight: 700; }

/* ---------- 共通の部品 ---------- */
.field-name {
  color: var(--field);
  font-weight: 700;
  text-decoration: none;
}
a.field-name:hover { text-decoration: underline; }

.section { padding: 72px 0 0; }
.section.is-first { padding-top: 36px; }

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
}
/* 節の見出しは、中の小見出し（18px）や一覧の文字との差がはっきり出る大きさにする */
.section-title h2 {
  margin: 0;
  font-size: 1.75rem;
  line-height: 1.35;
  letter-spacing: 0.02em;
}
.section-title a { font-size: var(--fs-s); white-space: nowrap; }

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--ink-2);
  font-size: var(--fs-s);
  line-height: 1.7;
}

/* ---------- 記事の一覧（画像がない記事は、文字だけで並べる） ---------- */
.story-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 48px;
}

.story { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.story.has-image { grid-template-columns: 160px minmax(0, 1fr); }
.story .picture { aspect-ratio: 3 / 2; background: var(--wash); overflow: hidden; }
.story .picture img { width: 100%; height: 100%; object-fit: cover; }

.story h3 {
  margin: 0 0 6px;
  font-size: var(--fs-m);
  line-height: 1.65;
}
.story h3 a { color: var(--ink); text-decoration: none; }
.story h3 a:hover { color: var(--brand); text-decoration: underline; }

/* 学部から探す */
.field-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}

.field-column-head { margin-bottom: 14px; }
.field-column-head h3 { margin: 0; font-size: var(--fs-xl); line-height: 1.3; }
.field-column-head h3 a { color: var(--field); text-decoration: none; }
.field-column-head h3 a:hover { text-decoration: underline; }
.field-column-head p { margin: 0; font-size: var(--fs-s); color: var(--ink-2); }

.guide-link {
  display: block;
  margin: 0 0 14px;
  padding: 14px 16px;
  background: var(--field-wash);
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  line-height: 1.6;
}
.guide-link small { display: block; font-weight: 400; color: var(--ink-2); font-size: var(--fs-s); }
.guide-link:hover { color: var(--field); }

.compact-list { list-style: none; margin: 0; padding: 0; }
.compact-list li { padding: 11px 0; border-bottom: 1px solid var(--rule); }
.compact-list li:first-child { padding-top: 0; }
.compact-list a {
  display: block;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.65;
}
.compact-list a:hover { color: var(--brand); text-decoration: underline; }
.compact-list time { display: block; color: var(--ink-2); font-size: var(--fs-s); }

/* 目的から探す：箱にせず、見出しと説明の組を2列に並べる */
.purpose-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 48px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.purpose-list a {
  font-size: var(--fs-l);
  font-weight: 700;
}
.purpose-list p { margin: 4px 0 0; color: var(--ink-2); max-width: 30em; }

/* 新着・更新：1行おきに地の色を変える */
.update-list { list-style: none; margin: 0; padding: 0; }
.update-list li {
  display: grid;
  grid-template-columns: 9.5em 3em 7em minmax(0, 1fr);
  align-items: baseline;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
}
.update-list time { color: var(--ink-2); font-size: var(--fs-s); font-variant-numeric: tabular-nums; }
.update-kind { font-size: var(--fs-s); color: var(--ink-2); }
.update-kind.is-updated { color: var(--brand); font-weight: 700; }
.update-list .field-name { font-size: var(--fs-s); }
.update-list a.title { color: var(--ink); text-decoration: none; }
.update-list a.title:hover { color: var(--brand); text-decoration: underline; }

/* ---------- フッター ---------- */
body > main { flex: 1 0 auto; }
.site-footer {
  margin-top: 96px;
  background: #253041;
  color: #d5dbe4;
  font-size: var(--fs-s);
  padding: 44px 0 28px;
}
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) repeat(2, minmax(0, 1fr));
  gap: 32px;
}
.footer-logo { width: 200px; height: auto; }
.footer-brand p { margin: 8px 0 0; color: #c3ccd8; max-width: 26em; }
.site-footer h2 { margin: 0 0 8px; font-size: var(--fs-s); color: #fff; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li + li { margin-top: 4px; }
.footer-note { margin: 32px 0 0; color: #c3ccd8; font-size: var(--fs-s); }
.footer-note + .footer-note { margin-top: 4px; }
.footer-note + .footer-bottom { margin-top: 8px; }
.footer-bottom { margin: 32px 0 0; color: #c3ccd8; }

/* ---------- 記事ページ ---------- */
.breadcrumb { padding-top: 18px; font-size: var(--fs-s); }
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--ink-2);
}
.breadcrumb li + li::before { content: "›"; margin-right: 4px; }
.breadcrumb a { color: var(--ink-2); }

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 960px) 260px; /* 本文と見出しは --measure（48字）で止め、広げた分は表や図が使う */
  justify-content: space-between;
  gap: 56px;
  padding-top: 20px;
}

.article { position: relative; min-width: 0; }

/* 固定ページ（広告掲載について など）：右の列を持たない1列 */
.page { max-width: 700px; padding-top: 20px; }
.page-wide { max-width: 800px; }
.page-title { margin: 4px 0 20px; font-size: var(--fs-2xl); line-height: 1.35; }

/* 学部ページ */
.guide-link-large { padding: 18px 20px; font-size: var(--fs-l); }

/* ロゴの横に学部名を並べ、「進学スコープ 獣医学部」と読ませる。学部の中のページだけに出す */
.brand-section {
  color: var(--field);
  font-size: var(--fs-xl);
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  padding-top: 4px; /* ロゴの文字の下端にそろえる */
}
.brand-section:hover { color: var(--field); text-decoration: underline; }

/* 学部の最初の面：学部の学生の写真を横いっぱいに敷き、左側を白くぼかして、学部名と説明を写真の上に載せる。
   写真のどこを中心に切り抜くかは --focus（object-position）。写真は主役が中央から右寄りのものを使う */
.faculty-hero-stage { position: relative; }
.faculty-hero-photo {
  width: 100%;
  aspect-ratio: 12 / 5;
  max-height: 520px;
  object-fit: cover;
  object-position: var(--focus, 50% 50%);
  background: var(--field-wash);
}
.faculty-hero-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.86) 34%, rgba(255, 255, 255, 0) 64%);
  pointer-events: none;
}
.faculty-hero-over {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
}
.faculty-hero-panel { max-width: 560px; }
.faculty-hero .breadcrumb { padding-top: 0; margin-bottom: 14px; }
.faculty-hero h1 {
  margin: 0;
  font-size: var(--fs-display);
  line-height: 1.2;
  color: var(--field);
  letter-spacing: 0.02em;
}
.faculty-lead { margin: 10px 0 0; font-size: var(--fs-l); max-width: 24em; word-break: keep-all; }

/* めざせる仕事：学科の節へのリンクを並べる */
.faculty-jobs { margin: 22px 0 0; }
.faculty-jobs p { margin: 0 0 4px; font-size: var(--fs-s); color: var(--ink-2); }
.faculty-jobs ul { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0; padding: 0; list-style: none; }
.faculty-jobs a { color: var(--ink); font-size: var(--fs-l); font-weight: 700; text-decoration-color: var(--rule); }
.faculty-jobs a:hover { color: var(--field); text-decoration-color: currentColor; }

/* 学科とめざせる仕事：学科ごとに、名前・年数・説明・記事への入口 */
.dept-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16em, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.dept-list > li { background: var(--wash); padding: 20px 22px 18px; scroll-margin-top: 16px; }
.dept-name { margin: 0; font-size: var(--fs-s); color: var(--ink-2); }
.dept-list h3 { margin: 2px 0 8px; color: var(--field); font-size: var(--fs-xl); line-height: 1.4; }
.dept-list p { margin: 0; }
.dept-list .more { display: block; width: fit-content; margin-top: 10px; font-size: var(--fs-s); }
.dept-schools { display: block; width: fit-content; margin-top: 12px; font-weight: 700; }
.dept-schools + .dept-schools { margin-top: 4px; }
.dept-schools + .more { margin-top: 6px; }

/* 学部の中で探す：ページ内の節へのリンク */
.faculty-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
  margin: 0;
  padding: 18px 0 0;
  list-style: none;
}
.faculty-jump a { color: var(--ink); font-weight: 700; }
.faculty-jump a:hover { color: var(--field); }

/* まず読む：受験ガイドを大きく、基本の記事を横に3つ */
.first-reads {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 32px;
  align-items: start;
}
.first-reads .guide-link { margin: 0; }
.first-reads .compact-list li:first-child { padding-top: 0; }

/* テーマごとの記事：2列に並べ、各テーマの一覧への入口を最後に置く */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 44px 48px;
}
.topic-grid h3 { margin: 0 0 12px; font-size: var(--fs-l); line-height: 1.4; }
.topic-grid .more { display: inline-block; margin-top: 12px; font-size: var(--fs-s); }
.section[id], .topic-grid section[id] { scroll-margin-top: 16px; }

/* 大学から探す：設置者ごとに、大学名を詰めて並べる */
/* 設置者（私立・国立・公立）ごとのまとまり：見出しを薄い地の帯にして、まとまりの間を広く空ける */
.school-groups { display: grid; gap: 40px; }
.school-groups h3 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 4px;
  padding: 10px 14px;
  background: var(--wash);
  font-size: var(--fs-l);
  line-height: 1.4;
}
.school-groups h3 span { font-weight: 400; color: var(--ink-2); font-size: var(--fs-s); }
.school-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13em, 1fr));
  gap: 0 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.school-list li { border-bottom: 1px solid var(--rule); }
/* 詳しい記事がある学校だけリンク（青と下線）。ない学校は黒い文字で、押せるように見せない */
.school-list li > * { display: block; padding: 9px 0; }
.school-list span { color: var(--ink); }
.school-list a { color: var(--brand); text-decoration: underline; text-decoration-thickness: 1px; }
.school-list a:hover { color: var(--brand-dark); }
.school-list small { color: var(--ink-2); font-size: var(--fs-s); margin-left: 4px; }
.school-note { margin: 4px 0 0; font-size: var(--fs-s); color: var(--ink-2); }
/* 職種ごとの学校の一覧のページ：数が多いので、種類と都道府県で絞り込み、地方 → 都道府県の順に並べる */
.list-page { max-width: 960px; padding-top: 20px; }
.list-lead { margin: 0 0 20px; max-width: 40em; color: var(--ink-2); }
.list-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 14px 16px;
  background: var(--wash);
}
.list-tools .filter-list { margin: 0; }
.list-tools .filter-list button { background: var(--paper); }
.list-tools .filter-list button span { margin-left: 6px; color: inherit; opacity: 0.75; }
.list-tools .filter-list button[aria-pressed="true"] { background: var(--ink); }
.pref-select select {
  padding: 7px 10px;
  border: 1px solid #a9b3c1; /* 入力欄の枠 */
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: var(--fs-s);
}
.list-result { margin: 0; font-size: var(--fs-s); color: var(--ink-2); }
.list-note { margin: 8px 0 0; font-size: var(--fs-s); color: var(--ink-2); }
.school-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; }
.school-tools .filter-list { margin: 0; }
/* 詳しい記事がある学校だけに絞り込む */
.article-only { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-s); cursor: pointer; }
.article-only input { width: 16px; height: 16px; margin: 0; accent-color: var(--brand); }
.article-only:has(input:disabled) { color: var(--ink-3); cursor: default; }
.school-tools { margin: 0 0 18px; }
.school-tools .filter-list button { background: var(--wash); }
.school-tools .filter-list button[aria-pressed="true"] { background: var(--ink); }
.region-jump { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 16px 0 0; padding: 0; list-style: none; font-size: var(--fs-s); }
.region { padding-top: 40px; scroll-margin-top: 8px; }
.region h2 { margin: 0 0 4px; padding-bottom: 10px; border-bottom: 1px solid var(--rule); font-size: 1.5rem; line-height: 1.4; }
.pref { padding-top: 18px; }
.pref h3 { margin: 0 0 6px; font-size: var(--fs-m); line-height: 1.4; }
.pref-count { margin-left: 8px; font-weight: 400; font-size: var(--fs-s); color: var(--ink-2); }
.school-rows {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.school-rows li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
}
.school-rows li > :first-child { min-width: 0; color: var(--ink); }
.school-rows a .school-name { color: var(--brand); text-decoration: underline; text-decoration-thickness: 1px; }
.school-rows a { text-decoration: none; }
.school-rows a:hover .school-name { color: var(--brand-dark); }
.school-rows small { display: block; color: var(--ink-2); font-size: var(--fs-s); line-height: 1.5; }
.school-type { flex: none; font-size: var(--fs-s); color: var(--ink-2); }
/* 都道府県から探す（数の多い一覧だけ）：地方ごとの行に都道府県のボタンと校数 */
.pref-grid { margin-top: 28px; }
.pref-grid h2 { margin: 0 0 12px; font-size: var(--fs-l); }
.pref-grid-row {
  display: grid;
  grid-template-columns: 7em minmax(0, 1fr);
  align-items: baseline;
  gap: 4px 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
}
.pref-grid-row > span { font-size: var(--fs-s); font-weight: 700; color: var(--ink-2); }
.pref-grid ul { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.pref-grid button {
  border: 0;
  padding: 5px 10px;
  background: var(--wash);
  color: var(--ink);
  font: inherit;
  font-size: var(--fs-s);
  cursor: pointer;
}
.pref-grid button span { margin-left: 6px; color: var(--ink-2); }
.pref-grid button:hover { background: var(--wash-2); }
.pref-grid button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.pref-grid button[aria-pressed="true"] span { color: inherit; opacity: 0.75; }
.pref { scroll-margin-top: 12px; }
/* 条件に合う学校が0校のボタンは押せない形にする */
.list-tools button:disabled, .pref-grid button:disabled { background: transparent; color: var(--ink-3); cursor: default; }
.pref-grid button:disabled span { color: inherit; }
.list-sources { margin-top: 56px; }
.list-sources a { word-break: break-all; }
.list-sources summary { cursor: pointer; font-size: var(--fs-s); color: var(--brand); margin-bottom: 8px; }

/* 学科ごとの大学の一覧のページ：題の横に校数 */
.page-count { margin-left: 12px; font-size: var(--fs-m); font-weight: 400; color: var(--ink-2); }

/* テーマで絞り込む */
.filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
}
.filter-list button {
  border: 0;
  padding: 7px 14px;
  background: var(--wash);
  color: var(--ink);
  font: inherit;
  font-size: var(--fs-s);
  cursor: pointer;
}
.filter-list button:hover { background: var(--wash-2); }
.filter-list button[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* 記事の一覧（題名・説明・日付） */
.article-list { list-style: none; margin: 0; padding: 0; }
.article-list > li { padding: 18px 0; border-bottom: 1px solid var(--rule); }
.article-list h3 { margin: 0 0 4px; font-size: var(--fs-l); line-height: 1.6; }
.article-list h3 a { color: var(--ink); text-decoration: none; }
.article-list h3 a:hover { color: var(--brand); text-decoration: underline; }
.article-list p { margin: 0 0 6px; color: var(--ink-2); max-width: 40em; }
.article-list mark { background: var(--marker); color: inherit; padding: 0 1px; }

/* 検索 */
.search-form { display: flex; gap: 8px; margin-bottom: 28px; }
.search-form input {
  flex: 1;
  min-width: 0;
  padding: 11px 14px;
  border: 1px solid #a9b3c1; /* 入力欄の枠 */
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: var(--fs-m);
}
.search-form button {
  border: 0;
  padding: 11px 22px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.search-form button:hover { background: var(--brand-dark); }
.search-summary { margin: 0 0 4px; font-size: var(--fs-m); }
.search-empty { padding: 20px 0; }
.search-empty p { margin: 0 0 14px; color: var(--ink-2); }
.search-fields { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.search-fields a { display: block; text-decoration: none; }

.article-header { padding-bottom: 8px; }

.article-header h1 {
  margin: 8px 0 18px;
  line-height: 1.3;
}
/* 主題を大きく、副題は一段小さく細くして主題との差をつける */
.article-header .title-main { display: block; font-size: var(--fs-title); letter-spacing: .01em; }
.article-header .title-sub {
  display: block;
  margin-top: 10px;
  font-size: var(--fs-l);
  font-weight: 400;
  color: var(--ink-2);
  line-height: 1.6;
}
/* 記事の頭の画像：画像の下にタイトルを置き、画像とタイトルを本文の1行と同じ幅にそろえる。画像は共有のときの画像と同じ 1.91:1 */
.article-header.has-image { max-width: var(--measure); }
.article-header.has-image h1 { margin-top: 24px; }
.lead-photo { margin: 0; }
.lead-photo img { display: block; width: 100%; height: auto; aspect-ratio: 1.91 / 1; object-fit: cover; background: var(--wash); }
.lead-photo figcaption { margin-top: 6px; font-size: var(--fs-s); color: var(--ink-3); }

.article-header .description {
  margin: 0 0 16px;
  font-size: var(--fs-l);
  max-width: 38em;
}

/* 広告を含む記事だけに出す。日付と同じ大きさ・同じ色で、目立たせず小さくもしない */
.promotion-note { color: var(--ink-2); }

/* 本文 */
.prose {
  font-size: var(--fs-l);
  line-height: 1.95;
}
.prose > * { margin-top: 0; margin-bottom: 1.4em; }
.prose p, .prose > ul, .prose > ol, .prose h2, .prose h3 { max-width: var(--measure); }
/* 本文も語の途中で折り返さない（auto-phrase。対応していないブラウザでは通常の折り返し） */
.prose p, .prose li { word-break: auto-phrase; text-wrap: pretty; }

/* 見出しは2段。大きい段は薄い背景の帯、小さい段は下に灰色の細い線を引く（色の線や飾りは使わない。線はデザインの決まりで見出しの下に使ってよい灰色の線） */
.prose h2 {
  margin: 2.6em 0 1em;
  padding: 10px 16px;
  background: var(--wash);
  font-size: var(--fs-xl);
  line-height: 1.45;
  scroll-margin-top: 16px;
}
.prose h3 {
  margin: 2em 0 0.8em;
  padding: 0 0 6px 2px;
  border-bottom: 1px solid var(--rule);
  font-size: 1.25rem;
  line-height: 1.5;
  scroll-margin-top: 16px;
}
.prose h2 + h3 { margin-top: 1.2em; }

.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.35em; }

.prose mark {
  /* 蛍光ペンで引いたように、字の下半分だけ。読者が持ち帰る結論の1文だけに使う（article-types/visuals.md） */
  background: linear-gradient(transparent 55%, var(--marker) 55%);
  color: inherit;
  padding: 0 1px;
}

/* まだない記事への案内。地の文に混ざらないようリンクと同じ青にするが、開く先がないので下線を引かずリンクにもしない */
.link-pending { color: var(--brand); }

/* 太字は表の赤字と同じ色。過去問集の「無料」のように、ほかと明らかに違う1項目だけに使う（article-types/visuals.md） */
.prose strong { color: #b42318; font-weight: 700; }

.prose sup a {
  text-decoration: none;
  font-size: 0.75em;
  padding: 0 2px;
}

/* この記事でわかること */
.summary {
  background: var(--field-wash);
  padding: 18px 22px 20px;
  margin: 20px 0 32px;
}
.summary h2 { margin: 0 0 8px; font-size: var(--fs-m); }
.summary ul { margin: 0; padding-left: 1.2em; line-height: 1.8; }

/* 目次：順番は並びで分かるので番号は付けない */
.toc h2 { margin: 0 0 8px; font-size: var(--fs-m); }
.toc ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.toc a {
  display: block;
  padding: 5px 0;
  color: var(--ink-2);
  text-decoration: none;
  line-height: 1.6;
}
.toc a:hover { color: var(--brand); text-decoration: underline; }
/* 小さい段の見出しは、属する大きい段の下に字下げして小さく並べる */
.toc ol ol { gap: 0; padding: 0 0 4px 1em; }
.toc ol ol a { padding: 3px 0; font-size: var(--fs-s); }

.toc-inline {
  display: none;
  background: var(--wash);
  margin-bottom: 32px;
}
.toc-inline summary {
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
}
.toc-inline .toc { padding: 0 16px 14px; }

/* 手順：本当に順番があるものだけ */
.steps {
  list-style: none;
  padding: 0 !important;
  counter-reset: step;
}
.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 0 48px;
  margin: 0 0 20px !important;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 0.1em;
  width: 32px; height: 32px;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #fff;
  border-radius: 50%;
  font-size: var(--fs-m);
  font-weight: 700;
  line-height: 1;
}
.steps strong { display: block; }
.steps span { display: block; font-size: var(--fs-m); color: var(--ink-2); line-height: 1.8; }

/* 比較表：線を使うのはここだけ */
.table-block { margin-bottom: 1.8em; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll:focus-visible { outline-offset: 2px; }
.table-block table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-s); /* 表は本文より一段小さく、幅を決め打ちしない（スマホで横に流れないように） */
  line-height: 1.7;
}
.table-block caption {
  caption-side: top;
  text-align: left;
  font-weight: 700;
  padding: 0 0 8px;
}
.table-block th, .table-block td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--table-line); /* taste-skill-ignore 表の罫線 */
  text-align: left;
  vertical-align: top;
}
.table-block thead th {
  background: var(--wash-2);
  font-weight: 700;
  border-bottom: 0;
}
.table-block tbody th { background: var(--wash); }
.nw { white-space: nowrap; } /* 語の途中で改行しない句（render-article.mjs の phrases） */
.table-block .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-note { margin: 8px 0 0; font-size: var(--fs-s); color: var(--ink-2); }
.scroll-hint { display: none; margin: 0 0 6px; font-size: var(--fs-s); color: var(--ink-2); }

/* 画像とキャプション */
.figure { margin: 0 0 1.8em; }
.figure img { width: 100%; }
.figure figcaption { margin-top: 8px; font-size: var(--fs-s); color: var(--ink-2); line-height: 1.7; }

/* 補足 */
.note {
  background: var(--brand-wash);
  padding: 16px 20px;
  font-size: var(--fs-m);
  line-height: 1.85;
}
.note-title { display: block; font-weight: 700; margin-bottom: 4px; color: var(--brand-dark); }
.note p { margin: 0; }
.note p + p { margin-top: 6px; }

/* 運営者情報などの項目と中身の組 */
.page-facts { display: grid; grid-template-columns: 7em 1fr; max-width: 42em; }
.page-facts dt, .page-facts dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.page-facts dt { font-weight: 700; }
.page-facts dd { overflow-wrap: anywhere; }

/* 引用 */
.quote {
  margin-left: 0;
  margin-right: 0;
  padding: 14px 18px;
  background: var(--wash);
  font-size: var(--fs-m);
}
.quote p { margin: 0 0 6px; }
.quote footer { font-size: var(--fs-s); color: var(--ink-2); }

/* 動画 */
.video { margin: 0 0 1.8em; }
.video-frame {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  background: #000;
}
.video-frame iframe { width: 100%; height: 100%; border: 0; }
/* 埋め込みを表示できないときは、黒い大きな枠を出さずにリンクだけにする */
.video-frame.is-unavailable {
  aspect-ratio: auto;
  background: var(--wash);
  color: var(--ink-2);
  text-align: center;
  padding: 28px 16px;
}
.video-frame p { margin: 0 0 6px; font-size: var(--fs-m); }
.video figcaption { margin-top: 8px; font-size: var(--fs-s); color: var(--ink-2); }

/* 広告枠 */
.ad-slot { margin: 2.2em 0; text-align: center; }
.ad-slot .ad-label { display: block; font-size: var(--fs-s); color: var(--ink-2); margin-bottom: 4px; }
.ad-slot .ad-box {
  min-height: 250px;
  max-width: 336px;
  margin: 0 auto;
  background: var(--wash);
  display: grid;
  place-items: center;
  color: var(--ink-2);
  font-size: var(--fs-s);
}

/* 紹介・相談の導線（広告） */
.cta {
  background: var(--wash);
  margin: 2.2em 0;
  padding: 18px 20px 20px;
}
.cta-label {
  margin: 0 0 6px;
  font-size: var(--fs-s);
  color: var(--ink-2);
}
.cta-label strong { color: var(--ink); margin-right: 8px; }
.cta h3 {
  margin: 0 0 6px !important;
  font-size: var(--fs-xl);
}
.cta p { margin: 0 0 16px; font-size: var(--fs-m); line-height: 1.8; }
.cta-button {
  display: inline-block;
  padding: 13px 26px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: var(--fs-m);
  text-decoration: none;
}
.cta-button:hover { background: var(--brand-dark); color: #fff; }
.cta-after { display: block; margin-top: 8px; font-size: var(--fs-s); color: var(--ink-2); }
/* リンクのカード：URL を1行で書くと、リンク先の題名と画像で出す。横長の画像（OGP）も本の表紙と同じく左に小さく置く */
.link-card {
  display: flex;
  max-width: var(--measure);
  margin: 1.2em 0;
  border: 1px solid var(--table-line);
  color: var(--ink);
  text-decoration: none;
  background: var(--paper);
}
.link-card:hover { border-color: var(--brand); }
.link-card:hover .link-card-title { color: var(--brand); text-decoration: underline; }
.link-card-image { flex: none; display: grid; place-items: center; background: var(--wash); }
.link-card-image img { display: block; }
.link-card.is-side .link-card-image { width: 140px; padding: 12px; }
.link-card.is-side .link-card-image img { width: 100%; height: auto; max-height: 180px; object-fit: contain; }
.link-card.is-large .link-card-image { width: 200px; }
.link-card.is-large .link-card-image img { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; }
@media (max-width: 520px) {
  .link-card.is-side .link-card-image { width: 104px; padding: 10px; }
  .link-card.is-large .link-card-image { width: 120px; }
}
.link-card-body { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; min-width: 0; }
.link-card-title { font-weight: 700; font-size: var(--fs-m); line-height: 1.6; }
.link-card-description { font-size: var(--fs-s); color: var(--ink-2); line-height: 1.6; }
.link-card-site { margin-top: auto; font-size: var(--fs-s); color: var(--ink-3); }
.promotion-note .pr-label { margin-right: 8px; color: var(--ink); }

/* 出典 */
.sources { margin-top: 3.2em; }
/* 出典は長くなるので折りたたんで置く。見出しを押すと開く */
.sources > summary { cursor: pointer; width: fit-content; }
.sources > summary h2 {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  font-size: var(--fs-m);
}
.sources[open] > summary { margin-bottom: 8px; }
.sources ol { margin: 0; padding-left: 1.6em; font-size: var(--fs-s); line-height: 1.8; }
.sources li + li { margin-top: 6px; }
.sources .checked { color: var(--ink-2); }

/* 執筆・編集 */
.byline-box {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 16px;
  padding: 20px;
  background: var(--wash);
  margin-top: 2em;
  font-size: var(--fs-m);
}
.byline-mark { width: 56px; height: 56px; }
.byline-box h2 { margin: 0 0 4px; padding: 0; border: 0; font-size: var(--fs-m); }
.byline-box p { margin: 0; color: var(--ink-2); line-height: 1.8; }

/* 関連記事 */
.related { margin-top: 3.5em; }
.related h2 { margin: 0 0 16px; font-size: var(--fs-xl); }

/* サイド */
/* 目次が画面より長いときは、サイドの中でスクロールさせる（下が画面の外に切れないように） */
.side-sticky {
  position: sticky; top: 20px; display: grid; gap: 28px;
  max-height: calc(100vh - 40px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
}
.toc a[aria-current="location"] { color: var(--brand); font-weight: 700; }
.side-box h2 { margin: 0 0 8px; font-size: var(--fs-m); }
.side-box .guide-link { font-size: var(--fs-s); }

/* ---------- 画面の幅ごとの調整 ---------- */
@media (max-width: 960px) {
  .field-columns { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .faculty-hero-photo { aspect-ratio: 16 / 9; }
  .first-reads { grid-template-columns: minmax(0, 1fr); gap: 20px; }

  .article-layout { grid-template-columns: minmax(0, 1fr); }
  .article-side { display: none; }
  .toc-inline { display: block; }
}

@media (max-width: 720px) {
  .site-nav { gap: 8px; }
  .site-nav .nav-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  .nav-fields a { padding: 8px 6px; text-align: center; }
  .site-nav .nav-topics { gap: 0 18px; }
  .nav-topics a { font-size: var(--fs-s); }

  .story-list { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .story.has-image { grid-template-columns: 112px minmax(0, 1fr); }
  .purpose-list { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .prose { font-size: var(--fs-m); line-height: 1.9; }
  .prose h2 { padding: 8px 12px; font-size: 1.25rem; }
  .prose h3 { font-size: 1.125rem; }
  .update-list li {
    grid-template-columns: auto auto minmax(0, 1fr);
    gap: 2px 10px;
  }
  .update-list li .title { grid-column: 1 / -1; }
  .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .scroll-hint { display: block; }
  .search-link .search-text { display: none; }
  .brand-logo { width: 180px; }
  .header-top {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "brand tools" "notice notice";
    gap: 6px 12px;
    padding-top: 12px;
    padding-bottom: 10px;
  }
  .site-notice { text-align: left; }
  .brand { gap: 10px; }
  .brand-section { font-size: var(--fs-l); padding-top: 2px; }
  .topic-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .section { padding-top: 56px; }
  .section-title h2 { font-size: 1.5rem; }
  /* 狭い画面では写真の上に文字を載せきれないので、写真の下を白くぼかし、文字は写真の下に置く */
  .faculty-hero-photo { aspect-ratio: 4 / 3; }
  .faculty-hero-stage::after { background: linear-gradient(0deg, #fff 0%, rgba(255, 255, 255, 0) 30%); }
  .faculty-hero-over { position: relative; display: block; margin-top: 12px; }
  .faculty-jump { padding: 12px 0 0; }
  .school-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
  .school-rows { grid-template-columns: minmax(0, 1fr); }
  .pref-grid-row { grid-template-columns: minmax(0, 1fr); }
  .list-tools { padding: 12px; }
  .pref-select, .pref-select select { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

@media print {
  .sample-banner, .review-band, .site-nav, .header-tools, .ad-slot, .article-side, .site-footer { display: none; }
}
