/**
 * Menu de navigation Nirmata (frontend, shortcode [nirmata_menu]).
 * Deux variantes :
 *   - .nirmata-menu--body   : pill buttons (usage en corps de page).
 *   - .nirmata-menu--header : liens texte compacts (usage en en-tête global).
 * Responsive : flex horizontal, wrap sur petits écrans.
 */

.nirmata-menu {
	margin: 1.2em 0;
}

/* Variante corps de page : alignée sur la colonne de contenu du thème
 * (theme.json) ; fallback libre pour les thèmes classiques. La variante
 * header ne fixe pas de largeur : elle s'intègre dans l'en-tête du thème,
 * qui gère lui-même sa largeur (souvent wide-size). */
.nirmata-menu--body {
	max-width: var( --wp--style--global--content-size, none );
	margin-inline: auto;
}

/* Variante corps : boutons centrés (sinon un petit nombre de boutons reste
 * calé à gauche). La variante header garde son alignement naturel. */
.nirmata-menu--body .nirmata-menu__list {
	justify-content: center;
}

.nirmata-menu__list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
	margin: 0;
	padding: 0;
	list-style: none;
}

.nirmata-menu__item {
	margin: 0;
}

.nirmata-menu__link {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	padding: 0.55em 1.1em;
	border: 1px solid #ccd;
	border-radius: 6px;
	background: #fff;
	color: #234;
	text-decoration: none;
	font-size: 0.95em;
	font-weight: 600;
	transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.nirmata-menu__link:hover,
.nirmata-menu__link:focus {
	background: #234;
	border-color: #234;
	color: #fff;
}

.nirmata-menu__link--disabled {
	background: #f4f4f6;
	border-color: #e0e0e6;
	color: #999;
	cursor: not-allowed;
}

.nirmata-menu__link--disabled:hover,
.nirmata-menu__link--disabled:focus {
	background: #f4f4f6;
	border-color: #e0e0e6;
	color: #999;
}

.nirmata-menu__badge {
	font-size: 0.7em;
	font-weight: 700;
	font-style: normal;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	padding: 0.1em 0.4em;
	border-radius: 999px;
	background: #ffe9c2;
	color: #8a5a00;
}

/* ------------------------------------------------------------------ */
/* Variante header : liens texte compacts, intégrables à l'en-tête.    */
/* ------------------------------------------------------------------ */

.nirmata-menu--header {
	margin: 0;
}

.nirmata-menu--header .nirmata-menu__list {
	gap: 0.15em;
	/* Le menu est placé sous la bannière (elle-même centrée) : on centre les
	 * items pour s'aligner sur la bannière, sinon un petit nombre de boutons
	 * se cale à l'extrémité gauche ou droite. */
	justify-content: center;
}

.nirmata-menu--header .nirmata-menu__link {
	padding: 0.35em 0.7em;
	border: none;
	border-radius: 4px;
	background: transparent;
	color: #345;
	font-size: 0.9em;
	font-weight: 600;
}

.nirmata-menu--header .nirmata-menu__link:hover,
.nirmata-menu--header .nirmata-menu__link:focus {
	background: rgba(0, 0, 0, 0.06);
	color: #123;
}

@media (max-width: 600px) {
	.nirmata-menu--body .nirmata-menu__list {
		flex-direction: column;
	}
	.nirmata-menu--body .nirmata-menu__link {
		width: 100%;
		justify-content: center;
	}
	/* Header : reste horizontal, wrap naturel si trop d'items. */
}

@media (prefers-color-scheme: dark) {
	.nirmata-menu__link {
		background: #1e1e1e;
		color: #eee;
		border-color: #444;
	}
	.nirmata-menu__link:hover,
	.nirmata-menu__link:focus {
		background: #456;
		border-color: #456;
		color: #fff;
	}
	.nirmata-menu__link--disabled {
		background: #262626;
		border-color: #333;
		color: #777;
	}
	.nirmata-menu__badge {
		background: #4a3a00;
		color: #ffce6a;
	}
	/* Header dark : liens texte clairs, hover subtil. */
	.nirmata-menu--header .nirmata-menu__link {
		background: transparent;
		color: #ddd;
	}
	.nirmata-menu--header .nirmata-menu__link:hover,
	.nirmata-menu--header .nirmata-menu__link:focus {
		background: rgba(255, 255, 255, 0.08);
		color: #fff;
	}
}