/**
 * 跑馬燈公告條樣式
 * Custom Member Manager Plugin
 */

.marquee-topbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--marquee-bg-color, #1e3a8a);
    color: var(--marquee-text-color, #ffffff);
    font-size: var(--marquee-font-size, 16px);
    line-height: var(--marquee-height, 45px);
    height: var(--marquee-height, 45px);
    overflow: hidden;
    z-index: 99999;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.marquee-topbar .marquee-content {
    display: inline-block;
    white-space: nowrap;
    animation: scroll-left var(--marquee-speed, 25s) linear infinite;
    padding-left: 100%;
}

.marquee-topbar .marquee-content a {
    color: var(--marquee-link-color, #ffd700);
    text-decoration: underline;
    font-weight: bold;
    margin: 0 20px;
    transition: opacity 0.3s ease;
}

.marquee-topbar .marquee-content a:hover {
    opacity: 0.8;
    text-decoration: none;
}

@keyframes scroll-left {
    0% {
        transform: translateX(0%);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* 響應式設計 */
@media (max-width: 768px) {
    .marquee-topbar {
        font-size: calc(var(--marquee-font-size, 16px) - 2px);
        padding: 8px 0;
    }
    
    .marquee-topbar .marquee-content a {
        margin: 0 15px;
    }
}

@media (max-width: 480px) {
    .marquee-topbar {
        font-size: calc(var(--marquee-font-size, 16px) - 4px);
        height: calc(var(--marquee-height, 45px) - 5px);
        line-height: calc(var(--marquee-height, 45px) - 5px);
    }
    
    .marquee-topbar .marquee-content a {
        margin: 0 10px;
    }
}

/* 為頁面內容預留空間 - 只在有跑馬燈時生效 */
body.has-marquee {
    padding-top: var(--marquee-height, 45px) !important;
}

/* 確保沒有跑馬燈時不影響原有樣式 */
body.no-marquee {
    /* 不設定 padding-top，保持原有佈景主題樣式 */
}

/* 暗色模式支援 */
@media (prefers-color-scheme: dark) {
    .marquee-topbar {
        box-shadow: 0 2px 4px rgba(255,255,255,0.05);
    }
}

/* 手機版header優化 - 整合到跑馬燈CSS中 */
@media (max-width: 767px) {
    /* 隱藏漢堡選單 */
    .dt-hamburger-menu,
    .mobile-menu-toggle,
    .hamburger .dt_mobilenav-mainmenu-toggle,
    button.hamburger,
    .hamburger-menu,
    .menu-toggle,
    .navbar-toggle,
    .mobile-toggle,
    .mobile-menu-button,
    #mobile-menu-toggle {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
    
    /* LOGO優化定位 */
    .site--logo {
        position: absolute !important;
        left: 1px !important;
        z-index: 1002 !important;
        margin-left: 0 !important;
        padding: 1px !important;
        display: flex !important;
        align-items: center !important;
        height: 46px !important;
        top: 28px !important;
        transform: none !important;
        background: transparent !important;
    }
    
    .site--logo img {
        height: 80px !important;
        width: auto !important;
        max-width: 60vw !important;
        object-fit: contain !important;
    }
    
    /* 當有跑馬燈時，調整LOGO位置避免重疊 */
    body.has-marquee .site--logo {
        top: calc(var(--marquee-height, 45px) + 2px) !important;
    }
    
    /* 當有跑馬燈時，調整整個header容器 */
    body.has-marquee .site-header,
    body.has-marquee .main-header {
        margin-top: var(--marquee-height, 45px) !important;
    }
    
    /* 調整主要內容區域，避免被跑馬燈覆蓋 */
    body.has-marquee .site-main,
    body.has-marquee .main-content,
    body.has-marquee #primary {
        margin-top: calc(var(--marquee-height, 45px) + 10px) !important;
    }
}

/* 移除不必要的元素 - 整合breadcrumbs和page-header隱藏 */
.breadcrumbs,
.page-header {
    display: none !important;
}

/* 動畫暫停功能（滑鼠懸停時） */
.marquee-topbar:hover .marquee-content {
    animation-play-state: paused;
}

/* 載入動畫 */
.marquee-topbar.loading .marquee-content {
    opacity: 0.7;
    animation-duration: calc(var(--marquee-speed, 25s) * 1.5);
}