/* トップページ（templates/home.html）だけで読む。2026-10-15 作り直し（決めごとは docs/design/top-page.md）。
   ゴルフスケール／トラベルスケール／テニスナビの home.css と同じ骨（白いカード基調・スライド＋目次・検索 1 本・お知らせ・各欄・スマホの間引き）を、
   このサイトの色（gs-shell.css の変数。主色はティール・副色は橙・差し色は青）で組む。色の hex は書かない。 */
.hm { --hm-gap: 40px; --hm-card: var(--card); --hm-line: var(--line); --hm-sub: var(--mute); --hm-radius: 10px;
  --hm-shadow: 0 1px 2px rgba(16, 36, 43, .06), 0 8px 24px -20px rgba(16, 36, 43, .35); padding-bottom: 8px; }
.hm h2, .hm h3 { border-bottom: 0; }
.hm .hm-sec { margin-top: var(--hm-gap); }
.hm .hm-sec-last { margin-bottom: 24px; }
.hm-sec-h { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.hm-sec-h h2, .hm-box-h h3 { margin: 0; font-size: 1.3rem; line-height: 1.4; font-weight: 800; color: var(--ink); }
.hm-more { margin-left: auto; font-size: .88rem; font-weight: 700; color: var(--g); white-space: nowrap; text-decoration: none; }
.hm-more::after { content: " ›"; }
.hm-more:hover { text-decoration: underline; }

/* ボタン・札 */
.hm-btn { display: inline-block; padding: 9px 22px; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--card);
  color: var(--ink); font-size: .9rem; font-weight: 700; text-decoration: none; line-height: 1.4; }
.hm-btn:hover { background: var(--ink); color: #fff; }
.hm-btn.is-main { border-color: var(--g); background: var(--g); color: #fff; }
.hm-btn.is-main:hover { background: var(--g-dark); border-color: var(--g-dark); }
.hm-btn.is-orange { border-color: var(--s-ink); background: var(--s-ink); color: #fff; }
.hm-btn.is-orange:hover { background: var(--s); border-color: var(--s); }
.hm-badge { display: inline-block; padding: 1px 8px; border-radius: 4px; font-size: .74rem; font-weight: 700; line-height: 1.6; white-space: nowrap; background: var(--soft); color: var(--hm-sub); }
.hm-badge.is-o { background: var(--s-soft); color: var(--s-ink); }
.hm-tag { padding: 0 7px; border-radius: 4px; background: var(--soft); color: var(--hm-sub); line-height: 1.7; font-size: .78rem; white-space: nowrap; }
.hm-rk-n { width: 26px; height: 26px; border-radius: 50%; background: var(--g); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; flex: 0 0 auto; }

/* ===== スライド: 左に大きく 1 枚（文字＋写真か一覧）＋ PC は右に目次 ===== */
.hm-mv { position: relative; margin-top: 20px; }
.hm-mv-main { position: relative; min-width: 0; }
/* 枠の高さは固定（幅の 1/2。16:9 は「縦長すぎる」＝ 2026-10-20 ユーザー判断で 2:1 に）。写真の縦横比や一覧の行数で高さが変わると、目次で切り替えたとき枠がカクカク動く（2026-10-15 ユーザー指摘） */
.hm-slide { display: grid; grid-template-columns: minmax(0, 45fr) minmax(0, 55fr); grid-template-rows: minmax(0, 1fr); aspect-ratio: 2 / 1; overflow: hidden;
  border: 1px solid var(--hm-line); border-radius: var(--hm-radius); background: var(--hm-card); }
.hm-slide[hidden] { display: none; }
.hm-slide.img-broken, .hm-slide:not(.has-img):not(.has-fig) { grid-template-columns: 1fr; }
.hm-slide.img-broken .hm-slide-img { display: none; }
.hm-slide-txt { display: flex; flex-direction: column; justify-content: center; gap: 10px; padding: 28px 30px; min-width: 0; min-height: 0; overflow: hidden; }
.hm-slide-lbl { align-self: flex-start; padding: 0 10px; border-radius: 99px; font-size: .76rem; font-weight: 700; line-height: 1.8; background: var(--tint); color: var(--g); }
.hm-slide-lbl.is-o { background: var(--s-soft); color: var(--s-ink); }
.hm-slide-lbl.is-g { background: var(--y-soft); color: var(--y-deep); }
.hm-slide-h { margin: 0; font-size: 1.65rem; line-height: 1.35; font-weight: 800; letter-spacing: .01em; color: var(--ink); }   /* 行は title_lines で切ってあるので balance は掛けない（語の途中で割れる） */
.hm-slide-ctas { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.hm-slide-img { position: relative; display: block; min-width: 0; min-height: 0; background: var(--soft); }
.hm-slide-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }   /* 写真の実寸で枠を押し広げない */
.hm-slide-img.is-contain { background: var(--card); border-left: 1px solid var(--hm-line); }
.hm-slide-img.is-contain img { object-fit: contain; padding: 24px; }   /* 白地の商品写真は切らない */
.hm-slide-credit { position: absolute; left: 8px; bottom: 8px; max-width: calc(100% - 16px); padding: 1px 8px; border-radius: 6px; background: rgba(16, 36, 43, .62); color: #fff; font-size: .68rem; line-height: 1.6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-slide-fig { display: flex; align-items: center; justify-content: center; padding: 16px 20px; background: var(--soft); min-width: 0; min-height: 0; overflow: hidden; }
.hm-slide-list { flex-direction: column; align-items: stretch; gap: 6px; margin: 0; list-style: none; }
.hm-slide-list li { display: flex; }
.hm-slide-list a { display: flex; flex: 1; align-items: center; gap: 12px; padding: 7px 14px; border-radius: 8px; background: var(--card); color: var(--ink); text-decoration: none; min-width: 0; box-shadow: var(--hm-shadow); }
.hm-slide-list a:hover { color: var(--g); }
.hm-slide-list-bd { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.hm-slide-list-bd b { font-size: .95rem; font-weight: 800; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hm-slide-list-bd small { font-size: .74rem; color: var(--hm-sub); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hm-tiles { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: stretch; padding: 14px; background: var(--card); border-left: 1px solid var(--hm-line); }
.hm-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0; min-height: 0; padding: 8px; border-radius: 12px; background: var(--soft); color: var(--ink); text-decoration: none; }
.hm-tile:hover b { color: var(--g); }
.hm-tile img { flex: 1 1 0; width: 100%; height: 0; min-height: 0; object-fit: contain; }
.hm-tile b, .hm-tile span { max-width: 100%; font-size: .74rem; line-height: 1.35; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hm-tile b { font-weight: 800; }
.hm-tile span { color: var(--hm-sub); }
.hm-tile small { font-size: .76rem; font-weight: 800; color: var(--s-ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.hm-slide-list-v { margin-left: auto; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--g); }
/* 前後ボタン・ドット（目次が入らない幅で出す） */
.hm-mv-nav { display: none; position: absolute; top: 50%; z-index: 2; width: 44px; height: 44px; margin-top: -22px; padding: 0; border: 0; border-radius: 50%;
  background: var(--card); color: var(--ink); box-shadow: var(--hm-shadow); cursor: pointer; align-items: center; justify-content: center; }
.hm-mv-nav .icon { width: 18px; height: 18px; }
.hm-mv-prev { left: -16px; }
.hm-mv-next { right: -16px; }
.hm-mv-dots { display: flex; justify-content: center; gap: 10px; margin-top: 10px; line-height: 0; }
.hm-dot { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%; background: var(--line); cursor: pointer; }
.hm-dot.is-on { background: var(--g); }
.hm-toc { display: none; }
@media (min-width: 1000px) {
  .hm-mv.has-toc { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; }
  .has-toc .hm-mv-nav, .has-toc .hm-mv-dots { display: none; }
  .hm-toc { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
  .hm-toc li { display: flex; flex: 1 1 0; min-height: 0; }
  .hm-toc a { position: relative; display: flex; flex-direction: column; justify-content: center; flex: 1; padding: 6px 12px; overflow: hidden; border: 1px solid var(--hm-line); border-radius: 8px;
    background: var(--card); color: var(--ink); text-decoration: none; transition: border-color .15s; }
  .hm-toc a:hover { border-color: var(--g); }
  .hm-toc a.is-on { border-color: var(--g); box-shadow: inset 4px 0 0 var(--g); }
  .hm-toc b, .hm-toc small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; line-height: 1.4; }
  .hm-toc b { font-size: .84rem; }
  .hm-toc small { font-size: .74rem; color: var(--hm-sub); }   /* 2 行目は中身の要約（施設の所在地・日付・1 位 …）。説明文ではなくコンテンツ */
  .hm-toc a.is-on::after { content: ""; position: absolute; left: 0; bottom: 0; width: 0; height: 3px; background: var(--g); }
  .hm-mv.is-playing .hm-toc a.is-on::after { animation: hm-prog 6s linear forwards; }
}
@keyframes hm-prog { to { width: 100%; } }
@media (min-width: 768px) and (max-width: 999px) {
  .hm-mv-main { padding: 0 56px; }
  .hm-mv-nav { display: flex; }
  .hm-mv-prev { left: 6px; }
  .hm-mv-next { right: 6px; }
}
/* 768〜1199px は枠が 620〜710px で文字の列が 280〜320px しかない。見出しと余白を詰めて枠に収める（はみ出すと overflow で切れる） */
@media (min-width: 768px) and (max-width: 1199px) {
  .hm-slide-txt { gap: 8px; padding: 18px 20px; }
  .hm-slide-h { font-size: 1.3rem; }
  .hm-slide-ctas .hm-btn { padding: 7px 14px; font-size: .84rem; }
  .hm-slide-list a { padding: 6px 12px; gap: 10px; }
  .hm-slide-list-bd b { font-size: .88rem; }
}

/* ===== 検索（丸い枠 1 本・主色。partials/search_form.html の .gy-search ＝ カテゴリの select ＋ 入力 ＋ ボタン） ===== */
.hm-find { margin-top: 24px; }
.hm-h1 { margin: 0 0 10px; font-size: .95rem; font-weight: 700; color: var(--hm-sub); border: 0; }
.gy-search { display: flex; align-items: stretch; max-width: 720px; margin: 0 auto; overflow: hidden; border: 2px solid var(--g); border-radius: 999px; background: var(--card); }
.gy-search:focus-within { box-shadow: 0 0 0 3px rgba(15, 118, 110, .22); }
.gy-search-cat { position: relative; display: flex; align-items: center; flex: 0 0 auto; border-right: 1px solid var(--hm-line); background: var(--soft); }
.gy-search-cat::after { content: ""; position: absolute; right: 14px; top: 50%; width: 7px; height: 7px; border-right: 2px solid var(--g); border-bottom: 2px solid var(--g);
  transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.gy-search-cat select { -webkit-appearance: none; appearance: none; border: 0; outline: 0; background: transparent; font: inherit; font-size: .88rem; font-weight: 800; color: var(--g);
  padding: 0 32px 0 18px; height: 100%; cursor: pointer; }
.gy-search-input { flex: 1; display: flex; align-items: center; gap: 10px; padding: 0 6px 0 16px; min-width: 0; }
.gy-search-ic { width: 18px; height: 18px; color: var(--hm-sub); flex-shrink: 0; }
.gy-search-input input { flex: 1; min-width: 0; padding: 11px 0; border: 0; outline: 0; font: inherit; font-size: 16px; background: transparent; color: var(--ink); }
.gy-search-input input::placeholder { color: var(--hm-sub); }
.gy-search-btn { flex: 0 0 auto; padding: 0 24px; border: 0; background: var(--g); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.gy-search-btn:hover { background: var(--g-dark); }

/* ===== お知らせカード ===== */
.hm-info { display: grid; gap: 12px; margin-top: 24px; }
.hm-promo { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 16px; padding: 14px 16px 14px 14px; background: var(--hm-card);
  border: 1px solid var(--hm-line); border-left: 5px solid var(--pc); border-radius: var(--hm-radius); color: var(--ink); text-decoration: none; transition: box-shadow .15s, transform .15s; }
.hm-promo.is-b { --pc: var(--brand); --pc-soft: var(--tint); --pc-ink: var(--g); }
.hm-promo.is-o { --pc: var(--s); --pc-soft: var(--s-soft); --pc-ink: var(--s-ink); }
.hm-promo:hover { color: var(--ink); box-shadow: 0 10px 24px -18px rgba(16, 36, 43, .55); transform: translateY(-1px); }
.hm-promo-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.hm-promo-eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-size: .74rem; }
.hm-promo-label { font-weight: 700; color: var(--pc-ink); background: var(--pc-soft); padding: 0 8px; border-radius: 99px; }
.hm-promo-title { font-weight: 800; font-size: 1.02rem; line-height: 1.4; }
.hm-promo-cta { display: inline-flex; align-items: center; gap: 2px; padding: 8px 12px 8px 16px; border-radius: 99px; background: var(--pc-ink); color: #fff; font-weight: 700; font-size: .84rem; white-space: nowrap; }
.hm-promo-cta .icon { width: 15px; height: 15px; }
@media (min-width: 1000px) { .hm-info { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } }

/* ===== これからの大会 ===== */
.hm-ev-grid { display: grid; gap: 12px; }
.hm-evc { display: flex; flex-direction: column; gap: 4px; padding: 13px 16px; border: 1px solid var(--hm-line); border-radius: var(--hm-radius); background: var(--hm-card);
  color: var(--ink); text-decoration: none; min-width: 0; transition: border-color .15s; }
.hm-evc:hover { border-color: var(--g); color: var(--ink); }
.hm-evc-top { display: flex; align-items: center; gap: 8px; }
.hm-evc-date { font-weight: 800; font-variant-numeric: tabular-nums; }
.hm-evc-top .hm-badge { margin-left: auto; }
.hm-evc-title { font-weight: 800; line-height: 1.45; }
.hm-evc-place { font-size: .84rem; color: var(--hm-sub); }
.hm-evc-meta { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: auto; padding-top: 4px; font-size: .78rem; }
@media (min-width: 640px) { .hm-ev-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .hm-ev-grid { grid-template-columns: repeat(4, 1fr); } }

/* ===== ランキング ===== */
.hm-rk-grid { display: grid; gap: 12px; }
.hm-rkc { display: flex; flex-direction: column; gap: 4px; padding: 13px 16px; border: 1px solid var(--hm-line); border-radius: var(--hm-radius); background: var(--hm-card);
  color: var(--ink); text-decoration: none; min-width: 0; transition: border-color .15s; }
.hm-rkc:hover { border-color: var(--g); color: var(--ink); }
.hm-rkc-cat { font-size: .8rem; font-weight: 700; color: var(--g); }
.hm-rkc-top { display: flex; align-items: center; gap: 8px; font-weight: 800; line-height: 1.4; flex-wrap: wrap; }
.hm-rkc-top small { font-weight: 600; color: var(--hm-sub); }
.hm-rkc-rest { font-size: .8rem; color: var(--hm-sub); line-height: 1.6; }
.hm-uses { margin-top: 12px; }
@media (min-width: 640px) { .hm-rk-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .hm-rk-grid { grid-template-columns: repeat(3, 1fr); } }

/* ===== 新しくオープンした施設（横スクロール） ===== */
.hm-scroll { display: flex; gap: 12px; overflow-x: auto; padding: 2px 2px 8px; scroll-snap-type: x proximity; }
.hm-pc { display: block; width: 190px; flex: 0 0 190px; scroll-snap-align: start; overflow: hidden; border: 1px solid var(--hm-line); border-radius: var(--hm-radius); background: var(--hm-card);
  color: var(--ink); text-decoration: none; transition: border-color .15s; }
.hm-pc.img-broken { display: none; }   /* 写真が読めなかった札は隠す（home.js） */
.hm-pc:hover { border-color: var(--g); color: var(--ink); }
.hm-pc-im { display: block; height: 124px; background: var(--soft); }
.hm-pc-im img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hm-pc-bd { display: block; padding: 8px 12px 10px; font-size: .86rem; line-height: 1.5; }
.hm-pc-bd small { display: block; font-size: .74rem; color: var(--hm-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-pc-bd b { display: block; font-weight: 800; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ===== 箱（ジムを探す: 都道府県・条件・駅・ブランド） ===== */
.hm-two { display: grid; gap: 20px; }
.hm-box { padding: 16px 18px; border: 1px solid var(--hm-line); border-radius: var(--hm-radius); background: var(--hm-card); min-width: 0; }
.hm-box-h { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.hm-box .hm-box-h h3 { font-size: 1.05rem; }
.hm-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.hm-chips a { display: inline-block; padding: 4px 11px; border-radius: 999px; background: var(--tint); color: var(--g); font-size: .84rem; font-weight: 700; text-decoration: none; line-height: 1.6; }
.hm-chips a:hover { background: var(--g); color: #fff; }
.hm-chips a:hover small { color: #fff; }
.hm-chips small { margin-left: 5px; font-size: .72rem; font-weight: 500; color: var(--hm-sub); font-variant-numeric: tabular-nums; }
@media (min-width: 900px) { .hm-two { grid-template-columns: 1fr 1fr; } }

/* ===== カテゴリから探す ===== */
.hm-cats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 0; padding: 0; list-style: none; }
.hm-cat { display: flex; flex-direction: column; height: 100%; padding: 13px 14px; border: 1px solid var(--hm-line); border-radius: var(--hm-radius); background: var(--hm-card);
  box-shadow: var(--hm-shadow); color: var(--ink); text-decoration: none; transition: border-color .15s; min-width: 0; }
.hm-cat:hover { border-color: var(--g); color: var(--ink); }
.hm-cat-ic .icon { width: 28px; height: 28px; color: var(--g); }
.hm-cat-name { margin-top: 6px; font-weight: 800; line-height: 1.35; }
.hm-cat-count { font-size: .8rem; font-weight: 700; color: var(--g); font-variant-numeric: tabular-nums; }
@media (min-width: 640px) { .hm-cats { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .hm-cats { grid-template-columns: repeat(5, 1fr); } }

/* ===== 読み物（画像の無い記事なので文字のカード） ===== */
.hm-arts { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.hm-art { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 12px 16px; border: 1px solid var(--hm-line); border-radius: var(--hm-radius); background: var(--hm-card);
  color: var(--ink); text-decoration: none; transition: border-color .15s; }
.hm-art:hover { border-color: var(--g); color: var(--ink); }
.hm-art small { font-size: .74rem; font-weight: 700; color: var(--g); }
.hm-art-title { font-weight: 800; line-height: 1.5; font-size: .95rem; }
@media (min-width: 640px) { .hm-arts { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .hm-arts { grid-template-columns: repeat(3, 1fr); } }

/* ===== スマホ ===== */
@media (max-width: 767px) {
  .hm { --hm-gap: 32px; }
  .hm-mv { margin-top: 12px; }
  .hm-slide, .hm-slide.has-img, .hm-slide.has-fig { grid-template-columns: 1fr; grid-template-rows: none; aspect-ratio: auto; }   /* スマホは写真が上・文字が下で縦に積むので枠の比率は固定しない */
  .hm-slide.has-img .hm-slide-img { order: -1; aspect-ratio: 16 / 9; }
  .hm-slide-img.is-contain { border-left: 0; border-bottom: 1px solid var(--hm-line); }
  .hm-slide-img.is-contain img { padding: 12px; }
  .hm-slide.has-fig .hm-slide-fig { order: -1; min-height: 120px; }
  .hm-slide-list li:nth-child(n+4) { display: none; }
  .hm-tiles { border-left: 0; border-bottom: 1px solid var(--hm-line); aspect-ratio: 16 / 9; grid-template-rows: minmax(0, 1fr); padding: 10px; }
  .hm-tile:nth-child(n+3) { display: none; }   /* スマホは 2 商品（4 つだと写真が切手の大きさになる） */
  .hm-slide-txt { gap: 8px; padding: 14px 16px 16px; }
  .hm-slide-h { font-size: 1.25rem; }
  .hm-slide-ctas .hm-btn { width: 100%; text-align: center; }
  .gy-search-cat select { font-size: .8rem; padding: 0 26px 0 12px; }
  .gy-search-cat::after { right: 10px; }
  .gy-search-ic { display: none; }
  .gy-search-input { padding-left: 12px; }
  .gy-search-btn { padding: 0 16px; }
  /* スマホは短く（兄弟サービスと同じ密度）: お知らせ 1 枚・大会 3 件・ランキングは 1 位だけ・都道府県 10・条件 8・駅 6・ブランド 6・カテゴリ 8・読み物 2 本 */
  .hm-info .hm-promo:nth-child(n+2), .hm-ev-grid > :nth-child(n+4), .hm-rkc-rest, .hm-rkc-top small,
  .hm-prefs > li:nth-child(n+11), .hm-facets > li:nth-child(n+9), .hm-stations > li:nth-child(n+7), .hm-brands > li:nth-child(n+7),
  .hm-cats > li:nth-child(n+9), .hm-arts > li:nth-child(n+3) { display: none; }
  .hm-sec-h h2, .hm-box-h h3 { font-size: 1.15rem; }
  .hm-pc { width: 150px; flex-basis: 150px; }
  .hm-pc-im { height: 100px; }
}
