﻿.gallery-image-container, .gallery-item {
    position: relative;
    overflow: hidden;
}

.gallery-caption-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 12px;
    opacity: 0;
    transition: opacity .25s ease, transform .3s ease;
}

.gallery-item:hover .gallery-caption-overlay,
.gallery-image-container:hover .gallery-caption-overlay {
    opacity: 1;
}

/* Service item improvements - maintain flexible heights */
.service .service-item {
    min-height: 280px; /* Minimum height for consistency */
}

.service .service-item .service-img {
    height: 200px; /* Fixed height for image container */
    overflow: hidden; /* Hide overflow */
}

.service .service-item .service-img img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Maintain aspect ratio while filling container */
}

/* Fix for service title text - allow wrapping but control it */
.child-name-custom {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    white-space: normal; /* Allow text wrapping */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Maximum 2 lines */
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
    padding-right: 10px;
}

/* Ensure text in service title doesn't break layout */
.service .service-item .service-tytle .d-flex {
    flex: 1;
    min-width: 0;
    align-items: center;
}

/* Fix for icon container in service title */
.service .service-item .service-tytle .btn-xl-square {
    width: 60px !important;
    height: 60px !important;
    padding: 6px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin: 10px;
}

.service .service-item .service-tytle .btn-xl-square img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Ensure the service title container has proper spacing */
.service .service-item .service-tytle {
    padding: 5px;
    box-sizing: border-box;
}