/* ここだけ いきものマップ 共通スタイル */
:root {
  --brand: #0d3b42; --brand2: #155e68; --brand-lt: #d8eeea; --accent: #ff7a45; --gold: #f2b938;
  --bg: #f6f8f4; --card: #fff; --ink: #18242a; --muted: #5b6b72; --line: #dfe6e2;
  --r-world: #7b3fd0; --r-japan: #e0412f; --r-few: #1f7ac8; --r-record: #c98a00; --r-lim: #6b7a80;
  --display: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Yu Gothic", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: system-ui, -apple-system, "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif; line-height: 1.7; font-size: 15.5px; }
a { color: var(--brand2); }
img { max-width: 100%; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.small { font-size: 13px; } .muted { color: var(--muted); }
h1, h2, h3 { font-family: var(--display); line-height: 1.4; }

/* ヘッダー */
.top { background: var(--brand); color: #fff; position: sticky; top: 0; z-index: 1000; box-shadow: 0 2px 10px rgba(0,0,0,.15); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 56px; }
.logo { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-family: var(--display); font-weight: 900; font-size: 15px; white-space: nowrap; }
.logo b { color: var(--gold); margin-left: 2px; }
.top nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.top nav a { color: #fff; text-decoration: none; font-size: 13.5px; padding: 6px 10px; border-radius: 8px; white-space: nowrap; }
.top nav a:hover { background: rgba(255,255,255,.12); }
@media (max-width: 560px) { .logo span { font-size: 13px; } .top nav a { padding: 6px 7px; font-size: 12.5px; } .top nav a:nth-child(1) { display: none; } }

.crumb { font-size: 12.5px; color: var(--muted); padding-top: 12px; padding-bottom: 4px; overflow-wrap: anywhere; }
.crumb a { color: var(--muted); }

/* レア度のバッジ */
.rb { display: inline-block; font-size: 11.5px; font-weight: 800; color: #fff; padding: 2px 9px; border-radius: 99px; letter-spacing: .03em; line-height: 1.6; white-space: nowrap; }
.rb.r-world { background: var(--r-world); } .rb.r-japan { background: var(--r-japan); } .rb.r-few { background: var(--r-few); } .rb.r-record { background: var(--r-record); }
.rb.r-lim { background: #fff; color: var(--r-lim); border: 1px solid var(--line); }

/* 生き物カード */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.it { position: relative; display: flex; flex-direction: column; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px 14px; text-decoration: none; color: var(--ink); overflow: hidden; transition: transform .15s, box-shadow .15s; min-width: 0; }
.it::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--line); }
.it.r-world::before { background: var(--r-world); } .it.r-japan::before { background: var(--r-japan); } .it.r-few::before { background: var(--r-few); } .it.r-record::before { background: var(--r-record); }
.it:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(13,59,66,.12); }
.it .rb { align-self: flex-start; }
.it .rb + .rb { margin-top: -2px; }
.it .em { position: absolute; right: 12px; top: 8px; font-size: 34px; opacity: .9; }
.it .nm { font-family: var(--display); font-size: 21px; font-weight: 900; line-height: 1.35; margin-top: 4px; padding-right: 44px; overflow-wrap: anywhere; }
.it .hl { font-size: 13.5px; color: var(--muted); line-height: 1.55; }
.it .fac { margin-top: auto; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 13.5px; font-weight: 700; color: var(--brand2); overflow-wrap: anywhere; }
.it .fac small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.it .dist { position: absolute; right: 12px; bottom: 12px; font-size: 12px; font-weight: 700; color: var(--accent); }

/* セクション・カード */
.sec { margin: 34px 0; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.sec-h h2 { margin: 0; font-size: 23px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 14px; cursor: pointer; font-family: inherit; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn:hover { filter: brightness(.97); }

/* 絞り込み */
.filters { display: flex; flex-direction: column; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 5px 12px; font-size: 13.5px; cursor: pointer; font-family: inherit; color: var(--ink); white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }
.chip.r-world[aria-pressed="true"] { background: var(--r-world); border-color: var(--r-world); }
.chip.r-japan[aria-pressed="true"] { background: var(--r-japan); border-color: var(--r-japan); }
.chip.r-few[aria-pressed="true"] { background: var(--r-few); border-color: var(--r-few); }
.chip.r-record[aria-pressed="true"] { background: var(--r-record); border-color: var(--r-record); }
.chip .n { opacity: .7; font-size: 12px; margin-left: 3px; }
.frow { display: flex; gap: 8px; flex-wrap: wrap; }
.frow input, .frow select { font: inherit; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: #fff; min-width: 0; }
.frow input { flex: 1 1 220px; }
.count { font-size: 13.5px; color: var(--muted); margin: 0 0 10px; }

/* 地図 */
#map { height: 520px; border-radius: 16px; border: 1px solid var(--line); z-index: 1; }
@media (max-width: 640px) { #map { height: 420px; } }
.pin { width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); display: grid; place-items: center; }
.pin span { transform: rotate(45deg); font-size: 15px; }
.pin.r-world { background: var(--r-world); } .pin.r-japan { background: var(--r-japan); } .pin.r-few { background: var(--r-few); } .pin.r-record { background: var(--r-record); }
.pop b { font-size: 15px; } .pop ul { margin: 6px 0; padding-left: 16px; } .pop li { margin: 2px 0; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; margin-top: 8px; }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }

/* 施設ページ */
.fhead { background: var(--brand); color: #fff; padding: 26px 0 24px; }
.fhead h1 { margin: 6px 0 6px; font-size: 30px; }
.fhead .meta { opacity: .9; font-size: 14px; }
.fhead .tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tagw { background: rgba(255,255,255,.15); color: #fff; padding: 2px 10px; border-radius: 99px; font-size: 12.5px; }
.ditem { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; margin-bottom: 14px; scroll-margin-top: 70px; border-left: 6px solid var(--line); }
.ditem.r-world { border-left-color: var(--r-world); } .ditem.r-japan { border-left-color: var(--r-japan); } .ditem.r-few { border-left-color: var(--r-few); } .ditem.r-record { border-left-color: var(--r-record); }
.ditem h2 { margin: 6px 0 4px; font-size: 24px; }
.ditem h2 .en { font-size: 13px; color: var(--muted); font-weight: 500; font-family: system-ui, sans-serif; margin-left: 6px; }
.ditem .lead { font-weight: 700; color: var(--brand2); margin: 0 0 6px; }
.ditem p { margin: 6px 0; }
.ditem .sub { font-size: 13px; color: var(--muted); }
.info { display: grid; grid-template-columns: 7em 1fr; gap: 6px 12px; font-size: 14.5px; }
.info dt { color: var(--muted); } .info dd { margin: 0; overflow-wrap: anywhere; }
.cols2 { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
@media (max-width: 860px) { .cols2 { grid-template-columns: 1fr; } }
.minimap { height: 260px; border-radius: 14px; border: 1px solid var(--line); margin-top: 12px; }
.links { display: flex; flex-wrap: wrap; gap: 8px; }
.links a { background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 5px 13px; font-size: 13.5px; text-decoration: none; color: var(--ink); }
.links a:hover { border-color: var(--brand2); }
.note { background: #fff8e6; border: 1px solid #f2dfa6; border-radius: 12px; padding: 10px 14px; font-size: 13.5px; }

/* 都道府県 */
.regions { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.region h3 { margin: 0 0 6px; font-size: 16px; }
.region a { display: inline-block; margin: 2px 8px 2px 0; font-size: 14px; }
.region a .n { color: var(--muted); font-size: 12px; }

.faq details { border-bottom: 1px solid var(--line); padding: 10px 0; }
.faq summary { font-weight: 700; cursor: pointer; }
.faq p { margin: 6px 0 0; font-size: 14.5px; }

.foot { background: var(--brand); color: #d9e7e5; margin-top: 50px; padding: 26px 0 70px; font-size: 14px; }
.foot a { color: #fff; }
.ad-slot:empty { display: none; }
