/* ============================================================
   main.css — ページ部品（トップ・パンくず・法務・404・用語集の外枠・最近見た）。
   色は gs-shell.css の変数だけを使う（hex を直書きしない。テーマの正本は design/theme.json）。
   Bootstrap は持ち込んでいない（.container / .breadcrumb 等は最小限を自前で定義）。
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; padding: 0;
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic Medium", "Yu Gothic", "Meiryo",
    "Noto Sans JP", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px; color: var(--ink); line-height: 1.7;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { color: var(--g); }
a:hover { color: var(--g-dark); }
main { min-height: 50vh; }
h1, h2, h3, h4 { line-height: 1.35; }
img { max-width: 100%; height: auto; }

.icon { width: 1em; height: 1em; display: inline-block; fill: currentColor; vertical-align: -0.125em; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.container { max-width: 1340px; margin: 0 auto; padding: 0 32px; }
@media (max-width: 992px) { .container { padding: 0 18px; } }

/* ---- ボタン ---- */
.btn-primary {
  display: inline-block; padding: .6rem 1.4rem; border-radius: 999px; background: var(--g); color: #fff;
  font-weight: 700; text-decoration: none; border: 1px solid var(--g);
}
.btn-primary:hover { background: var(--g-dark); color: #fff; }
.btn-outline {
  display: inline-block; padding: .5rem 1.1rem; border-radius: 999px; background: var(--card); color: var(--g);
  font-weight: 700; text-decoration: none; border: 1px solid var(--line);
}
.btn-outline:hover { border-color: var(--g); color: var(--g-dark); }

/* ---- パンくず（macros/breadcrumb.html）---- */
.breadcrumb {
  list-style: none; margin: 14px 0; padding: 0; display: flex; flex-wrap: wrap;
  font-size: .88rem; letter-spacing: .01em; color: var(--gs-mute);
}
.breadcrumb-item + .breadcrumb-item::before { content: '\203A'; padding: 0 .5rem; color: var(--gs-soft-mute); }
.breadcrumb-item a { text-decoration: none; color: var(--gs-mute); transition: color .2s ease; }
.breadcrumb-item a:hover { color: var(--gs-accent); }
.breadcrumb-item.active { color: var(--gs-mute); }
@media (max-width: 767.98px) {
  .breadcrumb { font-size: .74rem; line-height: 1.5; margin: 8px 0; }
  .breadcrumb-item + .breadcrumb-item::before { padding: 0 .3rem; }
}

/* ---- 見出し行（左バー ＋ 見出し ＋ 右端リンク）---- */
.gs-sec-head { display: flex; align-items: center; gap: 10px; margin: 0 0 15px; }
.gs-sec-bar { width: 4px; height: 21px; border-radius: 3px; background: var(--brand); flex-shrink: 0; }
.gs-sec-title { font-size: 1.28rem; font-weight: 800; color: var(--ink); margin: 0; }
.gs-sec-more { margin-left: auto; font-size: .86rem; font-weight: 700; color: var(--g); text-decoration: none; }
.gs-sec-more:hover { text-decoration: underline; }

/* ---- トップ: ヒーロー ---- */
.gs-hero { position: relative; overflow: hidden; background: var(--card); border-bottom: 1px solid var(--line); }
.gs-hero-inner { position: relative; min-height: 300px; display: flex; align-items: center; padding-top: 44px; padding-bottom: 76px; }
.gs-hero-text { position: relative; z-index: 2; max-width: 640px; }
.gs-eyebrow {
  display: inline-block; margin: 0 0 14px; padding: .2rem .8rem; border-radius: 999px;
  background: var(--s-soft); color: var(--s-ink); font-size: .8rem; font-weight: 800; letter-spacing: .04em;
}
.gs-hero-h1 { font-size: 2.6rem; font-weight: 900; line-height: 1.3; letter-spacing: .012em; color: var(--ink); margin: 0 0 18px; }
.gs-hero-h1 em { color: var(--g); font-style: normal; }
.gs-hero-lead { font-size: 1rem; line-height: 1.95; color: var(--mute); max-width: 36em; margin: 0; }

/* ---- トップ: 柱カード ---- */
.gs-cards-wrap { margin-top: -52px; position: relative; z-index: 5; }
.gs-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.gs-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 22px 24px;
  display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit;
  box-shadow: 0 20px 34px -28px rgba(16,36,43,.55); transition: transform .18s ease, box-shadow .18s ease;
}
a.gs-card:hover { transform: translateY(-4px); box-shadow: 0 28px 44px -26px rgba(16,36,43,.5); color: inherit; }
.gs-card.is-soon { opacity: .78; }
.gs-card-ic { width: 62px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: var(--g); }
.gs-card-ic .icon { width: 44px; height: 44px; }
.gs-card-body { flex: 1; min-width: 0; }
.gs-card-body h2 { font-size: 1.14rem; font-weight: 800; color: var(--ink); margin: 0 0 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gs-card-body p { font-size: .82rem; color: var(--mute); line-height: 1.65; margin: 0; }
.gs-soon { font-size: .68rem; font-weight: 800; color: var(--s-ink); background: var(--s-soft); border-radius: 999px; padding: .1rem .55rem; }
.gs-card-go { width: 44px; height: 44px; border-radius: 50%; background: var(--g); color: #fff;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: transform .18s ease; }
.gs-card-go .icon { width: 20px; height: 20px; }
a.gs-card:hover .gs-card-go { transform: translateX(3px); }

/* ---- トップ: 掲載の方針 ---- */
.gs-home-policy { margin-top: 44px; }
.gs-policy-list { margin: 0 0 16px; padding: 0; list-style: none; display: grid; gap: 8px; }
.gs-policy-list li {
  padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--card);
  font-size: .93rem; color: var(--mute);
}
.gs-policy-list li b { color: var(--ink); margin-right: .3em; }
.gs-home-note { font-size: .88rem; color: var(--mute); }

/* ---- トップ: 収録数・都道府県・大会・記事（数字は home_api が索引から数える）---- */
.gs-stats { list-style: none; margin: 36px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.gs-stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.gs-stat b { font-size: 1.55rem; font-weight: 900; color: var(--ink); line-height: 1.2; font-variant-numeric: tabular-nums; }
.gs-stat span { font-size: .8rem; color: var(--mute); }
.gs-home-prefs, .gs-home-events, .gs-home-articles { margin-top: 44px; }
.gs-prefs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 18px; }
.gs-pref-region h3 { font-size: .8rem; font-weight: 800; color: var(--mute); margin: 0 0 6px; letter-spacing: .04em; }
.gs-pref-region ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.gs-pref-region a, .gs-pref-region .is-zero { display: inline-flex; align-items: baseline; gap: 5px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); font-size: .86rem; font-weight: 700; color: var(--ink); text-decoration: none; }
.gs-pref-region a span, .gs-pref-region .is-zero span { font-size: .72rem; font-weight: 700; color: var(--g); font-variant-numeric: tabular-nums; }
.gs-pref-region .is-zero { color: var(--mute); background: transparent; }
.gs-pref-region .is-zero span { color: var(--mute); }
.gs-pref-region a:hover { border-color: var(--g); }
.gs-events, .gs-arts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.gs-events a, .gs-arts a { display: grid; grid-template-columns: 10em 1fr; gap: 2px 14px; align-items: baseline; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); text-decoration: none; color: var(--ink); }
.gs-events a:hover, .gs-arts a:hover { border-color: var(--g); }
.gs-event-date, .gs-art-cat { font-size: .8rem; font-weight: 700; color: var(--g); font-variant-numeric: tabular-nums; }
.gs-event-name, .gs-art-title { font-size: .95rem; font-weight: 800; }
.gs-event-meta, .gs-art-date { grid-column: 2; font-size: .8rem; color: var(--mute); }
@media (max-width: 900px) {
  .gs-hero-h1 { font-size: 2rem; }
  .gs-hero-inner { min-height: 0; padding-top: 30px; padding-bottom: 66px; }
  .gs-cards { grid-template-columns: 1fr; gap: 12px; }
  .gs-cards-wrap { margin-top: -40px; }
  .gs-stats { grid-template-columns: repeat(2, 1fr); margin-top: 28px; }
  .gs-prefs { grid-template-columns: repeat(2, 1fr); }
  .gs-events a, .gs-arts a { grid-template-columns: 1fr; }
  .gs-event-meta, .gs-art-date { grid-column: 1; }
}

/* ---- 施設検索フォーム（partials/search_form.html。トップ・/gym/ のハブ・検索結果ページが共有するので main.css に置く）---- */
.gy-search { margin: .9rem 0 .6rem; max-width: 40em; }
.gy-search-label { display: block; font-size: .74rem; font-weight: 700; letter-spacing: .04em; color: var(--mute); margin: 0 0 .3rem; }
.gy-search-row { display: flex; gap: .5rem; }
.gy-search-input { flex: 1 1 auto; min-width: 0; min-height: 46px; padding: .5rem .9rem; font-size: 1rem; color: var(--ink); background: var(--card);
  border: 2px solid var(--line); border-radius: 12px; -webkit-appearance: none; appearance: none; }
.gy-search-input:focus { outline: none; border-color: var(--g); box-shadow: 0 0 0 3px var(--gs-accent-soft); }
.gy-search-btn { display: inline-flex; align-items: center; gap: .35rem; min-height: 46px; padding: 0 1rem; border: 1px solid var(--g); border-radius: 12px;
  background: var(--g); color: #fff; font-weight: 700; font-size: .95rem; white-space: nowrap; cursor: pointer; }
.gy-search-btn:hover { background: var(--g-dark); border-color: var(--g-dark); }
.gy-search-btn .icon { width: 1.05em; height: 1.05em; }
.gy-search-hits { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .6rem .9rem; margin: 0 0 1rem; }
.gy-search-hit h3 { font-size: .8rem; font-weight: 800; letter-spacing: .04em; color: var(--mute); margin: 0 0 .35rem; }
.gy-search-hit .gy-rows { grid-template-columns: 1fr; }
.gy-search-empty p { margin: 0; color: var(--ink); }
.gy-search-empty ul { margin: .5rem 0 0; padding-left: 1.2rem; line-height: 1.9; color: var(--ink); }
.gy-search-empty a, .gy-search-how a { color: var(--g); font-weight: 700; }
.gy-search-how { margin: 0; padding-left: 1.2rem; line-height: 1.9; color: var(--ink); }
.gy-search-how b { color: var(--g); margin-right: .3em; }

/* ---- 法務ページ（運営者情報・プライバシー・免責）---- */
.legal { max-width: 720px; margin: 0 auto; padding: 36px 0 24px; line-height: 1.85; color: var(--ink); }
.legal h1 { font-size: 1.6rem; font-weight: 800; margin: 0 0 1rem; }
.legal h2 { font-size: 1.1rem; font-weight: 700; margin: 1.75rem 0 .5rem; }
.legal p, .legal li, .legal dd { color: var(--gs-mute); }
.legal ul { padding-left: 1.25rem; }
.legal-table { display: grid; grid-template-columns: 9em 1fr; gap: .35rem 1rem; margin: 0; }
.legal-table dt { font-weight: 700; color: var(--ink); }
.legal-table dd { margin: 0; }
@media (max-width: 600px) { .legal-table { grid-template-columns: 1fr; gap: 0 } .legal-table dd { margin-bottom: .6rem; } }
.legal .legal-date { font-size: .82rem; color: var(--mute); margin-top: 2rem; }
.legal .legal-nav { font-size: .86rem; color: var(--mute); margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }

/* ---- 404 ---- */
.notfound { max-width: 720px; margin: 0 auto; padding: 64px 0 40px; text-align: center; }
.notfound h1 { font-size: 1.8rem; font-weight: 800; color: var(--ink); margin: 0 0 .8rem; }
.notfound .lead { color: var(--gs-mute); margin: 0 0 1.5rem; }
.notfound-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0 0 1.4rem; }

/* ---- 最近見たページ（static/js/recent.js が描画。base.html の [data-recent-strip]）---- */
.gs-recent { margin: 36px auto 8px; }
.gs-recent-h { font-size: 1rem; font-weight: 800; color: var(--ink); margin: 0 0 12px; padding-left: 10px; border-left: 3px solid var(--brand); }
.gs-recent-scroll { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 10px;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.gs-recent-card { flex: 0 0 156px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 6px;
  background: var(--gs-card); border: 1px solid var(--gs-border-soft); border-radius: 10px;
  padding: 8px; color: inherit; text-decoration: none; min-width: 0;
  transition: border-color .15s ease, box-shadow .15s ease; }
.gs-recent-card:hover { border-color: var(--g); box-shadow: 0 2px 8px rgba(15,118,110,.12); color: inherit; text-decoration: none; }
.gs-recent-thumb { display: block; width: 100%; aspect-ratio: 4 / 3; border-radius: 6px; overflow: hidden; background: var(--soft); }
.gs-recent-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.gs-recent-noimg { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%;
  font-size: 1.6rem; font-weight: 800; color: var(--brand); }
.gs-recent-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gs-recent-kind { font-size: .68rem; font-weight: 700; color: var(--mute); letter-spacing: .04em; }
.gs-recent-title { font-size: .82rem; font-weight: 600; line-height: 1.35; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 600px) { .gs-recent-card { flex-basis: 132px; } }
