/* ============================================
   CSS Reset & Base Styles
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    /* Prevent zoom on double tap for iOS */
    -ms-touch-action: manipulation;
    touch-action: manipulation;
}

/* Font Face Declarations */
@font-face {
    font-family: 'Alibaba PuHuiTi';
    src: url('webfonts/AlibabaPuHuiTi-3-75-SemiBold.otf') format('opentype');
    /* font-weight: 600; */
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Alibaba PuHuiTi Bold';
    src: url('webfonts/AlibabaPuHuiTi-3-85-Bold.otf') format('opentype');
    /* font-weight: 700; */
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Alibaba PuHuiTi Regular';
    src: url('webfonts/AlibabaPuHuiTi-3-55-Regular.otf') format('opentype');
    /* font-weight: 400; */
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Alibaba PuHuiTi Regular3';
    src: url('webfonts/AlibabaPuHuiTi-3-55-RegularL3.otf') format('opentype');
    /* font-weight: 400; */
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Alibaba PuHuiTi Light';
    src: url('webfonts/AlibabaPuHuiTi-3-45-Light.otf') format('opentype');
    /* font-weight: 300; */
    font-style: normal;
    font-display: swap;
}

:root {
    --primary-orange: #FF6B35;
    --dark-bg: #1a1a1a;
    --light-text: #ffffff;
    --text-dark: #333333;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    overflow-x: hidden;
}

/* ============================================
   Header & Navigation
   ============================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10000;
    padding: 70px 160px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.3s ease-in-out, background-color 0.3s ease-in-out, backdrop-filter 0.3s ease-in-out, padding 0.3s ease-in-out;
}

/* Scrolled state for header */
.header.scrolled {
    height: 100px;
    padding-top: 0;
    padding-bottom: 0;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Change text colors when scrolled */
.header.scrolled .ign-text,
.header.scrolled .logo-text,
.header.scrolled .contact-link {
    color: var(--primary-orange);
}

/* Change menu icon bars color when scrolled */
.header.scrolled .menu-toggle::before,
.header.scrolled .menu-toggle::after,
.header.scrolled .menu-toggle span {
    background-color: var(--primary-orange);
}

/* Remove header background when navigation is open */
.nav-overlay.active~.header.scrolled {
    background-color: transparent;
    box-shadow: none;
}

body:has(.nav-overlay.active) .header.scrolled {
    background-color: transparent;
    box-shadow: none;
}

/* Restore white color when navigation is open */
.nav-overlay.active~.header .ign-text,
.nav-overlay.active~.header .logo-text,
.nav-overlay.active~.header .contact-link {
    color: white;
}

body:has(.nav-overlay.active) .header .ign-text,
body:has(.nav-overlay.active) .header .logo-text,
body:has(.nav-overlay.active) .header .contact-link {
    color: white;
}

.header.nav-open .ign-text,
.header.nav-open .logo-text,
.header.nav-open .contact-link {
    color: white;
}

.nav-overlay.active~.header .menu-toggle::before,
.nav-overlay.active~.header .menu-toggle::after,
.nav-overlay.active~.header .menu-toggle span {
    background-color: white;
}

body:has(.nav-overlay.active) .header .menu-toggle::before,
body:has(.nav-overlay.active) .header .menu-toggle::after,
body:has(.nav-overlay.active) .header .menu-toggle span {
    background-color: white;
}

.header.nav-open .menu-toggle::before,
.header.nav-open .menu-toggle::after,
.header.nav-open .menu-toggle span {
    background-color: white;
}

/* Remove header background when navigation is open (WeChat fallback) */
.header.nav-open.scrolled {
    background-color: transparent;
    box-shadow: none;
}

.header.hide {
    transform: translateY(-100%);
}

/* Show header when navigation is open */
.nav-overlay.active~.header.hide,
body:has(.nav-overlay.active) .header.hide {
    transform: translateY(0);
}


.logo,
.logo:hover,
.logo:visited,
.logo:active,
.logo:focus {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none !important;
    border-bottom: none !important;
    cursor: pointer;
    color: inherit;
}

.logo img {
    height: 45px;
    width: auto;
}

.ign-text {
    color: white;
    font-family: 'Alibaba PuHuiTi Bold', 'Alibaba PuHuiTi', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 20px;
    align-self: flex-start;
    margin-right: 4px;
    line-height: 1;
}

.logo-text-wrapper {
    display: flex;
    flex-direction: column;
    font-size: 22px;
    align-self: flex-start;
    margin-left: 10px;
}

.logo-text {
    color: white;
    font-family: 'Alibaba PuHuiTi Bold', 'Alibaba PuHuiTi', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1;
    white-space: nowrap;
}

.logo-text-top {
    letter-spacing: 0.5px;
}

.logo-text-bottom {
    letter-spacing: 0.3px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.contact-link {
    color: white;
    text-decoration: none;
    /* font-family: 'Alibaba PuHuiTi', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; */
    font-size: clamp(20px, 2vw + 1rem, 40px);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    gap: 16px;
}

.contact-link::before {
    content: '';
    display: inline-block;
    width: 36px;
    height: 36px;
    background-size: contain;
    background-repeat: no-repeat;
}

.contact-link:hover {
    color: var(--primary-orange);
    text-decoration: underline;
    text-underline-offset: 8px;
    text-decoration-thickness: 2px;
}

.menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: white;
    font-size: 64px;
    transition: opacity 0.3s ease;
    position: relative;
    width: 40px;
    height: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.menu-toggle i {
    display: none;
}

.menu-toggle::before,
.menu-toggle::after {
    content: '';
    display: block;
    width: 100%;
    height: 4px;
    background-color: white;
    transition: width 0.3s ease;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 4px;
    /* Unified thickness */
    background-color: white;
    transition: transform 0.3s ease;
    transform-origin: right;
}

.menu-toggle:hover span {
    transform: scaleX(1.2);
}

.menu-toggle:hover {
    opacity: 1;
}

.nav-overlay.active~.header .menu-toggle {
    display: none !important;
}

body:has(.nav-overlay.active) .menu-toggle {
    display: none !important;
}

.header.nav-open .menu-toggle {
    display: none !important;
}

/* ============================================
   Full Screen Navigation Overlay
   ============================================ */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.97);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 90px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

.nav-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    /* color: white; Removed for image */
    /* font-size: 40px; Removed for image */
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.nav-close img {
    width: clamp(20px, 5vw, 28px);
    height: clamp(20px, 5vw, 28px);
    display: block;
}

.nav-close:hover {
    opacity: 0.7;
}

body:has(.nav-overlay.active) .nav-close {
    display: flex !important;
}

.header.nav-open .nav-close {
    display: flex !important;
}

.nav-content {
    text-align: center;
}

.nav-menu {
    list-style: none;
}

.nav-menu li {
    margin: 25px 0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.nav-overlay.active .nav-menu li {
    opacity: 1;
    transform: translateY(0);
}

.nav-overlay.active .nav-menu li:nth-child(1) {
    transition-delay: 0.1s;
}

.nav-overlay.active .nav-menu li:nth-child(2) {
    transition-delay: 0.15s;
}

.nav-overlay.active .nav-menu li:nth-child(3) {
    transition-delay: 0.2s;
}

.nav-overlay.active .nav-menu li:nth-child(4) {
    transition-delay: 0.25s;
}

.nav-overlay.active .nav-menu li:nth-child(5) {
    transition-delay: 0.3s;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    font-family: 'Alibaba PuHuiTi', sans-serif;
    font-size: clamp(40px, 4vw + 1rem, 60px);
    display: inline-block;
    transition: color 0.3s ease, transform 0.3s ease;
}

.nav-menu a:hover {
    color: var(--primary-orange);
    text-decoration: underline;
    text-underline-offset: 16px;
    text-decoration-thickness: 2px;
    transform: scale(1.05);
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
    background-color: var(--primary-orange);
    color: white;
    padding: clamp(60px, 10vh, 120px) 20px;
    text-align: center;
}

.footer-container {
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-contact-link {
    color: white;
    text-decoration: none;
    font-family: 'Alibaba PuHuiTi', sans-serif;
    font-size: clamp(30px, 4vw + 1rem, 60px);
    line-height: 0.8;
    display: inline-flex;
    align-items: center;
    gap: clamp(10px, 1vw, 20px);
    transition: opacity 0.3s ease;
    margin-bottom: 10px;
    padding-bottom: clamp(10px, 1.5vw, 18px);
    position: relative;
}

.footer-contact-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background-color: white;
    transition: left 0.3s ease, right 0.3s ease;
}

.footer-contact-link:hover::after {
    left: -50px;
    right: -50px;
}

.footer-contact-link i {
    font-size: 0.6em;
}

.footer-subtext {
    font-family: 'Alibaba PuHuiTi', sans-serif;
    font-size: clamp(30px, 4vw + 1rem, 60px);
    margin-bottom: clamp(60px, 8vh, 120px);
}

.footer-info {}

.copyright {
    font-family: 'Alibaba PuHuiTi', sans-serif;
    font-size: clamp(12px, 1vw + 0.5rem, 18px);
    margin-bottom: 5px;
    line-height: 2.4;
}

.address {
    font-family: 'Alibaba PuHuiTi Regular', sans-serif;
    font-size: clamp(14px, 1.25vw + 0.25rem, 20px);
    word-wrap: break-word;
    line-height: 1.5;
}

/* ============================================
   Responsive - Mobile
   ============================================ */
@media (max-width: 1200px) {
    .header {
        padding: 40px 60px;
    }

    .header.scrolled {
        height: 125px;
        padding-top: 0;
        padding-bottom: 0;
        background-size: auto 125px;
    }

    .logo-text {
        font-size: 20px !important;
    }

    .contact-link {
        font-size: 20px;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 20px 30px;
    }

    .header.scrolled {
        height: 72px;
        padding-top: 0;
        padding-bottom: 0;
        background-size: auto 72px;
    }

    .logo {
        gap: 4px;
    }

    .logo img {
        height: 32px;
        max-width: 60vw;
        /* Limit width to prevent pushing nav off-screen */
        object-fit: contain;
    }

    .ign-text {
        font-size: 14px;
    }

    .logo-text-wrapper {
        font-size: 14px;
        margin-left: 6px;
    }

    .logo-text {
        font-size: 18px !important;
    }

    .contact-link {
        display: none !important;
    }

    .menu-toggle {
        width: 24px;
        height: 18px;
    }

    /* Mobile Footer */
    .site-footer {
        padding: 60px 1px;
    }

    .address {
        line-height: 1.3;
    }

    .footer-subtext span {
        display: block;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 15px 20px;
    }

    .logo img {
        height: 28px;
    }

    .ign-text {
        font-size: clamp(14px, 1.35vw + 8px, 16px);
    }

    .logo-text-wrapper {
        margin-left: 0px;
    }

    .logo-text {
        font-size: clamp(14px, 1.35vw + 8px, 16px) !important;
    }

    .nav-menu a {
        font-size: 28px;
    }
}

@media (max-width: 391px) {
    .header {
        padding: 15px 10px;
    }

    .logo img {
        height: 20px;
    }

    .ign-text {
        font-size: clamp(12px, 1.25vw + 8px, 14px);
    }

    .logo-text-wrapper {
        margin-left: -3px;
    }

    .logo-text {
        font-size: clamp(12px, 1.25vw + 8px, 14px) !important;
    }
}

/* ============================================
   Floating Scroll Buttons
   ============================================ */
.scroll-buttons {
    position: fixed;
    right: 15px;
    bottom: 100px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.scroll-btn {
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0.8;
}

.scroll-btn:hover,
.scroll-btn:active,
.scroll-btn.active {
    transform: scale(1.1);
    opacity: 1;
}

.scroll-btn img {
    width: 100%;
    height: 100%;
    display: block;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .scroll-buttons {
        right: 10px;
        top: 50%;
        bottom: auto;
        transform: translateY(-50%);
    }

    .scroll-btn {
        width: 30px;
        height: 30px;
    }
}

* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    -webkit-text-size-adjust: 100% !important;
    text-size-adjust: 100% !important;
}

/* ============================================
   Pagination (Unified)
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(8px, 1vw, 15px);
    padding: clamp(40px, 6vh, 80px) clamp(20px, 5vw, 40px);
    /* background-color: #f5f5f5; */
    width: 100%;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: clamp(35px, 4vw, 50px);
    height: clamp(35px, 4vw, 50px);
    padding: 0 clamp(8px, 1vw, 12px);
    background-color: white;
    color: #333;
    text-decoration: none;
    font-family: 'Alibaba PuHuiTi', sans-serif;
    font-size: clamp(14px, 1.5vw, 18px);
    font-weight: 500;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.page-link:hover {
    background-color: var(--primary-orange);
    color: white;
    border-color: var(--primary-orange);
}

.page-link.active {
    background-color: var(--primary-orange);
    color: white;
    border-color: var(--primary-orange);
}

.page-prev,
.page-next {
    font-size: clamp(12px, 1.2vw, 16px);
}

.news-list-section .pagination {
    background-color: black;
}

.news-list-section .page-ellipsis {
    color: #ffffff;
}

/* Mobile pagination adjustments */
@media (max-width: 768px) {
    .pagination {
        gap: 6px;
        padding: 30px 15px;
    }

    .page-link {
        min-width: 32px;
        height: 32px;
        font-size: 14px;
    }
}

/* ============================================
   Universal Back Button
   ============================================ */
.back-button {
    position: absolute;
    /* Changed from fixed to absolute to scroll with page */
    top: 180px;
    left: 160px;
    color: white;
    text-decoration: none;
    font-family: 'Alibaba PuHuiTi', sans-serif;
    font-size: clamp(20px, 2vw, 30px);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 10001;
}

.back-button.back-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.back-button:hover {
    color: var(--primary-orange);
}

.back-button img {
    height: 1.1em;
    width: auto;
    filter: brightness(0) invert(1);
    /* Ensure it matches white text */
}

@media (max-width: 1200px) {
    .back-button {
        top: 120px;
        left: 60px;
    }
}

@media (max-width: 768px) {
    .back-button {
        top: 60px;
        left: 30px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .back-button {
        display: none;
        top: 50px;
        left: 10px;
        font-size: 14px;
    }
}