@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&family=Roboto:wght@400;500;700;900&display=swap');
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}
.title {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
    align-items: center;
    margin: 0 auto;
	font-family: "Open-sans", sans-serif;
}
.title h2 {
	padding: 15px;
	font-size: 1.4em;
	font-weight: 500;
	color: #121212;
}
.title p {
	margin-top: 5px;
    font-size: 15px;
    font-weight: 400;
}
.grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    padding: 20px;
    font-family: "Open-sans", sans-serif;
}
.grid-item {
    position: relative;
    width: 310px;
    height: ;
    background: linear-gradient(#ffdd59 38%, transparent);
    border: 8px solid #181818;
    box-shadow: 0 0 15px #012a4a;
    cursor: pointer;
    overflow: hidden;
    perspective: 1000px; /* Aggiungere prospettiva per effetto di zoom */
}

.grid-item img {
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(transparent, #2c2c2c 58%);
    opacity: 0;
    transition: opacity 0.5s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.grid-item:hover img {
    transform: scale(1.1); /* Zoom out sull'immagine */
}

.grid-item:hover .overlay {
    opacity: 1;
}

.overlay-title {
    color: #fff;
    font-size: 24px;
    transform: translateY(-30px);
    transition: transform 0.5s, opacity 0.5s;
}

.overlay-text {
    color: white;
    opacity: 0;
    padding: 10px;
    margin-bottom: 120px;
    transform: translateY(30px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.line {
    width: 50%;
    height: 2px;
    background-color: white;
    position: relative;
    margin: 10px 0;
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.grid-item:hover .overlay-title {
    transform: translateY(0); /* Traslazione del titolo */
}

.grid-item:hover .overlay-text {
    opacity: 1; /* Paragrafo che appare */
    transform: translateY(0); /* Traslazione del paragrafo */
}

.grid-item:hover .line {
    transform: translateX(0); /* Traslazione della linea */
}

/***********************
   Draw Animation 
***********************/
.grid a {
	position: relative;
	display: inline-block;
	font-size: 1.2em;
	font-weight: 400;
	font-family: "Open-sans",sans-serif;
	padding: 10px 30px;
	text-decoration: none;
	color: rgba(255, 255, 255, 0.4);
	background: #373837; 
	border-radius: 4px;
	transition: 0.5s;
	transform: scale(1);
	
}
.grid a:hover {
	color: #fff;
	background: #101010; /*#14213d*/
	box-shadow: 0 0 30px #ccff33;
	transform:scale(1.1);
}
.grid a span {
	position: absolute;
	display: block;
	border-radius: 4px;
	background: #ffff00; /*#1e9bff #b0af2c*/
}
/*** top ***/
.grid a span:nth-child(1) {
	left: 0;
	top: 0;
	width: 100%;
	height: 2px;
	transform-origin: left;
	transform: scaleX(0);
	transition: transform: 0.2s;
	transition-delay: 0.45s;
}
.grid a:hover span:nth-child(1) {
    transform: scale(1);
    transition: transform: 0.2s;
    /*transition-delay: 0.3s;*/
}
/*** right ***/
.grid a span:nth-child(2) {
	right: 0;
	top: 0;
	width: 2px;
	height: 100%;
	transform-origin: top;
	transform: scaleY(0);
	transition: transform: 0.2s;
	transition-delay: 0.3s;
}
.grid a:hover span:nth-child(2) {
    transform: scaleY(1);
    transition: transform 0.2s;
    transition-delay: 0.1s;
}
/*** bottom ***/
.grid a span:nth-child(3) {
	right: 0;
	bottom: 0;
	width: 100%;
	height: 2px;
	transform-origin: right;
	transform: scaleX(0);
	transition: transform 0.2s;
	transition-delay: 0.15s
}
.grid a:hover span:nth-child(3) {
    transform: scaleX(1);
    transition: transform: 0.2s;
    transition-delay: 0.2s;  
 }
 /*** sx ***/
.grid a span:nth-child(4) {
	left: 0;
	bottom: 0;
	width: 2px;
	height: 100%;
	transform-origin: bottom;
	transform: scaleY(0);
	transition: transform 0.2s;
	/*transition-delay: 0.3s*/
}
.grid a:hover span:nth-child(4){
	 transform: scaleY(1);
	 transition: transform: 0.2s;
	 transition-delay: 0.3s;	
}


/*************************
       Responsive
**************************/

@media(max-width:600px) {
 
     .grid-item {
        width: 95%;
     }
     .overlay-text {
        width: 90%;
     }
     .title {
     	margin: 0 auto;
     }
     .title h2, p {
         margin-left: 10%;
     }
}
