/* ----------------------------------------------------------
   三重わんさんぽ — 大型犬向け犬同伴可スポットリンク集
   Design: 信頼感のある温かみのトーン。森・土・陶器の中間色。
   ---------------------------------------------------------- */

:root {
  /* Surfaces — 紙のような温かみ */
  --bg:          #f5efe2;
  --surface:    #fffbf2;
  --surface-2:  #f8f2e2;
  --border:     #d8cfb8;
  --border-2:   #ebe2cb;

  /* Ink */
  --ink:        #2a2620;
  --ink-2:      #4a4338;
  --ink-3:      #7c7363;
  --ink-faint:  #b3a991;

  /* Accents — 森と陶土 */
  --forest:     #3a6b41;
  --forest-d:   #234826;
  --forest-l:   #5a8c5f;
  --clay:       #b85a30;
  --clay-d:     #8c3f1c;
  --clay-l:     #d98a5e;
  --sky:        #466b7d;
  --cream:      #fff8e6;

  /* States */
  --ok-bg:      #dceac8;
  --ok-fg:      #2f5e1f;
  --check-bg:   #f7e7c8;
  --check-fg:   #8a5a14;
  --no-bg:      #efd6d2;
  --no-fg:      #87362a;

  --shadow-sm:  0 1px 2px rgba(43, 34, 18, .07);
  --shadow-md:  0 8px 22px -10px rgba(43, 34, 18, .22);
  --shadow-lg:  0 14px 36px -14px rgba(43, 34, 18, .28);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

body {
  font-family: "Zen Kaku Gothic New", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--ink);
  background:
    radial-gradient(1100px 600px at 92% -10%, #ecdfb8 0%, transparent 60%),
    radial-gradient(900px 520px at -10% 8%, #d9e6cc 0%, transparent 55%),
    radial-gradient(700px 400px at 50% 110%, #f3d9c1 0%, transparent 55%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--forest-d); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--clay-d); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 18px; }

/* ───── Header ───── */
.masthead {
  background: linear-gradient(180deg, rgba(255,250,235,.95) 0%, rgba(245,238,216,.92) 100%);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: saturate(1.2) blur(8px);
  -webkit-backdrop-filter: saturate(1.2) blur(8px);
}
.masthead .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  padding-bottom: 12px;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--forest-d);
  text-decoration: none;
}
.logo {
  width: 42px;
  height: 42px;
  color: var(--forest);
  background: var(--cream);
  border: 1.5px solid var(--border);
  border-radius: 50%;
  padding: 5px;
  box-shadow: var(--shadow-sm);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-title {
  font-family: "Zen Old Mincho", serif;
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
}
.brand-sub {
  font-size: 0.74rem;
  color: var(--ink-3);
  margin-top: 3px;
  letter-spacing: 0.02em;
}
.meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--forest);
  color: #fff;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: var(--shadow-sm);
}
.meta-sub {
  font-size: 0.72rem;
  color: var(--ink-3);
}

/* ───── Hero ───── */
.hero {
  padding: 44px 18px 22px;
  position: relative;
}
.hero h1 {
  font-family: "Zen Old Mincho", serif;
  font-weight: 600;
  font-size: clamp(1.65rem, 1.05rem + 2.6vw, 2.55rem);
  line-height: 1.32;
  letter-spacing: 0.03em;
  margin: 0 0 14px;
  color: var(--forest-d);
}
.hero h1::before {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  background: var(--clay);
  border-radius: 2px;
  margin-bottom: 18px;
}
.hero .lede {
  max-width: 64ch;
  color: var(--ink-2);
  margin: 0 0 22px;
  font-size: 1.02rem;
}
.hero strong { color: var(--clay-d); font-weight: 700; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .12s ease, box-shadow .15s ease;
}
.btn.primary {
  background: var(--forest);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn.primary:hover {
  background: var(--forest-d);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn.ghost { background: rgba(255,255,255,.6); color: var(--forest-d); border-color: var(--border); }
.btn.ghost:hover { background: var(--surface); border-color: var(--forest-l); }

/* ───── Filters ───── */
.filters {
  margin-top: 8px;
  padding: 16px 18px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
@media (min-width: 720px) {
  .filters { padding: 20px 24px 12px; }
}
.search-row { margin-bottom: 14px; }
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid var(--border);
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--ink-3);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search:focus-within { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(58, 107, 65, 0.18); }
.search input {
  border: 0;
  outline: 0;
  flex: 1;
  font: inherit;
  color: var(--ink);
  background: transparent;
  min-width: 0;
}
.search input::placeholder { color: var(--ink-faint); }
#clear-q {
  border: 0;
  background: transparent;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--ink-3);
  padding: 2px 8px;
  border-radius: 999px;
  line-height: 1;
}
#clear-q:hover { color: var(--clay-d); background: var(--surface-2); }

.filter-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 5px 0;
  flex-wrap: wrap;
}
.filter-label {
  flex: 0 0 auto;
  font-size: 0.72rem;
  color: var(--ink-3);
  letter-spacing: 0.1em;
  padding: 7px 0;
  min-width: 56px;
  font-weight: 700;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.chip {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink-2);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
}
.chip:hover { background: var(--surface-2); border-color: var(--forest-l); }
.chip:active { transform: scale(0.97); }
.chip[aria-pressed="true"] {
  background: var(--forest);
  color: #fff;
  border-color: var(--forest);
  box-shadow: var(--shadow-sm);
}
.chip.ok[aria-pressed="true"] { background: var(--ok-fg); border-color: var(--ok-fg); }
.chip.check[aria-pressed="true"] { background: var(--check-fg); border-color: var(--check-fg); }
.chip.no[aria-pressed="true"] { background: var(--no-fg); border-color: var(--no-fg); }

.result-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  margin-top: 10px;
  border-top: 1px dashed var(--border-2);
}
.count { font-size: 0.88rem; color: var(--ink-2); font-weight: 700; }
.link-btn {
  background: none;
  border: 0;
  color: var(--clay-d);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  font-size: 0.85rem;
}
.link-btn:hover { color: var(--clay); }

/* ───── Legend ───── */
.legend { margin-top: 20px; }
.legend details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px 18px;
  box-shadow: var(--shadow-sm);
}
.legend summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--forest-d);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.legend summary::after {
  content: "▸";
  transition: transform .2s ease;
  color: var(--clay);
  font-size: 0.9rem;
}
.legend details[open] summary::after { transform: rotate(90deg); }
.legend-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 16px;
}
@media (min-width: 720px) {
  .legend-grid { grid-template-columns: repeat(3, 1fr); }
}
.legend-grid h3 {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  margin: 0 0 10px;
  text-transform: uppercase;
  font-weight: 700;
}
.legend-grid ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.9rem;
}
.legend-note {
  margin: 16px 0 0;
  padding-top: 12px;
  border-top: 1px dashed var(--border-2);
  font-size: 0.8rem;
  color: var(--ink-3);
  line-height: 1.6;
}

/* ───── List / Cards ───── */
.list { margin-top: 24px; padding-bottom: 40px; }
#cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 720px) { #cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { #cards { grid-template-columns: repeat(3, 1fr); gap: 18px; } }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 11px;
  position: relative;
  transition: transform .15s ease, box-shadow .2s ease, border-color .15s ease;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--forest);
  opacity: 0.85;
}
.card.large-check::before { background: var(--check-fg); }
.card.large-no::before { background: var(--no-fg); opacity: 0.6; }
.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--forest-l);
  transform: translateY(-2px);
}
.card.large-no { background: #faf3ed; }
.card.large-check { background: #fcf6e2; }

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-top: 2px;
}
.card-name {
  font-family: "Zen Old Mincho", serif;
  font-weight: 600;
  font-size: 1.08rem;
  line-height: 1.38;
  margin: 0;
  color: var(--forest-d);
  word-break: break-word;
  letter-spacing: 0.01em;
}
.card-id {
  font-size: 0.7rem;
  color: var(--ink-faint);
  font-feature-settings: "tnum" 1;
  flex: 0 0 auto;
  padding-top: 4px;
  letter-spacing: 0.04em;
}
.where {
  font-size: 0.85rem;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-weight: 500;
}
.where::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--clay-l);
}
.where .sep { color: var(--ink-faint); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
}
.tag.category { background: #eaecdd; color: #455c2c; border-color: #d5dabd; }
.tag.ok { background: var(--ok-bg); color: var(--ok-fg); border-color: #c7d9b3; }
.tag.check { background: var(--check-bg); color: var(--check-fg); border-color: #e3cd9b; }
.tag.no { background: var(--no-bg); color: var(--no-fg); border-color: #d9b3ad; }

.conf {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 5px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.conf.high { background: var(--forest); color: #fff; }
.conf.medium { background: #c2b58b; color: #3a3220; }
.conf.low { background: #c39a8a; color: #4a2418; }

.card-body { font-size: 0.92rem; color: var(--ink-2); }
.card-body p { margin: 0 0 6px; }
.card-body .label {
  display: inline-block;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  font-weight: 700;
  margin-right: 6px;
  padding: 1px 6px;
  background: var(--surface-2);
  border-radius: 3px;
  vertical-align: 1px;
}
.card-notes {
  font-size: 0.83rem;
  color: var(--ink-3);
  border-left: 2.5px solid var(--clay-l);
  padding-left: 10px;
  background: rgba(217, 138, 94, 0.05);
  padding-top: 4px;
  padding-bottom: 4px;
  border-radius: 0 4px 4px 0;
}

.links {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px dashed var(--border-2);
}
.linkpill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  word-break: break-word;
  line-height: 1.3;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
}
.linkpill:active { transform: scale(0.98); }
.linkpill svg { flex: 0 0 auto; opacity: .9; }
.linkpill.primary {
  background: var(--forest);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.linkpill.primary:hover { background: var(--forest-d); color: #fff; }
.linkpill.map {
  background: #fff;
  color: var(--clay-d);
  border-color: var(--clay-l);
  font-weight: 700;
}
.linkpill.map:hover {
  background: var(--clay);
  color: #fff;
  border-color: var(--clay);
}
.linkpill.instagram {
  background: linear-gradient(135deg, #fdf497 0%, #fd5949 40%, #d6249f 70%, #285AEB 100%);
  color: #fff;
  border-color: transparent;
  font-weight: 700;
}
.linkpill.instagram:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}
.linkpill.source {
  background: transparent;
  color: var(--ink-2);
  border-color: var(--border);
  font-weight: 500;
  font-size: 0.78rem;
  padding: 5px 10px;
}
.linkpill.source:hover { background: var(--surface-2); color: var(--clay-d); border-color: var(--ink-faint); }
.source-row { display: flex; flex-wrap: wrap; gap: 4px; }

/* ───── Empty ───── */
.empty {
  margin-top: 20px;
  padding: 28px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--r-lg);
  text-align: center;
  color: var(--ink-3);
}

/* ───── Sources ───── */
.sources {
  margin-top: 36px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
}
.sources h2 {
  font-family: "Zen Old Mincho", serif;
  font-weight: 600;
  font-size: 1.2rem;
  margin: 0 0 6px;
  color: var(--forest-d);
  letter-spacing: 0.02em;
}
.lede-small { font-size: 0.85rem; color: var(--ink-3); margin: 0 0 14px; }
.sources-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 6px 16px;
  font-size: 0.85rem;
}
.sources-list li { padding: 2px 0; }

/* ───── Footer ───── */
.foot {
  margin-top: 34px;
  padding: 22px 18px;
  font-size: 0.78rem;
  color: var(--ink-3);
  text-align: center;
  border-top: 1px solid var(--border-2);
  line-height: 1.7;
}

/* ───── Focus / Motion ───── */
:focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ───── Mobile tweaks ───── */
@media (max-width: 480px) {
  body { font-size: 15px; }
  .hero { padding: 28px 18px 14px; }
  .hero .lede { font-size: 0.96rem; }
  .filters { padding: 14px 14px 6px; }
  .filter-row { gap: 8px; }
  .filter-label { min-width: 48px; font-size: 0.7rem; }
  .card { padding: 16px 14px 14px; }
  .card-name { font-size: 1.02rem; }
  .brand-title { font-size: 1rem; }
  .brand-sub { font-size: 0.7rem; }
  .meta-sub { display: none; }
}

/* ───── Print ───── */
@media print {
  :root { --bg: #fff; --surface: #fff; --surface-2: #fff; }
  html, body {
    background: #fff !important;
    color: #000;
    font-size: 10.5pt;
    line-height: 1.5;
  }
  .masthead { position: static; box-shadow: none; backdrop-filter: none; border-bottom: 1.5px solid #333; }
  .hero-actions, .filters, .legend, .empty, #clear-q, .link-btn, .foot { display: none !important; }
  .hero { padding: 16px 0 8px; }
  .hero h1::before { display: none; }
  .list { margin-top: 12px; padding-bottom: 0; }
  #cards { grid-template-columns: repeat(2, 1fr) !important; gap: 8px; }
  .card {
    break-inside: avoid;
    page-break-inside: avoid;
    box-shadow: none !important;
    border: 1px solid #999 !important;
    background: #fff !important;
    padding: 10px;
  }
  .card::before { display: none; }
  .card:hover { transform: none; }
  .linkpill {
    background: #fff !important;
    color: #000 !important;
    border: 1px solid #999 !important;
    padding: 2px 6px;
    font-size: 9pt;
  }
  .linkpill svg { display: none; }
  .linkpill.primary::after,
  .linkpill.map::after { content: " (" attr(href) ")"; font-size: 8pt; color: #555; word-break: break-all; }
  .tag, .conf { border: 1px solid #999 !important; background: #fff !important; color: #000 !important; }
  a { color: #000; text-decoration: underline; }
  .sources { page-break-before: auto; }
}

/* ───── Mobile-first improvements (≤640px) ───── */
@media (max-width: 640px) {
  /* 読みやすさ向上 */
  body { font-size: 16px; line-height: 1.65; }
  .hero h1 { font-size: 1.6rem; line-height: 1.35; }
  .hero p { font-size: 0.95rem; }

  /* 検索バーをスティッキーに */
  .filters {
    position: sticky;
    top: 8px;
    z-index: 20;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  }

  /* チップを少し大きくタップしやすく */
  .chip {
    padding: 9px 14px;
    font-size: 0.88rem;
    min-height: 38px;
  }

  /* フィルタラベルを上に */
  .filter-row {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  .filter-label {
    min-width: auto;
    padding: 0;
    font-size: 0.7rem;
  }

  /* カードの読みやすさ */
  .card { padding: 16px; }
  .card-title { font-size: 1.05rem; }
  .card-body p { font-size: 0.92rem; }

  /* タップ領域を最低 44x44 に（Apple HIG準拠） */
  .linkpill {
    min-height: 44px;
    padding: 10px 14px;
    font-size: 0.9rem;
    flex: 1 1 auto;
    justify-content: center;
  }
  .linkpill.source { min-height: 36px; font-size: 0.8rem; }

  /* リンクボタンを縦並びに（押しやすく） */
  .links { gap: 8px; }

  /* 検索inputのフォーカス時のズーム防止（iOS） */
  .search input { font-size: 16px; }
}
