/* ----- CSS Reset & Basic Setup ----- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #000000;
    color: #ffffff;
    font-family: 'Anton', sans-serif; 
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ----- News Header (Tabs) ----- */
.news-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end; 
    padding: 30px 0;
    position: relative; 
    margin-top: 7%;
}

.news-nav {
    display: flex;
    gap: 25px; 
    position: relative; 
    padding-bottom: 10px; 
}

/* เส้นสีเทาเต็มความยาว */
.news-nav::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%; 
    height: 2px; 
    background-color: #555555; 
    z-index: 1; 
}

.news-nav a {
    font-size: 1.5rem; 
    color: #888888; 
    transition: color 0.3s ease; 
    text-decoration: none; 
    z-index: 2;
}

.news-nav a.active {
    color: #ffffff; 
    font-weight: normal; 
}

/* เส้นใต้สีขาวที่เคลื่อนที่ได้ */
.nav-underline {
    position: absolute;
    bottom: 0;
    height: 2px;
    background-color: #ffffff;
    z-index: 2;
    transition: left 0.3s ease-out, width 0.3s ease-out;
}

.news-title {
    font-size: 3.5rem; 
    font-weight: 900; 
    letter-spacing: 1px;
    color: #ffffff; 
    position: relative;
    padding-bottom: 10px;
}

/* 2. "เพิ่ม" โค้ดส่วนนี้ใหม่ทั้งหมดต่อท้าย */
/* นี่คือส่วนที่สร้างเส้นใต้ครับ */
.news-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 60%;
    height: 3px;
    background-color: #ffffff;
}

/* ----- News Content (Tab Panels) ----- */
/* ซ่อนเนื้อหาแท็บทั้งหมดไว้ก่อน */
.news-grid {
    display: none;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding-bottom: 40px;
}

/* แสดงเฉพาะแท็บที่มี class "active" */
.news-grid.active {
    display: grid;
}


/* ----- News Card Styling ----- */
.news-card {
    border-radius: 3px;
    overflow: hidden;
    aspect-ratio: 16 / 9; 
    
    display: flex;
    position: relative;
}

/* Overlay (เหมือนเดิม) */
.news-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0) 100%);
    z-index: 1;
}

.card-background-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

/* .card-content (ปรับปรุง) */
.card-content {
    flex-grow: 1; 
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    
    position: relative; 
    z-index: 2; 
    color: #ffffff;
    padding: 20px; 
}

.summit-title {
    font-weight: bold;
    font-size: 0.9rem;
}

.event-name {
    text-align: left; 
    margin: 0;
    position: relative;
    top: 0;
    margin-top: 10px;
}

.future-text {
    font-family: 'Teko', 'Impact', 'Arial Black', sans-serif;
    font-size: 2rem; 
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
    background: linear-gradient(90deg, #9BF8F4, #6AF2D6, #C1F3A1, #F6F3A0);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.innovate-text {
    font-family: 'Playball', 'Brush Script MT', cursive;
    font-size: 1.5rem;
    color: #fff;
    margin-top: -10px; 
}

.event-details {
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.4;
}

.early-bird {
    font-weight: normal; 
}

.obscured-box {
    background-color: rgba(255, 255, 255, 0.9); 
    width: 65%; 
    height: 1.2em; 
    border-radius: 3px;
    margin-top: 5px; 
}

/* ----- Video Responsive Styling (สำหรับหลายวิดีโอ) ----- */
/* Styles for the video section */
.video-item-wrapper {
    margin-bottom: 20px; /* ระยะห่างระหว่างวิดีโอแต่ละอัน */
    background-color: #1a1a1a; /* หรือสีพื้นหลังที่ต้องการ */
    border-radius: 8px;
    overflow: hidden; /* เพื่อให้มุมโค้งของ container แสดงผลถูกต้อง */
}

.video-responsive {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio (divide 9 by 16 = 0.5625) */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000; /* สีพื้นหลังเมื่อวิดีโอโหลดช้าหรือไม่พร้อม */
}

.video-responsive video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-info {
    padding: 15px 20px;
    color: #f0f0f0; /* สีตัวอักษร */
    background-color: #000;
}

.video-info h3 {
    font-family: 'Teko', sans-serif; /* ใช้ font เดียวกับหัวข้อ News ถ้าต้องการ */
    font-size: 1.5em; /* ขนาดตัวอักษรของหัวข้อวิดีโอ */
    margin-top: 0;
    margin-bottom: 5px;
    color: #ffffff; /* สีของหัวข้อ */
    line-height: 1.2;
}

.video-info p {
    font-family: Arial, sans-serif; /* Font สำหรับวันที่ */
    font-size: 0.9em; /* ขนาดตัวอักษรของวันที่ */
    color: #b0b0b0; /* สีของวันที่ */
    margin: 0;
}

/* ปรับแต่ง news-grid สำหรับ video โดยเฉพาะ (ถ้าจำเป็น) */
#content-video.news-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* ปรับตามขนาดที่ต้องการ */
    gap: 20px; /* ระยะห่างระหว่างวิดีโอ */
}

/* ----- สไตล์สำหรับลิงก์การ์ด (เพิ่มใหม่) ----- */

.news-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    outline: none;
}

/* เอฟเฟกต์เมื่อเมาส์ชี้ (Hover) */
.news-card-link:hover .news-card,
.news-card-link:focus-visible .news-card {
    transform: scale(1.03);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

/* ปรับ .news-card เดิม ให้รองรับ transition */
.news-card {
    border-radius: 3px;
    overflow: hidden; 
    aspect-ratio: 16 / 9; 
    display: flex;
    position: relative; 
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}


/* ----- Footer ----- */
.main-footer {
    padding: 20px 0 40px 0;
}

.main-footer hr {
    border: none;
    height: 1px;
    background-color: #444; 
    margin-bottom: 20px;
}

.main-footer p {
    font-size: 0.8rem;
    color: #a0a0a0; 
}

/*
=================================================
MEDIA QUERIES (สำหรับมือถือ - 2 คอลัมน์ / วิดีโอ 1 คอลัมน์)
=================================================
*/

@media (max-width: 600px) {

    /* 1. Header (ยังคงเหมือนเดิม) */
    .news-header {
        margin-top: 10%;
    }
    .news-nav {
        gap: 15px; 
        margin-top: 30px;
    }
    .news-nav a {
        font-size: 0.9rem; 
    }
    .news-title {
        font-size: 1.3rem; 
    }
    
    /* 2. Grid (ปรับปรุง!) */
    
    /* (ก) ค่าเริ่มต้นสำหรับ grid (2 คอลัมน์) */
    .news-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 คอลัมน์ */
        gap: 15px; 
    }

    /* (ข) ▼▼▼ เพิ่มส่วนนี้ ▼▼▼
       สไตล์เฉพาะสำหรับแท็บวิดีโอ (1 คอลัมน์) */
    #content-video.news-grid {
        grid-template-columns: 1fr; /* บังคับให้เป็น 1 คอลัมน์ */
    }


    /* 3. Card Content (สำหรับแท็บ 2 คอลัมน์) */
    .card-content {
        padding: 15px; 
    }
    .future-text {
        font-size: 1rem; 
    }
    .innovate-text {
        font-size: 1rem; 
        margin-top: -8px;
    }
    .event-details {
        font-size: 0.75rem; 
    }
    .card-link-box {
        display: none;
    }

    /* 4. Footer (คงเดิม) */
    .main-footer p {
        text-align: center; 
    }
}