/* 2025可持续发展论坛 - 移动端导航样式 */

/* 移动端汉堡菜单样式 */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 3px;
    z-index: 10002;
}

.hamburger-line {
    width: 24px;
    height: 3px;
    background-color: #367F54;
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

/* 汉堡菜单按钮动画 */
.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* 移动端侧边抽屉菜单 */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-drawer {
    position: fixed;
    top: 0;
    right: -320px;
    width: 320px;
    height: 100vh;
    background: #ffffff;
    z-index: 10001;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
}

.mobile-menu-drawer.active {
    transform: translateX(-320px);
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

.mobile-menu-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 5px 10px;
    line-height: 1;
}

.mobile-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
    overflow-y: auto;
}

.mobile-menu-item {
    border-bottom: 1px solid #eee;
}

.mobile-menu-link {
    display: block;
    padding: 18px 20px;
    color: #333;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}

.mobile-menu-link:hover {
    background: #f8f9fa;
    color: #367F54;
    text-decoration: none;
}

.mobile-menu-link.active {
    background: #367F54;
    color: #ffffff;
}

/* 防止滚动穿透 */
body.mobile-menu-open {
    overflow: hidden;
}

/* 移动端响应式样式 */
@media (max-width: 768px) {
    /* 显示白色header并固定在顶部 */
    #white-header {
        display: block !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        z-index: 10001 !important;
    }
    
    /* 隐藏绿色导航条 */
    #green-navigation {
        display: none !important;
    }
    
    .header-container {
        padding: 15px 20px;
        justify-content: space-between;
    }
    
    /* 🚨 THE CAP NEEDS !important OR IT IS NOT A CAP. navigation.css sets
       `.header-logo { max-width: none !important }` for the desktop bar, and an
       !important declaration beats a normal one whatever the sheet order — so
       `width: 70vw` ran uncapped and the logo rendered 275px wide on a 393px
       phone, crowding the hamburger. It looked like a sizing choice rather than
       a dead rule, which is why it survived to Bunny's 2026-08-21 "fix the logo
       on the top". Same fault as the squeezed JC logo in 33fc3db: a fixed
       dimension meeting a cap that never applied. */
    .header-logo {
        width: 70vw !important;
        height: auto !important;
        max-width: 180px !important;
        min-width: 120px !important;
    }
    
    body {
        padding-top: 70px; /* 预留白色header高度 */
    }
    
    /* 显示汉堡菜单 */
    .mobile-menu-toggle {
        display: flex;
    }
}

/* 打印样式 */
@media print {
    .mobile-menu-toggle,
    .mobile-menu-overlay,
    .mobile-menu-drawer {
        display: none;
    }
}