/* =========================================
       1. MAIN LAYOUT STRUCTURE
       (Cấu trúc chia 2 phần: Sidebar trái & Nội dung phải)
       ========================================= */
.about-container {
    display: flex;
    width: 100%;
    padding: 70px 0px 0px 0px;
    /* Trừ đi chiều cao header để sidebar full màn hình */
    min-height: calc(100vh - var(--header-height));
}

.main-content {
    flex: 1;
    /* Chiếm toàn bộ phần còn lại sau khi trừ sidebar */
    background-color: #fff;
}

/* =========================================
       2. SIDEBAR NAVIGATION (Thanh bên trái)
       ========================================= */
.sidebar {
    width: 250px;
    background-color: var(--primary-color);
    color: #fff;
    padding: 40px 30px;

    /* Sticky: Giữ sidebar đứng yên khi cuộn nội dung bên phải */
    position: sticky;
    top: 70px;
    height: calc(100vh - 70px);

    flex-shrink: 0;
    /* Không bị co lại */
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 15px;
}

.sidebar ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sidebar a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s;
    display: block;
    padding: 5px 0;
}

/* Hiệu ứng Hover & Active (Đang xem mục nào) */
.sidebar a:hover,
.sidebar a.active {
    color: #fff;
    font-weight: 700;
    padding-left: 10px;
    /* Đẩy chữ sang phải */
    border-left: 3px solid var(--accent-color);
}

/* =========================================
       3. SECTION STYLING (Các khối nội dung)
       ========================================= */
.about-section {
    display: flex;
    min-height: auto;
    /* Mỗi section cao ít nhất 80% màn hình */
    align-items: center;
}

/* Grid chia 2 cột: 1 Text - 1 Ảnh */
.section-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    height: 100%;
}

/* --- Text Box (Chứa chữ) --- */
.text-box {
    padding: 60px 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.text-box h2 {
    font-size: 2.8rem;
    margin-bottom: 30px;
    font-weight: 700;
}

.text-box p {
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 20px;
    text-align: justify;
    color: var(--text-grey);
}

/* --- Image Box (Chứa ảnh full chiều cao) --- */
.img-box {
    width: 100%;
    height: 100%;
    /* QUAN TRỌNG: Cao bằng cột text */
    position: relative;
    overflow: hidden;
}

.img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Cắt ảnh lấp đầy khung */
    object-position: center center;
    display: block;
}

/* =========================================
       4. SPECIFIC THEMES (Màu sắc riêng từng phần)
       ========================================= */

/* Section: Our History (Nền Xanh Đậm) */
#history .text-box {
    background-color: var(--primary-color);
    color: #fff;
}

#history .text-box h2 {
    color: var(--accent-color);
}

#history .text-box p {
    color: rgba(255, 255, 255, 0.9);
}

/* Section: Our Purpose (Nền Be Nhạt) */
#purpose .text-box {
    background-color: var(--bg-beige);
}

#purpose .text-box h2 {
    color: var(--primary-color);
}

#purpose .text-box p {
    color: #444;
}

/* =========================================
       5. RESPONSIVE MOBILE (< 900px)
       ========================================= */
@media (max-width: 900px) {

    /* --- Layout Tổng: Chuyển sang dọc --- */
    .about-container {
        flex-direction: column;
    }

    /* --- Sidebar: Biến thành Sub-nav ngang dính trên đầu --- */
    .sidebar {
        width: 100%;
        height: auto;
        padding: 10px 5px;
        top: 70px;
        /* Khớp với chiều cao header mobile */
        z-index: 99;
        background-color: var(--primary-color);
        display: none;
    }

    .sidebar-title {
        display: none;
    }

    /* Ẩn tiêu đề */

    .sidebar ul {
        flex-direction: row;
        /* Xếp hàng ngang */
        width: 100%;
        gap: 4px;
        padding: 0;
        justify-content: space-around;
    }

    .sidebar ul li {
        flex: 1;
        /* Chia đều 4 phần */
        display: flex;
    }

    .sidebar a {
        width: 100%;
        font-size: 10px;
        /* Chữ nhỏ để vừa 1 dòng */
        padding: 8px 2px !important;
        text-align: center;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 4px;
        border-left: none !important;
        /* Bỏ viền trái của desktop */
        white-space: normal;
        line-height: 1.2;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 40px;
    }

    .sidebar a.active {
        background: var(--accent-color);
        color: var(--primary-color) !important;
        font-weight: 700;
    }

    /* --- Main Content --- */
    .main-content {
        padding-top: 0px;
    }

    .about-section {
        min-height: auto;
        padding-bottom: 0;
    }

    /* --- Section Grid: Xếp chồng dọc 1 cột --- */
    .section-grid {
        display: flex;
        flex-direction: column;
    }

    /* Đảo vị trí: Ảnh luôn lên đầu */
    .img-box {
        order: -1;
        width: 100%;
        height: 250px;
        /* Chiều cao cố định trên mobile */
    }

    .img-box img {
        object-position: top;
        /* Ưu tiên lấy phần trên của ảnh */
    }

    /* Text Box Padding */
    .text-box {
        padding: 40px 20px;
    }

    .text-box h2 {
        font-size: 1.8rem;
        margin-bottom: 15px;
    }

    .text-box p {
        font-size: 0.95rem;
    }
}