/* About Company Section */
.about-company {
    padding: 60px 20px;
    background-color: #f9f9f9;
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-header h2 {
    font-size: 32px;
    color: #000000;
    margin-bottom: 15px;
}

.company-cards-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.company-card {
    display: flex;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    height: 100%; /* Ensure consistent height */
}

.company-card:hover {
    transform: translateY(-5px);
}

.card-image {
    flex: 0 0 40%;
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3; /* 现代浏览器支持 */
}
/* 兼容旧浏览器的备选方案 */
@supports not (aspect-ratio: 4/3) {
    .card-image::before {
        content: '';
        display: block;
        padding-top: 75%; /* 4:3 比例 => 3/4 = 0.75 */
        width: 100%;
    }
}


.card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.card-icon {
    margin-bottom: 15px;
}

.card-icon i {
    font-size: 24px;
    color: #1a73e8;
}

.card-text h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #222;
    /* Title ellipsis after 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.8em; /* Adjust based on your line-height */
    line-height: 1.4;
}

.card-text p {
    color: #666;
    line-height: 1.6;
    /* Paragraph ellipsis after 4 lines */
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 6.4em; /* Adjust based on your line-height */
    margin-bottom: 0;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .company-cards-container {
        grid-template-columns: 1fr;
    }

    .company-card {
        flex-direction: row;
    }

    .card-image {
        flex: 0 0 40%;
    }
    /* 仅针对 .card-image 里的最后一张 img */
    .card-image img:last-child {
        width: auto;           /* 宽随比例 */
        height: 100%;          /* 高撑满容器 */
        position: absolute;
        left: 50%;             /* 先放到中间 */
        transform: translateX(-50%);
        text-align: center;    /* 对 img 本身无意义，可删 */
    }
}

@media (max-width: 768px) {
    .company-card {
        flex-direction: column;
    }

    .card-image {
        flex: 0 0 auto;
        height: auto; /* 取消固定高度 */
        aspect-ratio: 4 / 3;
    }


    /* 兼容旧浏览器 */
    @supports not (aspect-ratio: 4/3) {
        .card-image::before {
            padding-top: 75%;
        }
    }
    
    .card-text h3 {
        min-height: auto;
    }
    
    .card-text p {
        min-height: auto;
    }
}