/* ============================================================
   物件詳細ページ（等々力）専用スタイル
   ============================================================ */

.sub-page {
margin-top: 80px;
}

/* メインコンテナ */
.detail-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 60px 20px;
}

/* 物件タイトル */
.detail-title {
    font-size: 2.2rem;
    color: #00334e;
    font-family: 'Noto Serif JP', serif;
    border-bottom: 2px solid #00334e;
    padding-bottom: 15px;
    margin-bottom: 40px;
    letter-spacing: 0.05em;
}

/* -------------------------------------------
   画像ギャラリーシステム
   ------------------------------------------- */
.gallery-container {
    width: 100%;
    margin-bottom: 60px;
}

#main-display {
    background-color: transparent !important; /* 背景を透明に */
    background: transparent !important;       /* 念のため重ねて指定 */
    object-fit: contain !important;           /* 全体を表示 */
    width: auto !important;                   /* 横長・縦長に合わせて可変 */
    max-width: 100% !important;
    max-height: 80vh !important;              /* 画面からはみ出さない */
    display: block;
    margin: 0 auto;                           /* 真ん中に寄せる */
}

.main-photo-wrap {
    width: 100%;
    /* 高さを固定せず、最大でも画面の75%までに抑える設定 */
    height: 75vh; 
    min-height: 300px;
    background-color: #333; /* 背景を暗くすると、縦長写真の余白が目立たず綺麗です */
    margin-bottom: 15px;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
　　 background: transparent !important;     /* 背景を完全に透明にする */
    background-color: transparent !important;
    box-shadow: none !important;            /* もし影がグレーに見えているなら消す */
    object-fit: contain !important;         /* 画像を切り取らずに全体を表示 */
}



/* 中の画像の設定（ここが重要） */
.main-photo-wrap img {
    width: 100% !important;
    height: 100% !important;
    /* cover（切り抜き）をやめて contain（全体表示）にする */
    object-fit: contain !important; 
    transition: opacity 0.4s ease;
}


/* サムネイルの親要素 */
.thumbnail-grid {
    display: flex !important;  /* grid設定を強制的に上書きして消す */
    flex-wrap: nowrap !important; /* 絶対に2行にさせない */
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
    padding: 10px 0;
    overflow: hidden;         /* はみ出しを隠す */
    box-sizing: border-box;
}

/* サムネイル1つ1つ */
.thumb-item {
    flex: 1;                  /* ある枚数で横幅を均等に分ける */
    min-width: 0;             /* flexのバグ防止（これ重要） */
    aspect-ratio: 1 / 1;      /* 正方形 */
    cursor: pointer;
    border: 3px solid transparent;
    border-radius: 4px;
    box-sizing: border-box;   /* 枠線を内側に含める */
    overflow: hidden;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.thumb-item.active {
    border-color: #00334e;
    opacity: 1;
}

.thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.thumb-item:hover {
    opacity: 1;
}

/* -------------------------------------------
   物件スペック表
   ------------------------------------------- */
.spec-table {
    width: 100%;
    border-collapse: collapse;
    margin: 60px 0;
    background: #fff;
    border-top: 2px solid #00334e;
}

.spec-table th {
    background: #f8fafb;
    width: 25%;
    padding: 22px;
    border-bottom: 1px solid #e0e0e0;
    text-align: left;
    font-weight: 700;
    color: #00334e;
    font-size: 1rem;
}

.spec-table td {
    padding: 22px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 1.1rem;
    color: #333;
}

/* 戻るボタン */
.back-link-wrap {
    text-align: center;
    margin-top: 50px;
}

.back-link {
    color: #00334e;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    transition: opacity 0.3s;
}

.back-link:hover {
    opacity: 0.7;
    text-decoration: underline;
}

/* -------------------------------------------
   レスポンシブ（スマホ対応）
   ------------------------------------------- */
@media (max-width: 768px) {
    .detail-title {
        font-size: 1.6rem;
    }

    /* サムネイルの設定をスマホ用に調整 */
    .thumbnail-grid {
        display: flex;            /* gridではなくflexを維持 */
        grid-template-columns: none; /* 前のgrid設定をクリア */
        overflow-x: auto;         /* 横に溢れたらスクロールさせる */
        gap: 8px;
    }
	
    .thumb-item {
        flex: 0 0 22%;            /* スマホで1画面に約4.5枚見えるサイズ */
        min-width: 70px;          /* 小さくなりすぎ防止 */
    }

    .spec-table th {
        width: 35%;
        padding: 15px;
        font-size: 0.9rem;
    }

    .spec-table td {
        padding: 15px;
        font-size: 0.95rem;
    }
}