/* ========================================================================== 
    ギャラリーレイアウト & bxSliderカスタマイズ (main-content-rooms.css)
   ========================================================================== */

/* スライダー外枠 */
.room-gallery {
    width: 100%;
    margin-bottom: 20px;
    position: relative;
    /* 高さが0になるのを防ぐ */
    min-height: 1px; 
}

/* メインスライダー */
.room-gallery .slide {
    margin: 0;
    padding: 0;
    list-style: none;
    /* overflow: hidden; は削除（bxSliderの高さ計算を邪魔するため） */
    display: block;
    width: 100%;
}

/* 画像が消えるのを防ぐための設定 */
.room-gallery .slide li {
    width: 100%;
    display: block;
    visibility: visible !important;
}

.room-gallery .slide li img {
    width: 100%;
    height: auto !important; /* bxSliderの計算を優先 */
    display: block;
    border-radius: 4px;
}

/* サムネイルリスト */
.room-gallery .thumb {
    display: flex;
    justify-content: center; /* 横方向の中央揃え */
    gap: 8px;
    margin: 10px 0 0 0;
    padding: 0;
    list-style: none;
    flex-wrap: wrap;
}

.room-gallery .thumb li {
    width: 80px;
}

/* クリック層：ここが機能の肝 */
.room-gallery .thumb li a {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 10;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.room-gallery .thumb img {
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border: 2px solid transparent;
    display: block;
    pointer-events: none; /* クリックをaタグに通す */
    transition: all 0.2s ease;
}

/* 未選択：少し暗く */
.room-gallery .thumb a:not(.active) img {
    opacity: 0.5;
}

/* 選択中：明るく＋枠線 */
.room-gallery .thumb a.active img {
    border: 2px solid #006633;
    opacity: 1.0;
    box-shadow: 0 2px 8px rgba(0, 102, 51, 0.4);
}

/* bxSliderのリセット（!importantで確実に上書き） */
.bx-wrapper {
    border: none !important;
    box-shadow: none !important;
    background: none !important;
    margin-bottom: 10px !important;
}

.bx-viewport {
    /* ここが原因で消えることが多いため、高さを維持 */
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    left: 0 !important;
}

/* SP表示 */
@media (max-width: 768px) {
    .room-gallery .thumb {
        justify-content: center;/* flex-start から center に変更 */
        gap: 6px;
    }
    .room-gallery .thumb li {
        width: calc(25% - 6px); 
        min-width: 60px;
    }
}