/* =========================================
   HOME PAGE: FINAL VERSION (COMPLETE)
   ========================================= */

/* --- 0. RESET & GLOBAL --- */
.container { max-width: 1300px; margin: 0 auto; padding: 0 20px; }
a { text-decoration: none; color: inherit; transition: 0.3s; }

/* --- 1. BANNER & LAYOUT --- */
.banner-container { width: 100%; margin: 0 auto; background: #f0f0f0; }
.banner-img { width: 100%; height: auto; display: block; }
.section-container { padding: 80px 0; }

/* --- 2. TOP SECTION: Services & Video --- */
.top-services-vdo-bg { background-color: #f9fbfd !important; border-bottom: 1px solid #f0f0f0; }
.top-grid-layout { display: grid; grid-template-columns: 0.55fr 0.45fr; gap: 40px; }

.section-header-small {
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 2px solid #eee; padding-bottom: 10px; margin-bottom: 20px;
}

/* **จุดที่อัปเดต: ปรับขนาดเป็น 1.8rem และตัวหนา 700 เพื่อให้เท่ากับ News/Events** */
.section-header-small h3 {
    margin: 0; color: #1a3a5a;
    font-size: 1.8rem;
    font-weight: 700;
}

/* Services Grid & Cards */
.services-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.service-card {
    display: flex; flex-direction: column; justify-content: space-between;
    padding: 20px; border-radius: 12px; color: #fff; position: relative;
    overflow: hidden; min-height: 120px; box-shadow: 0 4px 10px rgba(0,0,0,0.08); transition: transform 0.3s;
}
.service-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.15); }
.service-content h4 { margin: 0 0 5px 0; font-size: 1.1rem; font-weight: 700; line-height: 1.2; }
.service-content span { font-size: 0.85rem; opacity: 0.9; }
.service-icon { position: absolute; bottom: 10px; right: 10px; font-size: 3rem; opacity: 0.15; }

/* --- Service Card Gradients --- */
.theme-navy { background: linear-gradient(135deg, #1a3a5a, #2c5282) !important; }
.theme-blue { background: linear-gradient(135deg, #214d72, #3b719f) !important; }
.theme-slate { background: linear-gradient(135deg, #2d4356, #4b6584) !important; }
.theme-green { background: linear-gradient(135deg, #134e4a, #2c7a7b) !important; }
.theme-teal { background: linear-gradient(135deg, #0d9488, #14b8a6) !important; }
.theme-mint { background: linear-gradient(135deg, #3d7a6c, #48c9b0) !important; }
.theme-cyan { background: linear-gradient(135deg, #075985, #0891b2) !important; }
.theme-marine { background: linear-gradient(135deg, #1a3a5a, #214d72, #2c7a7b) !important; }

/* --- Video Gallery --- */
.video-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.vdo-featured { grid-column: span 2; }
.video-item { margin-bottom: 10px; }
.video-wrapper { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: 8px; background: #000; }
.video-wrapper video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; object-fit: cover; }
.video-item h6 { margin: 8px 0 0 0; font-size: 0.95rem; color: #333; font-weight: 600; }

/* --- 3. NEWS SECTION --- */
.news-bg { background-color: #fff; }

/* --- 4. EVENTS SECTION --- */
.events-bg { background-color: #f9fbfd; }

/* --- 5. BOOKS SECTION --- */
.books-bg { background-color: #fff; }

/* Common Styles for News & Events */
.section-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 30px; 
    max-width: 1200px; 
    margin-left: auto; 
    margin-right: auto; 
}

/* หัวข้อส่วน News, Events และ Collaborators ใช้ขนาดนี้อยู่แล้ว */
.section-header h3 { font-size: 1.8rem; color: #1a3a5a; margin: 0; font-weight: 700; }
.section-header.center { justify-content: center; }

.btn-pill { background: #e0e0e0; color: #555; padding: 8px 25px; border-radius: 50px; font-weight: 600; font-size: 0.9rem; }
.btn-pill:hover { background: #1a3a5a; color: #fff; }
.btn-link { color: #1a3a5a; font-weight: 600; }

.card-grid { 
    display: grid; 
    grid-template-columns: repeat(4, 1fr); 
    gap: 25px; 
    max-width: 1200px; 
    margin: 0 auto; 
}
.common-card { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 10px rgba(0,0,0,0.05); transition: 0.3s; border: 1px solid #f0f0f0; display: flex; flex-direction: column; }
.common-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.1); }
.card-thumb { position: relative; height: 160px; overflow: hidden; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: 0.5s; }
.common-card:hover .card-thumb img { transform: scale(1.05); }
.date-badge { position: absolute; top: 10px; right: 10px; left: auto; background: #fff; padding: 5px 15px; border-radius: 50px; font-weight: bold; color: #1a3a5a; font-size: 0.85rem; box-shadow: 0 2px 8px rgba(0,0,0,0.15); z-index: 5; }
.card-info { padding: 15px; flex-grow: 1; display: flex; flex-direction: column; }
.card-info h5 { font-size: 0.95rem; margin: 0 0 10px 0; line-height: 1.4; height: 40px; overflow: hidden; color: #1a3a5a; font-weight: 700; }
.card-info .meta { font-size: 0.8rem; color: #777; margin-top: auto; display: flex; align-items: center; }
.card-info .meta i { margin-right: 6px; color: #2c7a7b; }

/* --- 5. COLLABORATORS --- */
.collaborators-bg { background-color: #fff; border-top: 1px solid #eee; }
.collaborators-wrapper { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 40px; margin-top: 20px; }
.partner-logo { display: flex !important; align-items: center !important; justify-content: center !important; width: 140px; height: 80px; opacity: 1 !important; filter: none !important; transition: transform 0.3s ease; }
.partner-logo:hover { transform: scale(1.05); }
.partner-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* --- 6. MOBILE RESPONSIVE --- */

/* Tablet & Smaller Desktop (below 1200px) */
@media (max-width: 1200px) {
    .container { max-width: 95%; }
    .card-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; }
}

/* Tablet (below 992px) */
@media (max-width: 992px) {
    .top-grid-layout { grid-template-columns: 1fr; gap: 30px; }
    .card-grid { grid-template-columns: repeat(2, 1fr); }
    .services-grid { grid-template-columns: repeat(2, 1fr); }
    .video-grid { grid-template-columns: repeat(2, 1fr); }
    .vdo-featured { grid-column: span 2; }
}

/* Mobile (below 768px) */
@media (max-width: 768px) {
    .section-container { padding: 40px 0; }
    .section-header h3 { font-size: 1.5rem; }
    .card-grid { grid-template-columns: 1fr; max-width: 400px; margin: 0 auto; }
    .services-grid { grid-template-columns: 1fr; }
    .video-grid { grid-template-columns: 1fr; }
    .vdo-featured { grid-column: span 1; }
    
    .section-header { flex-direction: column; align-items: flex-start; gap: 15px; }
    .btn-pill { width: 100%; text-align: center; }
    
    .partner-logo { width: 80px; height: 50px; }
    .collaborators-wrapper { gap: 20px; }
}

/* Extra Small Mobile (below 480px) */
@media (max-width: 480px) {
    .section-header h3 { font-size: 1.3rem; }
    .service-card { padding: 15px; min-height: 100px; }
    .card-thumb { height: 160px; }
}
/* --- Video Interaction Design --- */
.video-wrapper {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 12px;
    background: #000;
}

/* ปุ่ม Play ตรงกลาง */
.play-btn-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(26, 58, 90, 0.9); /* สีน้ำเงิน ม.อ. */
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    z-index: 2;
    border: 2px solid rgba(255,255,255,0.3);
}

/* เอฟเฟกต์เมื่อ Hover */
.js-video-container:hover .play-btn-overlay {
    background: #016301; /* เปลี่ยนเป็นสีเขียวหลัก */
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 0 20px rgba(1, 99, 1, 0.4);
}

/* ซ่อนแถบควบคุมเดิมของ Browser จนกว่าจะเล่น */
video::-webkit-media-controls-panel {
    display: none !important;
}
video[controls]::-webkit-media-controls-panel {
    display: flex !important;
}

/* ปรับหัวข้อให้มีขนาด 1.8rem ตามที่ตั้งไว้เดิม */
.section-header-small h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a3a5a;
}