.nurse-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

@media (max-width: 1024px) {
    .nurse-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .nurse-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.nurse-item {
    aspect-ratio: 4 / 3; /* Ensures 4:3 ratio */
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center; /* Centers content vertically */
    justify-content: center; /* Centers content horizontally */
    text-decoration: none;
    overflow: hidden;
    transition: all 0.3s ease;
}

.nurse-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0); /* Transparent by default */
    transition: background-color 0.3s ease;
    z-index: 1;
}

.nurse-item:hover::before {
    background-color: rgba(0, 0, 0, 0.5); /* Darken background on hover */
}

.nurse-title {
    position: relative; /* Stay within the flex container */
    z-index: 2; /* Ensure it appears above the ::before overlay */
    color: #fff;
    font-size: 18px;
    font-family: Oswald, sans-serif !important;
    font-weight: bold;
    text-align: center;
    opacity: 0; /* Hidden by default */
    transition: opacity 0.3s ease;
}

.nurse-item:hover .nurse-title {
    opacity: 1; /* Fade in the title on hover */
}
