/* ========================================
   買取実績詳細ページCSS
======================================== */

/* ページ全体 */
* {
    box-sizing: border-box;
}

body {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px;
    color: #f7f8fa;
    background: #0a1420;
    font-family: Arial, "Noto Sans JP", sans-serif;
    line-height: 1.8;
}

/* ページタイトル */
h1 {
    margin: 8px 0 32px;
    padding-bottom: 16px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    font-size: 30px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

h2 {
    margin: 0 0 20px;
    font-size: 22px;
}

/* 各情報セクション */
.detail-section {
    margin-bottom: 24px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.035);
}

/* セクション内の見出し */
.detail-section h2 {
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

/* 買取情報 */
.detail-section p {
    margin: 10px 0;
    overflow-wrap: anywhere;
}

/* ========================================
   買取情報
======================================== */

.purchase-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-left: 1px solid rgba(255, 255, 255, 0.15);
}

.purchase-info-item {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    min-width: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.purchase-info-label {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.06);
    font-size: 13px;
    font-weight: bold;
    color: #aeb9c8;
}

.purchase-info-value {
    display: flex;
    align-items: center;
    min-width: 0;
    padding: 12px 14px;
    font-size: 14px;
    color: #f7f8fa;
    overflow-wrap: anywhere;
}

/* ========================================
   メイン写真
======================================== */

.main-image-wrap {
    margin-bottom: 24px;
}

.main-image {
    display: block;
    width: 100%;
    max-height: 600px;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    background: #111c29;
    border-radius: 8px;
    cursor: zoom-in;
}

.image-hint {
    margin: 8px 0 0;
    color: #aeb9c8;
    font-size: 12px;
    text-align: right;
}

/* ========================================
   サムネイル写真一覧
   PC：10枚 / タブレット：5枚 / スマホ：3枚
======================================== */

.thumbnail-gallery {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 24px;
}

.thumbnail-image {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: #111c29;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    cursor: zoom-in;
    transition: opacity 0.2s ease;
}

.thumbnail-image:hover {
    opacity: 0.75;
}

/* ========================================
   写真一覧（従来の2列表示）
======================================== */

.image-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.detail-image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    background: #111c29;
    border-radius: 8px;
}

/* 写真がない場合 */
div.detail-image,
.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    color: #aeb9c8;
    background: #111c29;
    border-radius: 8px;
}

/* ========================================
   写真の拡大表示（ライトボックス）
======================================== */

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    padding: 50px 24px;
    background: rgba(0, 0, 0, 0.92);
    align-items: center;
    justify-content: center;
}

.lightbox.is-open {
    display: flex;
}

.lightbox img {
    display: block;
    max-width: 95%;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
}

.lightbox-close {
    position: absolute;
    top: 12px;
    right: 24px;
    padding: 0;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 42px;
    line-height: 1;
    cursor: pointer;
}

/* ========================================
   一覧へ戻るリンク
======================================== */

.back-link {
    display: inline-block;
    margin: 8px 0 24px;
    padding: 12px 24px;
    border: 1px solid rgba(216, 196, 255, 0.45);
    border-radius: 8px;
    color: #d8c4ff;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.back-link:hover {
    background: rgba(216, 196, 255, 0.1);
    border-color: #d8c4ff;
}

/* 読み込みエラー・未登録時のメッセージ */
body>p {
    overflow-wrap: anywhere;
}

/* ========================================
   タブレット
======================================== */

@media (max-width: 900px) {
    .thumbnail-gallery {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

/* ========================================
   スマートフォン
======================================== */

@media (max-width: 700px) {
    body {
        padding: 20px 16px;
    }

    h1 {
        margin-bottom: 24px;
        font-size: 24px;
    }

    h2 {
        font-size: 19px;
    }

    .detail-section {
        padding: 16px;
        margin-bottom: 16px;
    }

    .image-gallery {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .purchase-info-grid {
        grid-template-columns: 1fr;
    }

    .purchase-info-item {
        grid-template-columns: 95px minmax(0, 1fr);
    }

    .purchase-info-label,
    .purchase-info-value {
        padding: 10px 12px;
    }
}

@media (max-width: 600px) {
    .thumbnail-gallery {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }

    .main-image {
        max-height: 400px;
    }

    .lightbox {
        padding: 48px 12px;
    }

    .lightbox img {
        max-width: 100%;
        max-height: 85vh;
    }

    .lightbox-close {
        top: 8px;
        right: 16px;
    }

    .back-link {
        max-width: 100%;
        padding: 10px 18px;
    }
}