/*
Theme Name: Can Portfolio
Theme URI: https://phantancan.com
Author: Phan Tấn Can
Description: Theme WordPress custom 100% từ HTML. Tối ưu hóa UI/UX và chuẩn Mobile Responsive Menu.
Version: 1.6
*/

/* ==========================================================================
   1. RESET & BIẾN TOÀN CỤC (GLOBAL VARIABLES)
   ========================================================================== */
:root { 
    --orange: #F15A2B; 
    --orange-hover: #e04b1e; 
    --border-color: #eaeaea;
    --text-main: #111;
    --text-muted: #666;
    --bg-light: #fafafa;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }
body { background: var(--bg-light); color: var(--text-main); overflow-x: hidden; line-height: 1.5; }
a { text-decoration: none; transition: all 0.2s ease; }

.text-orange { color: var(--orange); }
.bg-orange { background-color: var(--orange); }

/* ==========================================================================
   2. NÚT BẤM & THÀNH PHẦN CHUNG (COMPONENTS)
   ========================================================================== */
.btn-primary { background-color: var(--orange); color: white; padding: 12px 28px; border-radius: 50px; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: none; cursor: pointer;}
.btn-primary:hover { background-color: var(--orange-hover); transform: translateY(-2px); color: white; }

.btn-outline { border: 1px solid #ddd; background: white; color: var(--text-main); padding: 12px 28px; border-radius: 50px; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.btn-outline:hover { border-color: var(--text-main); }

.btn-readmore { font-size: 13px; font-weight: 600; color: var(--orange); display: inline-flex; align-items: center; gap: 4px; }
.btn-readmore:hover { text-decoration: underline; }

.social-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; color: white; cursor: pointer; }
.social-icon:hover { transform: translateY(-2px); }

.tag { font-size: 11px; font-weight: 600; padding: 4px 12px; border-radius: 20px; background: #FFF0EC; color: var(--orange); display: inline-block; margin-bottom: 4px; text-transform: uppercase;}
.tag.blue { background: #EEF2FF; color: #4F46E5; }
.tag.green { background: #ECFDF5; color: #059669; }

.section-title { font-size: 20px; font-weight: 800; color: var(--text-main); display: flex; align-items: center; gap: 8px; text-transform: uppercase; }
.section-title::after { content: '•'; color: var(--orange); }
.section-link { font-size: 13px; font-weight: 600; color: var(--orange); display: flex; align-items: center; gap: 4px; }
.section-link:hover { text-decoration: underline; }

.form-group { display: flex; gap: 8px; }
.input-field { flex: 1; border: 1px solid #ddd; background: #f9f9f9; border-radius: 8px; padding: 12px 16px; font-size: 13px; outline: none; }
.input-field:focus { border-color: var(--orange); background: white; }

/* ==========================================================================
   3. HEADER & MENU NAVIGATION CHUẨN
   ========================================================================== */
.main-nav { background: white; border-bottom: 1px solid #f5f5f5; position: sticky; top: 0; z-index: 999; }
.nav-container { max-width: 1200px; margin: 0 auto; padding: 0 24px; height: 72px; display: flex; align-items: center; justify-content: space-between; position: relative; }
.nav-logo a { font-size: 28px; font-weight: 900; color: var(--orange); letter-spacing: -1px; text-decoration: none; }

.nav-menu { display: flex; gap: 36px; align-items: center; transition: all 0.3s ease; }
.nav-link { font-size: 14px; font-weight: 500; color: #444; position: relative; padding: 8px 0; }
.nav-link.active { color: var(--orange); font-weight: 700; }
.nav-link.active::after { content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 2px; background: var(--orange); border-radius: 2px; }
.nav-link:hover { color: var(--orange); }

/* Các nút ẩn/hiện mặc định cho Desktop */
.mobile-menu-toggle { display: none; font-size: 24px; color: #111; cursor: pointer; }
.mobile-only-btn { display: none; }

/* ==========================================================================
   4. GIAO DIỆN TRANG CHỦ (FRONT-PAGE)
   ========================================================================== */
.hero-section { position: relative; min-height: 600px; width: 100%; overflow: hidden; background-color: var(--border-color); }
.hero-slider-bg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.swiper-slide-bg { width: 100%; height: 100%; background-size: cover; background-position: center top; background-repeat: no-repeat; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(to right, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.7) 40%, rgba(255,255,255,0) 100%); z-index: 1; }

.stats-container { background: white; box-shadow: 0 10px 40px rgba(0,0,0,0.08); border-radius: 20px; max-width: 1100px; margin: -50px auto 60px; position: relative; z-index: 10; display: grid; grid-template-columns: repeat(4, 1fr); padding: 10px 0; }
.stat-item { display: flex; align-items: center; gap: 16px; padding: 24px 32px; border-right: 1px solid #f0f0f0; }
.stat-item:last-child { border-right: none; }
.stat-icon { font-size: 32px; color: var(--orange); }

.los-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-top: 24px; }
.los-card { position: relative; height: 420px; border-radius: 20px; overflow: hidden; box-shadow: 0 4px 20px rgba(0,0,0,0.06); transition: transform 0.3s; background-size: cover; background-position: center; }
.los-card:hover { transform: translateY(-5px); }
.los-card::before { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.85) 100%); z-index: 1; }
.los-content { position: absolute; inset: 0; z-index: 2; padding: 28px 24px; display: flex; flex-direction: column; justify-content: space-between; }
.los-icon { width: 48px; height: 48px; background: var(--orange); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-size: 20px; box-shadow: 0 4px 12px rgba(241, 90, 43, 0.3); }

.project-card { background: white; border-radius: 20px; overflow: hidden; box-shadow: 0 4px 20px rgba(0,0,0,0.05); border: 1px solid #f5f5f5; display: flex; flex-direction: column; transition: transform 0.3s ease; }
.project-card:hover { transform: translateY(-4px); box-shadow: 0 10px 25px rgba(0,0,0,0.08); }
.project-img-wrap { display: block; overflow: hidden; }
.project-img { height: 200px; width: 100%; background-size: cover; background-position: top center; border-bottom: 1px solid #f0f0f0; display: block; transition: transform 0.4s ease; }
.project-card:hover .project-img { transform: scale(1.05); }

.dashboard-container { background: white; border-radius: 24px; padding: 32px 40px; box-shadow: 0 4px 24px rgba(0,0,0,0.04); border: 1px solid #f5f5f5; overflow-x: auto; }
.run-stat { border-right: 1px solid #f0f0f0; padding: 0 24px; position: relative; min-width: 180px; }
.run-stat:first-child { padding-left: 0; }
.run-stat:last-child { border-right: none; padding-right: 0; }
.map-outline { fill: #FFF0EC; stroke: var(--orange); stroke-width: 1.5; }

.timeline-wrapper { position: relative; margin: 80px 0 60px; height: 160px; }
.timeline-line { position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: repeating-linear-gradient(to right, var(--orange) 0, var(--orange) 6px, transparent 6px, transparent 12px); transform: translateY(-50%); }
.timeline-grid { position: absolute; inset: 0; display: flex; justify-content: space-between; align-items: center; }
.timeline-item { position: relative; width: 140px; display: flex; flex-direction: column; align-items: center; }
.timeline-dot { width: 12px; height: 12px; background: var(--orange); border-radius: 50%; border: 3px solid white; box-shadow: 0 0 0 1px var(--orange); position: relative; z-index: 2; }
.timeline-content { position: absolute; width: 160px; text-align: center; }
.timeline-item.down .timeline-content { top: 20px; }
.timeline-item.up .timeline-content { bottom: 20px; }

/* ==========================================================================
   5. TRANG BLOG & DANH MỤC (ARCHIVE)
   ========================================================================== */
.blog-hero { position: relative; min-height: 400px; background-image: url('https://images.unsplash.com/photo-1476480862126-209bfaa8edc8?q=80&w=2070&auto=format&fit=crop'); background-size: cover; background-position: center 30%; }
.blog-hero-overlay { position: absolute; inset: 0; background: linear-gradient(to right, rgba(255,255,255,1) 0%, rgba(255,255,255,0.85) 40%, rgba(255,255,255,0) 100%); }

.filter-bar { display: flex; justify-content: center; gap: 12px; padding: 30px 24px; border-bottom: 1px solid var(--border-color); background: white; flex-wrap: wrap; }
.filter-pill { padding: 10px 24px; border-radius: 50px; font-size: 14px; font-weight: 600; color: #444; border: 1px solid #ddd; background: white; cursor: pointer; transition: all 0.2s; text-decoration: none; }
.filter-pill:hover { border-color: var(--orange); color: var(--orange); }
.filter-pill.active { background: var(--orange); color: white; border-color: var(--orange); }

.blog-container { max-width: 1200px; margin: 0 auto; padding: 40px 24px; }
.blog-layout { display: grid; grid-template-columns: 280px 1fr; gap: 40px; }

.blog-widget { background: white; border: 1px solid var(--border-color); border-radius: 16px; padding: 24px; margin-bottom: 24px; box-shadow: 0 4px 20px rgba(0,0,0,0.02); }
.blog-widget-title { font-size: 14px; font-weight: 800; color: var(--text-main); text-transform: uppercase; margin-bottom: 16px; letter-spacing: 0.5px; }

.blog-search-box { position: relative; width: 100%; }
.blog-search-input { width: 100%; padding: 12px 16px 12px 40px; border: 1px solid #ddd; border-radius: 50px; font-size: 13px; outline: none; transition: border 0.2s; }
.blog-search-input:focus { border-color: var(--orange); }
.blog-search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #888; font-size: 14px; z-index: 2; }

.cat-list { list-style: none; padding: 0; margin: 0; }
.cat-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid #f5f5f5; }
.cat-item:last-child { border-bottom: none; padding-bottom: 0; }
.cat-link { font-size: 14px; color: #444; text-decoration: none; font-weight: 500; transition: color 0.2s; }
.cat-link:hover { color: var(--orange); }
.cat-count { font-size: 13px; color: var(--orange); font-weight: 700; }

.side-post { display: flex; gap: 12px; margin-bottom: 16px; cursor: pointer; text-decoration: none; }
.side-post:last-child { margin-bottom: 0; }
.side-post:hover .side-post-title { color: var(--orange); }
.side-post-img { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.side-post-title { font-size: 13px; font-weight: 700; color: var(--text-main); line-height: 1.4; margin-bottom: 4px; transition: color 0.2s; }
.side-post-date { font-size: 11px; color: var(--text-muted); }

.featured-post { background: white; border: 1px solid var(--border-color); border-radius: 20px; overflow: hidden; display: grid; grid-template-columns: 1fr 1.2fr; margin-bottom: 40px; box-shadow: 0 4px 20px rgba(0,0,0,0.03); }
.featured-content { padding: 40px; display: flex; flex-direction: column; justify-content: center; }
.featured-img { background-size: cover; background-position: center; min-height: 300px; display: block; width: 100%; height: 100%; transition: transform 0.4s ease; }
.featured-post:hover .featured-img { transform: scale(1.03); }

.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.post-card { background: white; border: 1px solid var(--border-color); border-radius: 16px; overflow: hidden; transition: transform 0.2s; display: flex; flex-direction: column; }
.post-card:hover { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(0,0,0,0.06); }
.post-card-img { height: 180px; width: 100%; object-fit: cover; border-bottom: 1px solid #f9f9f9; display: block; transition: transform 0.4s ease; }
.post-card:hover .post-card-img { transform: scale(1.05); }
.post-card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.post-tag { font-size: 10px; font-weight: 800; color: var(--orange); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.post-title { font-size: 16px; font-weight: 800; color: var(--text-main); line-height: 1.4; margin-bottom: 8px; }
.post-excerpt { font-size: 13px; color: var(--text-muted); line-height: 1.5; margin-bottom: 16px; flex: 1; }
.post-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 16px; border-top: 1px solid #f0f0f0; font-size: 12px; color: #888; }

.insights-section { background: white; border-radius: 20px; padding: 32px; border: 1px solid var(--border-color); margin-bottom: 60px; }
.insights-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 20px; }
.insight-card { background: linear-gradient(135deg, #fafafa, #f5f5f5); border-radius: 16px; padding: 20px; display: flex; justify-content: space-between; align-items: center; gap: 16px; border: 1px solid #eee; transition: transform 0.2s; }
.insight-card:hover { transform: translateY(-3px); }
.insight-card-img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; }

.blog-tl-container { margin-top: 20px; position: relative; padding-top: 20px; border-top: 1px solid var(--border-color); }
.blog-tl-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.blog-tl-item { position: relative; padding-top: 16px; }
.blog-tl-dot { position: absolute; top: -24px; left: 0; width: 12px; height: 12px; background: var(--orange); border-radius: 50%; border: 2px solid white; }
.blog-tl-year { font-size: 18px; font-weight: 800; color: var(--text-main); margin-bottom: 12px; }
.blog-tl-list { list-style: none; padding: 0; margin: 0; }
.blog-tl-list li { font-size: 13px; color: #555; margin-bottom: 8px; display: flex; align-items: flex-start; gap: 6px; }
.blog-tl-list li::before { content: '•'; color: var(--orange); font-weight: bold; }

.pagination { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 40px 0 20px; flex-wrap: wrap; }
.page-item { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 14px; font-weight: 600; color: #444; text-decoration: none; border: 1px solid transparent; transition: all 0.2s; }
.page-item:hover { background: #eee; }
.page-item.active { background: var(--orange); color: white; }
.page-prev-next { font-size: 14px; font-weight: 600; color: #444; padding: 8px 16px; border-radius: 50px; border: 1px solid #ddd; text-decoration: none; transition: all 0.2s; }
.page-prev-next:hover { border-color: var(--orange); color: var(--orange); }

/* ==========================================================================
   6. CHI TIẾT BÀI VIẾT (SINGLE POST)
   ========================================================================== */
.breadcrumb { font-size: 12px; color: #888; margin-bottom: 24px; display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumb a { color: #888; text-decoration: none; transition: color 0.2s; }
.breadcrumb a:hover { color: var(--orange); }

.article-hero { position: relative; background-size: cover; background-position: center right; padding: 60px 0; border-bottom: 1px solid var(--border-color); }
.hero-content { max-width: 1200px; margin: 0 auto; padding: 0 24px; width: 60%; }

.article-tag { font-size: 11px; font-weight: 800; color: var(--orange); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; display: inline-block; }
.article-title { font-size: 44px; font-weight: 900; line-height: 1.15; color: #111; letter-spacing: -1px; margin-bottom: 16px; }
.article-excerpt { font-size: 15px; color: #555; margin-bottom: 32px; max-width: 500px; line-height: 1.6; }

.author-meta { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.author-info { display: flex; align-items: center; gap: 12px; }
.author-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.meta-item { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #666; font-weight: 500; }

.single-container { max-width: 1200px; margin: 0 auto; padding: 40px 24px; }
.article-layout { display: grid; grid-template-columns: 200px 1fr 300px; gap: 48px; }

/* Left Sidebar - TOC */
.left-sidebar { position: sticky; top: 100px; align-self: start; }
.toc-title { font-size: 12px; font-weight: 800; color: #111; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 16px; }
.toc-list { list-style: none; display: flex; flex-direction: column; gap: 12px; margin-bottom: 40px; padding: 0; }
.toc-item a { font-size: 13px; color: #666; text-decoration: none; transition: all 0.2s; display: block; border-left: 2px solid transparent; padding-left: 12px; margin-left: -14px; }
.toc-item.active a { color: #111; font-weight: 700; border-left-color: var(--orange); }
.toc-item a:hover { color: var(--orange); }

.progress-box { margin-bottom: 40px; }
.progress-label { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; color: #111; margin-bottom: 8px; }
.progress-bar { height: 4px; background: #eee; border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--orange); width: 0%; transition: width 0.1s; }

.share-box { display: flex; gap: 10px; flex-wrap: wrap; }
.share-icon { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; color: white; text-decoration: none; transition: transform 0.2s; }
.share-icon:hover { transform: scale(1.1); }
.bg-fb { background: #1877F2; } .bg-in { background: #0A66C2; } .bg-x { background: #000; } .bg-link { background: #888; }

/* Article Content - Bọc trắng */
.article-body { background: #ffffff; padding: 48px; border-radius: 20px; border: 1px solid var(--border-color); box-shadow: 0 4px 20px rgba(0,0,0,0.03); color: var(--text-main); font-size: 16px; line-height: 1.8; }
.article-body h2 { font-size: 26px; font-weight: 800; color: #111; margin: 40px 0 16px; scroll-margin-top: 100px; }
.article-body h2:first-child { margin-top: 0; }
.article-body h3 { font-size: 20px; font-weight: 700; color: #111; margin: 30px 0 16px; }
.article-body p { margin-bottom: 16px; }
.article-body img { max-width: 100%; height: auto; border-radius: 12px; margin: 24px 0; display: block; }
.article-body a { color: var(--orange); text-decoration: none; font-weight: 500; }
.article-body a:hover { text-decoration: underline; }
.article-body ul, .article-body ol { margin-bottom: 24px; padding-left: 20px; }
.article-body li { margin-bottom: 8px; }
.article-body blockquote { background: #FFF0EC; border-left: 4px solid var(--orange); padding: 20px 24px; border-radius: 0 12px 12px 0; margin: 24px 0; font-size: 16px; font-weight: 600; color: var(--orange); font-style: italic; line-height: 1.5; }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 48px; border-top: 1px solid #eee; padding-top: 32px; }
.nav-card { border: 1px solid #eee; border-radius: 12px; padding: 20px; text-decoration: none; transition: border 0.2s; display: flex; flex-direction: column; }
.nav-card:hover { border-color: var(--orange); }
.nav-label { font-size: 11px; color: #888; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.nav-title { font-size: 14px; font-weight: 700; color: #111; }
.nav-card.next { text-align: right; }
.nav-card.next .nav-label { justify-content: flex-end; }

/* Right Sidebar */
.right-sidebar { position: sticky; top: 100px; align-self: start; display: flex; flex-direction: column; gap: 24px; }
.author-widget { text-align: center; }
.author-widget img { width: 80px; height: 80px; border-radius: 50%; margin-bottom: 12px; }
.author-name { font-size: 18px; font-weight: 800; color: #111; }
.author-role { font-size: 12px; color: #888; margin-bottom: 16px; }
.author-bio { font-size: 13px; color: #555; line-height: 1.5; margin-bottom: 20px; }
.author-social { display: flex; justify-content: center; gap: 12px; margin-bottom: 20px; }

.promo-widget { background: #fffaf8; border-color: #ffeae3; }
.promo-title { font-size: 16px; font-weight: 800; color: #111; margin-bottom: 12px; line-height: 1.3; }
.promo-desc { font-size: 13px; color: #555; margin-bottom: 16px; }
.promo-list { list-style: none; margin-bottom: 20px; padding: 0; }
.promo-list li { font-size: 12px; color: #333; margin-bottom: 8px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.promo-img { width: 100%; border-radius: 8px; margin-bottom: 16px; }

/* Bottom Section */
.bottom-section { background: white; padding: 60px 24px; border-top: 1px solid #eee; }
.bottom-layout { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr; gap: 40px; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.related-card { text-decoration: none; display: block; transition: transform 0.2s; }
.related-card:hover { transform: translateY(-4px); }
.related-card img { width: 100%; height: 140px; object-fit: cover; border-radius: 12px; margin-bottom: 12px; }
.related-tag { font-size: 10px; font-weight: 800; color: var(--orange); text-transform: uppercase; margin-bottom: 4px; }
.related-title { font-size: 14px; font-weight: 700; color: #111; line-height: 1.4; margin-bottom: 8px; transition: color 0.2s;}
.related-card:hover .related-title { color: var(--orange); }
.related-meta { font-size: 11px; color: #888; }

.newsletter-box { background: #fffaf8; border: 1px solid #ffeae3; border-radius: 16px; padding: 32px 24px; }
.newsletter-title { font-size: 16px; font-weight: 800; color: #111; margin-bottom: 8px; }
.newsletter-desc { font-size: 13px; color: #555; margin-bottom: 20px; }
.newsletter-input { width: 100%; padding: 12px 16px; border: 1px solid #ddd; border-radius: 8px; font-size: 13px; outline: none; margin-bottom: 12px; box-sizing: border-box;}
.newsletter-input:focus { border-color: var(--orange); }

/* ==========================================================================
   7. DANH MỤC DỰ ÁN (ARCHIVE PROJECT)
   ========================================================================== */
.project-hero { position: relative; background: linear-gradient(135deg, #fffaf8 0%, #fff 50%, #fff5f2 100%); padding: 80px 24px 60px; overflow: hidden; }
.hero-container { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; position: relative; z-index: 2; }
.hero-left { max-width: 600px; }
.hero-tag { font-size: 12px; font-weight: 800; color: var(--orange); text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 16px; display: inline-block; }
.hero-title { font-size: 56px; font-weight: 900; line-height: 1.1; color: #111; letter-spacing: -1.5px; margin-bottom: 24px; }
.hero-desc { font-size: 15px; color: #555; margin-bottom: 40px; max-width: 480px; line-height: 1.6; }

.hero-stats { display: flex; gap: 32px; flex-wrap: wrap; }
.stat-box { display: flex; align-items: center; gap: 12px; }
.stat-icon { font-size: 24px; color: var(--orange); }
.stat-text { display: flex; flex-direction: column; }
.stat-num { font-size: 20px; font-weight: 900; color: #111; line-height: 1.2; }
.stat-label { font-size: 11px; color: #666; }

.hero-right { position: relative; width: 500px; height: 400px; }
.hero-img { position: absolute; bottom: -60px; right: 0; width: 100%; height: 120%; object-fit: cover; -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,1) 80%, rgba(0,0,0,0) 100%); mask-image: linear-gradient(to top, rgba(0,0,0,1) 80%, rgba(0,0,0,0) 100%); }
.handwritten-text { position: absolute; top: 0; right: -20px; font-family: 'Caveat', cursive; font-size: 42px; line-height: 1.1; color: #333; transform: rotate(-5deg); z-index: 10;}

.filter-section { max-width: 1200px; margin: 0 auto; padding: 40px 24px 20px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; }
.filter-list { display: flex; gap: 12px; flex-wrap: wrap; }
.sort-select { padding: 10px 20px; border-radius: 50px; border: 1px solid #ddd; font-size: 13px; font-weight: 500; color: #444; background: white; outline: none; cursor: pointer; }

.project-container { max-width: 1200px; margin: 0 auto; padding: 20px 24px 60px; }
.project-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin-bottom: 48px; }
.project-img-wrapper { background: #f8f9fa; height: 220px; padding: 20px; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid #f0f0f0; overflow: hidden;}
.project-img-wrapper img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); transition: transform 0.4s ease;}
.project-card:hover .project-img-wrapper img { transform: scale(1.05); }
.project-content { padding: 24px; flex: 1; display: flex; flex-direction: column; }
.cat-tag { font-size: 10px; font-weight: 800; color: var(--orange); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.project-title { font-size: 18px; font-weight: 800; color: #111; margin-bottom: 8px; }
.project-desc { font-size: 13px; color: #666; line-height: 1.5; margin-bottom: 20px; flex: 1; }
.tech-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tech-tag { font-size: 11px; font-weight: 600; padding: 4px 12px; border-radius: 20px; background: #FFF0EC; color: var(--orange); }

.featured-section { max-width: 1200px; margin: 0 auto 60px; padding: 0 24px; }
.featured-box { background: white; border: 1px solid #eee; border-radius: 24px; padding: 40px; display: grid; grid-template-columns: 1fr 1.2fr; gap: 48px; align-items: center; box-shadow: 0 4px 24px rgba(0,0,0,0.02); }
.featured-img-box { position: relative; border-radius: 16px; overflow: hidden; height: 320px; }
.featured-img-box img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.featured-box:hover .featured-img-box img { transform: scale(1.03); }
.play-btn { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 56px; height: 56px; background: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--orange); font-size: 20px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); cursor: pointer; transition: transform 0.2s; }
.play-btn:hover { transform: translate(-50%, -50%) scale(1.1); }
.featured-content h2 { font-size: 28px; font-weight: 900; color: #111; margin: 8px 0 16px; }
.featured-list { list-style: none; margin-bottom: 24px; }
.featured-list li { font-size: 13px; color: #444; margin-bottom: 8px; display: flex; gap: 8px; align-items: center; }
.featured-list li i { color: var(--orange); }
.prj-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 32px; }
.prj-stat-card { background: #fafafa; border: 1px solid #eee; padding: 20px; border-radius: 12px; text-align: center; }
.prj-stat-val { font-size: 24px; font-weight: 900; color: #111; }
.prj-stat-label { font-size: 12px; color: #666; margin-top: 4px; }

.clients-section { max-width: 1200px; margin: 0 auto 60px; padding: 0 24px; }
.clients-title { font-size: 14px; font-weight: 800; color: #111; text-transform: uppercase; margin-bottom: 24px; display: flex; align-items: center; gap: 8px; }
.clients-title::after { content: '•'; color: var(--orange); }
.clients-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 32px; opacity: 0.6; filter: grayscale(100%); transition: all 0.3s; }
.clients-row:hover { opacity: 1; filter: grayscale(0%); }
.client-logo { font-size: 24px; font-weight: 800; color: #333; display: flex; align-items: center; gap: 8px; }

.cta-container { max-width: 1200px; margin: 0 auto 60px; padding: 0 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.cta-box { background: #fdfdfd; border: 1px solid #eee; border-radius: 20px; padding: 40px; display: flex; align-items: center; justify-content: space-between; gap: 24px; position: relative; overflow: hidden; }
.cta-box.left { background: #fffaf8; border-color: #ffeae3; }
.cta-box.left img { width: 140px; height: 160px; object-fit: cover; border-radius: 12px; }
.cta-box.right { background: #f8f9fa; border-color: #eee; }
.cta-title { font-size: 20px; font-weight: 800; color: #111; margin-bottom: 12px; }
.cta-desc { font-size: 13px; color: #555; margin-bottom: 20px; }
.cta-list { list-style: none; margin-bottom: 24px; }
.cta-list li { font-size: 13px; color: #333; margin-bottom: 8px; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.cta-list li i { color: var(--orange); }
.input-group { display: flex; gap: 8px; margin-bottom: 12px; }
.cta-input { flex: 1; padding: 12px 16px; border: 1px solid #ddd; border-radius: 8px; font-size: 13px; outline: none; }
.cta-input:focus { border-color: var(--orange); }

/* ==========================================================================
   8. CHI TIẾT DỰ ÁN (SINGLE PROJECT)
   ========================================================================== */
.pd-hero { background: linear-gradient(135deg, #fffaf8 0%, #fff 40%, #fdfdfd 100%); padding: 60px 0; border-bottom: 1px solid var(--border-color); }
.pd-hero-container { max-width: 1200px; margin: 0 auto; padding: 0 24px; display: grid; grid-template-columns: 1fr 1.1fr; gap: 60px; align-items: center; }
.pd-tag { font-size: 11px; font-weight: 800; color: var(--orange); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; display: inline-block; }
.pd-title { font-size: 48px; font-weight: 900; line-height: 1.15; color: #111; letter-spacing: -1.5px; margin-bottom: 16px; }
.pd-desc { font-size: 15px; color: #555; margin-bottom: 24px; line-height: 1.6; }

.pd-meta-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; border-top: 1px solid #eee; padding-top: 24px; }
.pd-meta-item { display: flex; align-items: flex-start; gap: 8px; }
.pd-meta-icon { color: #555; font-size: 16px; margin-top: 2px; }
.pd-meta-content { display: flex; flex-direction: column; gap: 4px; }
.pd-meta-label { font-size: 11px; color: #888; font-weight: 600; }
.pd-meta-val { font-size: 12px; color: #111; font-weight: 600; line-height: 1.3; }
.pd-meta-val a { color: var(--orange); text-decoration: none; }
.pd-meta-val a:hover { text-decoration: underline; }

.pd-hero-img { position: relative; width: 100%; }
.pd-hero-img img { width: 100%; filter: drop-shadow(0 20px 40px rgba(0,0,0,0.15)); border-radius: 12px; }

.pd-layout { display: grid; grid-template-columns: 1fr 340px; gap: 60px; max-width: 1200px; margin: 0 auto; padding: 60px 24px; }
.pd-content { color: var(--text-main); font-size: 15px; line-height: 1.7; }
.pd-content h2 { font-size: 20px; font-weight: 800; color: #111; margin: 48px 0 16px; }
.pd-content h2:first-child { margin-top: 0; }
.pd-content p { margin-bottom: 24px; }
.pd-content img { max-width: 100%; height: auto; border-radius: 12px; margin-bottom: 24px; }

.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin: 32px 0; }
.feature-item { text-align: center; }
.feature-icon { width: 48px; height: 48px; margin: 0 auto 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; color: var(--orange); }
.feature-title { font-size: 13px; font-weight: 800; color: #111; margin-bottom: 4px; }
.feature-desc { font-size: 11px; color: #666; }

.pd-content ul.checklist { list-style: none; margin-bottom: 32px; padding: 0; }
.pd-content ul.checklist li { margin-bottom: 12px; display: flex; gap: 12px; align-items: flex-start; }
.pd-content ul.checklist li i { color: var(--orange); font-size: 16px; margin-top: 4px; }

.gallery-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 32px; }
.gallery-img { width: 100%; border-radius: 12px; object-fit: cover; border: 1px solid #eee; box-shadow: 0 4px 12px rgba(0,0,0,0.03); }
.gallery-img.large { grid-column: span 2; }

.results-grid { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 24px; margin-bottom: 48px;}
.result-box { flex: 1 1 calc(33.333% - 16px); background: white; border: 1px solid #f0f0f0; border-radius: 12px; padding: 24px 20px; text-align: center; box-shadow: 0 4px 16px rgba(0,0,0,0.02); }
.result-val { font-size: 28px; font-weight: 900; color: #111; margin-bottom: 8px; line-height: 1; }
.result-label { font-size: 12px; color: #555; line-height: 1.4; }

.testimonial-box { background: #fafafa; border: 1px solid #eee; border-radius: 16px; padding: 32px; margin-top: 24px; margin-bottom: 48px;}
.quote-icon { font-size: 24px; color: var(--orange); margin-bottom: 16px; opacity: 0.8; }
.testimonial-text { font-size: 15px; font-weight: 500; color: #111; line-height: 1.6; margin-bottom: 24px; }
.client-info { display: flex; align-items: center; gap: 12px; }
.client-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.client-name { font-size: 14px; font-weight: 800; color: #111; }
.client-role { font-size: 12px; color: #666; }

.pd-sidebar { position: sticky; top: 100px; display: flex; flex-direction: column; gap: 32px; }
.info-table { width: 100%; border-collapse: collapse; }
.info-table tr { border-bottom: 1px solid #f5f5f5; }
.info-table tr:last-child { border-bottom: none; }
.info-table td { padding: 12px 0; font-size: 13px; }
.info-label { color: #666; width: 40%; }
.info-val { color: #111; font-weight: 500; text-align: right; }
.info-val a { color: var(--orange); text-decoration: none; }

.cta-widget { background: #fffaf8; border-color: #ffeae3; position: relative; overflow: hidden; padding-bottom: 0; }
.cta-widget .cta-desc { font-size: 13px; color: #555; margin-bottom: 16px; line-height: 1.5; }
.cta-widget .cta-list { list-style: none; margin-bottom: 20px; padding:0; }
.cta-widget .cta-list li { font-size: 12px; color: #333; margin-bottom: 8px; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.cta-person { display: block; width: 100%; margin-top: 20px; border-radius: 12px 12px 0 0; -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,1) 80%, rgba(0,0,0,0) 100%); mask-image: linear-gradient(to top, rgba(0,0,0,1) 80%, rgba(0,0,0,0) 100%);}

.related-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.related-item { display: flex; gap: 16px; margin-bottom: 20px; cursor: pointer; text-decoration: none;}
.related-img { width: 80px; height: 60px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.related-content { display: flex; flex-direction: column; justify-content: center; }
.related-item-title { font-size: 13px; font-weight: 800; color: #111; margin-bottom: 6px; transition: color 0.2s; }
.related-item:hover .related-item-title { color: var(--orange); }

.bottom-cta { background: #fffaf8; border-radius: 20px; padding: 48px; margin: 20px auto 60px; max-width: 1200px; display: flex; justify-content: space-between; align-items: center; border: 1px solid #ffeae3; position: relative; }
.bottom-cta-left { max-width: 500px; }
.bottom-cta-title { font-size: 24px; font-weight: 800; color: #111; margin-bottom: 12px; }
.bottom-cta-desc { font-size: 14px; color: #555; }
.arrow-icon { font-size: 40px; color: var(--orange); opacity: 0.5; margin-right: 40px; transform: rotate(-10deg); }

/* ==========================================================================
   9. TỐI ƯU HÓA ĐIỆN THOẠI & TABLET (MOBILE RESPONSIVE TỔNG HỢP)
   ========================================================================== */

/* --- TABLET (Dưới 1024px) --- */
@media (max-width: 1024px) {
    .blog-layout, .article-layout, .pd-layout, .bottom-layout { grid-template-columns: 1fr !important; gap: 40px; }
    .hero-content, .pd-hero-container { width: 100% !important; grid-template-columns: 1fr !important; }
    
    .left-sidebar, .right-sidebar, .pd-sidebar { position: static !important; }
    .left-sidebar { display: flex; flex-direction: column; }
    
    .toc-list { flex-direction: row; flex-wrap: wrap; gap: 16px; }
    .toc-item a { border-left: none; padding-left: 0; margin-left: 0; border-bottom: 2px solid transparent; padding-bottom: 4px; }
    .toc-item.active a { border-left-color: transparent; border-bottom-color: var(--orange); }
    
    .post-grid, .insights-grid, .blog-tl-grid, .related-grid, .los-grid, .stats-container, .pd-meta-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .featured-post { grid-template-columns: 1fr !important; }
    .featured-img { min-height: 250px; }
}

/* --- MOBILE (Dưới 768px) --- */
@media (max-width: 768px) {
    /* 1. Mobile Hamburger Menu */
    .mobile-menu-toggle { display: block !important; }
    .desktop-only-btn { display: none !important; }
    
    .nav-menu {
        position: absolute;
        top: 72px; /* Bắt đầu từ dưới thanh header */
        left: -100%; /* Ẩn menu đi */
        width: 100%;
        height: calc(100vh - 72px); /* Chiếm hết màn hình */
        background: white;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding-top: 40px;
        gap: 24px;
        box-shadow: 0 10px 20px rgba(0,0,0,0.05);
        transition: left 0.3s ease;
    }
    
    .nav-menu.active { left: 0; /* Vuốt ra khi bấm nút */ }
    .nav-link { font-size: 18px; }
    .mobile-only-btn { display: inline-flex !important; margin-top: 20px; }

    /* 2. Text Size */
    .hero-title, .pd-title, .article-title, .blog-hero h1 { font-size: 32px !important; line-height: 1.2 !important; letter-spacing: -0.5px; }
    .hero-desc, .pd-desc, .article-excerpt, .hero-section p { font-size: 14px !important; }
    .section-title { font-size: 18px !important; }
    .handwritten-text { display: none !important; } 

    /* 3. Padding chuẩn */
    .container, .single-container, .project-container, .blog-container, .filter-section { padding: 30px 20px !important; }

    /* 4. Grid 1 Cột */
    .post-grid, .insights-grid, .blog-tl-grid, .related-grid, .feature-grid, 
    .results-grid, .gallery-grid, .prj-stats-grid, .pd-meta-grid, .cta-container, 
    .stats-container, .los-grid { grid-template-columns: 1fr !important; }
    .gallery-img.large { grid-column: span 1 !important; }
    
    /* 5. Khối Dashboard Strava Vuốt Ngang */
    .dashboard-container { padding: 20px 16px !important; }
    .dashboard-container > div:nth-child(2) { display: flex !important; overflow-x: auto; padding-bottom: 16px; -webkit-overflow-scrolling: touch; }
    .dashboard-container > div:nth-child(2)::-webkit-scrollbar { display: none; }
    .run-stat { min-width: 160px; flex-shrink: 0; border-right: 1px solid #f0f0f0 !important; padding: 0 16px !important; }
    .run-stat:last-child { border-right: none !important; }

    /* 6. Chi tiết bài viết & Dự án */
    .article-body { padding: 24px 20px !important; }
    .post-nav { grid-template-columns: 1fr !important; gap: 16px; }
    .nav-card.next { text-align: left !important; }
    .nav-card.next .nav-label { justify-content: flex-start !important; }
    .featured-box { padding: 24px !important; }
    .featured-img-box { height: 200px !important; margin-bottom: 24px; }
    
    .bottom-cta { padding: 32px 20px !important; flex-direction: column; text-align: center; gap: 24px; }
    .arrow-icon { display: none !important; }
    .cta-box { flex-direction: column !important; text-align: center; padding: 24px !important; }
    .cta-list li { justify-content: center; }
    .cta-box.left img { width: 100% !important; height: 200px !important; }
    
    /* 7. Bộ lọc Danh mục Vuốt Ngang */
    .filter-bar { justify-content: flex-start; overflow-x: auto; padding: 16px 20px; white-space: nowrap; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
    .filter-bar::-webkit-scrollbar { display: none; }

    /* Ẩn dòng kẻ ziczac ngang tránh vỡ khung */
    .timeline-wrapper { display: none !important; }
    .hero-right { width: 100%; height: 300px; margin-top: 40px; }

    /* 8. Canh giữa Footer */
    footer > div { flex-direction: column; text-align: center; gap: 32px !important; }
    footer > div > div:nth-child(2) { flex-direction: column; gap: 24px !important; }
    footer > div > div:nth-child(2) > div { align-items: center !important; }
    footer .author-social { justify-content: center !important; }
}