/**
 * HighRezIO Lightbox Styles
 */

/* ============================================
   ライトボックス コンテナ
   ============================================ */
.hrz-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hrz-lightbox.hrz-lb-active {
    display: block;
    opacity: 1;
}

/* 背景 */
.hrz-lb-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
}

/* 画像コンテナ */
.hrz-lb-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* 画像ラッパー */
.hrz-lb-image-wrapper {
    position: relative;
    flex: 1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: grab;
}

.hrz-lb-image-wrapper:active {
    cursor: grabbing;
}

/* ローディング */
.hrz-lb-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.hrz-lb-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: hrz-lb-spin 0.8s linear infinite;
}

@keyframes hrz-lb-spin {
    to { transform: rotate(360deg); }
}

/* 画像 */
.hrz-lb-image {
    max-width: none;
    max-height: none;
    user-select: none;
    -webkit-user-drag: none;
    transition: opacity 0.2s ease;
}

/* ============================================
   メニュー
   ============================================ */
.hrz-lb-menu {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 8px;
    backdrop-filter: blur(8px);
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.hrz-lb-menu.hrz-lb-menu-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* メニューボタン */
.hrz-lb-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.hrz-lb-btn:hover:not(:disabled) {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.hrz-lb-btn:disabled {
    color: rgba(255, 255, 255, 0.3);
    cursor: default;
}

.hrz-lb-btn svg {
    width: 20px;
    height: 20px;
}

/* フルスクリーンアイコン切り替え */
.hrz-lb-btn .hrz-icon-compress {
    display: none;
}

.hrz-lb-fullscreen .hrz-lb-btn .hrz-icon-expand {
    display: none;
}

.hrz-lb-fullscreen .hrz-lb-btn .hrz-icon-compress {
    display: block;
}

/* fitボタンアイコン切り替え（はみ出し時） */
.hrz-lb-btn .hrz-icon-fit-contract {
    display: none;
}

.hrz-lb-btn.hrz-lb-overflow .hrz-icon-fit-expand {
    display: none;
}

.hrz-lb-btn.hrz-lb-overflow .hrz-icon-fit-contract {
    display: block;
}

/* ズームコントロール */
.hrz-lb-zoom-control {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 8px;
}

.hrz-lb-zoom-bar {
    width: 100px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.hrz-lb-zoom-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.1s;
}

.hrz-lb-zoom-bar::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.hrz-lb-zoom-bar::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.hrz-lb-zoom-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    min-width: 45px;
    text-align: center;
}

/* ============================================
   ナビゲーションボタン
   ============================================ */
.hrz-lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 80px;
    padding: 0;
    background-color: rgba(0, 0, 0, 0.4);
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease, background-color 0.2s;
    pointer-events: none;
}

.hrz-lb-nav.hrz-lb-nav-visible {
    opacity: 1;
    pointer-events: auto;
}

.hrz-lb-nav:hover {
    background-color: rgba(0, 0, 0, 0.6);
    color: #fff;
}

.hrz-lb-nav svg {
    width: 32px;
    height: 32px;
}

.hrz-lb-nav-prev {
    left: 0;
    border-radius: 0 8px 8px 0;
}

.hrz-lb-nav-next {
    right: 0;
    border-radius: 8px 0 0 8px;
}

/* ============================================
   EXIF表示
   ============================================ */
.hrz-lb-exif {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
}

.hrz-lb-exif-table {
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 6px;
    overflow: hidden;
    backdrop-filter: blur(8px);
    font-size: 12px;
}

.hrz-lb-exif-row {
    display: grid;
}

.hrz-lb-exif-row.border-top {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.hrz-lb-exif-cell {
    text-align: center;
    padding: 4px 12px;
}

.hrz-lb-exif-cell.border-left {
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.hrz-lb-exif-title {
    color: rgba(255, 255, 255, 0.6);
    font-size: 10px;
    margin-bottom: 2px;
}

.hrz-lb-exif-value {
    color: #fff;
}

/* ============================================
   モバイル対応
   ============================================ */
@media (max-width: 768px) {
    .hrz-lb-menu {
        top: 8px;
        right: 8px;
        padding: 6px 10px;
        gap: 4px;
    }

    .hrz-lb-btn {
        width: 32px;
        height: 32px;
    }

    .hrz-lb-btn svg {
        width: 18px;
        height: 18px;
    }

    .hrz-lb-zoom-control {
        display: none;
    }

    .hrz-lb-nav {
        width: 40px;
        height: 60px;
    }

    .hrz-lb-nav svg {
        width: 24px;
        height: 24px;
    }

    .hrz-lb-exif {
        bottom: 8px;
        left: 1%;
        width: 98%;
        transform: none;
    }

    .hrz-lb-exif-cell {
        padding: 3px 8px;
    }

    .hrz-lb-exif-title {
        font-size: 9px;
    }

    .hrz-lb-exif-table {
        font-size: 11px;
    }
}

/* ============================================
   画像ブロックのクリック可能表示
   ============================================ */
.block-image figure,
.gallery-pickup,
.gallery-item {
    cursor: zoom-in;
}

