/**
 * Feature Lightbox - Main Styles
 * 
 * Styles for BaguetteBox integration.
 * 
 * @package Feature_Lightbox
 * @since 1.0.0
 */

/* ============================================
   BaguetteBox 按鈕修正
   ============================================ */

/* 確保按鈕容器正確顯示 */
#baguetteBox-slider .baguetteBox-button {
    background-color: transparent;
    display: block;
    opacity: 1;
    visibility: visible;
}

/* 箭頭 SVG 樣式 */
#baguetteBox-slider .baguetteBox-button svg {
    fill: #fff;
    width: 44px;
    height: 44px;
    -webkit-filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.5));
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.5));
}

/* 上一頁按鈕位置 */
#baguetteBox-slider #previous-button {
    left: 20px;
}

/* 下一頁按鈕位置 */
#baguetteBox-slider #next-button {
    right: 20px;
}

/* 關閉按鈕位置 */
#baguetteBox-slider #close-button {
    top: 20px;
    right: 20px;
}

/* 按鈕 hover 效果 */
#baguetteBox-slider .baguetteBox-button:hover svg {
    fill: #f0f0f0;
    -webkit-transform: scale(1.1);
    -ms-transform: scale(1.1);
    transform: scale(1.1);
    -webkit-transition: all 0.2s ease;
    -o-transition: all 0.2s ease;
    transition: all 0.2s ease;
}

/* ============================================
   覆蓋層樣式
   ============================================ */

#baguetteBox-overlay {
    background-color: rgba(0, 0, 0, 0.9);
}

#baguetteBox-overlay.visible {
    opacity: 1;
}

/* ============================================
   隱藏的 Lightbox 項目
   （用於 Place Card 等特殊場景）
   ============================================ */

.fc-lightbox-hidden-item {
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    position: absolute;
    z-index: -1;
    pointer-events: none;
    /* 使用 clip 而非 clip-path 以支援更多瀏覽器 */
    clip: rect(1px, 1px, 1px, 1px);
}

/* ============================================
   圖片說明文字樣式
   ============================================ */

#baguetteBox-overlay .full-image figcaption {
    color: #fff;
    text-align: center;
    padding: 10px 20px;
    background-color: rgba(0, 0, 0, 0.6);
    font-size: 14px;
    line-height: 1.5;
}

/* ============================================
   載入動畫
   ============================================ */

#baguetteBox-overlay .spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    -webkit-animation: baguetteBox-spin 0.8s linear infinite;
    animation: baguetteBox-spin 0.8s linear infinite;
}

@-webkit-keyframes baguetteBox-spin {
    to { -webkit-transform: rotate(360deg); }
}

@keyframes baguetteBox-spin {
    to { 
        -webkit-transform: rotate(360deg);
        transform: rotate(360deg);
    }
}

/* ============================================
   響應式設計 (RWD)
   ============================================ */

/* 平板裝置 */
@media (max-width: 768px) {
    #baguetteBox-slider .baguetteBox-button svg {
        width: 32px;
        height: 32px;
    }

    #baguetteBox-slider #previous-button {
        left: 10px;
    }

    #baguetteBox-slider #next-button {
        right: 10px;
    }

    #baguetteBox-slider #close-button {
        top: 10px;
        right: 10px;
    }

    #baguetteBox-overlay .full-image figcaption {
        font-size: 12px;
        padding: 8px 15px;
    }
}

/* 小型手機 */
@media (max-width: 480px) {
    #baguetteBox-slider .baguetteBox-button svg {
        width: 28px;
        height: 28px;
    }

    #baguetteBox-slider #previous-button,
    #baguetteBox-slider #next-button {
        width: 44px;
        height: 44px;
    }

    #baguetteBox-overlay .full-image figcaption {
        font-size: 11px;
        padding: 6px 10px;
    }
}

/* ============================================
   可訪問性改善
   ============================================ */

/* 鍵盤焦點樣式 */
#baguetteBox-slider .baguetteBox-button:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* 減少動畫（尊重使用者偏好） */
@media (prefers-reduced-motion: reduce) {
    #baguetteBox-slider .baguetteBox-button:hover svg {
        -webkit-transition: none;
        -o-transition: none;
        transition: none;
        -webkit-transform: none;
        -ms-transform: none;
        transform: none;
    }

    #baguetteBox-overlay .spinner {
        -webkit-animation: none;
        animation: none;
    }
}

/* ============================================
   高對比模式支援
   ============================================ */

@media (prefers-contrast: high) {
    #baguetteBox-slider .baguetteBox-button svg {
        -webkit-filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.8));
        filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.8));
    }

    #baguetteBox-overlay .full-image figcaption {
        background-color: rgba(0, 0, 0, 0.9);
    }
}