/* ==============================
   CSS変数（サイト共通）
============================== */
:root {
    --navy:       #1a2744;
    --navy-light: #253358;
    --pink:       #E8436A;
    --pink-light: #fde8ee;
    --gray-bg:    #f7f7f7;
    --gray-light: #ebebeb;
    --text:       #333;
    --text-muted: #888;
    --white:      #fff;
    --radius:     10px;
    --shadow:     0 2px 8px rgba(0,0,0,0.10);
    --card-shadow: 0 3px 12px rgba(0,0,0,0.10);
}

/* ==============================
   ページ全体
============================== */
body.page-template-page-near-me .site-content {
    padding: 0 !important;
}
body.page-template-page-near-me .ast-container {
    max-width: 100% !important;
    padding: 0 !important;
}

.nm-wrap {
    background: var(--gray-bg);
    min-height: 80vh;
}

/* ==============================
   ヒーローセクション
============================== */
.nm-hero {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
    color: var(--white);
    padding: 48px 20px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.nm-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 70% 20%, rgba(232,67,106,0.18) 0%, transparent 60%);
    pointer-events: none;
}
.nm-hero-icon {
    font-size: 48px;
    line-height: 1;
    margin-bottom: 12px;
    animation: nm-bounce 2s ease-in-out infinite;
}
@keyframes nm-bounce {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-6px); }
}
.nm-hero h1 {
    font-size: 1.7rem;
    font-weight: 800;
    margin: 0 0 8px;
    color: var(--white);
    letter-spacing: 0.02em;
}
.nm-hero p {
    font-size: 0.93rem;
    color: rgba(255,255,255,0.75);
    margin: 0;
    line-height: 1.7;
}

/* ==============================
   フォームエリア
============================== */
.nm-form-section {
    max-width: 720px;
    margin: 0 auto;
    padding: 32px 20px 24px;
}

.nm-form-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    padding: 28px 24px;
}

/* ジャンル選択 */
.nm-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 10px;
    letter-spacing: 0.03em;
}
.nm-label span {
    display: inline-block;
    background: var(--gray-light);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 400;
    padding: 1px 8px;
    border-radius: 20px;
    margin-left: 6px;
    vertical-align: middle;
}

.nm-genre-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.nm-genre-btn {
    background: var(--white);
    border: 1.5px solid var(--gray-light);
    color: var(--text);
    border-radius: 24px;
    padding: 6px 14px;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.18s;
    white-space: nowrap;
    font-weight: 500;
}
.nm-genre-btn:hover {
    border-color: var(--pink);
    color: var(--pink);
}
.nm-genre-btn.active {
    background: var(--pink);
    border-color: var(--pink);
    color: var(--white);
    font-weight: 700;
}
.nm-genre-btn.all-btn.active {
    background: var(--navy);
    border-color: var(--navy);
}

/* 距離選択 */
.nm-radius-row {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
}
.nm-radius-btn {
    flex: 1;
    background: var(--white);
    border: 1.5px solid var(--gray-light);
    border-radius: var(--radius);
    padding: 10px 0;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    text-align: center;
    transition: all 0.18s;
    line-height: 1.3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.nm-radius-btn:hover {
    border-color: var(--navy);
    color: var(--navy);
}
.nm-radius-btn small {
    font-size: 0.68rem;
    font-weight: 400;
    opacity: 0.7;
    display: block;
}
.nm-radius-btn.active {
    background: var(--navy);
    border-color: var(--navy);
    color: var(--white);
}

/* 取得ボタン */
.nm-search-btn {
    display: block;
    width: 100%;
    background: var(--pink);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    padding: 16px;
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    letter-spacing: 0.04em;
    position: relative;
    overflow: hidden;
}
.nm-search-btn:hover {
    background: #d63060;
    transform: translateY(-1px);
}
.nm-search-btn:active {
    transform: translateY(0);
}
.nm-search-btn:disabled {
    background: var(--gray-light);
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}
.nm-search-btn .nm-btn-icon {
    margin-right: 8px;
    font-size: 1.1em;
}


/* 位置情報に関する説明 */
.nm-location-notice {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin: 12px 0 0;
}
.nm-location-notice a {
    color: #5c6bc0;
    text-decoration: underline;
}
.nm-location-list {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 4px 0 8px 1.4em;
    padding: 0;
    list-style: disc;
}
.nm-location-list li {
    line-height: 1.7;
}

/* ステータスメッセージ */
.nm-status {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    display: none;
    align-items: center;
    gap: 10px;
}
.nm-status.info {
    background: #e8f0fe;
    color: #1a56b0;
    display: flex;
}
.nm-status.error {
    background: #fde8ee;
    color: #b0213a;
    display: flex;
}
.nm-status.success {
    background: #e8f8ef;
    color: #1a7a3a;
    display: flex;
}
.nm-status-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: nm-spin 0.7s linear infinite;
    flex-shrink: 0;
}
@keyframes nm-spin {
    to { transform: rotate(360deg); }
}

/* ==============================
   結果エリア
============================== */
.nm-results-section {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 20px 48px;
    display: none;
}

.nm-results-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.nm-results-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--navy);
    margin: 0;
}
.nm-results-count {
    background: var(--pink-light);
    color: var(--pink);
    font-size: 0.82rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 20px;
}
.nm-results-meta {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-left: auto;
}

/* 結果なし */
.nm-no-results {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}
.nm-no-results .nm-no-icon {
    font-size: 40px;
    margin-bottom: 12px;
}
.nm-no-results p {
    margin: 0 0 8px;
    font-size: 0.95rem;
}
.nm-no-results a {
    color: var(--pink);
    font-weight: 700;
    text-decoration: none;
}

/* スポットカードリスト */
.nm-card-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.nm-next-btn {
    display: inline-block;
    padding: 12px 32px;
    background: var(--pink);
    color: white;
    border: none;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}
.nm-next-btn:hover { background: var(--pink-light); }


.nm-spot-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: stretch;
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    transition: transform 0.18s, box-shadow 0.18s;
    position: relative;
}
.nm-spot-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.14);
    color: var(--text);
    text-decoration: none;
}

/* 距離バッジ（左端の帯） */
.nm-card-rank {
    width: 56px;
    background: var(--navy);
    color: var(--white);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 12px 4px;
    gap: 2px;
}
.nm-card-rank-num {
    font-size: 1.3rem;
    font-weight: 900;
    line-height: 1;
}
.nm-card-rank-label {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.6);
    line-height: 1;
}

/* サムネイル */
.nm-card-thumb {
    width: 90px;
    flex-shrink: 0;
    background: var(--gray-light);
    overflow: hidden;
    position: relative;
}
.nm-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.nm-card-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--gray-light);
    background: #f0f0f0;
}

/* カード本文 */
.nm-card-body {
    flex: 1;
    padding: 14px 16px;
    min-width: 0;
}
.nm-card-genre {
    font-size: 0.75rem;
    color: var(--pink);
    font-weight: 700;
    margin-bottom: 4px;
}
.nm-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--navy);
    margin: 0 0 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nm-card-address {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 8px;
}
.nm-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}
.nm-card-distance {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--navy);
    color: var(--white);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
}
.nm-card-walk {
    font-size: 0.78rem;
    color: var(--text-muted);
}
.nm-card-rating {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-left: auto;
}
.nm-card-rating .nm-star {
    color: #f5a623;
    margin-right: 2px;
}

/* ==============================
   レスポンシブ
============================== */
@media (max-width: 600px) {
    .nm-hero h1 { font-size: 1.35rem; }
    .nm-form-card { padding: 20px 16px; }
    .nm-card-rank { width: 48px; }
    .nm-card-thumb { width: 76px; }
    .nm-card-body { padding: 12px; }
    .nm-card-title { font-size: 0.93rem; }
}
