/* ========================================
   スポット検索ページ CSS
======================================== */
* { box-sizing: border-box; }
:root {
    --pink: #E8436A; --pink-light: #F06B8A; --pink-pale: #FFF0F3;
    --navy: #1A1F36; --navy-mid: #2D3557; --gray: #6B7280;
    --gray-light: #F4F5F7; --border: #E8EAED;
    --yellow: #F59E0B; --green: #10B981; --blue: #3B82F6;
    --purple: #8B5CF6; --orange: #F97316;
}
body.page-template-page-spot-search { overflow-x: hidden !important; }
html { overflow-x: hidden !important; overflow-y: scroll !important; }
body.page-template-page-spot-search .site-content { padding: 0 !important; }
body.page-template-page-spot-search .ast-container { max-width: 100% !important; padding: 0 !important; }

/* ===== スタッツバー ===== */
.ms-search-stats-bar { background: var(--navy); padding: 8px 20px; }
.ms-search-stats-bar-inner { max-width: 1400px; margin: 0 auto; display: flex; align-items: center; gap: 12px; flex-wrap: nowrap; overflow: hidden; }
.ms-search-stat-title { font-size: 12px; font-weight: 700; color: white; white-space: nowrap; margin-right: auto; }
.ms-search-stat-item { font-size: 11px; color: rgba(255,255,255,0.7); display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.ms-search-stat-num { font-size: 13px; font-weight: 800; color: white; }
.ms-search-stat-div { width: 1px; height: 12px; background: rgba(255,255,255,0.2); flex-shrink: 0; }

/* ===== メインレイアウト ===== */
.ms-search-top { background: var(--gray-light); padding: 0; min-height: calc(100vh - 120px); }
.ms-search-main { max-width: 1400px; margin: 0 auto; padding: 16px; display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }
.ms-search-content { min-width: 0; }
.ms-search-sidebar { display: flex; flex-direction: column; gap: 12px; }

/* ===== ブロック ===== */
.ms-search-block { background: white; border-radius: 10px; padding: 16px; border: 1px solid var(--border); margin-bottom: 12px; }
.ms-search-block:last-child { margin-bottom: 0; }
.ms-search-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.ms-search-section-title { font-size: 14px; font-weight: 900; color: var(--navy); margin: 0; display: flex; align-items: center; gap: 6px; }
.ms-search-section-title::before { content: ''; display: block; width: 4px; height: 14px; background: var(--pink); border-radius: 2px; flex-shrink: 0; }

/* 小見出し */
.ms-search-sub-label { font-size: 12px; font-weight: 700; color: var(--gray); margin-bottom: 8px; margin-top: 16px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.ms-search-sub-label:first-of-type { margin-top: 0; }

/* ===== 検索フォーム ===== */
.ms-search-keyword-box { display: flex !important; align-items: center !important; border: 1.5px solid var(--border) !important; border-radius: 8px !important; margin-bottom: 16px !important; background: white !important; transition: border-color 0.2s; padding: 4px !important; gap: 4px !important; overflow: visible !important; }
.ms-search-keyword-box:focus-within { border-color: var(--pink) !important; }
.ms-search-keyword-icon { padding: 0 6px !important; font-size: 16px; color: var(--gray); flex-shrink: 0 !important; }
.ms-search-keyword-input { flex: 1 !important; border: none !important; outline: none !important; font-size: 14px; padding: 10px 4px !important; font-family: inherit; color: var(--navy); min-width: 0 !important; background: transparent !important; box-shadow: none !important; }
.ms-search-keyword-btn { background: var(--pink) !important; color: white !important; border: none !important; padding: 0 16px !important; height: 38px !important; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; transition: background 0.2s; font-family: inherit; flex-shrink: 0 !important; border-radius: 6px !important; margin: 0 !important; display: block !important; }
.ms-search-keyword-btn:hover { background: var(--pink-light); }

/* フィルタータブ（チップUI風） */
.ms-filter-tabs { display: flex; gap: 6px; margin-bottom: 0; padding: 12px 0 8px; }
.ms-filter-tab-btn {
    padding: 6px 16px; border: 1.5px solid var(--border); border-radius: 20px;
    background: white; font-size: 12px; font-weight: 600; color: var(--gray);
    cursor: pointer; transition: all 0.15s; white-space: nowrap; font-family: inherit;
    outline: none !important; box-shadow: none !important;
}
.ms-filter-tab-btn:hover { border-color: var(--pink); color: var(--pink); background: var(--pink-pale); }
.ms-filter-tab-btn.active { background: var(--pink); border-color: var(--pink); color: white; }
.ms-filter-tab-count { display: inline-block; background: white; color: var(--pink); font-size: 10px; font-weight: 700; padding: 0 4px; border-radius: 8px; margin-left: 4px; }
.ms-filter-tab-btn.active .ms-filter-tab-count { background: rgba(255,255,255,0.3); color: white; }

/* タブパネル */
.ms-filter-tab-panel { padding: 14px 0 8px; }
body .ms-filter-tab-panel { display: none; }
body .ms-filter-tab-panel.active { display: block; }

/* フィルターグリッド */
.ms-filter-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.ms-filter-checkbox { display: flex; align-items: center; }
.ms-filter-checkbox input[type="checkbox"] { display: none; }
.ms-filter-checkbox span { display: inline-block; padding: 5px 12px; border: 1.5px solid var(--border); border-radius: 20px; font-size: 12px; font-weight: 600; color: var(--gray); cursor: pointer; transition: all 0.15s; white-space: nowrap; user-select: none; }
.ms-filter-checkbox input:checked + span { background: var(--pink); border-color: var(--pink); color: white; }
.ms-filter-checkbox span:hover { border-color: var(--pink); color: var(--pink); }
.ms-filter-parent-label { width: 100%; font-size: 11px; font-weight: 700; color: var(--gray); padding: 8px 0 4px; border-top: 1px solid var(--border); margin-top: 4px; }
.ms-filter-parent-label:first-child { border-top: none; margin-top: 0; }
.ms-filter-child span { padding-left: 16px; }

/* こだわり条件チップ（パープル系） */
.ms-filter-checkbox.ms-cond-chip input:checked + span { background: var(--purple); border-color: var(--purple); color: white; }
.ms-filter-checkbox.ms-cond-chip span:hover { border-color: var(--purple); color: var(--purple); }
.ms-filter-tab-btn.ms-tab-cond.active { background: var(--purple); border-color: var(--purple); color: white; }
.ms-filter-tab-btn.ms-tab-cond:hover { border-color: var(--purple); color: var(--purple); background: #F5F3FF; }
.ms-filter-tab-btn.ms-tab-cond .ms-filter-tab-count { color: var(--purple); }
.ms-filter-tab-btn.ms-tab-cond.active .ms-filter-tab-count { background: rgba(255,255,255,0.3); color: white; }
.ms-cond-disclaimer { font-size: 10px; color: var(--gray); background: var(--gray-light); border-radius: 6px; padding: 6px 10px; margin-top: 10px; line-height: 1.5; }
.ms-cond-category-label { width: 100%; font-size: 11px; font-weight: 700; color: var(--navy); padding: 10px 0 6px; border-top: 1px solid var(--border); margin-top: 6px; }
.ms-cond-category-label:first-of-type { border-top: none; margin-top: 0; padding-top: 4px; }
.ms-cond-grid { margin-bottom: 4px; }

/* 検索ボタン */
.ms-search-btn-area { display: flex; gap: 10px; padding-top: 14px; border-top: 1px solid var(--border); margin-top: 8px; }
.ms-btn-search-submit { flex: 1; background: var(--pink); color: white; border: none; padding: 12px; border-radius: 8px; font-size: 14px; font-weight: 700; cursor: pointer; transition: background 0.2s; font-family: inherit; }
.ms-btn-search-submit:hover { background: var(--pink-light); }
.ms-btn-search-reset { padding: 12px 20px; background: white; color: var(--gray); border: 1.5px solid var(--border); border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s; font-family: inherit; text-decoration: none; display: inline-flex; align-items: center; }
.ms-btn-search-reset:hover { border-color: var(--gray); color: var(--navy); }

/* 検索結果 */
.ms-results-count { font-size: 12px; color: var(--gray); margin-bottom: 12px; font-weight: 600; }
.ms-spot-cards-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.ms-spot-card-s { background: white; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; text-decoration: none; color: inherit; display: flex; flex-direction: column; transition: all 0.2s; }
.ms-spot-card-s:hover { border-color: var(--pink); box-shadow: 0 4px 12px rgba(232,67,106,0.1); transform: translateY(-2px); }
.ms-spot-card-thumb-s { aspect-ratio: 4/3; overflow: hidden; background: var(--gray-light); display: flex; align-items: center; justify-content: center; font-size: 28px; }
.ms-spot-card-thumb-s img { width: 100%; height: 100%; object-fit: cover; }
.ms-spot-card-body-s { padding: 10px; flex: 1; display: flex; flex-direction: column; gap: 5px; }
.ms-spot-card-title-s { font-size: 12px; font-weight: 700; color: var(--navy); line-height: 1.4; }
.ms-spot-card-tags-s { display: flex; flex-wrap: wrap; gap: 4px; }
.ms-spot-tag-s { font-size: 9px; font-weight: 600; padding: 2px 6px; border-radius: 3px; }
.ms-tag-genre-s { background: var(--pink-pale); color: var(--pink); }
.ms-tag-area-s { background: #EFF6FF; color: var(--blue); }
.ms-spot-card-meta-s { font-size: 10px; color: var(--gray); display: flex; align-items: center; gap: 6px; margin-top: auto; }
.ms-spot-card-address-s { font-size: 10px; color: var(--gray); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ms-spot-rating-badge-s { color: var(--yellow); font-weight: 700; }
.ms-pending-badge { display: inline-block; font-size: 9px; font-weight: 700; color: #92400E; background: #FEF3C7; border: 1px solid #FCD34D; border-radius: 4px; padding: 2px 6px; white-space: nowrap; }

/* ===== サイドバー ===== */
.ms-sidebar-card { background: white; border-radius: 10px; border: 1px solid var(--border); overflow: hidden; }
.ms-sidebar-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--gray-light); }
.ms-sidebar-title { font-size: 12px; font-weight: 800; color: var(--navy); }
.ms-sidebar-more { font-size: 10px; color: var(--gray); text-decoration: none; }
.ms-sidebar-more:hover { color: var(--pink); }

/* ジャンル別ランキング */
.ms-genre-rank-header-side { padding: 6px 12px; font-size: 11px; font-weight: 900; color: white; }
.ms-genre-rank-card-side { border-bottom: 1px solid var(--border); }
.ms-genre-rank-card-side:last-child { border-bottom: none; }
.ms-genre-rank-item-side { display: flex; align-items: center; gap: 7px; padding: 6px 10px; border-bottom: 1px solid var(--border); text-decoration: none; color: inherit; transition: background 0.2s; }
.ms-genre-rank-item-side:last-child { border-bottom: none; }
.ms-genre-rank-item-side:hover { background: var(--gray-light); }
.ms-genre-rank-num-side { font-size: 11px; font-weight: 800; width: 16px; text-align: center; flex-shrink: 0; }
.ms-genre-rank-thumb-side { width: 30px; height: 30px; border-radius: 4px; overflow: hidden; background: var(--gray-light); display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.ms-genre-rank-thumb-side img { width: 100%; height: 100%; object-fit: cover; }
.ms-genre-rank-info-side { flex: 1; min-width: 0; }
.ms-genre-rank-name-side { font-size: 10px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-genre-rank-meta-side { font-size: 9px; color: var(--gray); }
.ms-genre-rank-star-side { font-size: 10px; color: var(--yellow); font-weight: 700; flex-shrink: 0; }

/* 駅クイックアクセス */
.ms-station-grid-side { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; padding: 10px; }
.ms-station-btn-side { background: var(--gray-light); color: var(--navy); text-decoration: none; font-size: 10px; font-weight: 600; padding: 7px 4px; border-radius: 5px; text-align: center; transition: all 0.2s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.ms-station-btn-side:hover { background: var(--pink-pale); color: var(--pink); }

/* 最新レビュー */
.ms-recent-review-item { display: flex; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); text-decoration: none; color: inherit; transition: background 0.2s; }
.ms-recent-review-item:last-child { border-bottom: none; }
.ms-recent-review-item:hover { background: var(--gray-light); }
.ms-recent-review-thumb { width: 36px; height: 36px; border-radius: 5px; overflow: hidden; background: var(--gray-light); display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.ms-recent-review-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ms-recent-review-info { flex: 1; min-width: 0; }
.ms-recent-review-spot { font-size: 11px; font-weight: 700; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-recent-review-rating { font-size: 9px; color: var(--yellow); font-weight: 700; }
.ms-recent-review-text { font-size: 10px; color: var(--gray); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== 検索中オーバーレイ ===== */
.ms-search-overlay { display: none; position: fixed; inset: 0; background: rgba(26,31,54,0.55); z-index: 9999; align-items: center; justify-content: center; flex-direction: column; gap: 16px; }
.ms-search-overlay.active { display: flex; }
.ms-search-spinner { width: 48px; height: 48px; border: 4px solid rgba(255,255,255,0.25); border-top-color: var(--pink); border-radius: 50%; animation: msSpinnerRot 0.8s linear infinite; }
@keyframes msSpinnerRot { to { transform: rotate(360deg); } }
.ms-search-overlay-text { font-size: 14px; font-weight: 700; color: white; letter-spacing: 0.03em; }

/* ===== レスポンシブ ===== */
@media (max-width: 1024px) {
    .ms-search-main { grid-template-columns: 1fr; }
    .ms-search-sidebar { display: grid; grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .ms-search-main { padding: 8px; gap: 10px; }
    .ms-search-block { padding: 12px; }
    .ms-spot-cards-grid { grid-template-columns: repeat(2, 1fr); }
    .ms-search-sidebar { grid-template-columns: 1fr; }
}
