/* === RESET & CƠ BẢN === */
* { box-sizing: border-box; margin: 0; padding: 0; font-family: Arial, sans-serif; }
body { background-color: #f4f4f4; color: #333; line-height: 1.6; }
a { text-decoration: none; color: inherit; cursor: pointer; }
ul { list-style: none; }

/* === BANNER CHÍNH === */
.site-banner img { width: 100%; max-height: 250px; object-fit: cover; display: block; }
.site-banner {
    max-width: 1280px;
    margin: 0 auto;
    background: white;
    text-align: center;
    /* QUAN TRỌNG: Làm gốc để hình con bám vào */
    position: relative; 
    overflow: hidden;
}

.banner-base {
    width: 100%;
    max-height: 250px;
    object-fit: cover;
    display: block;
}

.overlay-img {
    /* QUAN TRỌNG: Để có thể di chuyển tự do */
    position: absolute; 
    
    /* Vị trí theo yêu cầu của bạn */
    top: 54%; 
    left: 8.7%; 
    
    /* Tùy chỉnh thêm để hình ảnh không bị to quá */
    width: 8% !important; 
    height: auto;
    
    /* Nếu muốn tâm hình ảnh nằm đúng điểm 50%-20%, hãy thêm dòng này: */
    transform: translate(-50%, -50%);
}

/* === MENU (NAVBAR) === */
header { background-color: #0056b3; color: white; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 5px rgba(0,0,0,0.2);}
nav { display: flex; max-width: 1280px; margin: 0 auto; padding: 0 15px; flex-wrap: wrap;}
nav a { padding: 15px 20px; display: block; font-weight: bold; transition: background 0.3s; }
nav a:hover, nav a.active { background-color: #003d82; }

/* === BỐ CỤC CHÍNH (2 CỘT) === */
.container { display: flex; max-width: 1280px; margin: 5px auto; gap: 5px; padding: 0 5px; min-height: 500px;}
.main-content { flex: 3; background: white; padding: 25px; border-radius: 5px; box-shadow: 0 0 10px rgba(0,0,0,0.1); }
.sidebar-right { flex: 1; display: flex; flex-direction: column; gap: 20px; }

.widget { background: white; padding: 15px; border-radius: 5px; box-shadow: 0 0 10px rgba(0,0,0,0.1); }
.widget h3 { border-bottom: 2px solid #0056b3; padding-bottom: 10px; margin-bottom: 15px; color: #0056b3; font-size: 16px;}
.widget ul li { padding: 8px 0; border-bottom: 1px dashed #ccc; font-size: 14px;}
.widget ul li:last-child { border-bottom: none; }
.widget ul li:hover { color: #0056b3; }

/* === TRANG CHỦ & SLIDER === */
.slider-container { position: relative; width: 100%; height: 350px; overflow: hidden; border-radius: 5px; margin-bottom: 30px;}
.slide { position: absolute; width: 100%; height: 100%; opacity: 0; transition: opacity 0.8s ease-in-out; opacity: 0; /* Làm mờ ảnh */
    z-index: 1; /* Nằm ở lớp dưới */
    visibility: hidden;}
.slide.active { opacity: 1; /* Hiện rõ ảnh */
    z-index: 10; /* Kéo lên lớp trên cùng */
    visibility: visible;}
.slide img { width: 100%; height: 100%; object-fit: cover; }
.slide-title { position: absolute; bottom: 0; width: 100%; background: rgba(0, 86, 179, 0.8); color: white; padding: 10px; text-align: center; font-weight: bold; }

.section-title { border-left: 5px solid #0056b3; padding-left: 10px; color: #0056b3; margin-bottom: 20px; border-bottom: 1px solid #eee; padding-bottom: 5px; text-transform: uppercase;}

.grid-posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 15px; margin-bottom: 30px; }
.post-card { border: 1px solid #eee; padding: 10px; border-radius: 5px; text-align: center; transition: transform 0.2s;}
.post-card:hover { transform: translateY(-5px); box-shadow: 0 5px 15px rgba(0,0,0,0.1); border-color: #0056b3;}
.post-card img { width: 100%; height: 130px; object-fit: cover; border-radius: 3px; margin-bottom: 10px; }
.post-card h4 { font-size: 14px; color: #333; }

/* === CẤU TRÚC BÀI VIẾT & TRANG TĨNH === */
.page-content h1, .post-content h1 { color: #0056b3; margin-bottom: 15px; font-size: 22px;}
.page-content p, .post-content p { margin-bottom: 15px; text-align: justify; }
.page-content img, .post-content img { max-width: 100%; border-radius: 5px; margin-bottom: 15px; }

/* === FOOTER === */
footer { background-color: #003d82; color: white; padding: 30px 15px; margin-top: 40px; }
.footer-content { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px;}
.footer-info h3 { margin-bottom: 15px; text-transform: uppercase; border-bottom: 2px solid #fff; display: inline-block; padding-bottom: 5px;}
.footer-info p { margin-bottom: 8px; font-size: 14px;}
.footer-bottom { text-align: center; padding-top: 20px; margin-top: 20px; border-top: 1px solid rgba(255,255,255,0.2); font-size: 13px;}

/* === TRANG VIDEO CLIP === */
.video-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); 
    gap: 25px; 
    margin-top: 20px;
}
.video-item { 
    background: #fff; 
    border: 1px solid #eee; 
    border-radius: 8px; 
    overflow: hidden; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}
.video-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}
/* Khung giữ tỷ lệ 16:9 chuẩn cho video YouTube */
.video-wrapper { 
    position: relative; 
    padding-bottom: 56.25%; /* Tỷ lệ 16:9 */
    height: 0; 
    overflow: hidden; 
}
.video-wrapper iframe { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    border: none;
}
.video-info { 
    padding: 15px; 
}
.video-info h3 { 
    color: #0056b3; 
    font-size: 16px; 
    margin-bottom: 8px; 
    line-height: 1.4;
}
.video-info p { 
    font-size: 14px; 
    color: #555; 
    margin-bottom: 0;
}

/* ========================================================= */
/* === RESPONSIVE DESIGN: TỐI ƯU CHO ĐIỆN THOẠI & TABLET === */
/* ========================================================= */

/* Áp dụng khi màn hình nhỏ hơn 768px (Điện thoại và Máy tính bảng nhỏ) */
@media screen and (max-width: 768px) {
    .main-content {padding: 5px;}
    .post-card img {height: 200px;}
    
    /* 1. Xếp dọc 2 cột chính (Nội dung lên trên, Sidebar xuống dưới) */
    .container {
        flex-direction: column;
    }
    
    /* 2. Menu tự động dàn thành nhiều dòng, nút nhỏ lại một chút */
    nav a {
        padding: 10px;
        flex: 1 1 30%; /* Mỗi nút chiếm khoảng 1/3 màn hình */
        font-size: 12px;
    }


    /* 4. Danh sách bài viết (Gương mặt tiêu biểu) xếp thành 2 cột thay vì 3-4 cột */
    .grid-posts {
        grid-template-columns: repeat(2, 1fr);
    }

    /* 5. Chữ tiêu đề nhỏ lại một chút */
    .post-content h1 {
        font-size: 18px;
    }
    .section-title {
        font-size: 16px;
    }

    /* 6. Form liên hệ xếp dọc lại (nếu có) */
    .contact-form-container {
        flex-direction: column !important;
    }
}

/* Áp dụng khi màn hình cực nhỏ (iPhone SE, điện thoại đời cũ) dưới 480px */
@media screen and (max-width: 480px) {
    
    /* Gương mặt tiêu biểu xếp thành 1 cột duy nhất */
    .grid-posts {
        grid-template-columns: 1fr;
    }

    /* Menu xếp thành 2 cột */
    nav a {
        flex: 1 1 45%; 
    }
    

}