/* ロゴの配色: 紺 #2f4f7f / 水色 #a9cde8 / くすみ緑 #aebba1 */
:root {
  --navy: #2f4f7f;
  --sky: #a9cde8;
  --sage: #aebba1;
  --bg: #f4f8fb;
  --card: #fff;
  --text: #24385a;
  --muted: #6b7f99;
  --line: #dce8f1;
  --chip: #eaf1f7;
  --hit: #fff1b8;
  color-scheme: light; /* ロゴが白地前提のためライト固定 */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.7 "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Yu Gothic UI", system-ui, sans-serif;
}

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

.site-head, .filters, #list, .site-foot, .status {
  max-width: 44rem;
  margin-inline: auto;
}
.site-head, #list, .site-foot, .status { padding-inline: 16px; }

/* ---------- ヘッダー ---------- */
.site-head { padding-top: 16px; padding-bottom: 4px; }
.logo { display: block; width: min(300px, 82%); height: auto; margin-bottom: 8px; }
h1 { margin: 0 0 6px; font-size: 1.15rem; font-weight: 700; line-height: 1.5; color: var(--navy); }
.lead { margin: 0 0 8px; font-weight: 500; }
.how {
  margin: 0;
  padding: 10px 14px;
  border-radius: 14px;
  background: #e6f1f9;
  color: var(--text);
  font-size: .88rem;
  line-height: 1.7;
}

/* ---------- 絞り込み ---------- */
.filters {
  margin-top: 16px;
  margin-inline: 16px;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 20px;
  background: var(--card);
}
@media (min-width: 720px) { .filters { margin-inline: auto; } }

#q {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  font: inherit; /* 16px未満だとiOSでズームされる */
}
#q:focus { outline: none; border-color: var(--navy); background: #fff; }

.filter-row { display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; }
.filter-label {
  flex: none;
  min-width: 2.2em;
  padding-top: 7px;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 700;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--chip);
  color: var(--navy);
  font-family: inherit;
  font-size: .85rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--navy); color: #fff; }
.chip:disabled { opacity: .35; cursor: default; }
.chip:focus-visible, .btn:focus-visible, .to-filters:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }

.rows .chip { min-width: 36px; padding: 0 8px; }

.count { margin: 10px 0 0; color: var(--muted); font-size: .82rem; font-weight: 700; text-align: right; }

/* ---------- 魚カード ---------- */
#list { padding-top: 14px; padding-bottom: 8px; }

.fish {
  margin: 0 0 12px;
  padding: 14px 14px 16px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 20px;
  scroll-margin-top: 12px;
}
.fish[hidden] { display: none; }
.fish.is-target { border-color: var(--navy); box-shadow: 0 0 0 4px var(--hit); }

.fish-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fish h2 { margin: 0; font-size: 1.3rem; font-weight: 700; line-height: 1.4; color: var(--navy); }
.fish h2 a { color: inherit; text-decoration: none; }

.cat-tag {
  flex: none;
  padding: 2px 10px;
  border-radius: 999px;
  background: #eef2ea;
  color: #5d6e52;
  font-size: .7rem;
  font-weight: 700;
}

.aliases { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 0; padding: 0; list-style: none; }
.aliases li {
  padding: 0 9px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.7;
}

.links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 6px 8px;
  border-radius: 14px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
}
.btn-sabaki { background: var(--navy); color: #fff; }
.btn-recipe { background: var(--sky); color: #1f3a63; }
.btn small { display: block; font-weight: 500; font-size: .7rem; opacity: .85; }
.btn:active { transform: translateY(1px); opacity: .85; }

.memo { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: #eef2ea; }
.memo h3 { margin: 0 0 2px; color: #5d6e52; font-size: .78rem; }
.memo p { margin: 0; white-space: pre-wrap; }

.status { padding-block: 24px; color: var(--muted); text-align: center; }
.status[hidden] { display: none; }

/* ---------- フッター・ページ上部へ ---------- */
.site-foot { padding-top: 8px; padding-bottom: 40px; color: var(--muted); font-size: .8rem; }
.site-foot p { margin: 0 0 8px; }
.site-foot .copy { margin-top: 12px; }

.to-filters {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-family: inherit;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 2px 8px rgb(47 79 127 / .35);
  cursor: pointer;
}
.to-filters[hidden] { display: none; }

@media (min-width: 600px) {
  h1 { font-size: 1.4rem; }
}
