﻿/* ======== 基本レイアウト ======== */
body, html {
    height: 100%;
    margin: 0;
    padding: 0;
    background: #f8fafc;
    color: #222;
    font-family: 'Noto Sans JP', 'Yu Gothic', 'Meiryo', sans-serif;
}
body {
    min-height: 100vh;
    height: 100vh;
    overflow: hidden;
}
/* コンテンツ幅を95%にして中央寄せ */
.container-fluid {
    width: 95%;
    margin: 0 auto;
    height: 100vh;
    /* row間の隙間をなくす */
    padding: 0;
}
.row {
    height: 100vh;
    min-height: 100vh;
    /* パノラマとサムネの間の隙間を減らす */
    gap: 0;
}
header {
    background-color: #343a40;
    color: white;
    padding: 10px;
    text-align: center;
    font-size: 1.5rem;
}
/* パノラマ画像をサムネイル側（右）に寄せる */
#panorama {
    width: 100%;
    height: 90vh;
    margin-right: 0;
    padding-right: 0;
    display: flex;
    justify-content: flex-end; /* 右寄せ */
    align-items: center;
}

/* ======== サムネイルサイドパネル ======== */
.thumb-scroll {
    overflow-y: auto;
    max-height: 80vh;
    height: 100vh;
    min-height: 100vh;
    background: #f4f6fa;
    border-left: 1px solid #e0e0e0;
    /* パノラマとの隙間を減らすためpaddingを調整 */
    padding: 1rem 0.2rem;
    box-shadow: -2px 0 8px 0 rgba(0,0,0,0.03);
}
#thumbnail-container {
    gap: 0.5rem;
    /* デフォルトはflexで縦並び */
    display: flex;
    flex-direction: column;
}

/* ======== サムネイル装飾統合 ======== */
.thumbnail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #fff;
    border-radius: 0.7rem;
    box-shadow: 0 2px 8px 0 rgba(0,0,0,0.04);
    margin-bottom: 0.4rem;
    padding: 0.7rem 0.2rem 0.5rem 0.2rem;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border 0.2s, box-shadow 0.2s, background 0.2s;
    position: relative;
    width: 100%;
    min-width: 100px;
    max-width: 100%;
    min-height: 102px;
    box-sizing: border-box;
}
.thumbnail-item.active {
    border: 2px solid #0d6efd;
    background: linear-gradient(90deg, #e3f0ff 0%, #f8fafc 100%);
    box-shadow: 0 4px 16px 0 rgba(13,110,253,0.10);
}
.thumbnail-item.active::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 14px;
    height: 14px;
    background: #0d6efd;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 4px 0 rgba(13,110,253,0.15);
}
.thumbnail-item:hover:not(.active) {
    border: 2px solid #b6d4fe;
    background: #f0f6ff;
}

/* ======== サムネイル画像 ======== */
.thumbnail {
    width: 96%;
    height: auto;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 0.4rem;
    box-shadow: 0 1px 4px 0 rgba(0,0,0,0.07);
    margin-bottom: 0.3rem;
    border: 1px solid #e0e0e0;
    background: #f8fafc;
    display: block;
    max-height: 110px;
    /* サムネイル画像のラベルを重ねるための親要素としてrelative指定 */
    position: relative;
}

/* ======== サムネイル画像名ラベル（写真に重ねて表示） ======== */
.thumbnail-label {
    position: absolute;
    left: 50%;
    bottom: 6px;
    transform: translateX(-50%);
    width: 90%;
    font-size: 0.92rem;
    color: #fff;
    background: rgba(0,0,0,0.55);
    padding: 2px 8px 2px 8px;
    border-radius: 0.3rem;
    word-break: break-all;
    text-align: center;
    box-shadow: 0 1px 4px 0 rgba(0,0,0,0.13);
    pointer-events: none;
    z-index: 2;
    font-weight: 500;
    letter-spacing: 0.01em;
    /* 文字が見やすいようにやや太字・影も追加 */
    text-shadow: 0 1px 2px rgba(0,0,0,0.7), 0 0 2px #000;
}

/* サムネイル画像とラベルを重ねるためのラッパー */
.thumbnail-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

/* ======== メニューカード等 ======== */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}
.menu-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}
.menu-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}
.menu-card a {
    text-decoration: none;
    color: #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    height: 100%;
    text-align: center;
}
.menu-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #004d99;
}
.menu-title {
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0;
}

/* ======== レスポンシブ ======== */
@media (max-width: 991px) {
    .col-md-10, .col-md-2 {
        min-height: 40vh;
        height: 40vh;
    }
    #panorama, .thumb-scroll {
        height: 40vh;
        min-height: 40vh;
    }
    #panorama {
        justify-content: flex-end; /* 右寄せ */
    }
    .thumb-scroll {
        padding: 0.5rem 0.1rem;
    }
    .thumbnail-item {
        width: 100px;
        min-width: 100px;
        min-height: 120px;
    }
    .thumbnail {
        width: 95%;
        max-height: 70px;
        aspect-ratio: 16/9;
    }
    .thumbnail-label {
        font-size: 0.85rem;
        padding: 1.5px 6px 1.5px 6px;
    }
}
@media (max-width: 767px) {
    .row {
        flex-direction: column;
    }
    .col-md-10, .col-md-2 {
        width: 100%;
        min-height: unset;
        height: unset;
    }
    #panorama, .thumb-scroll {
        height: 40vh;
        min-height: 40vh;
    }
    #panorama {
        justify-content: flex-end; /* 右寄せ */
    }
    .thumb-scroll {
        max-height: 30vh;
        /* サムネイルサイドパネル自体は1カラムでOK */
        display: block;
        padding: 0.5rem 0.1rem;
    }
    #thumbnail-container {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important; /* スマホで2列にする */
        gap: 0.5rem;
    }
    .thumbnail-item {
        width: 100%;
        min-width: 0;
        min-height: 100px;
        margin-bottom: 0; /* gridのgapで調整するため */
    }
    .thumbnail {
        width: 100%;
        max-height: unset;
        aspect-ratio: 16/9;
    }
    .thumbnail-label {
        font-size: 0.80rem;
        padding: 1px 4px 1px 4px;
    }
}

/* ======== 戻るボタン ======== */
.text-center.mt-3 {
    position: absolute;
    bottom: 1.5rem;
    left: 0;
    width: 100%;
    z-index: 10;
}