/* =========================================================
    Component: Stay Gallery Modal
    File: assets/css/3_components/stay-gallery-modal.css
   ========================================================= */

/* モーダル全体（画面全体を覆う） */
.p-stayGalleryModal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    justify-content: flex-end; /* 右寄せ */
    visibility: hidden; /* デフォルトは非表示 */
    opacity: 0;
    transition: visibility 0.4s, opacity 0.4s ease;
}

/* JSで付与される開いた状態のクラス */
.p-stayGalleryModal.is-open {
    visibility: visible;
    opacity: 1;
}

/* 背景の黒半透明 */
.p-stayGalleryModal__overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
}

/* スライドインするコンテンツ本体 */
.p-stayGalleryModal__content {
    position: relative;
    width: 100%;
    max-width: 900px; /* PCでは幅を制限し、タブレットサイズで右から出る */
    height: 100%;
    background-color: var(--wan-color-white, #fff);
    display: flex;
    flex-direction: column;
    
    /* 右側に隠しておき、is-openの時に0に戻る */
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.p-stayGalleryModal.is-open .p-stayGalleryModal__content {
    transform: translateX(0);
}

/* ==========================================
   ヘッダーと横スクロールナビ
   ========================================== */
.p-stayGalleryModal__header {
    border-bottom: 1px solid var(--wan-color-border-light);
    background-color: #fff;
    flex-shrink: 0;
}

.p-stayGalleryModal__headerTop {
    display: flex;
    align-items: center;
    padding: var(--wan-s-3) var(--wan-s-4);
}

.p-stayGalleryModal__closeBtn {
    background: transparent;
    border: none;
    font-size: var(--wan-f-size-xl);
    padding: var(--wan-s-2);
    cursor: pointer;
    margin-right: var(--wan-s-3);
}

.p-stayGalleryModal__headerTitle {
    font-weight: var(--wan-f-weight-bold);
    font-size: var(--wan-f-size-md);
}

/* 横スクロール可能なタブ */
.p-stayGalleryModal__nav {
    overflow-x: auto;
    scrollbar-width: none; /* Firefox用スクロールバー非表示 */
}
.p-stayGalleryModal__nav::-webkit-scrollbar {
    display: none; /* Chrome/Safari用 */
}

.p-stayGalleryModal__navList {
    display: flex;
    padding: 0 var(--wan-s-4);
    margin: 0;
    list-style: none;
    white-space: nowrap; /* 折返し禁止 */
}

.p-stayGalleryModal__navLink {
    display: block;
    padding: var(--wan-s-3) var(--wan-s-2);
    margin-right: var(--wan-s-4);
    color: var(--wan-color-text-muted);
    font-weight: var(--wan-f-weight-bold);
    font-size: var(--wan-f-size-sm);
    text-decoration: none;
    border-bottom: 2px solid transparent;
}

/* アクティブなタブ等の装飾があればここに追加 */
.p-stayGalleryModal__navLink:hover,
.p-stayGalleryModal__navLink.is-active {
    color: var(--wan-color-brand);
    border-bottom-color: var(--wan-color-brand);
}

/* ==========================================
   ボディ（写真一覧エリア）
   ========================================== */
.p-stayGalleryModal__body {
    flex-grow: 1;
    overflow-y: auto; /* 縦スクロール可能に */
    padding: var(--wan-s-6) var(--wan-s-4);
    scroll-behavior: smooth; /* アンカーリンク時のスムーススクロール */
}

.p-stayGalleryModal__section {
    margin-bottom: var(--wan-s-8);
}

.p-stayGalleryModal__secTitle {
    font-size: var(--wan-f-size-lg);
    font-weight: var(--wan-f-weight-bold);
    margin-bottom: var(--wan-s-4);
}

/* 写真グリッド（スマホ2列、PC3列） */
.p-stayGalleryModal__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* スマホは2列 */
    gap: var(--wan-s-2);
}

@media screen and (min-width: 768px) {
    .p-stayGalleryModal__grid {
        grid-template-columns: repeat(3, 1fr); /* PC(タブレット以上)は3列 */
    }
}

/* 写真を正方形に揃えて綺麗に並べる */
.p-stayGalleryModal__item {
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background-color: var(--wan-color-bg-light);
    border-radius: var(--wan-r-sm);
}

.p-stayGalleryModal__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.p-stayGalleryModal__item:hover img {
    transform: scale(1.05); /* マウスホバーで少し拡大 */
}