@charset "UTF-8";

/* ============================================================
   International Politics Review / 国際政治の友
   style.css
   ------------------------------------------------------------
   1. デザイントークン（色・書体・余白）
   2. リセットと基本タイポグラフィ
   3. レイアウト
   4. ヘッダー / ナビゲーション
   5. ヒーロー
   6. カード（記事一覧）
   7. 記事本文
   8. 用語集
   9. フォーム部品（検索・フィルタ）
   10. フッター
   11. ユーティリティ
   12. レスポンシブ
   13. 印刷
   ============================================================ */


/* ------------------------------------------------------------
   1. デザイントークン
   ------------------------------------------------------------ */

:root {
  /* 色 ── 生成りの紙に、藍と臙脂 */
  --bg:          #fbfaf7;
  --bg-alt:      #f3f0e9;
  --bg-sunken:   #ece8de;
  --surface:     #ffffff;

  --ink:         #1c2029;
  --ink-strong:  #0f1319;
  --muted:       #5d6472;
  --line:        #ddd7ca;
  --line-soft:   #eae5da;

  --accent:      #8c2f39;   /* 臙脂 */
  --accent-ink:  #6f242c;
  --accent-soft: #f4e9ea;
  --navy:        #23405f;   /* 藍 */
  --navy-soft:   #e7edf4;

  /* 書体 */
  --font-serif: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho",
                "Noto Serif JP", "Source Han Serif JP", "MS PMincho",
                Georgia, "Times New Roman", serif;
  --font-sans:  -apple-system, BlinkMacSystemFont, "Segoe UI",
                "Hiragino Kaku Gothic ProN", "Yu Gothic", "YuGothic",
                "Noto Sans JP", Meiryo, sans-serif;
  --font-mono:  "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  /* 寸法 */
  --wrap:       1120px;
  --wrap-read:  720px;
  --radius:     4px;
  --radius-lg:  8px;

  /* 影 */
  --shadow-sm: 0 1px 2px rgba(28, 32, 41, .06);
  --shadow-md: 0 2px 10px rgba(28, 32, 41, .08);
  --shadow-lg: 0 8px 30px rgba(28, 32, 41, .10);
}

/* ダークモード ── OS 設定を既定にしつつ、手動切替を優先 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:          #14171e;
    --bg-alt:      #1a1e27;
    --bg-sunken:   #10131a;
    --surface:     #1c212b;

    --ink:         #e6e4de;
    --ink-strong:  #f5f3ee;
    --muted:       #9aa2b2;
    --line:        #2e3542;
    --line-soft:   #262c37;

    --accent:      #d1707a;
    --accent-ink:  #e79aa2;
    --accent-soft: #2b2024;
    --navy:        #8fb2d8;
    --navy-soft:   #1d2733;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 2px 10px rgba(0, 0, 0, .45);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, .5);
  }
}

:root[data-theme="dark"] {
  --bg:          #14171e;
  --bg-alt:      #1a1e27;
  --bg-sunken:   #10131a;
  --surface:     #1c212b;

  --ink:         #e6e4de;
  --ink-strong:  #f5f3ee;
  --muted:       #9aa2b2;
  --line:        #2e3542;
  --line-soft:   #262c37;

  --accent:      #d1707a;
  --accent-ink:  #e79aa2;
  --accent-soft: #2b2024;
  --navy:        #8fb2d8;
  --navy-soft:   #1d2733;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 2px 10px rgba(0, 0, 0, .45);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, .5);
}


/* ------------------------------------------------------------
   2. リセットと基本タイポグラフィ
   ------------------------------------------------------------ */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.9;
  font-feature-settings: "palt" 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-serif);
  color: var(--ink-strong);
  line-height: 1.45;
  font-weight: 600;
  margin: 0 0 .6em;
  letter-spacing: .01em;
}

h1 { font-size: clamp(1.7rem, 1.2rem + 2vw, 2.6rem); }
h2 { font-size: clamp(1.35rem, 1.1rem + 1.1vw, 1.75rem); }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }

p { margin: 0 0 1.5em; }

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}
a:hover { color: var(--accent-ink); border-bottom-color: currentColor; }
a:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
  border-radius: 2px;
}

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

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 3rem 0;
}

blockquote {
  margin: 2rem 0;
  padding: .2rem 0 .2rem 1.4rem;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  font-family: var(--font-serif);
  font-size: 1.02rem;
}
blockquote p:last-child { margin-bottom: 0; }

ul, ol { margin: 0 0 1.6em; padding-left: 1.4em; }
li { margin-bottom: .5em; }

code {
  font-family: var(--font-mono);
  font-size: .9em;
  background: var(--bg-sunken);
  padding: .1em .35em;
  border-radius: 3px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 2em;
  font-size: .95rem;
}
th, td {
  border-bottom: 1px solid var(--line);
  padding: .7em .8em;
  text-align: left;
  vertical-align: top;
}
th {
  background: var(--bg-alt);
  font-family: var(--font-serif);
  font-weight: 600;
  white-space: nowrap;
}

::selection { background: var(--accent); color: #fff; }


/* ------------------------------------------------------------
   3. レイアウト
   ------------------------------------------------------------ */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 24px;
}

.wrap--read { max-width: var(--wrap-read); }

.section { padding: 4.5rem 0; }
.section--tight { padding: 3rem 0; }
.section--alt { background: var(--bg-alt); }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  padding-bottom: .8rem;
  border-bottom: 2px solid var(--ink-strong);
}
.section-head h2 { margin: 0; }
.section-head .section-head__more { font-size: .9rem; white-space: nowrap; }

.eyebrow {
  font-family: var(--font-sans);
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 .5rem;
  font-weight: 600;
}

.lede {
  font-size: 1.08rem;
  color: var(--muted);
  line-height: 1.95;
}

/* スキップリンク */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: .6rem 1rem;
  z-index: 200;
}
.skip-link:focus {
  left: 0;
  border-bottom: 0;
}


/* ------------------------------------------------------------
   4. ヘッダー / ナビゲーション
   ------------------------------------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  border-bottom: 0;
  color: var(--ink-strong);
  margin-right: auto;
}
.brand:hover { color: var(--ink-strong); border-bottom: 0; }

.brand__mark {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: -.04em;
}

.brand__text { display: flex; flex-direction: column; line-height: 1.25; }
.brand__ja {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: .04em;
}
.brand__en {
  font-size: .62rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav { display: flex; align-items: center; gap: .3rem; }

.nav a {
  color: var(--ink);
  font-size: .92rem;
  padding: .5rem .8rem;
  border-radius: var(--radius);
  border-bottom: 0;
}
.nav a:hover { background: var(--bg-alt); color: var(--accent); border-bottom: 0; }
.nav a[aria-current="page"] {
  color: var(--accent);
  font-weight: 600;
  background: var(--accent-soft);
}

.icon-btn {
  appearance: none;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1rem;
  line-height: 1;
  transition: background-color .15s ease, border-color .15s ease;
}
.icon-btn:hover { background: var(--bg-alt); border-color: var(--muted); }

.nav-toggle { display: none; }


/* ------------------------------------------------------------
   5. ヒーロー
   ------------------------------------------------------------ */

.hero {
  padding: 5rem 0 4rem;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(1200px 400px at 15% -10%, var(--navy-soft), transparent 65%),
    radial-gradient(900px 350px at 90% 0%, var(--accent-soft), transparent 60%);
}

.hero__inner { max-width: 780px; }

.hero h1 {
  font-size: clamp(2rem, 1.3rem + 3vw, 3.1rem);
  letter-spacing: .02em;
  margin-bottom: .3em;
}

.hero__sub {
  font-family: var(--font-sans);
  font-size: .78rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 1.6rem;
}

.hero__lede {
  font-size: 1.12rem;
  line-height: 2.05;
  color: var(--ink);
  max-width: 62ch;
}

.hero__actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.5rem;
  border-radius: var(--radius);
  font-size: .95rem;
  font-weight: 600;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, transform .1s ease;
}
.btn:hover {
  background: var(--accent-ink);
  border-color: var(--accent-ink);
  color: #fff;
  border-bottom-color: var(--accent-ink);
}
.btn:active { transform: translateY(1px); }

.btn--ghost { background: transparent; color: var(--accent); }
.btn--ghost:hover { background: var(--accent-soft); color: var(--accent-ink); }

/* 統計バー */
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
.stat__num {
  font-family: var(--font-serif);
  font-size: 1.9rem;
  color: var(--ink-strong);
  line-height: 1.2;
}
.stat__label { font-size: .8rem; color: var(--muted); letter-spacing: .05em; }


/* ------------------------------------------------------------
   6. カード（記事一覧）
   ------------------------------------------------------------ */

.grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--muted);
}

.card__tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .9rem; }

.tag {
  font-size: .7rem;
  letter-spacing: .06em;
  padding: .22em .7em;
  border-radius: 999px;
  background: var(--navy-soft);
  color: var(--navy);
  border: 1px solid transparent;
  white-space: nowrap;
}
.tag--accent { background: var(--accent-soft); color: var(--accent); }
a.tag:hover { border-color: currentColor; border-bottom-color: currentColor; }

.card__title {
  font-size: 1.16rem;
  margin: 0 0 .5rem;
  line-height: 1.55;
}
.card__title a { color: var(--ink-strong); border-bottom: 0; }
.card__title a:hover { color: var(--accent); border-bottom: 0; }

.card__meta {
  font-size: .8rem;
  color: var(--muted);
  margin: 0 0 .9rem;
  font-family: var(--font-serif);
}

.card__excerpt {
  font-size: .9rem;
  color: var(--muted);
  line-height: 1.85;
  margin: 0 0 1.2rem;
}

.card__foot {
  margin-top: auto;
  padding-top: .9rem;
  border-top: 1px solid var(--line-soft);
  font-size: .82rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
}

/* 準備中のカード */
.card--pending {
  border-style: dashed;
  background: transparent;
}
.card--pending:hover { transform: none; box-shadow: none; border-color: var(--line); }
.card--pending .card__title { color: var(--muted); }
.card--pending .tag { background: var(--bg-sunken); color: var(--muted); }

/* 特集カード（横長） */
.card--feature {
  grid-column: 1 / -1;
  flex-direction: row;
  gap: 2rem;
  align-items: center;
  background: var(--bg-alt);
}
.card--feature .card__body { flex: 1; }
.card--feature .card__title { font-size: 1.5rem; }
.card--feature .card__rank {
  flex: 0 0 auto;
  width: 130px;
  height: 130px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px dashed var(--accent);
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: .85rem;
  letter-spacing: .1em;
  text-align: center;
  padding: 1rem;
}


/* ------------------------------------------------------------
   7. 記事本文
   ------------------------------------------------------------ */

.breadcrumb {
  font-size: .8rem;
  color: var(--muted);
  padding: 1.2rem 0 0;
  margin: 0;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { margin: 0 .5em; opacity: .6; }

.article-header {
  padding: 2rem 0 2.5rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 3rem;
}
.article-header h1 { margin-bottom: .5rem; }
.article-header .article-header__sub {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--muted);
  margin-bottom: 1.2rem;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  font-size: .82rem;
  color: var(--muted);
}
.article-meta span::before { content: ""; }

/* 書誌情報ボックス */
.bookdata {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.6rem;
  margin: 0 0 2.5rem;
  font-size: .9rem;
}
.bookdata h2 {
  font-size: .75rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .9rem;
  font-family: var(--font-sans);
  font-weight: 700;
}
.bookdata dl {
  display: grid;
  grid-template-columns: 7em 1fr;
  gap: .45rem 1rem;
  margin: 0;
}
.bookdata dt { color: var(--muted); font-size: .85rem; }
.bookdata dd { margin: 0; }

/* 目次 */
.toc {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.2rem 1.5rem;
  margin: 0 0 3rem;
}
.toc h2 {
  font-size: .95rem;
  margin-bottom: .7rem;
  font-family: var(--font-sans);
  letter-spacing: .05em;
}
.toc ol { margin: 0; padding-left: 1.3em; font-size: .9rem; }
.toc li { margin-bottom: .35em; }
.toc a { color: var(--ink); }
.toc a:hover { color: var(--accent); }

/* 本文 */
.prose { font-size: 1.02rem; line-height: 2.05; }
.prose h2 {
  margin-top: 3.4rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--line);
}
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 2.4rem; color: var(--accent-ink); }
.prose ul, .prose ol { margin-bottom: 1.8em; }
.prose li { line-height: 1.95; }
.prose strong { color: var(--ink-strong); font-weight: 700; }

/* 用語リンク（本文中） */
.term {
  border-bottom: 1px dotted var(--navy);
  color: var(--navy);
  cursor: help;
}
.term:hover { background: var(--navy-soft); border-bottom-style: solid; }

/* 補足ボックス */
.callout {
  background: var(--navy-soft);
  border-radius: var(--radius-lg);
  padding: 1.3rem 1.6rem;
  margin: 2.5rem 0;
  font-size: .94rem;
  line-height: 1.9;
}
.callout h3 {
  margin: 0 0 .6rem;
  font-size: .95rem;
  color: var(--navy);
  font-family: var(--font-sans);
  letter-spacing: .05em;
}
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.callout--warn { background: var(--accent-soft); }
.callout--warn h3 { color: var(--accent); }

/* キーポイント */
.keypoints {
  counter-reset: kp;
  list-style: none;
  padding: 0;
  margin: 2rem 0 2.5rem;
}
.keypoints li {
  counter-increment: kp;
  position: relative;
  padding-left: 2.6rem;
  margin-bottom: 1rem;
}
.keypoints li::before {
  content: counter(kp);
  position: absolute;
  left: 0;
  top: .28em;
  width: 1.8rem;
  height: 1.8rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-serif);
  font-size: .85rem;
  line-height: 1;
}

/* 記事下ナビ */
.article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 3.5rem 0 0;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
.article-nav a {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1rem 1.2rem;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.article-nav a:hover { border-color: var(--accent); color: var(--accent); background: var(--bg-alt); }
.article-nav .article-nav__label {
  display: block;
  font-size: .72rem;
  letter-spacing: .12em;
  color: var(--muted);
  margin-bottom: .3rem;
}
.article-nav .article-nav__next { text-align: right; }


/* ------------------------------------------------------------
   8. 用語集
   ------------------------------------------------------------ */

.glossary-tools {
  position: sticky;
  top: 68px;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 1.2rem 0;
  margin-bottom: 2.5rem;
}

.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; }

.chip {
  appearance: none;
  cursor: pointer;
  font-family: inherit;
  font-size: .82rem;
  padding: .35rem .95rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  transition: all .15s ease;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.term-count { font-size: .82rem; color: var(--muted); margin: 0 0 1.5rem; }

.glossary-group { margin-bottom: 3rem; }
.glossary-group__head {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: var(--ink-strong);
  padding-bottom: .5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--accent);
  display: flex;
  align-items: baseline;
  gap: .8rem;
}
.glossary-group__head small {
  font-family: var(--font-sans);
  font-size: .72rem;
  letter-spacing: .12em;
  color: var(--muted);
  text-transform: uppercase;
}

.term-list { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }

.term-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.4rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.term-card:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.term-card:target { border-color: var(--accent); background: var(--accent-soft); }

.term-card h3 {
  font-size: 1.05rem;
  margin: 0 0 .15rem;
  color: var(--ink-strong);
}
.term-card .term-card__en {
  font-size: .78rem;
  color: var(--muted);
  font-style: italic;
  margin: 0 0 .7rem;
  letter-spacing: .02em;
}
.term-card p { font-size: .9rem; line-height: 1.85; margin: 0 0 .8rem; color: var(--ink); }
.term-card .term-card__see { font-size: .8rem; color: var(--muted); margin: 0; }

.no-results {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--muted);
  font-family: var(--font-serif);
}
.no-results[hidden] { display: none; }


/* ------------------------------------------------------------
   9. フォーム部品
   ------------------------------------------------------------ */

.search {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 480px;
}
.search input {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  padding: .7rem 1rem .7rem 2.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.search input::placeholder { color: var(--muted); opacity: .8; }
.search__icon {
  position: absolute;
  left: .9rem;
  color: var(--muted);
  pointer-events: none;
  font-size: .95rem;
  line-height: 1;
}


/* ------------------------------------------------------------
   9a. 合言葉ゲート（functions/_middleware.js が返すログイン画面で使用）
   ------------------------------------------------------------ */

html[data-admin-locked="1"] body > *:not(.gate) { display: none !important; }

.gate {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1000px 500px at 50% 0%, var(--navy-soft), transparent 70%),
    var(--bg);
}

.gate__box {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2.2rem 2rem;
  text-align: center;
}

.gate__mark {
  width: 52px;
  height: 52px;
  margin: 0 auto 1.2rem;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: 1rem;
  letter-spacing: -.04em;
}

.gate__box h1 { font-size: 1.2rem; margin-bottom: .4rem; }
.gate__box p { font-size: .85rem; color: var(--muted); line-height: 1.8; margin-bottom: 1.4rem; }

.gate__box input[type="password"],
.gate__box input[type="text"] {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 1.5rem;
  letter-spacing: .5em;
  text-align: center;
  padding: .7rem .5rem .7rem 1rem;
  margin-bottom: .9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink);
}
.gate__box input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.gate__box .btn { width: 100%; justify-content: center; }

.gate__msg { font-size: .82rem; min-height: 1.6em; margin: .9rem 0 0; }
.gate__msg[data-tone="warn"] { color: var(--accent); }
.gate__msg[data-tone="ok"] { color: var(--navy); }

.gate__code {
  width: 100%;
  font-family: var(--font-mono);
  font-size: .72rem;
  line-height: 1.6;
  text-align: left;
  letter-spacing: 0;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .7rem;
  margin: 1rem 0 .6rem;
  color: var(--ink);
  word-break: break-all;
  white-space: pre-wrap;
}

.gate__link {
  display: inline-block;
  margin-top: 1rem;
  font-size: .8rem;
  color: var(--muted);
}


/* ------------------------------------------------------------
   9b. 管理画面（admin.html でのみ使用）
   ------------------------------------------------------------ */

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}

.admin-preview {
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 1.8rem;
}

.field { margin-bottom: 1.4rem; }

.field > label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink-strong);
  margin-bottom: .35rem;
}

.field .hint {
  display: block;
  font-size: .76rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: .45rem;
}

.field input[type="text"],
.field input[type="date"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  font-family: inherit;
  font-size: .95rem;
  line-height: 1.8;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .6rem .8rem;
}
.field textarea { resize: vertical; min-height: 7rem; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field input:invalid:not(:placeholder-shown) { border-color: var(--accent); }

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0 1rem;
}

.admin-group {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.6rem;
  margin-bottom: 1.8rem;
  background: var(--surface);
}
.admin-group > h2 {
  font-size: 1rem;
  font-family: var(--font-sans);
  letter-spacing: .04em;
  padding-bottom: .5rem;
  margin-bottom: 1.2rem;
  border-bottom: 1px solid var(--line-soft);
}

.admin-actions {
  position: sticky;
  bottom: 0;
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding: 1rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  z-index: 20;
}

.btn--small { padding: .5rem 1rem; font-size: .85rem; }

.admin-status {
  font-size: .82rem;
  color: var(--muted);
  min-height: 1.5em;
  margin: .6rem 0 0;
}
.admin-status[data-tone="ok"] { color: var(--navy); }
.admin-status[data-tone="warn"] { color: var(--accent); }

.code-out {
  width: 100%;
  font-family: var(--font-mono);
  font-size: .78rem;
  line-height: 1.7;
  min-height: 9rem;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .8rem;
  color: var(--ink);
  white-space: pre;
  overflow: auto;
}

@media (max-width: 980px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-preview { position: static; max-height: none; }
}


/* ------------------------------------------------------------
   10. フッター
   ------------------------------------------------------------ */

.site-footer {
  background: var(--bg-sunken);
  border-top: 1px solid var(--line);
  padding: 3.5rem 0 2rem;
  margin-top: 5rem;
  font-size: .9rem;
}

.footer-grid {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: 1.6fr 1fr 1fr;
  margin-bottom: 2.5rem;
}
.footer-grid h3 {
  font-family: var(--font-sans);
  font-size: .75rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .9rem;
}
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: .5em; }
.footer-grid a { color: var(--ink); font-size: .88rem; }
.footer-grid a:hover { color: var(--accent); }
.footer-grid p { font-size: .86rem; color: var(--muted); line-height: 1.9; }

.footer-bottom {
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: .78rem;
  color: var(--muted);
}
.footer-bottom p { margin: 0; }


/* ------------------------------------------------------------
   11. ユーティリティ
   ------------------------------------------------------------ */

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

.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.stack > * + * { margin-top: 1.2rem; }


/* ------------------------------------------------------------
   12. レスポンシブ
   ------------------------------------------------------------ */

@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .card--feature { flex-direction: column; align-items: flex-start; gap: 1.2rem; }
  .card--feature .card__rank { width: 92px; height: 92px; font-size: .72rem; }
}

@media (max-width: 720px) {
  body { font-size: 15.5px; }

  .nav-toggle { display: grid; }

  .nav {
    position: fixed;
    inset: 68px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    padding: .6rem 24px 1.2rem;
    display: none;
  }
  .nav[data-open="true"] { display: flex; }
  .nav a { padding: .85rem .4rem; border-radius: 0; border-bottom: 1px solid var(--line-soft); }
  .nav a:last-child { border-bottom: 0; }

  .hero { padding: 3.5rem 0 3rem; }
  .section { padding: 3rem 0; }
  .stats { gap: 1.8rem; }
  .grid { grid-template-columns: 1fr; }
  .term-list { grid-template-columns: 1fr; }
  .article-nav { grid-template-columns: 1fr; }
  .article-nav .article-nav__next { text-align: left; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.8rem; }
  .bookdata dl { grid-template-columns: 5.5em 1fr; }
  .glossary-tools { position: static; }
}

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


/* ------------------------------------------------------------
   13. 印刷
   ------------------------------------------------------------ */

@media print {
  .site-header, .site-footer, .toc, .article-nav, .glossary-tools, .hero__actions { display: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  a { color: #000; border: 0; }
  .prose h2 { break-after: avoid; }
}
