/* 至考シリーズ共通の見た目（白黒基調・見出しは明朝）。
   色と寸法は至考の測図（C:\claude\cad\src\app\globals.css と page.tsx）に合わせてある。 */
:root {
  --mm-bg: #ffffff;
  --mm-surface: #f6f6f6;
  --mm-text: #111111;
  --mm-secondary: #555555;
  --mm-muted: #999999;
  --mm-line: #e0e0e0;
  --mm-accent: #111111;
  --mm-accent-hover: #000000;
  --mm-error: #b42318;
  --font-sans: "Geist", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", Meiryo, sans-serif;
  --font-mincho: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--mm-bg);
  color: var(--mm-text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul { margin: 0; }
a { color: inherit; }

/* ---------- ヘッダー ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  font-size: 0.875rem;
  letter-spacing: 0.025em;
  color: var(--mm-secondary);
}

.site-header a {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.site-header a:hover { color: var(--mm-text); }

/* ---------- 本文の枠 ---------- */
.container {
  flex: 1;
  width: 100%;
  max-width: 64rem;
  margin: 0 auto;
  padding: 32px 24px 96px;
  display: flex;
  flex-direction: column;
  gap: 64px;
}

.hero {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

h1 {
  font-family: var(--font-mincho);
  font-size: 3rem;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.h1-sub {
  margin-left: 0.5rem;
  vertical-align: middle;
  white-space: nowrap;
  font-family: var(--font-sans);
  font-size: 1rem;
  letter-spacing: 0;
  color: var(--mm-secondary);
}

/* データのページ用。題名が長いので、トップより小さくする */
.h1-data { font-size: 2.25rem; }

.eyebrow {
  margin-bottom: -8px;
  font-size: 0.875rem;
  letter-spacing: 0.025em;
  color: var(--mm-secondary);
}

.back { font-size: 0.875rem; color: var(--mm-secondary); }
.back a { text-underline-offset: 4px; }
.back a:hover { color: var(--mm-text); }

.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--mm-text); }

.tagline {
  font-family: var(--font-mincho);
  font-size: 1.25rem;
  color: var(--mm-secondary);
}

.lead {
  max-width: 40rem;
  font-size: 0.875rem;
  line-height: 1.9;
  color: var(--mm-secondary);
}

/* ---------- 区切りつきの節 ---------- */
.block {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-top: 48px;
  border-top: 1px solid var(--mm-line);
}

h2 {
  font-family: var(--font-mincho);
  font-size: 1.5rem;
  font-weight: 400;
}

.body {
  font-size: 0.875rem;
  line-height: 1.9;
  color: var(--mm-secondary);
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

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

.feature h3 {
  font-family: var(--font-mincho);
  font-size: 1.125rem;
  font-weight: 400;
}

.feature p {
  font-size: 0.875rem;
  line-height: 1.9;
  color: var(--mm-secondary);
}

.feature .note {
  font-size: 0.75rem;
  color: var(--mm-muted);
}

/* ---------- 地図 ---------- */
:root {
  /* map.js の GROUPS と同じ値にする */
  --map-island: #2563eb;
  --map-remote: #ea580c;
}

.header-nav { display: flex; gap: 20px; }

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-size: 0.875rem;
  color: var(--mm-secondary);
}

.hero-links a { text-underline-offset: 4px; }
.hero-links a:hover { color: var(--mm-text); }

.block { scroll-margin-top: 8px; }

.block > .note {
  font-size: 0.75rem;
  line-height: 1.8;
  color: var(--mm-muted);
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin: 0 4px 0 2px;
  border-radius: 50%;
  vertical-align: baseline;
}

.dot-island { background: var(--map-island); }
.dot-remote { background: var(--map-remote); }

.map-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.map {
  height: min(70vh, 560px);
  min-height: 360px;
  border: 1px solid var(--mm-line);
  border-radius: 8px;
  background: var(--mm-surface);
  /* 見出しや凡例より手前に出ないようにする */
  isolation: isolate;
  font-family: var(--font-sans);
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 4px;
  font-size: 0.875rem;
  cursor: pointer;
}

.legend-item input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--mm-accent);
}

.legend-item .dot { margin: 0; }
.legend-count { color: var(--mm-muted); font-size: 0.75rem; }

.map-box .status { text-align: left; }

.map-popup { display: flex; flex-direction: column; gap: 2px; min-width: 160px; }
.map-popup-kind { font-size: 0.75rem; color: var(--mm-secondary); }
.map-popup-name { font-size: 0.9375rem; color: var(--mm-text); }
.map-popup-sub { font-size: 0.8125rem; color: var(--mm-secondary); }
.map-popup-note { margin-top: 4px; font-size: 0.6875rem; color: var(--mm-muted); }

.leaflet-popup-content-wrapper { border-radius: 8px; }

/* ---------- 利用条件とダウンロード ---------- */
.terms {
  padding: 24px 24px 24px 44px;
  border: 1px solid var(--mm-line);
  border-radius: 8px;
  font-size: 0.875rem;
  line-height: 1.9;
  color: var(--mm-secondary);
}

.terms li + li { margin-top: 8px; }

.download {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding-top: 8px;
  scroll-margin-top: 24px;
}

.agree {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  font-size: 0.875rem;
  cursor: pointer;
}

.agree input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--mm-accent);
  cursor: pointer;
}

.button {
  padding: 12px 32px;
  border: 0;
  border-radius: 4px;
  background: var(--mm-accent);
  color: var(--mm-bg);
  font: inherit;
  font-size: 0.875rem;
  letter-spacing: 0.025em;
  cursor: pointer;
}

.button:hover:not(:disabled) { background: var(--mm-accent-hover); }

.button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.button:focus-visible,
.agree input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--mm-text);
  outline-offset: 3px;
}

.status {
  min-height: 1.5em;
  font-size: 0.75rem;
  line-height: 1.5;
  text-align: center;
  color: var(--mm-muted);
}

.status.is-error { color: var(--mm-error); }

/* ---------- 至考シリーズのカード ---------- */
.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  border: 1px solid var(--mm-line);
  border-radius: 8px;
  text-decoration: none;
}

a.card:hover,
.card.is-current { border-color: var(--mm-accent); }

.card-kind,
.card-copy {
  font-size: 0.875rem;
  color: var(--mm-secondary);
}

.card-name {
  font-family: var(--font-mincho);
  font-size: 1.5rem;
}

.card-link {
  font-size: 0.75rem;
  color: var(--mm-secondary);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.card-here {
  font-size: 0.75rem;
  color: var(--mm-muted);
}

.note-banner { align-items: flex-start; }

.note-banner img {
  width: 9rem;
  height: auto;
  flex-shrink: 0;
}

.note-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ---------- フッター ---------- */
.site-footer {
  padding: 32px 24px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--mm-muted);
}

.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.consent-note {
  max-width: 32rem;
  font-size: 0.75rem;
  line-height: 1.8;
  text-align: center;
  color: var(--mm-muted);
}

.consent-note a { text-underline-offset: 3px; }
.consent-note a:hover { color: var(--mm-text); }

/* ---------- 規約・ポリシーのページ ---------- */
.legal {
  max-width: 48rem;
  gap: 40px;
  padding-top: 48px;
}

.legal-head { display: flex; flex-direction: column; gap: 16px; }

.legal h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0;
}

.legal section { display: flex; flex-direction: column; gap: 10px; }
.legal h2 { font-size: 1.125rem; }

.legal p,
.legal li {
  font-size: 0.875rem;
  line-height: 2;
  color: var(--mm-secondary);
}

.legal ul { padding-left: 1.25rem; }
.legal strong { font-weight: 400; color: var(--mm-text); }
.legal .legal-date { font-size: 0.75rem; color: var(--mm-muted); }

/* ---------- 広い画面（Tailwind の sm 相当） ---------- */
@media (min-width: 640px) {
  .site-header { padding: 20px 48px; }
  .container { padding-left: 48px; padding-right: 48px; }
  h1 { font-size: 4.5rem; }
  .h1-data { font-size: 3.5rem; }
  .legal h1 { font-size: 1.875rem; }
  .h1-sub { margin-left: 0.75rem; font-size: 1.25rem; }
  .tagline { font-size: 1.5rem; }
  .grid { grid-template-columns: 1fr 1fr; gap: 24px 32px; }
  .note-banner { flex-direction: row; align-items: center; gap: 24px; }
  .site-footer { padding: 32px 48px; }
}
