/* dobutsuen.com — 明るく・清潔・視覚的。子ども向けに幼稚化しない（仕様§4） */
:root {
  --bg: #fdfbf7;
  --card: #ffffff;
  --ink: #33302b;
  --sub: #7d766c;
  --accent: #e8842c;
  --accent-soft: #fdf0e2;
  --green: #4c9a6a;
  --line: #ece7de;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(60, 50, 30, .08), 0 4px 14px rgba(60, 50, 30, .06);
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  line-height: 1.65;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
main { max-width: 1080px; margin: 0 auto; padding: 0 16px 64px; }

/* header */
.site-header {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 12px 20px; background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.logo { font-size: 1.32rem; font-weight: 700; display: inline-flex; align-items: baseline; gap: 9px; }
/* アドレスは小さく添えるだけ。「どうぶつえん.com」とは書かない
   （その表記のドメインは別法人が実在するため、存在しないアドレスを示唆しない） */
.logo-sub { color: var(--accent); font-size: .78rem; font-weight: 600; letter-spacing: .02em; }
@media (max-width: 480px) { .logo-sub { display: none; } }
.site-header nav { display: flex; gap: 4px; }
.site-header nav a { padding: 6px 12px; border-radius: 20px; font-size: .92rem; }
.site-header nav a:hover { background: var(--accent-soft); }
.header-search { margin-left: auto; display: flex; gap: 6px; }
.header-search input {
  border: 1px solid var(--line); border-radius: 20px; padding: 7px 14px;
  font-size: .9rem; width: 180px; background: var(--bg);
}
.header-search button {
  border: 0; background: var(--accent); color: #fff; border-radius: 20px;
  padding: 7px 16px; font-size: .9rem; cursor: pointer;
}

/* hero */
.hero { text-align: center; padding: 44px 8px 24px; }
.hero h1 { font-size: 1.7rem; margin: 0 0 8px; }
.hero p { color: var(--sub); margin: 0; }

/* animal cards */
.section-title { font-size: 1.15rem; margin: 36px 0 14px; display: flex; align-items: baseline; gap: 10px; }
.section-title small { color: var(--sub); font-weight: normal; font-size: .85rem; }
.card-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
.animal-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; text-align: center; cursor: pointer; position: relative;
  transition: transform .12s ease; border: 2px solid transparent;
}
.animal-card:hover { transform: translateY(-2px); }
.animal-card.selected { border-color: var(--accent); background: var(--accent-soft); }
.animal-card.selected::after {
  content: "✓"; position: absolute; top: 8px; right: 10px;
  background: var(--accent); color: #fff; width: 24px; height: 24px;
  border-radius: 50%; line-height: 24px; font-size: .85rem;
}
.animal-card .illust, .animal-illust {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #f6f1e7, #efe8da);
  color: #b3a988; overflow: hidden;
}
.animal-card .illust img, .animal-illust img { width: 100%; height: 100%; object-fit: cover; }
.placeholder-mark { color: #c2b89f; font-size: .75rem; letter-spacing: .1em; }
.animal-card .name { padding: 10px 6px 12px; font-weight: 600; font-size: .95rem; }
.animal-card .meta { color: var(--sub); font-size: .78rem; padding-bottom: 10px; margin-top: -8px; }

/* selection bar */
.select-bar {
  position: sticky; bottom: 12px; margin-top: 20px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 12px 16px; display: none;
  align-items: center; gap: 10px; flex-wrap: wrap;
}
.select-bar.active { display: flex; }
.select-bar .chips { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.chip {
  background: var(--accent-soft); border-radius: 16px; padding: 4px 12px;
  font-size: .88rem; display: inline-flex; gap: 6px; align-items: center;
  white-space: nowrap;   /* 狭い画面で1文字ずつ縦に折り返されるのを防ぐ */
}
.chip button { border: 0; background: none; cursor: pointer; color: var(--accent); font-size: 1rem; padding: 0; }
.btn-primary {
  background: var(--accent); color: #fff; border: 0; border-radius: 24px;
  padding: 10px 22px; font-size: .95rem; cursor: pointer; font-weight: 600;
}
.btn-primary:disabled { opacity: .4; cursor: default; }

/* lists */
.zoo-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.zoo-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 18px; display: block;
}
.zoo-card h3 { margin: 0 0 4px; font-size: 1.02rem; }
.zoo-card .pref { color: var(--accent); font-size: .82rem; font-weight: 600; }
.zoo-card .meta { color: var(--sub); font-size: .85rem; }
.badge { display: inline-block; border-radius: 12px; padding: 1px 10px; font-size: .76rem; margin-left: 6px; vertical-align: middle; }
.badge.visible { background: #e3f2e8; color: var(--green); }
.badge.hidden { background: #fdeaea; color: #c0564f; }
.badge.seasonal { background: #fdf3d9; color: #a07d1f; }
.badge.unknown { background: #f0ede7; color: var(--sub); }
.badge.rare { background: #f3e9fb; color: #8250b5; }

/* detail pages */
.detail-head { display: flex; gap: 24px; align-items: center; padding-top: 28px; flex-wrap: wrap; }
.detail-head .illust-block { flex-shrink: 0; width: 180px; }
.detail-head .animal-illust { width: 180px; border-radius: var(--radius); }
.illust-note { color: var(--sub); font-size: .72rem; margin: 6px 0 0; line-height: 1.45; text-align: center; }
.detail-head h1 { margin: 0 0 4px; font-size: 1.5rem; }
.detail-head .sci { color: var(--sub); font-style: italic; font-size: .9rem; }
.detail-head .stats { margin-top: 8px; font-size: .92rem; }
.freshness { color: var(--sub); font-size: .82rem; margin-top: 20px; }
.stale-note { background: #fdf3d9; border-radius: 8px; padding: 10px 14px; font-size: .85rem; margin-top: 12px; }
.official-link { color: var(--accent); font-weight: 600; }
table.plain { border-collapse: collapse; width: 100%; font-size: .92rem; }
table.plain th, table.plain td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.cat-block h2 { font-size: 1.05rem; margin: 28px 0 10px; border-left: 4px solid var(--accent); padding-left: 10px; }

/* prefecture chips */
.pref-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.pref-chip { background: var(--card); box-shadow: var(--shadow); border-radius: 20px; padding: 8px 18px; font-size: .92rem; }
.pref-chip small { color: var(--sub); }
.pref-chip.selected-chip { background: var(--accent); color: #fff; }
.pref-chip.selected-chip small { color: rgba(255,255,255,.8); }

@media (max-width: 640px) {
  .header-search { width: 100%; margin-left: 0; }
  .header-search input { flex: 1; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
  .animal-card .name { font-size: .82rem; padding: 8px 4px 10px; }
  .hero h1 { font-size: 1.3rem; }
  /* 選択バー: 横一列だとボタンの文言に押されてチップが潰れるので縦に積む */
  .select-bar { flex-direction: column; align-items: stretch; gap: 10px; padding: 10px 12px; }
  .select-bar .chips { flex: none; }
  .select-bar .btn-primary { width: 100%; padding: 12px 16px; }
}

/* footer */
.site-footer { border-top: 1px solid var(--line); padding: 24px 20px 40px; text-align: center; color: var(--sub); font-size: .85rem; background: #fff; }
.site-footer .note { max-width: 640px; margin: 6px auto 0; font-size: .78rem; }

/* 種が公式に特定されていない場合の注記（§33: 断定しない） */
.uncertain-note {
  background: #fdf3d9; color: #7a5f16; border-radius: 6px;
  padding: 6px 10px; font-size: .78rem; margin-top: 6px; line-height: 1.5;
}

/* 収録範囲ページ */
.cards-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 8px 0 4px; }
.stat-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 22px; min-width: 120px; text-align: center;
}
.stat-card .num { font-size: 1.7rem; font-weight: 700; color: var(--accent); }
.stat-card .num small { font-size: .9rem; color: var(--sub); font-weight: normal; }
.stat-card .label { font-size: .8rem; color: var(--sub); }
.plain-list { padding-left: 1.2em; }
.plain-list li { margin-bottom: 8px; }

/* 閉園した施設の告知 */
.closed-note {
  background: #fdeaea; color: #8d3a34; border-radius: 8px;
  padding: 10px 14px; font-size: .88rem; margin: 10px 0; line-height: 1.6;
}

/* 一時休園など、閉園ではない一時的な告知 */
.notice-box {
  background: #fdf3d9; color: #7a5f16; border-radius: 8px;
  padding: 10px 14px; font-size: .88rem; margin: 10px 0; line-height: 1.6;
}
.notice-box .notice-meta { color: #8d7434; font-size: .82rem; }
/* 営業はしているが当サイトが収録できていない場合。警告色にしない */
.notice-box.coverage { background: #f0ede7; color: #5d574c; }
.notice-box.coverage .notice-meta { color: var(--sub); }

/* お問い合わせフォーム */
.contact-intro { max-width: 640px; margin: 0 auto 22px; }
.contact-intro .note { color: var(--sub); font-size: .85rem; line-height: 1.7; }
.contact-form { max-width: 640px; margin: 0 auto; display: grid; gap: 16px; }
.contact-form label { display: grid; gap: 6px; font-size: .92rem; font-weight: 600; }
.contact-form input, .contact-form textarea {
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
  font: inherit; font-weight: normal; background: #fff; width: 100%;
}
.contact-form textarea { resize: vertical; }
.contact-form .req {
  background: var(--accent-soft); color: var(--accent); border-radius: 10px;
  padding: 1px 8px; font-size: .72rem; margin-left: 8px; vertical-align: middle;
}
.contact-form button { justify-self: start; }
.form-error {
  max-width: 640px; margin: 0 auto 16px; background: #fdeaea; color: #8d3a34;
  border-radius: 8px; padding: 10px 14px; font-size: .9rem;
}
/* ハニーポット: 画面にも支援技術にも出さないが、autofillには拾われる位置に置く */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
