html { scroll-behavior: smooth; }
body { margin: 0; font-family: Arial, sans-serif; background-color: #f4f4f4; }

/* Navigation */
nav { background-color: #333; color: white; padding: 0.5em 1em; position: relative; }
nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	justify-content: center; /* ✅ Centre le menu horizontalement */
}
nav ul li a { color: white; text-decoration: none; padding: 0.8em 1em; display: block; }
nav ul li a:hover { background-color: #575757; }

/* Menu hamburger */
.menu-toggle { display: none; flex-direction: column; cursor: pointer; }
.menu-toggle span { background: white; height: 3px; width: 25px; margin: 4px 0; }

/* Header */
header {
	text-align: center;
	padding: 3em 1em;
	background: linear-gradient(to right, #ffffff, #1E90FF);
	color: white;
}
header h1 { margin: 0; font-size: 2.5em; }
header p { font-size: 1.2em; margin: 0.5em 0 0; line-height: 1.4em; }

/* Main */
main { padding: 2em; max-width: 1100px; margin: auto; background: white; box-shadow: 0 0 10px rgba(0,0,0,0.1); }
main h2 { font-size: 1.4em; line-height: 1.5em; }

/* Styles des cartes */
.cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 1em;
	margin-top: 2em;
}

.card {
	position: relative;
	border-radius: 5px;
	overflow: hidden;
	text-align: center;
	box-shadow: 0 2px 5px rgba(0,0,0,0.1);
	min-height: 200px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: white;
	font-weight: bold;
	font-size: 1.2em;
	text-shadow: 2px 2px 5px rgba(0,0,0,0.7);
	transition: transform 0.6s ease-in-out, 
		filter 0.6s ease-in-out, 
		box-shadow 0.6s ease-in-out;
	will-change: transform, filter, box-shadow; /* Optimisation GPU */
}

/* Calque image de base */
.card-bg {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-size: cover;
	background-position: center;
	opacity: 1; /* Toujours visible */
	z-index: 0; /* Derrière le texte */
	transition: transform 0.6s ease-in-out;
}
/* Calque image de survol */
.card-bg-hover {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-size: cover;
	background-position: center;
	opacity: 0; /* Cachée au départ */
	z-index: 1; /* Derrière le texte */
	transition: opacity 0.6s ease-in-out, transform 0.6s ease-in-out;
}

/* Texte au-dessus */
.card-text {
	position: relative;
	z-index: 2;
}

/* Lien cliquable */
.card-link {
	display: block;
	text-decoration: none;
	color: inherit;
}

/* Effet hover : changement de fond */
.card:hover {
	filter: brightness(1.1);
	transform: scale(1.08) translateY(-5px); /* Zoom + élévation */
	box-shadow: 0 15px 25px rgba(0, 0, 0, 0.3); /* Ombre plus marquée */
}

.card:hover .card-bg-hover {
	opacity: 1; /* Affiche la nouvelle image */
	transform: scale(1.05); /* Petit zoom fluide */
}

/* Footer */
footer { text-align: center; padding: 1em; background-color: #333; color: white; margin-top: 2em; }
footer .footer-link { color: #00BFFF; text-decoration: none; font-weight: bold; }
footer .footer-link:hover { color: #87CEFA; text-decoration: underline; }

/* Responsive */
@media (max-width: 768px) {
	nav ul { display: none; flex-direction: column; width: 100%; background-color: #333; }
	nav ul.show { display: flex; }
	.menu-toggle { display: flex; position: absolute; right: 1em; top: 0.8em; }
}

