/*
Theme Name: 食べ放題ハンター
Theme URI: https://example.com/
Author: リーブル株式会社
Description: 食べ放題専門グルメサイト用オリジナルテーマ。日本地図検索・会員登録・口コミ★評価機能を搭載。
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: tabehodai-hunter
*/

:root {
  --th-primary: #e65c00;
  --th-primary-dark: #c24e00;
  --th-accent: #d92b2b;
  --th-star: #f5a623;
  --th-text: #2b2b2b;
  --th-muted: #777;
  --th-bg: #faf7f2;
  --th-white: #fff;
  --th-border: #e8e0d5;
  --th-radius: 10px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  color: var(--th-text);
  background: var(--th-bg);
  line-height: 1.7;
}
img { max-width: 100%; height: auto; }
a { color: var(--th-primary-dark); text-decoration: none; }
a:hover { opacity: .85; }

.th-container { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* ---------- Header ---------- */
.th-header { background: var(--th-white); border-bottom: 3px solid var(--th-primary); position: sticky; top: 0; z-index: 100; }
.th-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; max-width: 1080px; margin: 0 auto; position: relative; }
.th-logo { font-size: 1.5rem; font-weight: 900; color: var(--th-primary); letter-spacing: .02em; }
.th-logo a { color: inherit; }
.th-logo .th-logo-sub { display: block; font-size: .65rem; font-weight: 400; color: var(--th-muted); letter-spacing: .2em; }
.th-nav ul { list-style: none; display: flex; gap: 20px; margin: 0; padding: 0; }
.th-nav a { font-weight: 600; color: var(--th-text); font-size: .95rem; }
.th-member-links { display: flex; gap: 8px; align-items: center; }
.th-btn {
  display: inline-block; background: var(--th-primary); color: #fff !important;
  padding: 8px 18px; border-radius: 999px; font-weight: 700; font-size: .9rem;
  border: none; cursor: pointer;
}
.th-btn:hover { background: var(--th-primary-dark); opacity: 1; }
.th-btn--ghost { background: transparent; color: var(--th-primary) !important; border: 2px solid var(--th-primary); }
.th-btn--ghost:hover { background: #fff3e8; }
.th-nav-toggle { display: none; background: none; border: none; font-size: 1.6rem; cursor: pointer; color: var(--th-primary); }

.th-search-bar { background: var(--th-primary); padding: 10px 0; }
.th-search-bar form { display: flex; gap: 8px; max-width: 640px; margin: 0 auto; padding: 0 16px; }
.th-search-bar input[type="search"] {
  flex: 1; padding: 9px 14px; border: none; border-radius: 999px; font-size: .95rem;
}
.th-search-bar button { background: var(--th-text); color: #fff; border: none; border-radius: 999px; padding: 0 22px; font-weight: 700; cursor: pointer; }

/* ---------- Hero ---------- */
.th-hero { text-align: center; padding: 44px 16px 10px; }
.th-hero h1 { font-size: 1.9rem; margin: 0 0 8px; }
.th-hero h1 span { color: var(--th-primary); }
.th-hero p { color: var(--th-muted); margin: 0; }

/* ---------- Japan map ---------- */
.th-map-section { padding: 24px 0 48px; }
.th-map {
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  gap: 5px;
  max-width: 860px;
  margin: 0 auto;
}
.th-map a {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  transition: transform .12s ease;
}
.th-map a:hover { transform: scale(1.12); opacity: 1; z-index: 2; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.th-map .th-count {
  font-size: .62rem; font-weight: 400; background: rgba(255,255,255,.28);
  border-radius: 999px; padding: 0 6px; margin-top: 2px;
}
.th-region-hokkaido { background: #4a90d9; }
.th-region-tohoku   { background: #45b0a8; }
.th-region-kanto    { background: #e65c00; }
.th-region-chubu    { background: #8bbd3f; }
.th-region-kinki    { background: #d9534f; }
.th-region-chugoku  { background: #b06ab3; }
.th-region-shikoku  { background: #e6a23c; }
.th-region-kyushu   { background: #e64980; }
.th-map-legend { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 18px; font-size: .8rem; color: var(--th-muted); }
.th-map-legend span::before { content: ""; display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; background: var(--c, #ccc); }

/* ---------- Sections ---------- */
.th-section { padding: 40px 0; }
.th-section--alt { background: var(--th-white); }
.th-section-title { text-align: center; font-size: 1.5rem; margin: 0 0 6px; }
.th-section-title span { color: var(--th-primary); }
.th-section-sub { text-align: center; color: var(--th-muted); font-size: .85rem; margin: 0 0 28px; letter-spacing: .15em; }
.th-more { text-align: center; margin-top: 26px; }

/* ---------- Shop cards ---------- */
.th-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.th-card {
  background: var(--th-white); border: 1px solid var(--th-border); border-radius: var(--th-radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: box-shadow .15s ease;
}
.th-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.1); }
.th-card-thumb { aspect-ratio: 16 / 10; background: #eee; display: block; }
.th-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.th-card-thumb--placeholder { display: flex; align-items: center; justify-content: center; color: #d9b98a; font-size: 2rem; background: linear-gradient(135deg, #f7ead9, #f3d9bb); }
.th-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.th-card h3 { margin: 0; font-size: 1.05rem; line-height: 1.4; }
.th-card h3 a { color: var(--th-text); }
.th-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.th-badge { font-size: .7rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: #fff1e5; color: var(--th-primary-dark); border: 1px solid #f5cba2; }
.th-badge--pref { background: #e8f2fb; color: #2a6db0; border-color: #bcd7ef; }
.th-card-meta { font-size: .8rem; color: var(--th-muted); }
.th-card-price { font-weight: 700; color: var(--th-accent); font-size: .95rem; }

/* ---------- Stars ---------- */
.th-stars { position: relative; display: inline-block; font-size: 1rem; line-height: 1; color: #ddd; letter-spacing: 2px; }
.th-stars::before { content: "★★★★★"; }
.th-stars .th-stars-fill { position: absolute; top: 0; left: 0; overflow: hidden; white-space: nowrap; color: var(--th-star); }
.th-stars .th-stars-fill::before { content: "★★★★★"; letter-spacing: 2px; }
.th-rating-num { font-weight: 800; color: var(--th-star); margin-left: 6px; }
.th-rating-count { font-size: .78rem; color: var(--th-muted); }

/* ---------- Ranking ---------- */
.th-ranking { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.th-ranking li { position: relative; }
.th-ranking .th-card { flex-direction: row; align-items: center; }
.th-ranking .th-card-thumb { width: 180px; flex-shrink: 0; aspect-ratio: 16/11; }
.th-rank-no {
  position: absolute; top: -8px; left: -8px; z-index: 3;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--th-text); color: #fff; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.th-ranking li:nth-child(1) .th-rank-no { background: #d4a017; }
.th-ranking li:nth-child(2) .th-rank-no { background: #9c9c9c; }
.th-ranking li:nth-child(3) .th-rank-no { background: #a05a2c; }

/* ---------- News list ---------- */
.th-news-list { list-style: none; margin: 0 auto; padding: 0; max-width: 720px; }
.th-news-list li { border-bottom: 1px dashed var(--th-border); padding: 12px 4px; display: flex; gap: 16px; align-items: baseline; }
.th-news-date { color: var(--th-muted); font-size: .82rem; white-space: nowrap; }

/* ---------- Single shop ---------- */
.th-main { padding: 36px 0 64px; }
.th-single-header h1 { font-size: 1.7rem; margin: 8px 0 10px; }
.th-eyecatch { border-radius: var(--th-radius); overflow: hidden; margin: 18px 0; }
.th-rating-panel {
  display: flex; gap: 28px; flex-wrap: wrap; align-items: center;
  background: var(--th-white); border: 1px solid var(--th-border);
  border-radius: var(--th-radius); padding: 18px 22px; margin: 18px 0;
}
.th-rating-panel .th-rating-big { font-size: 2.4rem; font-weight: 900; color: var(--th-star); line-height: 1; }
.th-rating-detail { display: grid; gap: 4px; font-size: .88rem; }
.th-rating-detail span.label { display: inline-block; width: 5.5em; color: var(--th-muted); }
.th-info-table { width: 100%; border-collapse: collapse; background: var(--th-white); border-radius: var(--th-radius); overflow: hidden; margin: 20px 0; }
.th-info-table th, .th-info-table td { border: 1px solid var(--th-border); padding: 11px 14px; text-align: left; font-size: .92rem; }
.th-info-table th { background: #fff6ec; width: 9em; color: var(--th-primary-dark); font-weight: 700; }
.th-content { background: var(--th-white); border: 1px solid var(--th-border); border-radius: var(--th-radius); padding: 24px 26px; }
.th-content > :first-child { margin-top: 0; }

/* ---------- Reviews ---------- */
.th-reviews { margin-top: 40px; }
.th-reviews h2 { font-size: 1.3rem; border-left: 5px solid var(--th-primary); padding-left: 10px; }
.th-review-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.th-review {
  background: var(--th-white); border: 1px solid var(--th-border);
  border-radius: var(--th-radius); padding: 16px 18px;
}
.th-review-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.th-review-head .avatar { border-radius: 50%; }
.th-review-author { font-weight: 700; }
.th-review-date { color: var(--th-muted); font-size: .78rem; }
.th-review-scores { font-size: .78rem; color: var(--th-muted); margin-top: 6px; }
.th-review-scores b { color: var(--th-star); }
.th-review p { margin: 8px 0 0; }

/* Review form */
.th-review-form {
  background: var(--th-white); border: 2px solid var(--th-primary);
  border-radius: var(--th-radius); padding: 22px 24px; margin-top: 26px;
}
.th-review-form h3 { margin-top: 0; }
.th-review-form textarea { width: 100%; border: 1px solid var(--th-border); border-radius: 8px; padding: 10px; font-size: .95rem; }
.th-rating-inputs { display: grid; gap: 8px; margin: 12px 0 16px; }
.th-rating-input { display: flex; align-items: center; gap: 12px; }
.th-rating-input .label { width: 6em; font-weight: 700; font-size: .9rem; }
.th-star-select { display: inline-flex; flex-direction: row-reverse; }
.th-star-select input { display: none; }
.th-star-select label { font-size: 1.5rem; color: #ddd; cursor: pointer; padding: 0 2px; }
.th-star-select input:checked ~ label,
.th-star-select label:hover,
.th-star-select label:hover ~ label { color: var(--th-star); }
.th-login-invite { background: #fff6ec; border: 1px dashed var(--th-primary); border-radius: var(--th-radius); padding: 22px; text-align: center; margin-top: 26px; }

/* ---------- Forms (register/login) ---------- */
.th-form-card { max-width: 460px; margin: 0 auto; background: var(--th-white); border: 1px solid var(--th-border); border-radius: var(--th-radius); padding: 28px 30px; }
.th-form-card h1 { font-size: 1.4rem; text-align: center; margin-top: 0; }
.th-form-card label { display: block; font-weight: 700; font-size: .88rem; margin: 14px 0 4px; }
.th-form-card input[type="text"], .th-form-card input[type="email"], .th-form-card input[type="password"] {
  width: 100%; padding: 10px 12px; border: 1px solid var(--th-border); border-radius: 8px; font-size: .95rem;
}
.th-form-card .th-btn { width: 100%; margin-top: 20px; padding: 12px; font-size: 1rem; }
.th-form-note { font-size: .8rem; color: var(--th-muted); text-align: center; margin-top: 14px; }
.th-alert { border-radius: 8px; padding: 10px 14px; font-size: .88rem; margin-bottom: 14px; }
.th-alert--error { background: #fdecea; color: #b3261e; border: 1px solid #f5c6c2; }
.th-alert--success { background: #eaf7ee; color: #1e7d3c; border: 1px solid #bfe5cb; }

/* ---------- Mypage ---------- */
.th-mypage-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.th-mypage-head .avatar { border-radius: 50%; }

/* ---------- Archive / misc ---------- */
.th-archive-title { font-size: 1.4rem; margin: 0 0 4px; }
.th-archive-title span { color: var(--th-primary); }
.th-archive-desc { color: var(--th-muted); font-size: .9rem; margin-bottom: 24px; }
.th-pagination { display: flex; gap: 6px; justify-content: center; margin-top: 34px; }
.th-pagination .page-numbers { padding: 7px 13px; background: var(--th-white); border: 1px solid var(--th-border); border-radius: 8px; font-size: .9rem; }
.th-pagination .current { background: var(--th-primary); color: #fff; border-color: var(--th-primary); }
.th-empty { text-align: center; color: var(--th-muted); padding: 60px 0; }

/* ---------- Footer ---------- */
.th-footer { background: var(--th-text); color: #ddd; margin-top: 60px; }
.th-footer-inner { max-width: 1080px; margin: 0 auto; padding: 34px 16px 40px; text-align: center; }
.th-footer a { color: #fff; }
.th-footer-nav { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; font-size: .88rem; }
.th-copy { font-size: .78rem; color: #aaa; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .th-grid { grid-template-columns: repeat(2, 1fr); }
  .th-map { gap: 3px; }
  .th-map a { font-size: .55rem; border-radius: 5px; }
  .th-map .th-count { font-size: .5rem; padding: 0 4px; }
  .th-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--th-white); border-bottom: 2px solid var(--th-primary); padding: 10px 16px 16px; }
  .th-nav.is-open { display: block; }
  .th-nav ul { flex-direction: column; gap: 10px; }
  .th-nav-toggle { display: block; }
  .th-ranking .th-card-thumb { width: 120px; }
}
@media (max-width: 560px) {
  .th-grid { grid-template-columns: 1fr; }
  .th-hero h1 { font-size: 1.4rem; }
  .th-member-links .th-btn { padding: 6px 12px; font-size: .78rem; }
}

/* ==========================================================
   レスポンシブ強化
   ========================================================== */

/* モバイル用 都道府県リスト(通常は非表示) */
.th-map-list { display: none; }
.th-map-list-region { margin-bottom: 14px; }
.th-map-list-region h3 {
  font-size: .85rem; margin: 0 0 6px; padding-left: 10px;
  border-left: 5px solid var(--c, var(--th-primary));
}
.th-region-label--hokkaido { --c: #4a90d9; }
.th-region-label--tohoku   { --c: #45b0a8; }
.th-region-label--kanto    { --c: #e65c00; }
.th-region-label--chubu    { --c: #8bbd3f; }
.th-region-label--kinki    { --c: #d9534f; }
.th-region-label--chugoku  { --c: #b06ab3; }
.th-region-label--shikoku  { --c: #e6a23c; }
.th-region-label--kyushu   { --c: #e64980; }
.th-map-list-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.th-map-list-chips a {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--th-white); border: 1px solid var(--th-border);
  border-radius: 999px; padding: 6px 12px;
  font-size: .82rem; font-weight: 600; color: var(--th-text);
}
.th-map-list-chips a:active { background: #fff3e8; }
.th-map-list-chips .th-count {
  background: var(--c, var(--th-primary)); color: #fff;
  border-radius: 999px; padding: 0 7px; font-size: .7rem; font-weight: 700;
}

/* タブレット以下 */
@media (max-width: 860px) {
  .th-header-inner { flex-wrap: wrap; }
  .th-logo { font-size: 1.2rem; }
  .th-rating-panel { gap: 16px; padding: 14px 16px; }
  .th-content { padding: 18px 16px; }
  .th-section { padding: 30px 0; }
}

/* スマホ: 地図をリスト表示に切り替え */
@media (max-width: 700px) {
  .th-map, .th-map-legend { display: none; }
  .th-map-list { display: block; }
  .th-map-section { padding: 10px 0 24px; }
}

/* スマホ小 */
@media (max-width: 560px) {
  .th-hero { padding: 26px 14px 6px; }
  .th-hero p { font-size: .85rem; }
  .th-search-bar input[type="search"] { font-size: 16px; } /* iOSズーム防止 */

  .th-single-header h1 { font-size: 1.25rem; }

  /* 店舗情報テーブルを縦積みに */
  .th-info-table, .th-info-table tbody, .th-info-table tr, .th-info-table th, .th-info-table td { display: block; width: 100%; }
  .th-info-table tr { border-bottom: 1px solid var(--th-border); }
  .th-info-table th { border: none; padding: 9px 14px 0; background: transparent; font-size: .78rem; }
  .th-info-table td { border: none; padding: 2px 14px 9px; }
  .th-info-table { border: 1px solid var(--th-border); }

  /* ランキングカードを縦に */
  .th-ranking .th-card { flex-direction: column; align-items: stretch; }
  .th-ranking .th-card-thumb { width: 100%; aspect-ratio: 16/9; }

  /* 評価パネル・フォーム */
  .th-rating-panel { flex-direction: column; align-items: flex-start; gap: 12px; }
  .th-form-card { padding: 20px 18px; }
  .th-review-form { padding: 16px 14px; }
  .th-rating-input .label { width: 5em; font-size: .82rem; }
  .th-star-select label { font-size: 1.3rem; }

  .th-news-list li { flex-direction: column; gap: 2px; }
}
