/* ============================================================
   PROJECTS.CSS - Magazine Style Project Gallery
   Mobile First + Irregular Grid Layout
   ============================================================ */

:root {
    --primary: #e63946;
    --primary-dark: #c1121f;
    --secondary: #1d3557;
    --accent: #f4a261;
    --accent-light: #ffd166;
    --white: #ffffff;
    --light: #f8f9fa;
    --light-blue: #e8f4f8;
    --text-dark: #1a1a2e;
    --text-muted: #6c757d;
    --gradient-warm: linear-gradient(135deg, #fff5f5 0%, #fef3e2 100%);
    --gradient-cool: linear-gradient(135deg, #e8f4f8 0%, #f0f4ff 100%);
    --gradient-primary: linear-gradient(135deg, #e63946 0%, #f4a261 100%);
    --gradient-dark: linear-gradient(135deg, #1d3557 0%, #457b9d 100%);
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-xxl: 4rem;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 30px;
    --radius-full: 50px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.15);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.2);
    --transition: all 0.3s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Segoe UI', -apple-system, sans-serif; line-height: 1.6; color: var(--text-dark); background: var(--white); overflow-x: hidden; }
html, body { max-width: 100vw; overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; transition: var(--transition); }
ul { list-style: none; }
.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 20px; }

/* ==================== HEADER ==================== */
.header { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; background: var(--white); box-shadow: var(--shadow-sm); }
.header-container { display: flex; align-items: center; justify-content: space-between; padding: 10px 15px; max-width: 1280px; margin: 0 auto; }
.logo { flex-shrink: 0; }
.logo img { height: 36px; width: auto; }

.nav-toggle { display: flex; flex-direction: column; justify-content: center; align-items: center; width: 48px; height: 48px; background: var(--primary); border: none; border-radius: var(--radius-sm); cursor: pointer; z-index: 1001; box-shadow: var(--shadow-sm); }
.hamburger { width: 22px; height: 3px; background: var(--white); position: relative; border-radius: 2px; transition: var(--transition); }
.hamburger::before, .hamburger::after { content: ''; position: absolute; width: 22px; height: 3px; background: var(--white); border-radius: 2px; transition: var(--transition); }
.hamburger::before { top: -7px; }
.hamburger::after { top: 7px; }
.nav-toggle.active { background: var(--secondary); }
.nav-toggle.active .hamburger { background: transparent; }
.nav-toggle.active .hamburger::before { transform: rotate(45deg); top: 0; }
.nav-toggle.active .hamburger::after { transform: rotate(-45deg); top: 0; }

.nav-menu { position: fixed; top: 0; right: -100%; width: 80%; max-width: 320px; height: 100vh; background: var(--white); box-shadow: var(--shadow-lg); padding: 80px var(--space-md) var(--space-lg); transition: right 0.4s ease; overflow-y: auto; }
.nav-menu.active { right: 0; }
.nav-list { display: flex; flex-direction: column; gap: var(--space-xs); }
.nav-link { display: block; padding: var(--space-sm) var(--space-md); font-size: 1rem; font-weight: 500; color: var(--text-dark); border-radius: var(--radius-sm); }
.nav-link:hover, .nav-link.active { background: var(--light-blue); color: var(--primary); }
.nav-link.nav-cta { background: var(--gradient-primary); color: var(--white); text-align: center; margin-top: var(--space-sm); }

/* ==================== PAGE HERO ==================== */
.page-hero { padding: calc(80px + var(--space-xl)) 0 var(--space-xl); background: var(--gradient-dark); text-align: center; }
.breadcrumb { font-size: 0.85rem; color: rgba(255,255,255,0.7); margin-bottom: var(--space-sm); }
.breadcrumb a { color: var(--accent); }
.breadcrumb span { margin: 0 5px; }
.page-hero h1 { font-size: 1.75rem; font-weight: 700; color: var(--white); margin-bottom: var(--space-sm); }
.page-subtitle { color: rgba(255,255,255,0.85); font-size: 1rem; }

/* ==================== FILTER SECTION ==================== */
.filter-section { padding: var(--space-md) 0; background: var(--white); border-bottom: 1px solid #eee; position: sticky; top: 68px; z-index: 100; }
.filter-wrapper { display: flex; flex-direction: column; gap: var(--space-sm); }
.filter-label { font-size: 0.85rem; font-weight: 600; color: var(--secondary); display: flex; align-items: center; gap: var(--space-xs); }
.filter-pills { display: flex; gap: var(--space-xs); overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.filter-pills::-webkit-scrollbar { height: 3px; }
.filter-pills::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 2px; }

.pill { flex-shrink: 0; padding: 8px 16px; font-size: 0.8rem; font-weight: 500; color: var(--text-muted); background: var(--light); border: none; border-radius: var(--radius-full); cursor: pointer; transition: var(--transition); white-space: nowrap; }
.pill:hover { color: var(--primary); background: var(--light-blue); }
.pill.active { background: var(--secondary); color: var(--white); }

/* ==================== FEATURED PROJECT：全宽大横幅 ==================== */
.featured-project { padding: var(--space-xl) 0; background: var(--light); }
.featured-card { background: var(--white); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); }
.featured-image { position: relative; aspect-ratio: 16/9; overflow: hidden; }
.featured-image img { width: 100%; height: 100%; object-fit: cover; }
.featured-overlay { position: absolute; top: var(--space-md); left: var(--space-md); }
.project-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--accent); color: var(--secondary); padding: 8px 16px; border-radius: var(--radius-full); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; }

.featured-content { padding: var(--space-lg); }
.project-meta { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin-bottom: var(--space-sm); }
.meta-item { font-size: 0.8rem; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.meta-item i { color: var(--primary); }
.featured-content h2 { font-size: 1.5rem; color: var(--secondary); margin-bottom: var(--space-sm); line-height: 1.3; }
.featured-content > p { color: var(--text-muted); margin-bottom: var(--space-lg); line-height: 1.8; }

.project-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-sm); margin-bottom: var(--space-lg); padding: var(--space-md); background: var(--gradient-cool); border-radius: var(--radius-md); }
.stat-item { text-align: center; }
.stat-item strong { display: block; font-size: 1.75rem; color: var(--primary); font-weight: 700; }
.stat-item span { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; }

.btn-featured { display: inline-flex; align-items: center; gap: var(--space-xs); padding: var(--space-sm) var(--space-lg); background: var(--gradient-primary); color: var(--white); font-weight: 600; border-radius: var(--radius-full); }
.btn-featured:hover { transform: translateX(5px); box-shadow: var(--shadow-md); }

/* ==================== MAGAZINE GRID：杂志风格不规则网格 ==================== */
.projects-section { padding: var(--space-xxl) 0; background: var(--white); }
.section-header { text-align: center; margin-bottom: var(--space-xl); }
.section-header h2 { font-size: 1.5rem; color: var(--secondary); margin-bottom: var(--space-xs); }
.section-header p { color: var(--text-muted); }

.magazine-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-lg); }

.project-card { background: var(--white); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); transition: var(--transition); }
.project-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); }

.card-image { position: relative; overflow: hidden; }
.card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.project-card:hover .card-image img { transform: scale(1.08); }
.card-overlay { position: absolute; top: var(--space-sm); left: var(--space-sm); }
.card-tag { display: inline-block; background: var(--secondary); color: var(--white); padding: 4px 12px; border-radius: var(--radius-full); font-size: 0.65rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }

.card-body { padding: var(--space-md); }
.card-location { font-size: 0.75rem; color: var(--primary); margin-bottom: 4px; display: flex; align-items: center; gap: 4px; }
.card-body h3 { font-size: 1.1rem; color: var(--secondary); margin-bottom: var(--space-xs); line-height: 1.3; }
.card-body p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; margin-bottom: var(--space-sm); }
.card-footer { display: flex; justify-content: space-between; align-items: center; padding-top: var(--space-sm); border-top: 1px solid #eee; }
.card-year { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; }
.card-link { font-size: 0.85rem; font-weight: 600; color: var(--primary); display: flex; align-items: center; gap: 4px; }
.card-link:hover { gap: 8px; }

/* Mobile: All cards same style */
.project-card .card-image { aspect-ratio: 16/10; }

/* ==================== PAGINATION：水平分页 ==================== */
.pagination { display: flex; justify-content: center; align-items: center; gap: var(--space-sm); margin-top: var(--space-xxl); }
.page-btn { width: 44px; height: 44px; display: flex; justify-content: center; align-items: center; background: var(--secondary); color: var(--white); border-radius: 50%; font-size: 1rem; box-shadow: var(--shadow-sm); }
.page-btn:hover { background: var(--primary); transform: scale(1.1); }
.page-btn.disabled { opacity: 0.4; pointer-events: none; }
.page-numbers { display: flex; align-items: center; gap: 4px; }
.page-num { width: 38px; height: 38px; display: flex; justify-content: center; align-items: center; background: var(--light); color: var(--text-dark); font-size: 0.9rem; font-weight: 500; border-radius: var(--radius-sm); }
.page-num:hover { background: var(--light-blue); color: var(--primary); }
.page-num.active { background: var(--primary); color: var(--white); }
.page-dots { color: var(--text-muted); padding: 0 4px; }

/* ==================== MAP SECTION：全球分布 ==================== */
.map-section { padding: var(--space-xxl) 0; background: var(--gradient-warm); }
.map-header { text-align: center; margin-bottom: var(--space-xl); }
.map-header h2 { font-size: 1.5rem; color: var(--secondary); margin-bottom: var(--space-xs); }
.map-header h2 i { color: var(--primary); margin-right: var(--space-xs); }
.map-header p { color: var(--text-muted); }

.region-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-md); }
.region-card { background: var(--white); padding: var(--space-lg); border-radius: var(--radius-lg); text-align: center; box-shadow: var(--shadow-sm); transition: var(--transition); }
.region-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.region-icon { width: 60px; height: 60px; margin: 0 auto var(--space-sm); background: var(--gradient-primary); color: var(--white); border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 1.5rem; }
.region-card h4 { font-size: 1rem; color: var(--secondary); margin-bottom: 4px; }
.region-card p { font-size: 0.8rem; color: var(--text-muted); margin-bottom: var(--space-sm); }
.region-count { display: inline-block; background: var(--light-blue); color: var(--primary); padding: 4px 12px; border-radius: var(--radius-full); font-size: 0.75rem; font-weight: 600; }

/* ==================== CTA SECTION ==================== */
.cta-section { padding: var(--space-xxl) 0; background: var(--secondary); text-align: center; }
.cta-content h2 { font-size: 1.5rem; color: var(--white); margin-bottom: var(--space-sm); }
.cta-content > p { color: rgba(255,255,255,0.85); margin-bottom: var(--space-lg); }
.cta-buttons { display: flex; flex-direction: column; gap: var(--space-sm); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs); padding: var(--space-sm) var(--space-lg); font-size: 0.95rem; font-weight: 600; border-radius: var(--radius-full); border: 2px solid transparent; cursor: pointer; transition: var(--transition); }
.btn-whatsapp { background: #25D366; color: var(--white); }
.btn-whatsapp:hover { background: #1da851; transform: translateY(-3px); }
.btn-outline { background: transparent; border-color: var(--white); color: var(--white); }
.btn-outline:hover { background: var(--white); color: var(--secondary); }

/* ==================== FOOTER ==================== */
.footer { background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 50%, #90caf9 100%); color: var(--text-dark); padding: var(--space-xxl) 0 var(--space-lg); }
.footer-vision { text-align: center; padding: 0 10px var(--space-xl); margin-bottom: var(--space-xl); border-bottom: 1px solid rgba(255,255,255,0.1); }
.footer-vision h3 { font-size: 1.25rem; margin-bottom: var(--space-sm); color: var(--primary); font-weight: 700; }
.footer-vision p { color: var(--text-dark); font-weight: 700; max-width: 600px; margin: 0 auto; }
.footer-grid { display: grid; gap: var(--space-lg); margin-bottom: var(--space-xl); }
.footer-col h4 { font-size: 1rem; margin-bottom: var(--space-md); color: var(--primary); font-weight: 700; }
.footer-col ul li { margin-bottom: var(--space-sm); }
.footer-col a { color: var(--text-dark); font-weight: 700; }
.footer-col a:hover { color: var(--primary); padding-left: 5px; }
.contact-list li { display: flex; align-items: center; gap: var(--space-sm); color: var(--text-dark); font-weight: 700; }
.contact-list i { color: var(--primary); width: 20px; }
.footer-bottom { text-align: center; padding-top: var(--space-lg); border-top: 1px solid rgba(0,0,0,0.08); }
.footer-bottom p { color: var(--text-dark); font-weight: 700; font-size: 0.875rem; }

/* ==================== BACK TO TOP ==================== */
.back-to-top { position: fixed; bottom: 20px; right: 20px; width: 50px; height: 50px; background: var(--primary); color: var(--white); border: none; border-radius: 50%; cursor: pointer; opacity: 0; visibility: hidden; transition: var(--transition); z-index: 999; box-shadow: var(--shadow-md); }
.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover { background: var(--primary-dark); transform: translateY(-5px); }

/* ==================== TABLET (768px+) ==================== */
@media (min-width: 768px) {
    .container { padding: 0 var(--space-lg); }
    
    /* Header */
    .header-container { padding: 8px 20px; }
    .logo img { height: 32px; }
    .nav-toggle { display: none; }
    .nav-menu { position: static; width: auto; height: auto; background: transparent; box-shadow: none; padding: 0; overflow: visible; }
    .nav-list { flex-direction: row; gap: 0; }
    .nav-link { padding: 4px 3px; font-size: 0.65rem; white-space: nowrap; }
    .nav-link:hover, .nav-link.active { background: transparent; color: var(--primary); }
    .nav-link.nav-cta { margin-top: 0; margin-left: 2px; padding: 4px 6px; font-size: 0.65rem; background: var(--primary); color: var(--white); }
    .nav-link.nav-cta:hover, .nav-link.nav-cta.active { background: var(--primary-dark); color: var(--white); }
    
    /* Filter */
    .filter-section { top: 56px; }
    .filter-wrapper { flex-direction: row; align-items: center; }
    .filter-pills { overflow-x: visible; }
    .pill { padding: 10px 20px; font-size: 0.85rem; }
    
    /* Page Hero */
    .page-hero h1 { font-size: 2.25rem; }
    
    /* Featured */
    .featured-card { display: grid; grid-template-columns: 1fr 1fr; }
    .featured-image { aspect-ratio: auto; }
    .featured-content { display: flex; flex-direction: column; justify-content: center; }
    .featured-content h2 { font-size: 1.75rem; }
    
    /* MAGAZINE GRID: 不规则布局 */
    .magazine-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: auto;
        gap: var(--space-lg);
    }
    
    /* 大卡片占2列 */
    .project-card.size-large {
        grid-column: span 2;
    }
    .project-card.size-large .card-image { aspect-ratio: 21/9; }
    .project-card.size-large .card-body h3 { font-size: 1.35rem; }
    
    /* 中卡片占1列，正常高度 */
    .project-card.size-medium .card-image { aspect-ratio: 4/3; }
    
    /* 小卡片占1列，紧凑型 */
    .project-card.size-small .card-image { aspect-ratio: 16/9; }
    .project-card.size-small .card-body p { display: none; } /* 隐藏描述 */
    .project-card.size-small .card-body h3 { font-size: 1rem; margin-bottom: var(--space-sm); }
    
    /* Region */
    .region-grid { grid-template-columns: repeat(4, 1fr); }
    
    /* CTA */
    .cta-content h2 { font-size: 2rem; }
    .cta-buttons { flex-direction: row; justify-content: center; }
    
    /* Footer */
    .footer-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ==================== DESKTOP (1024px+) ==================== */
@media (min-width: 1024px) {
    .header-container { padding: 10px 30px; gap: 40px; justify-content: flex-start; }
    .nav-menu { margin-left: 0; }
    .nav-list { gap: 5px; }
    .logo img { height: 46px; }
    .nav-link { padding: 8px 12px; font-size: 0.92rem; }
    .nav-link.nav-cta { padding: 8px 18px; font-size: 0.92rem; }
    
    .filter-section { top: 66px; }
    
    .page-hero { padding: calc(90px + var(--space-xxl)) 0 var(--space-xxl); }
    .page-hero h1 { font-size: 2.75rem; }
    
    .featured-content { padding: var(--space-xl); }
    .featured-content h2 { font-size: 2rem; }
    .stat-item strong { font-size: 2.25rem; }
    
    .section-header h2 { font-size: 2rem; }
    
    .magazine-grid { gap: var(--space-xl); }
    .project-card.size-large .card-body h3 { font-size: 1.5rem; }
    .project-card.size-large .card-body { padding: var(--space-lg); }
    
    .map-header h2 { font-size: 2rem; }
    .region-card { padding: var(--space-xl); }
}

/* ==================== LARGE DESKTOP (1280px+) ==================== */
@media (min-width: 1280px) {
    .page-hero h1 { font-size: 3rem; }
    .featured-content h2 { font-size: 2.25rem; }
}
