/* 1. The main section holds the background color and structure */
.modern-service-section {
    background-color: #badbe9; 
    padding: 100px 0;
    position: relative;
    overflow: hidden;
    z-index: 1; /* Ensures content stays on top */
}

/* 2. The pseudo-element holds the image and the opacity */
.modern-service-section::before {
    content: "";
    position: absolute;
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0;
    
    background-image: url('https://www.brightspeech.ca/public/assets/images/backgrounds/bg-service.webp');
    background-position: center top;
    background-size: cover;
    background-repeat: no-repeat;
    
    /* SET YOUR OPACITY HERE (0.0 is fully transparent, 1.0 is fully solid) */
    opacity: 0.3; 
    
    z-index: -1; /* Puts the image behind your content but in front of the background color */
}
/* --- Card Styling --- */
.modern-service-card {
    height: 100%;
    transition: transform 0.3s ease;
}

.modern-service-card a {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
}

.modern-service-card:hover {
    transform: translateY(-8px);
}

/* --- Image Box --- */
.service-image-box {
    width: 100%;
    height: 462px; 
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.service-image-box figure {
    margin: 0;
    width: 100%;
    height: 100%;
}

.service-image-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.modern-service-card:hover .service-image-box img {
    transform: scale(1.05);
}

/* --- Overlapping Content Box --- */
.service-content-box {
    background: #ffffff;
    border-radius: 12px;
    padding: 40px 30px;
    margin: -95px 20px 0 20px;
    position: relative;
    z-index: 2;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08); /* Slightly darkened shadow to pop against the background image */
    display: flex;
    flex-direction: column;
    flex-grow: 1; 
}

/* --- Header Row (Icon + Title) --- */
.service-header-row {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.service-icon {
    width: 45px;
    height: 45px;
    flex-shrink: 0;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.service-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-3);
    margin: 0;
    line-height: 1.3;
}

/* --- Description --- */
.service-desc {
    flex-grow: 1;
    margin-bottom: 20px;
}

.service-desc p {
    font-size: 16px;
    color: #4e4e4e;
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Read More Button --- */
.service-read-more {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-6);
    display: flex;
    align-items: center;
    transition: color 0.3s ease;
}

.service-read-more svg {
    margin-left: 5px;
    transition: transform 0.3s ease;
}

.modern-service-card:hover .service-read-more svg {
    transform: translateX(5px);
}

/* --- Responsive Adjustments --- */
@media (max-width: 991px) {
    .service-content-box {
        margin: -50px 15px 0 15px;
        padding: 20px;
    }
    .service-image-box {
        height: 240px;
    }
}

@media (max-width: 767px) {
    .modern-service-section {
        padding: 50px 0;
    }
}