/* ==========================================================================
   8. SEARCH BY AREA（エリア選択）— 2列構成＋全国全幅
   ========================================================================== */

/* 1. セクション外枠：ビューポート幅いっぱい・貝殻の白 */
.ks-nav-section {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding: 32px 20px;
    padding-left: calc(20px + (50vw - 50%));
    padding-right: calc(20px + (50vw - 50%));
    background: var(--shore-warm);
    box-sizing: border-box;
}

/* 2. 内側コンテナ：他セクションと同幅（1100px） */
.ks-nav-wrap {
    max-width: 1100px;
    margin: 48px auto;
    padding: 0 20px;
    background: transparent;
    text-align: center;
}

/* 3. ヘッダー */
.ks-nav-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 36px;
}

.ks-nav-header::after {
    content: '';
    width: 30px;
    height: 1px;
    background: var(--sacred-gold);
    margin-top: 12px;
}

.ks-sub-title {
    font-size: 11px;
    letter-spacing: 0.4em;
    color: var(--sacred-gold);
    margin-bottom: 12px;
}

.ks-main-title {
    font-family: var(--font-serif) !important;
    font-size: 28px;
    color: var(--depth-700) !important;
    letter-spacing: 0.15em;
    margin: 0 0 12px 0 !important;
    line-height: 1.2;
}

/* 4. ボタングリッド：2列 */
.ks-region-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* 5. 地域ボタン */
.ks-region-card {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff !important;
    border: 1px solid var(--shore-sand, #D4C4B0) !important;
    height: 72px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(11, 30, 45, 0.04);
}

.ks-region-card:hover {
    border-color: var(--horizon-cta);
    background: var(--mist-50) !important;
    transform: translateY(-2px);
}

/* 全国から探す：他ボタンと同幅・中央配置 */
.ks-region-all {
    grid-column: 1 / 3;
    justify-self: center;
    width: calc((100% - 16px) / 2); /* 2列グリッドの片側と同じ幅 */
    border: 1px solid var(--sacred-gold) !important;
    background: var(--sacred-gold) !important;
    color: #ffffff !important;
    margin-top: 4px;
    text-decoration: none;
    transition: background 0.3s ease, border-color 0.3s ease;
}

@media (max-width: 480px) {
    .ks-region-all {
        width: 100%;
    }
}
.ks-region-all:hover {
    background: var(--sacred-light, #D4C49A) !important;
    border-color: var(--sacred-light, #D4C49A) !important;
    color: #ffffff !important;
}
.ks-region-all:hover .ks-jp {
    color: #ffffff !important;
}

/* 全国リンク：内側 span 越しでも確実に <a> が反応する */
a.ks-region-all {
    position: relative;
    z-index: 1;
    cursor: pointer;
}
a.ks-region-all .ks-jp {
    pointer-events: none;
}

.ks-jp {
    font-size: 15px;
    font-weight: 600;
    color: var(--depth-700);
}

/* 6. モーダル本体 */
.ks-modal {
    position: fixed;
    inset: 0;
    background: rgba(11, 30, 45, 0.8) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
    backdrop-filter: blur(8px);
}

.ks-modal.ks-active {
    opacity: 1;
    visibility: visible;
}

.ks-modal-box {
    background: #fff !important;
    width: 90%;
    max-width: 540px;
    padding: 40px 30px !important;
    position: relative;
    border-radius: 4px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    border-top: 3px solid var(--sacred-gold, #A8956A);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ks-modal-box .ks-modal-close {
    all: unset !important;
    position: absolute;
    top: 15px;
    right: 15px !important;
    left: auto !important;
    font-size: 24px;
    color: var(--mist-900);
    cursor: pointer;
    line-height: 1;
}

.ks-modal-title {
    font-size: 20px !important;
    color: var(--depth-700) !important;
    text-align: center !important;
    margin-top: 0 !important;
    margin-bottom: 20px !important;
    padding-bottom: 12px !important;
    border-bottom: 1px solid var(--sys-border-light) !important;
}

/* 都道府県リスト：2列でボタン化 */
.ks-modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 0 !important;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.ks-modal-body a {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--mist-100, #F0F5F8);
    height: 48px;
    border: 1px solid var(--sys-border-light);
    color: var(--depth-700);
    text-decoration: none;
    font-size: 14px;
    transition: 0.2s;
}

.ks-modal-body a:hover {
    background: var(--horizon-light) !important;
    border-color: var(--horizon-cta) !important;
    color: var(--horizon-cta) !important;
}

.ks-modal-footer {
    margin-top: 30px !important;
    padding-top: 20px !important;
    border-top: 1px dashed var(--sys-border-light);
    text-align: center;
    flex-shrink: 0;
}

.ks-modal-footer a {
    font-size: 14px;
    color: var(--horizon-cta) !important;
    font-weight: bold;
    text-decoration: none !important;
}

