/* Research Section with Solid Design */
.research {
    background-color: white;
    position: relative;
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h20v20H0V0zm10 10h10v10H10V10zm-5 5h5v5H5v-5z' fill='%234D6DE3' fill-opacity='0.03'/%3E%3C/svg%3E");
}

.research-grid {
    display: grid;
    /* auto-fit collassa le colonne vuote, auto-fill no */
    grid-template-columns: repeat(auto-fit, minmax(280px, auto));
    gap: 2.5rem;
    max-width: 1200px;
    margin: 0 auto;
    justify-content: center;  /* centra l’insieme delle colonne */
}


.research-item {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(77, 109, 227, 0.08);
    transition: var(--transition);
    flex-direction: column;
    height: 97%;
    border: 3px solid var(--border-color);
    padding: 2rem 1.8rem;
    position: relative;
    z-index: 1;
}

/* Add a distinctive side border for personality */
.research-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 8px;
    height: 100%;
    background: var(--primary-gradient);
    transition: var(--transition);
}

.research-item:hover {
    transform: translateY(-10px);
    border-color: rgba(77, 109, 227, 0.2);
    box-shadow: 0 20px 40px rgba(107, 77, 227, 0.15);
}

.research-item:hover::before {
    width: 12px;
}

/* Create a decorative corner element */
.research-item::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 30px;
    height: 30px;
    background: var(--accent-color);
    clip-path: polygon(100% 0, 0 0, 100% 100%);
    opacity: 0.7;
    transition: var(--transition);
}

.research-item:hover::after {
    width: 40px;
    height: 40px;
    background: var(--secondary-color);
}

.research-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    text-align: center;
    width: 85px;
    height: 85px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: var(--primary-color);
    transition: var(--transition);
    position: relative;
    z-index: 1;
}

/* Create a solid background with outline for the icon */
.research-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(77, 109, 227, 0.1);
    border-radius: 16px;
    z-index: -1;
    transition: var(--transition);
}

.research-icon::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border: 2px dashed rgba(77, 109, 227, 0.3);
    border-radius: 20px;
    z-index: -2;
    transition: var(--transition);
}

.research-item:hover .research-icon {
    color: var(--secondary-color);
    transform: scale(1.1) rotate(5deg);
}

.research-item:hover .research-icon::before {
    background: rgba(107, 77, 227, 0.15);
    transform: rotate(-5deg);
}

.research-item:hover .research-icon::after {
    border-color: var(--secondary-color);
    transform: rotate(-8deg);
}

.research-content {
    flex: 1;
}

.research-content h3 {
    color: var(--primary-color);
    font-size: 1.0rem;
    margin-bottom: 1rem;
    position: relative;
    text-align: center;
    padding-bottom: 0.8rem;
}

.research-content h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: var(--secondary-gradient);
    border-radius: 2px;
}

.research-content p {
    margin-bottom: 0;
    color: var(--light-text);
    line-height: 1.3;
    font-size: 1rem;
    text-align: center;
}


.research-item:only-child {
    justify-self: center;   /* centra l’item nella sua cella */
    max-width: 320px;       /* oppure il width che preferisci */
    width: 100%;
}



