* { box-sizing: border-box; scroll-behavior: smooth; }
body { font-family: 'Segoe UI', sans-serif; margin: 0; background: #f8f9fa; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.my-5 { margin: 50px 0; }

/* Header */
.header { background: #1a5276; color: white; padding: 15px 0; position: sticky; top: 0; z-index: 1000; }
.nav a { color: white; text-decoration: none; margin-left: 20px; }

/* Banner Cân Đối & Hiện Đại */
.banner {
    height: 550px; /* Tăng độ cao để cân đối hơn với chiều rộng */
    position: relative;
    overflow: hidden;
    background: #000;
}

.slide-container, .slide {
    height: 100%;
    width: 100%;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Giúp ảnh không bị méo */
    display: block;
}

/* Lớp phủ tối giúp chữ nổi bật */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4); /* Độ tối vừa phải */
    z-index: 1;
}

/* Căn chỉnh văn bản giữa Banner */
.banner-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    text-align: center;
    z-index: 10;
    width: 90%;
    max-width: 800px;
}

.banner-text h1 {
    font-size: 3rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Đường kẻ trang trí cân đối */
.divider {
    width: 80px;
    height: 4px;
    background: #d4ac0d;
    margin: 20px auto;
    border-radius: 2px;
}

.banner-text p {
    font-size: 1.25rem;
    font-weight: 300;
    margin: 0;
    font-style: italic;
    opacity: 0.9;
}

/* Hiệu ứng chữ hiện lên từ từ */
.animate-up {
    animation: fadeInUp 1s ease-out;
}
.animate-up-delayed {
    animation: fadeInUp 1.5s ease-out;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Tương thích điện thoại */
@media (max-width: 768px) {
    .banner { height: 350px; }
    .banner-text h1 { font-size: 1.8rem; }
    .banner-text p { font-size: 1rem; }
}


/* News */
.news-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.news-card { background: white; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
.news-card img { width: 100%; height: 200px; object-fit: cover; }
.section-title { text-align: center; color: #1a5276; margin-bottom: 30px; }

/* 3 Columns Body */
.row { display: flex; flex-wrap: wrap; margin: 0 -15px; }
.column { flex: 33.33%; padding: 0 15px; }
.card { background: white; padding: 20px; border-radius: 15px; height: 100%; box-shadow: 0 5px 15px rgba(0,0,0,0.05); }
.floating-img img { width: 100%; border-radius: 10px; animation: float 3s infinite ease-in-out; }
@keyframes float { 0%, 100% {transform: translateY(0)} 50% {transform: translateY(-15px)} }
/* Khung chứa ảnh dự án */
.project-slider {
    width: 100%;
    height: 250px; /* Chiều cao khung hiển thị */
    overflow: hidden;
    border-radius: 10px;
    position: relative;
    border: 1px solid #eee;
}

/* Thùng chứa các ảnh xếp chồng dọc */
.project-slides {
    display: flex;
    flex-direction: column; /* Xếp ảnh theo cột dọc */
    height: 500%; /* (Số ảnh 5) x 100% */
    animation: projectRunVertical 15s infinite ease-in-out;
}

.p-slide {
    width: 100%;
    height: 250px; /* Phải khớp với chiều cao project-slider */
    object-fit: cover;
    cursor: pointer;
    flex-shrink: 0; /* Đảm bảo ảnh không bị co lại */
}

/* Hiệu ứng trượt dọc (Y) */
@keyframes projectRunVertical {
    0%, 15% { transform: translateY(0); } /* Ảnh 1 */
    20%, 35% { transform: translateY(-20%); } /* Ảnh 2 (100/5 ảnh = 20%) */
    40%, 55% { transform: translateY(-40%); } /* Ảnh 3 */
    60%, 75% { transform: translateY(-60%); } /* Ảnh 4 */
    80%, 95% { transform: translateY(-80%); } /* Ảnh 5 (Lặp lại ảnh 1) */
    100% { transform: translateY(0); }
}
/* Bố cục 3 video song song */
.video-grid-triple {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Chia 3 cột bằng nhau */
    gap: 25px; /* Khoảng cách giữa các video */
}

.video-box {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.video-box:hover {
    transform: translateY(-5px); /* Hiệu ứng nổi lên khi di chuột */
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* Tỷ lệ khung hình 16:9 chuẩn */
    height: 0;
    background: #000;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-info {
    padding: 15px;
}

.video-info h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #1a5276;
}

.video-info p {
    margin: 0;
}

/* Tương thích điện thoại: 3 video sẽ xếp chồng thành 1 cột */
@media (max-width: 992px) {
    .video-grid-triple {
        grid-template-columns: repeat(2, 1fr); /* Màn hình vừa hiện 2 video */
    }
}

@media (max-width: 600px) {
    .video-grid-triple {
        grid-template-columns: 1fr; /* Màn hình nhỏ hiện 1 video */
    }
}


/* Progress */
.progress-bar { background: #eee; height: 15px; border-radius: 10px; overflow: hidden; margin-top: 10px; }
#progress-fill { background: #27ae60; height: 100%; transition: 0.5s; }
input { width: 100%; padding: 8px; margin-top: 10px; border: 1px solid #ddd; }

/* Footer */
.footer { background: #2c3e50; color: white; padding: 40px 0; }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }

 /*Lightbox */
.lightbox { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); }
.lightbox-content { margin: auto; display: block; max-width: 80%; max-height: 80%; margin-top: 5%; border: 4px solid white; }
.img-clickable { cursor: pointer; }
/* CSS cho bản đồ */
.footer-map {
    width: 100%;
    margin-top: 20px;
    background: #eee; /* Màu nền dự phòng khi đang tải map */
    border-radius: 15px;
    overflow: hidden;
}

.footer-map iframe {
    display: block; /* Xóa khoảng trắng thừa dưới iframe */
}



@media (max-width: 768px) { .column, .news-grid, .footer-grid { flex: 100%; grid-template-columns: 1fr; } }

/* Chống tràn trang bên phải */
html, body {
    max-width: 100%;
    overflow-x: hidden; /* Giấu phần bị tràn bên phải */
    margin: 0;
    padding: 0;
}

/* Đảm bảo ảnh và video không bao giờ vượt quá chiều rộng màn hình */
img, iframe, video, .video-wrapper {
    max-width: 100%;
    height: auto;
}

/* Căn chỉnh lại các hàng (Row) để không bị dư lề */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-left: 0;
    margin-right: 0;
    width: 100%;
}

/* Ép các cột phải chiếm hết 100% trên điện thoại */
@media (max-width: 768px) {
    .column, .news-card, .video-box {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        margin-left: 0;
        margin-right: 0;
        margin-bottom: 20px;
    }
}
/* 1. Thiết lập cốt lõi */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background-color: #f0f2f5;
    font-family: 'Segoe UI', Arial, sans-serif;
    overflow-x: hidden; /* Tuyệt đối không cho trang bị trượt ngang */
}

/* 2. CĂN GIỮA TOÀN TRANG (Quan trọng nhất) */
.container {
    max-width: 1200px; /* Độ rộng tối đa của web */
    margin: 0 auto;    /* Đẩy toàn bộ khối vào chính giữa màn hình */
    padding: 20px;
    width: 100%;       /* Đảm bảo chiếm hết chiều rộng nếu màn hình nhỏ */
}

/* 3. DÀN ĐỀU CÁC PHẦN (Grid System) */
.news-grid, .video-grid, .row {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;         /* Khoảng cách giữa các thẻ */
    justify-content: space-between; /* Dàn đều các thẻ ra hai bên, không dồn về trái */
    width: 100%;
}

/* 4. CẤU TRÚC THẺ (CARD) - Tự co giãn */
.news-card, .video-box, .column {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    
    /* Tính toán độ rộng để chia đều */
    flex: 1 1 calc(33.33% - 25px); /* Chia 3 cột, trừ đi khoảng cách gap */
    min-width: 300px; /* Không để thẻ quá nhỏ */
}

/* Riêng phần tin tức nếu bạn chỉ muốn 2 cột */
#tin-tuc .news-card {
    flex: 1 1 calc(50% - 25px);
}

/* 5. XỬ LÝ ẢNH VÀ VIDEO TRÀN KHUNG */
img, video, iframe {
    width: 100% !important;
    height: 220px;
    object-fit: cover; /* Ép ảnh/video lấp đầy khung, không để khoảng trắng nội bộ */
    display: block;
}

.section-title {
    text-align: center;
    width: 100%;
    margin: 40px 0 20px;
    font-size: 2rem;
    color: #1a5276;
}
/* Stats Grid */
.stats-grid {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.stat-item .label { color: #666; display: block; }
.stat-item .value { font-weight: bold; font-size: 1.1rem; color: #1a5276; }

.donation-stats {
    padding: 10px 0;
}

.stat-box {
    text-align: center;
    background: #fdfaf0;
    padding: 15px;
    border-radius: 10px;
    border: 1px dashed #d4ac0d;
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: #c0392b; /* Màu đỏ trang trọng cho con số mục tiêu */
}

.progress-bar-outer {
    background: #eee;
    height: 25px;
    border-radius: 20px;
    overflow: hidden;
    margin-top: 15px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}

#progress-fill-active {
    width: 0%; /* Bắt đầu từ 0 để có hiệu ứng chạy */
    height: 100%;
    background: linear-gradient(90deg, #27ae60, #2ecc71);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
    transition: width 2s cubic-bezier(0.17, 0.67, 0.83, 0.67);
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
/* Khung bao ngoài mã QR */
.qr-wrapper {
    text-align: center;
    padding: 20px;
    background: #ffffff;
    border-radius: 15px;
}

/* Viền bao quanh mã QR tạo điểm nhấn */
.qr-border {
    display: inline-block;
    padding: 10px;
    background: #fff;
    border: 2px solid #f1c40f; /* Màu vàng đồng giáo xứ */
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.qr-border:hover {
    transform: scale(1.05); /* Hiệu ứng phóng to nhẹ khi di chuột */
}

/* Ảnh QR */
.qr-image {
    display: block;
    width: 180px;
    height: 300px;
    cursor: pointer;
}

/* Chú thích dưới QR */
.qr-caption {
    margin-top: 15px;
    font-size: 0.85rem;
    color: #7f8c8d;
    font-weight: 500;
}

/* Chỉnh lại khung ngân hàng cho đồng bộ */
.bank-card {
    background: #fdfaf0;
    padding: 15px;
    border-radius: 10px;
    border-left: 5px solid #d4ac0d;
    font-size: 0.9rem;
    line-height: 1.8;
}
