/*
 * Electronic Service Italia - CSS del template tpl-certificazioni.php.
 * Valori da Elementor post-9329 (flip box con effetto dissolvenza).
 */

.es-cert {
	padding: 0 30px 100px;
}

.es-cert__title {
	max-width: 780px;
	margin: 160px auto 40px;
	font-size: 48px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: -1px;
	text-align: center;
}

.es-cert + .es-cert .es-cert__title {
	margin-top: 90px;
}

.es-cert__grid {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	max-width: 1180px;
	margin: 0 auto;
}

/* Primo gruppo: l'ultima riga e' centrata come nell'originale */
.es-cert:first-of-type .es-cert__grid {
	justify-content: center;
}

.es-cert + .es-cert .es-cert__grid {
	max-width: 1260px;
}

.es-cert__card {
	position: relative;
	width: calc((100% - 40px) / 3);
	height: 280px;
	transition: box-shadow 0.3s;
}

.es-cert__card:hover,
.es-cert__card:focus-within {
	box-shadow: 0 10px 20px rgba(0, 0, 0, 0.61);
}

.es-cert__face {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	padding: 35px;
	text-align: center;
	transition: opacity 0.6s;
}

.es-cert__face--front {
	background-color: var(--es-blue);
}

.es-cert__face--back {
	background-color: var(--es-steel);
	opacity: 0;
}

.es-cert__card:hover .es-cert__face--back,
.es-cert__card:focus-within .es-cert__face--back,
.es-cert__card:focus .es-cert__face--back {
	opacity: 1;
}

.es-cert__img {
	display: block;
	width: auto;
	max-width: 217px;
	max-height: 83px;
	margin-bottom: 15px;
}

.es-cert__img--tall {
	max-height: 128px;
}

.es-cert__name {
	margin: 0;
	color: var(--es-white);
	font-family: var(--es-font-head);
	font-size: 18px;
	font-weight: 600;
	line-height: 1.2;
}

.es-cert__btn {
	display: inline-block;
	margin-top: 20px;
	padding: 14px 24px;
	border-radius: 5px;
	background-color: var(--es-accent);
	color: var(--es-white);
	font-family: var(--es-font-head);
	font-size: 14px;
	font-weight: 700;
	line-height: 1.2;
	transition: 0.3s;
}

.es-cert__btn:hover,
.es-cert__btn:focus-visible {
	/* Originale (misurato dal vivo): nessun cambio al passaggio */
	background-color: var(--es-accent);
	color: var(--es-white);
}

.es-page--cert .es-cert:has(+ .es-cta) {
	padding-bottom: 221px;
}

@media (max-width: 1024px) {
	.es-cert__card {
		width: calc((100% - 20px) / 2);
	}
}

@media (max-width: 767px) {
	.es-cert {
		padding: 0 20px 100px;
	}

	.es-cert__title {
		margin: 150px auto 30px;
	}

	.es-cert + .es-cert .es-cert__title {
		margin-top: 80px;
	}

	.es-cert__card {
		width: 100%;
	}

	.es-page--cert .es-cert:has(+ .es-cta) {
		padding-bottom: 100px;
	}
}

/* Card visibili su un solo dispositivo (come hide_desktop / hide_tablet+mobile di Elementor) */
@media (min-width: 1025px) { .es-cert__card--solo-mobile { display: none; } }
@media (max-width: 1024px) { .es-cert__card--solo-desktop { display: none; } }

