/* 早見表ラボ 共通スタイル */
:root {
  --ink: #2b2b33;
  --muted: #66666f;
  --bg: #faf9f6;
  --card: #ffffff;
  --accent: #44548f;
  --accent-strong: #35426f;
  --accent-soft: #eef0f7;
  --line: #e5e2da;
  --highlight: #fff7dd;
  --radius: 10px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN",
    "Hiragino Sans", "Yu Gothic Medium", "Yu Gothic", Meiryo, system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.85;
  font-size: 16px;
}

/* ---------- ヘッダー ---------- */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.site-header .inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
}
.site-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
}
.site-title a { color: var(--ink); text-decoration: none; }
.site-tagline {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 8px max(16px, calc((100% - 828px) / 2));
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  gap: 6px;
  scrollbar-width: none;
}
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a {
  font-size: 0.82rem;
  color: var(--accent);
  text-decoration: none;
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 3px 12px;
  white-space: nowrap;
}
.site-nav a:hover { background: #e0e4f2; }

/* ---------- レイアウト ---------- */
main {
  max-width: 860px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.breadcrumb {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0 0 14px;
}
.breadcrumb a { color: var(--accent); text-decoration: none; }
.breadcrumb span::before { content: " › "; color: var(--muted); }

h1 {
  font-size: 1.5rem;
  line-height: 1.45;
  margin: 0 0 8px;
}
.lead {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0 0 20px;
}

h2 {
  font-size: 1.2rem;
  margin: 44px 0 12px;
  padding: 6px 0 6px 14px;
  border-left: 4px solid var(--accent);
  background: linear-gradient(to right, var(--accent-soft), transparent);
  border-radius: 3px;
}
h3 { font-size: 1.02rem; margin: 28px 0 8px; }

p { margin: 0 0 1em; }

/* ---------- ツールカード(トップページ) ---------- */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin: 20px 0 8px;
  padding: 0;
  list-style: none;
}
.tool-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: box-shadow 0.15s;
}
.tool-card:hover { box-shadow: 0 3px 12px rgba(60, 70, 110, 0.12); }
.tool-card a {
  display: block;
  padding: 16px 16px 14px;
  text-decoration: none;
  color: var(--ink);
}
.tool-card .tool-name {
  font-weight: 700;
  color: var(--accent-strong);
  font-size: 1.02rem;
  margin: 0 0 4px;
}
.tool-card .tool-desc {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
}

/* ---------- ヒーロー(トップの生まれ年導線) ---------- */
.hero-box {
  background: linear-gradient(135deg, var(--accent-soft), #f9f4e6);
  border: 1px solid #ccd3ea;
  border-radius: var(--radius);
  padding: 22px 20px;
  margin: 0 0 22px;
}
.hero-box .hero-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-strong);
  margin: 0 0 4px;
}
.hero-box .hero-desc {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0 0 12px;
}
.hero-box .row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.hero-box select {
  font-size: 1.05rem;
  padding: 8px 10px;
  border: 1px solid #c9c5bb;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

/* ---------- ツールUI ---------- */
.tool-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 18px;
  margin: 0 0 26px;
}
.tool-box .row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 12px;
}
.tool-box label { font-size: 0.9rem; font-weight: 600; }
.tool-box input[type="number"],
.tool-box input[type="date"],
.tool-box select {
  font-size: 1.05rem;
  padding: 8px 10px;
  border: 1px solid #c9c5bb;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  max-width: 100%;
}
.tool-box input[type="number"] { width: 7.5em; }
.btn {
  display: inline-block;
  font-size: 0.98rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 6px;
  padding: 9px 22px;
  cursor: pointer;
}
.btn:hover { background: var(--accent-strong); }

.result {
  display: none;
  margin-top: 14px;
  padding: 14px 16px;
  background: var(--accent-soft);
  border-radius: 8px;
  font-size: 0.95rem;
}
.result.show { display: block; }
.result .big {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--accent-strong);
}

/* ---------- テーブル ---------- */
.table-wrap {
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 14px 0 26px;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.88rem;
}
thead th {
  position: sticky;
  top: 43px; /* 固定ナビの高さぶん下げる */
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  padding: 8px 10px;
  white-space: nowrap;
  z-index: 1;
}
tbody th, tbody td {
  padding: 6px 10px;
  border-top: 1px solid var(--line);
  text-align: center;
  white-space: nowrap;
}
tbody tr:nth-child(even) { background: #f6f5f1; }
tbody tr.hl { background: var(--highlight); }
tbody th { font-weight: 600; }

caption {
  caption-side: top;
  text-align: left;
  font-size: 0.82rem;
  color: var(--muted);
  padding: 8px 10px 4px;
}

/* ---------- 補足・注意 ---------- */
.note {
  font-size: 0.85rem;
  background: #fdf6e8;
  border: 1px solid #f0e2bc;
  border-radius: 8px;
  padding: 12px 14px;
  margin: 14px 0;
}
.note strong { color: #8a6d1d; }

ul, ol { padding-left: 1.4em; }
li { margin-bottom: 0.3em; }

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

/* ---------- 広告スロット(AdSense導入後に使用) ---------- */
.ad-slot {
  margin: 26px 0;
  text-align: center;
  min-height: 0;
}

/* ---------- フッター ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--card);
  margin-top: 40px;
}
.site-footer .inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 22px 16px 30px;
  font-size: 0.8rem;
  color: var(--muted);
}
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin-bottom: 10px;
}
.site-footer a { color: var(--muted); }

/* ---------- 印刷対応(早見表の印刷需要向け) ---------- */
@media print {
  .site-header, .site-nav, .breadcrumb, .tool-box, .site-footer,
  .ad-slot, .no-print { display: none !important; }
  body { background: #fff; font-size: 11px; }
  main { max-width: none; padding: 0; }
  .table-wrap { border: none; overflow: visible; }
  table { font-size: 10px; }
  thead th { position: static; background: #ddd !important; color: #000; }
  h1 { font-size: 16px; }
  h2 { font-size: 13px; background: none; }
}

@media (max-width: 480px) {
  body { font-size: 15.5px; }
  h1 { font-size: 1.3rem; }
  thead th, tbody td, tbody th { padding: 6px 7px; }
}
