/* ==========================================================================
   KLLUX Master Stylesheet (Japanese Modern Luxury Concept)
   Colors: Dark Indigo (#1E2A38), Charcoal (#2B2B2B), Washi Beige (#F9F6F0)
   ========================================================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: #F9F6F0; /* 和紙のような上品な生成り色 */
    color: #2B2B2B; /* チャコールグレー */
    font-family: 'Montserrat', 'Noto Serif JP', sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Header & Hero
   ========================================================================== */

header {
    /* グラデーションを重ねて背景写真の視認性を保ちつつ、文字をクッキリ白く浮き立たせます */
    background-image: 
        linear-gradient(to bottom, rgba(30, 42, 56, 0.25), rgba(43, 43, 43, 0.15)), 
        url('../images/back.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #1E2A38; /* 万が一画像が読み込めない場合の藍色フォールバック */
    color: #F9F6F0;
    padding: 80px 20px; /* 画像がより美しく見えるよう上下の余白を少し広げました */
    text-align: center;
    position: relative;
    border-bottom: 4px solid #D4AF37; /* 高級感のあるゴールドライン */
    box-shadow: inset 0 0 100px rgba(0,0,0,0.5); /* 画像の四隅を自然に暗くする演出 */
}
#main-title {
    font-family: 'Cinzel', serif;
    font-size: 3.2rem;
    font-weight: 700;
    letter-spacing: 4px;
    margin-bottom: 10px;
}

#sub-title {
    font-size: 1.1rem;
    letter-spacing: 2px;
    font-weight: 300;
    text-transform: uppercase;
    opacity: 0.9;
}

/* Lang Switcher */
.lang-switcher {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 8px;
}

.lang-switcher button {
    background: rgba(249, 246, 240, 0.15);
    border: 1px solid rgba(249, 246, 240, 0.4);
    color: #F9F6F0;
    padding: 5px 12px;
    font-size: 0.8rem;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.3s;
}

.lang-switcher button:hover, .lang-switcher button.active {
    background: #F9F6F0;
    color: #1E2A38;
    border-color: #F9F6F0;
}

/* ==========================================================================
   Main Layout & UI Components
   ========================================================================== */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.search-nearme-container {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.search-box {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 15px;
    color: #777;
}

.search-box input {
    width: 100%;
    padding: 14px 14px 14px 45px;
    font-size: 1rem;
    border: 1px solid #D1CFC9;
    background-color: #FFFFFF;
    color: #2B2B2B;
    border-radius: 4px;
    outline: none;
}

.nearme-btn {
    background-color: #1E2A38;
    color: #F9F6F0;
    border: none;
    padding: 0 25px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

/* Filters */
.filter-section {
    background-color: #FFFFFF;
    border: 1px solid #EAE8E2;
    padding: 25px;
    border-radius: 4px;
    margin-bottom: 25px;
}

.filter-group {
    margin-bottom: 20px;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-label {
    font-weight: 500;
    font-size: 0.95rem;
    margin-bottom: 12px;
    color: #1E2A38;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-btn {
    background-color: #F4F2EC;
    color: #2B2B2B;
    border: 1px solid #E1DFD7;
    padding: 8px 18px;
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.filter-btn.active {
    background-color: #1E2A38;
    color: #F9F6F0;
    border-color: #1E2A38;
}

.counter-container {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 20px;
}

#store-counter {
    font-weight: 700;
    color: #1E2A38;
}

/* ==========================================================================
   Perfect Responsive Luxury Grid Layout (バグ修正済)
   ========================================================================== */
.grid-container {
    display: grid;
    grid-template-columns: 1fr; /* スマホ向けデフォルトは1列 */
    gap: 25px;
}

@media(min-width: 768px) {
    .grid-container {
        grid-template-columns: repeat(2, 1fr); /* タブレット：2列 */
    }
}

@media(min-width: 1024px) {
    .grid-container {
        grid-template-columns: repeat(3, 1fr); /* PC：3列 */
    }
}

.luxury-card {
    background: #FFFFFF;
    border: 1px solid #EAE8E2;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    transition: transform 0.2s;
}

.luxury-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(30,42,56,0.08);
}

.card-body {
    padding: 25px;
}

.card-header-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.card-area-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 600;
    color: #7A766A;
}

.distance-badge {
    background-color: #E2ECF7;
    color: #1E2A38;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
}

.luxury-card h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.35rem;
    color: #1E2A38;
    margin-bottom: 12px;
}

.card-description {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 20px;
}

.meta-info-grid {
    border-top: 1px dashed #EAE8E2;
    padding-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.85rem;
    color: #555;
}

.parking-line {
    background-color: #F9F6F0;
    padding: 6px 10px;
    border-radius: 4px;
    border-left: 3px solid #1E2A38;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 15px;
}

.badge-tag {
    background: #F4F2EC;
    color: #666258;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 2px;
    text-transform: uppercase;
}

.card-actions {
    display: flex;
    border-top: 1px solid #EAE8E2;
    background-color: #FDFDFD;
}

.action-btn {
    flex: 1;
    text-align: center;
    padding: 14px 10px;
    font-size: 0.9rem;
    text-decoration: none;
    font-weight: 500;
}

.map-btn { color: #1E2A38; border-right: 1px solid #EAE8E2; }
.web-btn { color: #666258; }

.zero-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px 20px;
    color: #666;
}

/* ==========================================================================
   Footer & Share UI
   ========================================================================== */
footer {
    background-color: #2B2B2B;
    color: #EAE8E2;
    padding: 50px 20px 30px 20px;
    margin-top: 60px;
}

.disclaimer-container {
    max-width: 1200px;
    margin: 0 auto 35px auto;
    font-size: 0.85rem;
    color: #B5B2AA;
}

.share-section {
    text-align: center;
    border-top: 1px solid #444;
    padding-top: 25px;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.share-buttons a, .share-buttons button {
    padding: 10px 22px;
    border-radius: 4px;
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
}

#share-whatsapp { background-color: #25D366; }
#share-line { background-color: #06C755; }
#share-wechat { background-color: #09B83E; }
#share-copy { background-color: #1E2A38; }

.footer-bottom {
    text-align: center;
    font-size: 0.8rem;
    color: #88857E;
    margin-top: 20px;
}

/* ==========================================================================
   Mobile Optimization (スマホ環境のファーストビュー軽量化)
   ========================================================================== */
@media (max-width: 768px) {
/* 1. ヘッダー自体の上部パディングを広げ、ボタン用のスペースを確保 */
    header {
        padding: 45px 15px 25px 15px; /* 上部に少しゆとりを持たせます */
    }

    /* 2. 言語ボタンを右上ぴったりに配置（マージン0） */
    .lang-switcher {
        top: 0 !important;
        right: 0 !important;
        gap: 4px; /* ボタン同士の間隔も少し詰めてコンパクトに */
    }

    .lang-switcher button {
        padding: 4px 8px; /* ボタン自体を小さくしてタイトルの邪魔をしないようにします */
        font-size: 0.7rem;
        border-radius: 0 0 0 4px; /* 右上ぴったりに置くため、左下だけ丸みを持たせる luxury スタイル */
    }

    /* 3. タイトルがボタンの下に回り込むようマージンを調整 */
    #main-title {
        font-size: 2.0rem;
        margin-top: 10px; /* 言語ボタンの下に綺麗に収まるように調整 */
        margin-bottom: 5px;
    }
    /* 4. 横スクロールフィルター（既存の制御を維持＋微調整） */
    .filter-buttons {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        gap: 6px !important;
        padding-bottom: 4px !important;
    }
    .filter-buttons::-webkit-scrollbar { 
        display: none !important; 
    }
    .filter-btn { 
        flex: 0 0 auto !important; 
        white-space: nowrap !important; 
        padding: 6px 14px !important; /* ボタン自体も少し低床化 */
        font-size: 0.8rem !important;
    }
    
    /* 5. カウンターの余白も調整 */
    .counter-container {
        margin-bottom: 15px;
        font-size: 0.85rem;
    }
}