/* ========================================
   大略國際網站 - 通用 RWD 修正樣式表
   dalue-rwd-common.css
   適用於所有頁面
   ======================================== */

/* 基礎滾動修正 */
html {
    overflow-x: hidden !important;
    overflow-y: scroll !important;
    -webkit-overflow-scrolling: touch !important;
}

body {
    overflow-x: hidden !important;
    overflow-y: scroll !important;
    -webkit-overflow-scrolling: touch !important;
}

/* Overlay 基礎設定 */
.mobile-menu-overlay {
    pointer-events: none !important;
}

.mobile-menu-overlay.active {
    pointer-events: auto !important;
}

/* ========================================
   最新消息輪播按鈕位置修正（全版本適用）
   ======================================== */
.carousel-btn-left {
    left: 5px !important;  /* 距離左邊 5px，不超出灰色區塊 */
}

.carousel-btn-right {
    right: 5px !important;  /* 距離右邊 5px，不超出灰色區塊 */
}

/* ========================================
   Hero Section 下方空白修正（全版本適用）
   ======================================== */
.hero-section {
    margin-bottom: 0 !important;  /* 移除下方多餘空白 */
}

.hero-container {
    margin-bottom: 0 !important;  /* 移除下方多餘空白 */
}

/* ========================================
   手機版修正 (≤ 768px)
   ======================================== */
@media (max-width: 768px) {
    
    /* ===== 導覽列修正 ===== */
    
    /* 🔧 手機版導覽列加厚 + Logo 放大 */
    .navbar-wrapper {
        min-height: auto !important;
    }
    
    .navbar-bg {
        transform: scaleY(1.15) !important;  /* 垂直加厚 15% */
        transform-origin: top !important;
    }
    
    .logo-link {
        width: 35% !important;  /* Logo 放大到 35%（原本 18%，接近放大一倍）*/
    }
    
    /* 漢堡選單放大，更好點擊 */
    .hamburger-menu {
        display: flex !important;
        width: 26px !important;
        height: 26px !important;
        pointer-events: auto !important;  /* 確保可點擊 */
        cursor: pointer !important;
        z-index: 1000 !important;
    }
    
    .hamburger-menu span {
        width: 100%;
        height: 2.5px !important;
        pointer-events: none !important;  /* 讓事件穿透到按鈕 */
    }
    
    /* 指標事件控制 */
    .navbar,
    .navbar-wrapper,
    .navbar-bg {
        pointer-events: none !important;
    }
    
    .navbar .hamburger-menu,
    .navbar .logo-link {
        pointer-events: auto !important;
    }
    
    .nav-menu:not(.mobile-open) {
        display: none !important;
    }
    
    .nav-menu.mobile-open {
        display: flex !important;
        pointer-events: auto !important;
        position: fixed !important;
        right: 0 !important;
        top: 0 !important;
        height: 100vh !important;
        z-index: 999 !important;
    }
    
    .mobile-menu-overlay:not(.active) {
        pointer-events: none !important;
    }
    
    .mobile-menu-overlay.active {
        pointer-events: auto !important;
    }
    
    html, body {
        overflow-y: scroll !important;
        -webkit-overflow-scrolling: touch !important;
        touch-action: pan-y pan-x !important;
    }
    
    /* ===== 內容區塊上方空白修正（加強版）===== */
    
    /* 移除所有可能的上方間距 */
    .frame-container,
    .main-content,
    .news-container,
    .content-wrapper {
        margin-top: 0 !important;
        padding-top: 20px !important;
    }
    
    .rectangular-frame {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    
    /* 文字區塊的上方間距 */
    .text-section,
    .content-section,
    .container {
        padding-top: 20px !important;
        margin-top: 0 !important;
    }
    
    /* contact.html 特定修正 */
    .contact-form-section {
        padding-top: 20px !important;
        margin-top: 0 !important;
    }
    
    /* news.html 特定修正 */
    .news-header {
        padding-top: 20px !important;
        margin-top: 0 !important;
    }
    
    /* ===== Footer Copyright 修正 ===== */
    .footer-navbar-wrapper {
        min-height: 80px;
    }

    .footer-navbar-bg {
        min-height: 80px;
        object-fit: cover;
    }

    .footer-copyright {
        white-space: normal !important;
        font-size: 12px !important;
        width: 90%;
        text-align: center;
        line-height: 1.5;
        padding: 10px;
    }
    
    /* ===== 聯絡表單修正（僅 index.html）===== */
    .contact-form-header {
        flex-direction: column !important;
        gap: 30px !important;
    }

    .contact-form-left {
        width: 100%;
        align-items: center;
    }

    .contact-form-logo {
        width: 150px !important;
    }

    .contact-form-fields {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        width: 100%;
    }

    .contact-form-group {
        width: 100%;
    }

    .contact-form-input,
    .contact-form-textarea {
        width: 100% !important;
        box-sizing: border-box;
    }

    .contact-form-container {
        padding: 30px 20px !important;
    }
    
    /* ===== Hero Section 修正（organizational_structure.html）===== */
    .hero-section {
        width: 100% !important;
        height: auto !important;
        min-height: 50vh !important;
        margin-left: 0 !important;
        background-attachment: scroll !important;
        overflow: hidden !important;
    }
    
    /* ===== Investor Relations Hero 修正 ===== */
    .hero-section {
        height: auto !important;
        margin-bottom: 60px !important;
    }
    
    /* ===== 圖片響應式 ===== */
    img {
        max-width: 100% !important;
        height: auto !important;
    }
}

/* ========================================
   更小螢幕修正 (≤ 480px)
   ======================================== */
@media (max-width: 480px) {
    .footer-copyright {
        font-size: 11px !important;
        width: 95%;
        padding: 8px;
    }
}
