/* =========================================
   1. Theme Variables (Deep Cyan / Salt Lake Crisis)
   ========================================= */
:root {
    --font-heading: 'Pridi', serif;
    --font-body: 'Prompt', sans-serif;
    
    /* โทนสีพื้นหลัง (น้ำเงินเข้มเกือบดำ สไตล์น้ำลึก) */
    --bg-base: #060c14; 
    --bg-article: #0c1522; 
    --nav-bg: rgba(6, 12, 20, 0.85); 
    
    /* โทนสีข้อความ */
    --text-primary: #e2e8f0; 
    --text-secondary: #94a3b8; 
    
    /* สีเน้นหลัก (ฟ้าอมเขียว Teal สื่อถึงสีของน้ำและแร่ธาตุ) */
    --accent-color: #14b8a6; 
    
    /* สีเส้นขอบ */
    --border-color: #1e2e42; 
}

html {
    scroll-behavior: smooth; /* ทำให้เลื่อนหน้าเว็บแบบนุ่มนวลเวลาคลิกเมนู */
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-body);
    background-color: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
}

/* =========================================
   2. Navbar (Sticky & Glassmorphism)
   ========================================= */
.navbar {
    position: fixed;
    top: 0; left: 0; width: 100%;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    z-index: 1000;
    padding: 15px 0;
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.nav-logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--accent-color);
    font-weight: 600;
    letter-spacing: 1px;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 25px;
}

.nav-links li a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 400;
    transition: color 0.3s;
}

.nav-links li a:hover {
    color: var(--accent-color);
}

/* =========================================
   3. Hero Section (YouTube Video Full-Width)
   ========================================= */
.hero {
    position: relative; 
    height: 100vh;
    width: 100%;
    display: flex; 
    align-items: center; 
    justify-content: center; 
    text-align: center; 
    overflow: hidden;
    background-color: #000;
}

.hero-video-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* อัปเกรดสูตรคำนวณใหม่ ให้ขยายเต็มทุกมิติหน้าจอ ไร้ขอบดำแน่นอน */
.hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100vw;
    height: 100vh;
    transform: translate(-50%, -50%);
}

@media (min-aspect-ratio: 16/9) {
    .hero-video { height: 56.25vw; }
}

@media (max-aspect-ratio: 16/9) {
    .hero-video { width: 177.78vh; }
}

.hero-overlay { 
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; 
    background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, rgba(10,10,10,0.8) 70%, rgba(10,10,10,1) 100%); 
    z-index: 1; 
}

.hero-content { 
    position: relative; z-index: 2; max-width: 900px; padding: 0 40px; margin-top: 40px; 
}

.hero h1 { 
    font-family: var(--font-heading); font-size: clamp(2.8rem, 6vw, 4.5rem); 
    color: var(--accent-color); margin-bottom: 25px; line-height: 1.2;
    letter-spacing: 1px;
}

.hero p { 
    font-size: clamp(1.2rem, 2.5vw, 1.6rem); color: #e5e5e5; font-weight: 300; line-height: 1.5;
}

/* =========================================
   4. Main Article Layout (Fluid & Responsive)
   ========================================= */
.container { 
    width: 92%; /* ใช้เปอร์เซ็นต์เพื่อให้ยืดหดตามแต่ละ Platform อัตโนมัติ */
    max-width: 1200px; /* ขยายความกว้างสูงสุดให้ดูพรีเมียมและกว้างขวางขึ้น */
    margin: 0 auto; 
    position: relative; 
    z-index: 10; 
}

.single-article { 
    background-color: var(--bg-article); 
    margin-top: -12vh; /* ดึงกระดาษซ้อนทับวิดีโอมากขึ้นเพื่อความมีมิติ */
    padding: 80px 7%; /* ใช้เปอร์เซ็นต์ทำ padding ด้านข้าง เนื้อหาจะบีบตัวสวยงามทุกหน้าจอ */
    border-radius: 20px 20px 0 0; 
    box-shadow: 0 -20px 60px rgba(0,0,0,0.7); 
    border-top: 1px solid var(--border-color); 
}

.location-badge { 
    display: inline-block; padding: 8px 18px; background: rgba(212, 175, 55, 0.08); 
    color: var(--accent-color); border: 1px solid rgba(212, 175, 55, 0.2); border-radius: 30px; 
    font-size: 0.95rem; margin-bottom: 50px; font-weight: 500;
}

.article-section { margin-bottom: 70px; padding-top: 90px; margin-top: -90px; }
.article-section h2 { font-family: var(--font-heading); font-size: clamp(1.8rem, 3vw, 2.2rem); color: var(--accent-color); margin-bottom: 25px; border-bottom: 1px solid var(--border-color); padding-bottom: 12px; }
.article-section p { 
    font-size: clamp(1.1rem, 1.8vw, 1.25rem); 
    color: var(--text-primary); 
    font-weight: 300; 
    margin-bottom: 25px; 
    text-indent: 2.5em; 
    line-height: 1.9; 
    text-align: left; /* เปลี่ยนตรงนี้ครับ */
}
/* แก้ไขเพิ่มเติมเพื่อให้บอร์ดแกลเลอรีขยายตามพื้นที่ใหม่ได้อย่างสวยงาม */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* ปรับขนาดขั้นต่ำของรูปให้ใหญ่ขึ้นตามหน้าจอ */
    gap: 25px;
}

/* =========================================
   5. Gallery & Tags
   ========================================= */
.section-title { font-family: var(--font-heading); font-size: 1.5rem; text-align: center; margin: 60px 0 30px; color: var(--text-primary); }
.section-title::after { content: ''; display: block; width: 50px; height: 2px; background: var(--accent-color); margin: 15px auto 0; }

.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.gallery-item { position: relative; border-radius: 12px; overflow: hidden; cursor: pointer; aspect-ratio: 4/3; border: 1px solid var(--border-color); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; filter: brightness(0.85); }
.gallery-item:hover img { transform: scale(1.05); filter: brightness(1); }

.article-tags-source { margin-top: 60px; padding-top: 30px; border-top: 1px solid var(--border-color); }
.tags { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.tag-item { font-size: 0.85rem; color: var(--text-secondary); padding: 5px 12px; border: 1px solid var(--border-color); border-radius: 4px; transition: all 0.3s; }
.tag-item:hover { color: var(--bg-article); background-color: var(--accent-color); border-color: var(--accent-color); }

.source-credit { font-size: 0.9rem; color: var(--text-secondary); }
.source-credit a { color: var(--accent-color); text-decoration: none; }

/* =========================================
   6. Footer
   ========================================= */
.site-footer {
    background-color: #050505;
    padding: 60px 20px 20px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
}
.site-footer h2 { font-family: var(--font-heading); color: var(--accent-color); margin-bottom: 10px; font-size: 1.5rem; }
.site-footer p { color: var(--text-secondary); font-size: 0.95rem; margin-bottom: 30px; max-width: 500px; margin-left: auto; margin-right: auto; }
.footer-bottom { border-top: 1px solid #1a1a1a; padding-top: 20px; font-size: 0.85rem; color: #666; }

/* =========================================
   7. Lightbox Modal
   ========================================= */
.lightbox { display: none; position: fixed; z-index: 9999; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.95); backdrop-filter: blur(10px); justify-content: center; align-items: center; }
.lightbox-content img { max-width: 90vw; max-height: 80vh; border-radius: 8px; border: 1px solid var(--border-color); }
.caption { margin-top: 20px; color: var(--text-primary); font-family: var(--font-heading); font-size: 1.1rem; text-align: center;}
.close-btn { position: absolute; top: 20px; right: 30px; font-size: 40px; color: #fff; cursor: pointer; }
.nav-btn { position: absolute; top: 50%; transform: translateY(-50%); background: transparent; border: none; color: #fff; font-size: 3rem; cursor: pointer; opacity: 0.5; }
.nav-btn:hover { opacity: 1; color: var(--accent-color); }
.prev { left: 30px; } .next { right: 30px; }

/* =========================================
   8. Hamburger Icon (ซ่อนไว้ในหน้าจอ PC)
   ========================================= */
.hamburger {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 6px;
    z-index: 1001; /* ให้อยู่เหนือเมนูที่เลื่อนลงมา */
}

.bar {
    width: 28px;
    height: 3px;
    background-color: var(--text-primary);
    transition: all 0.3s ease-in-out;
    border-radius: 3px;
}

/* =========================================
   9. Mobile Responsive & Hamburger Menu
   ========================================= */
@media (max-width: 768px) {
    /* แสดงปุ่ม Hamburger */
    .hamburger { display: flex; }

    /* ซ่อนและจัดรูปแบบเมนูที่กางออก */
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--nav-bg);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        flex-direction: column;
        align-items: center;
        padding: 30px 0;
        gap: 30px;
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 10px 30px rgba(0,0,0,0.5);
        
        /* แอนิเมชันซ่อนเมนูแบบเลื่อนขึ้น */
        transform: translateY(-150%);
        opacity: 0;
        transition: transform 0.4s ease, opacity 0.4s ease;
        z-index: 1000;
        display: flex; /* ให้แสดงผลเป็น flex ไม่ใช่ถูกซ่อน */
    }

    /* คลาสนี้จะถูกเพิ่มเมื่อคลิกที่เมนู */
    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
    }

    /* แอนิเมชันเปลี่ยน Hamburger เป็นตัว X */
    .hamburger.active .bar:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
        background-color: var(--accent-color);
    }
    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }
    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
        background-color: var(--accent-color);
    }

    /* ปรับ Layout ให้มือถือ */
    .single-article { margin-top: -5vh; padding: 40px 20px; }
    .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}