@charset "UTF-8";

/* ==========================================================================
   製品個別ページ共通スタイル（JavaScript連携版）
   ========================================================================== */

/* 1. ギャラリー全体のレイアウトコンテナ */
.gallery-container {
    position: relative;
}

/* 2. 通常表示メイン画像表示エリアの枠 */
.main-image-viewport {
    width: 100%;
    height: 380px; /* 必要に応じて高さを調整してください */
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

/* メイン画像表示エリア内のリンク付き画像 */
.main-image-viewport a {
    display: block;
    width: 100%;
    height: 100%;
    cursor: zoom-in;
    transition: opacity 0.2s ease-in-out;
}

/* 画像が見切れないように縦横比を維持して自動フィット */
.main-image-viewport a img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 画像切り替え時のフェード効果クラス */
.main-image-fade {
    animation: mainImgFadeEffect 0.3s ease-out;
}
@keyframes mainImgFadeEffect {
    from { opacity: 0.5; }
    to { opacity: 1; }
}

/* 3. サムネイルボタンの標準スタイル設定 */
.thumbnail-row .thumb-btn {
    display: block;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 6px;
    padding: 2px;
    background-color: #ffffff;
    transition: border-color 0.2s ease, opacity 0.2s ease, transform 0.1s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.thumbnail-row .thumb-btn:hover {
    opacity: 0.8;
}

/* サムネイルのアクティブ状態（青い太枠＆はっきり表示） */
.thumbnail-row .thumb-btn.active {
    border-color: #2563eb;
    transform: scale(1.02);
}


/* ==========================================================================
   ページ最下部共通：ライトボックス（画像拡大表示）のスタイル定義
   ========================================================================== */

/* 1. ライトボックス全体を覆う黒い背景（オーバーレイ） */
.univ-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(10, 15, 30, 0.95); /* 深みのあるダークブルーグレー */
    z-index: 99999; /* 他のどの要素よりも必ず前面に配置 */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s;
}

/* ライトボックス起動時のアクティブ状態 */
.univ-lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* 2. 画像とキャプションを内包するコンテンツ枠 */
.univ-lightbox-content {
    position: relative;
    max-width: 85%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: scale(0.95);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); /* ポップアップ風のバウンス効果 */
}
.univ-lightbox-overlay.active .univ-lightbox-content {
    transform: scale(1);
}

/* 3. 拡大表示される画像自体のフィット調整 */
.univ-lightbox-img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 4px solid #ffffff;
    background-color: #1e293b;
}

/* 4. 画像下部に表示される説明（キャプション） */
.univ-lightbox-caption {
    color: #f1f5f9;
    margin-top: 16px;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    background-color: rgba(15, 23, 42, 0.8);
    padding: 8px 18px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
    max-width: 500px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* 5. ナビゲーションボタン（閉じる・戻る・進む）の共通設定 */
.univ-lightbox-btn {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s, transform 0.2s, color 0.2s;
    user-select: none;
    z-index: 100000;
}
.univ-lightbox-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #3b82f6; /* ホバー時に青色にハイライト */
    transform: scale(1.08);
}
.univ-lightbox-btn:active {
    transform: scale(0.95);
}

/* 閉じる（×）ボタンの位置とサイズ */
.univ-lightbox-close {
    top: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    font-size: 28px;
}

/* 左右のスライド送り戻しボタン（矢印） */
.univ-lightbox-nav {
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
}
.univ-lightbox-prev {
    left: 32px;
}
.univ-lightbox-next {
    right: 32px;
}

/* 拡大スライド画像切り替え時のフェードアニメーション */
.univ-lightbox-img-fade {
    animation: univFadeEffect 0.25s ease-out;
}
@keyframes univFadeEffect {
    from { opacity: 0.3; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

/* スマホやタブレットなどのモバイル表示対応 */
@media (max-width: 768px) {
    .main-image-viewport {
        height: 280px; /* スマホではメイン画像高さを少し縮小 */
    }
    .univ-lightbox-nav {
        width: 44px;
        height: 44px;
        background: rgba(15, 23, 42, 0.6); /* タップしやすいよう背景を少し濃く */
    }
    .univ-lightbox-prev { left: 12px; }
    .univ-lightbox-next { right: 12px; }
    .univ-lightbox-close { top: 16px; right: 16px; width: 40px; height: 40px; font-size: 22px; }
    .univ-lightbox-content { max-width: 92%; }
    .univ-lightbox-img { border-width: 2px; }
}

/* ==========================================================================
   画面右下常駐：ページ上部に戻るホバーボタン
   ========================================================================== */
.scroll-to-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: #2563eb; /* 統一感のある鮮やかな青 */
    color: #ffffff;
    border: none;
    border-radius: 50%; /* 完全な丸型 */
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4); /* 青い上品な陰影 */
    cursor: pointer;
    z-index: 9999; /* ライトボックス（99999）のすぐ背面に配置 */
    
    /* 初期状態は非表示（JSでactiveクラスがつくと表示） */
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px); /* 下から湧き出るような演出の初期位置 */
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s, background-color 0.2s;
}

/* ボタンがアクティブ（スクロールされた時）のスタイル */
.scroll-to-top-btn.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* マウスホバー時のエフェクト */
.scroll-to-top-btn:hover {
    background-color: #1d4ed8; /* 少し濃い青に */
    transform: translateY(-3px); /* 軽く上に浮き上がる */
    box-shadow: 0 6px 20px rgba(29, 78, 216, 0.6);
}

/* クリックした瞬間の一瞬の縮小 */
.scroll-to-top-btn:active {
    transform: translateY(-1px) scale(0.95);
}

/* ボタン内の上向き矢印（SVG）のサイズ */
.scroll-to-top-btn svg {
    width: 24px;
    height: 24px;
    transition: transform 0.2s;
}

.scroll-to-top-btn:hover svg {
    transform: translateY(-2px); /* 矢印だけさらに上にピョコッと動く */
}

/* スマホ表示時の位置微調整 */
@media (max-width: 768px) {
    .scroll-to-top-btn {
        bottom: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
    }
}