/* ========================================
   LAYOUT SIMPLE ET CLAIR
   TOP (hauteur fixe) | MAIN (flexible) | FOOTER (hauteur fixe)
   CENTRÉ SUR LA PAGE
   ======================================== */

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

html, body {
	width: 100%;
	height: auto;
	font-family: 'Karla', sans-serif;
	background-color: #ffffff;
}

body {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	gap: 0;
}

/* ===== CONTENEUR PRINCIPAL - CENTRÉ ===== */
body > * {
	width: 95%;
	max-width: 1400px;
	margin: 0;
	padding: 0;
}

/* ===== TOP - FIXÉ EN HAUT DE PAGE ===== */
.layout-top {
	position: fixed;
	top: 0;
	left: 50%;
	transform: translateX(-50%);
	width: 95% !important;
	max-width: 1400px !important;
	height: auto;
	background: white;
	z-index: 2000;
	padding: 0;
	display: flex;
	justify-content: center;
	align-items: center;
	border-radius: 0 0 10px 10px;
}

/* ===== MAIN - FLEXIBLE ET SCROLLABLE ===== */
.layout-main {
	width: 95%;
	max-width: 1400px;
	background: white;
	padding: 0;
	padding-top: 80px; /* espace pour le header fixe */
	height: auto;
	min-height: auto;
	overflow-y: visible;
	display: flex;
	justify-content: center;
	align-items: flex-start;
}

/* ===== FOOTER - HAUTEUR FIXE ===== */
.layout-footer {
	flex-shrink: 0;
	width: 95%;
	max-width: 1400px;
	height: auto;
	background: white;
	border-radius: 10px;

	padding: 0;
	margin-top: 0;
	display: flex;
	justify-content: center;
	align-items: center;
}

/* Centrer le contenu avec largeur max */
.container {
	max-width: 95%;
	margin: 0 auto;
}

@media (max-width: 768px) {
	html, body {
		overflow-x: hidden;
		width: 100%;
	}

	body > * {
		width: 95%;
		max-width: 95%;
	}

	.layout-main {
		width: 100% !important;
		max-width: 100% !important;
		padding: 8px !important;
		padding-top: 8px !important;
	}

	body:not(.is-home) .layout-main {
		padding-top: 100px !important; /* espace pour le header fixe sur pages intérieures */
	}
	
	.layout-top {
		width: 95% !important;
		max-width: 95% !important;
		top: 0;
		border-radius: 0 0 10px 10px;
	}
	
	.layout-footer {
		width: 100% !important;
		max-width: 100% !important;
	}
	
	/* Forcer les tables à prendre toute la largeur */
	.layout-main table {
		width: 100% !important;
		max-width: 100% !important;
	}
	
	.layout-main td {
		width: 100% !important;
		max-width: 100% !important;
		padding: 1px !important;
	}
}

/* ===== PAGE ACCUEIL : HERO PLEIN ÉCRAN ===== */
body.is-home {
	background-color: #ffffff;
}

body.is-home .layout-top {
	top: 0;
	border-radius: 0 0 10px 10px;
}

body.is-home .layout-main {
	padding: 0 !important;
	width: 95% !important;
	max-width: 1400px !important;
	margin: 0 auto !important;
	align-items: stretch !important;
}

@media (max-width: 768px) {
	body.is-home .layout-main {
		padding: 0 !important;
		width: 100% !important;
		max-width: 100% !important;
	}
}

/* Annuler les styles de la table wrapper dans main.php */
body.is-home .layout-main > table {
	background-color: transparent !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	margin: 0 !important;
	padding: 0 !important;
}

body.is-home .layout-main > table > tbody > tr > td {
	padding: 0 !important;
}

@media (max-width: 768px) {
	body.is-home .layout-main {
		padding: 0 !important;
		width: 100% !important;
		max-width: 100% !important;
	}
}

@media (max-width: 480px) {
	body.is-home .layout-main {
		padding: 0 !important;
		width: 100% !important;
		max-width: 100% !important;
	}
}
