/* ============================================
   MODERN FULL-WIDTH LAYOUT — Genesis8Bit
   Normes 2024+ : CSS Grid, Flexbox, clamp(),
   container queries, prefers-color-scheme
   ============================================ */

/*------------- RESET & BASE (Modern) -------------*/
*, *::before, *::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html {
	font-size: 16px;
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	width: 100%;
	min-height: 100dvh; /* dynamic viewport height */
	background: #0a0a0a;
	color: #f0f0f0;
	font-family: Arial, Helvetica, sans-serif;
	font-size: clamp(0.85rem, 1vw + 0.7rem, 1rem);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

img {
	max-width: 100%;
	height: auto;
	display: block;
	border: 0;
}

a {
	color: #1e8f69;
	text-decoration: none;
	outline: none;
	transition: color 0.2s ease, background-color 0.2s ease;
}
a:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}
a:active {
	color: #ffff00;
}

p {
	margin: 0 0 1.2em;
}

ul {
	margin: 1em 0 1.4em 1.5em;
	line-height: 1.6;
}

h1, h2, h3 {
	line-height: 1.3;
	margin: 1.2em 0 0.5em;
	color: #ffffff;
}
h1 { font-size: clamp(1.8rem, 3vw + 0.5rem, 2.5rem); }
h2 { font-size: clamp(1.4rem, 2vw + 0.5rem, 1.8rem); }
h3 { font-size: clamp(1.1rem, 1.5vw + 0.5rem, 1.4rem); }

table {
	width: 100%;
	border-collapse: collapse;
}
td, th {
	padding: 8px 12px;
	border: 1px solid #333;
	text-align: left;
}

/*------------- LAYOUT PRINCIPAL (Full Width) -------------*/
#site {
	width: 100%;
	min-width: 320px;
}

/*------------- HEADER — menu horizontal en haut de l'écran -------------*/
#header {
	position: relative;
	z-index: 100;
	width: 100%;
	background-color: #0a0a0a;
	border-radius: 8px;
	padding: 0.5rem;
	margin-block: 1rem;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Le menu inclus via require_once s'affiche en horizontal */
#header ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 4px;
	list-style: none;
	margin: 0;
	padding: 0;
}

#header li a,
#header a {
	display: block;
	padding: 12px 20px;
	font-weight: bold;
	color: #fff;
	border-radius: 6px;
	transition: background-color 0.2s ease, color 0.2s ease;
}

#header li a:hover,
#header a:hover {
	background-color: #fff;
	color: #1a1a1a;
	text-decoration: none;
}

/*------------- WRAP — grille : aside gauche | contenu droite -------------*/
#wrap {
	display: grid;
	grid-template-columns: 260px 1fr; /* aside fixe à gauche | contenu flexible à droite */
	gap: 2rem;
	padding-block: 2rem;
	min-height: calc(100vh - 300px);
}

/*------------- SIDEBAR (aside à gauche de l'écran) -------------*/
aside {
	position: sticky;
	top: 80px; /* sous le menu */
	display: flex;
	flex-direction: column;
	gap: 1rem;
	width: 260px;
	min-width: 260px;
	max-width: 260px;
}

.widget {
	background: #1a1a1a;
	color: #f0f0f0;
	padding: clamp(0.8rem, 2vw, 1.2rem);
	border-radius: 10px;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.widget-title {
    margin: 0 0 0.5em;
    padding-bottom: 0.4em;
    border-bottom: 1px solid #333;
    font-size: 1.1em;
    color: #ffffff;
    text-decoration: none;
}

.widget ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.widget li {
	padding: 6px 0;
	border-top: 1px dotted #333;
}

.widget li a:hover {
	background-color: #231f20;
	color: #fff;
	padding-inline: 8px;
	margin-inline: -8px;
	border-radius: 6px;
	text-decoration: none;
}

/*------------- CONTENT (à droite de l'aside) -------------*/
#content {
	background: #0a0a0a;
	border-radius: 12px;
	padding: clamp(1rem, 3vw, 2rem);
	min-width: 0; /* empêche le débordement flex/grid */
}

.post-title {
	font-size: clamp(1.4rem, 2vw + 0.5rem, 1.8rem);
	margin-bottom: 0.3em;
	color: #ffffff;
}

.post-meta {
	margin-bottom: 0.8em;
	font-size: 0.9em;
	color: #ff4444;
}

.post-image {
	margin: 1rem 0;
	padding: 6px;
	border: 1px solid #333;
	border-radius: 6px;
	background: #1a1a1a;
}

/*------------- NEWS / INFO BOXES -------------*/
.news, .informations, .images {
	border: 1px solid #444;
	padding: clamp(0.8rem, 2vw, 1.5rem);
	color: #f0f0f0;
	background-color: #1a1a1a;
	border-radius: 10px;
	margin-bottom: 1.5rem;
}

/*------------- FOOTER -------------*/
#footer {
	width: 100%;
	clear: both;
	color: #aaa;
	font-size: clamp(0.75rem, 1vw + 0.4rem, 0.9em);
	background-color: #111;
	border-radius: 8px;
	padding: 2rem 1rem;
	margin-block: 2rem;
	text-align: center;
}

#footer a {
	color: #fff;
	font-weight: bold;
}

/*------------- FORM STYLES -------------*/
form fieldset {
	border: 1px solid #444;
	border-radius: 8px;
	padding: clamp(0.6rem, 2vw, 1rem);
	margin-bottom: 1rem;
}

form legend {
	font-weight: bold;
	color: #ccc;
	padding: 0 0.5em;
}

form label {
	display: inline-block;
	margin-right: 0.5em;
	color: #ddd;
}

form input[type="text"] {
	background: #222;
	border: 1px solid #444;
	color: #fff;
	padding: 6px 10px;
	border-radius: 4px;
	font-size: inherit;
	transition: border-color 0.2s ease;
}

form input[type="text"]:focus {
	outline: none;
	border-color: #1e8f69;
	box-shadow: 0 0 0 2px rgba(30, 143, 105, 0.3);
}

form input[type="submit"] {
	background: #1e8f69;
	color: #fff;
	border: none;
	padding: 8px 20px;
	border-radius: 6px;
	font-size: inherit;
	cursor: pointer;
	transition: background-color 0.2s ease, transform 0.1s ease;
}

form input[type="submit"]:hover {
	background: #25b084;
	transform: translateY(-1px);
}

/*------------- RESPONSIVE — TABLETTE -------------*/
@media (max-width: 1024px) {
	#wrap {
		grid-template-columns: 220px 1fr;
		gap: 1.5rem;
	}

	aside {
		width: 220px;
		min-width: 220px;
		max-width: 220px;
	}
}

/*------------- RESPONSIVE — MOBILE -------------*/
@media (max-width: 768px) {
	#site {
		padding-inline: 0.5rem;
	}

	#wrap {
		grid-template-columns: 1fr; /* empilement vertical */
		gap: 1.5rem;
	}

	aside {
		order: 2; /* entre header et contenu sur mobile */
		width: auto;
		min-width: auto;
		max-width: none;
	}

	#header ul {
		flex-direction: column;
		align-items: center; /* centre les éléments (images + liens texte) */
		list-style: none;      /* supprime les puces en mobile */
	}

	/* Centre les images du header (logo à gauche, drapeau à droite) */
	#header li a {
		display: flex;
		justify-content: center;
		align-items: center;
		width: auto; /* ne pas étirer au full-width */
	}

	#header li img {
		display: block;
		margin: 0 auto;
	}

	#header li a,
	#header a {
		text-align: center;
		padding: 14px 16px;
	}

	#content {
		padding: clamp(0.8rem, 3vw, 1.5rem);
	}

	form label {
		display: block;
		margin-bottom: 0.3em;
	}

	form input[type="text"] {
		width: 100%;
	}
}

/*------------- SMALL MOBILE -------------*/
@media (max-width: 480px) {
	#site {
		padding-inline: 1rem;
	}

	#header li a,
	#header a {
		font-size: 0.95em;
		padding: 12px 10px;
	}

	form input[type="radio"] {
		margin-right: 0.3em;
	}
}


/*------------- DARK MODE (si le système le supporte) -------------*/
@media (prefers-color-scheme: light) {
	body {
		background: #f5f5f5;
		color: #1a1a1a;
	}

	#header, .site-logo-img {
		filter: invert(1); /* adapter le logo si besoin */
	}

	.widget, .news, .informations, .images {
		background-color: #ffffff;
		border-color: #ddd;
		color: #333;
	}

	form input[type="text"] {
		background: #fff;
		border-color: #ccc;
		color: #1a1a1a;
	}
}

/*------------- REDUCED MOTION -------------*/
@media (prefers-reduced-motion: reduce) {
	html, a, form input[type="submit"] {
		transition: none !important;
		scroll-behavior: auto !important;
	}
}