/* Styles front-end du plugin Recettes Scoutisme (préfixe rscout-)
   S'appuie sur les styles hérités du thème (couleurs de texte, police),
   ajoute uniquement la mise en page nécessaire. */

/* ---------- Page de recherche ---------- */

.rscout-search-page {
	margin: 1.5em 0;
}

.rscout-search-form {
	margin-bottom: 2em;
	padding: 1em;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 8px;
}

.rscout-search-bar {
	margin-bottom: 1em;
}

.rscout-search-input {
	width: 100%;
	max-width: 480px;
	min-height: 44px;
	padding: 0.6em 0.8em;
	font-size: 1em;
	border: 1px solid rgba(0, 0, 0, 0.25);
	border-radius: 6px;
	box-sizing: border-box;
}

.rscout-filter-group {
	border: none;
	margin: 0 0 1em 0;
	padding: 0;
}

.rscout-filter-group legend {
	font-weight: 600;
	margin-bottom: 0.4em;
	padding: 0;
}

.rscout-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
}

.rscout-pill {
	position: relative;
}

.rscout-pill input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	cursor: pointer;
}

.rscout-pill label {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	box-sizing: border-box;
	padding: 0.5em 1em;
	border: 1px solid rgba(0, 0, 0, 0.25);
	border-radius: 999px;
	cursor: pointer;
	font-size: 0.9em;
	line-height: 1.4;
	user-select: none;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.rscout-pill input[type="checkbox"]:checked + label {
	background-color: #2b6a3f;
	border-color: #2b6a3f;
	color: #fff;
}

.rscout-pill input[type="checkbox"]:focus-visible + label {
	outline: 2px solid #2b6a3f;
	outline-offset: 2px;
}

.rscout-search-actions {
	margin-top: 1.2em;
}

.rscout-search-submit {
	min-height: 44px;
	padding: 0.6em 1.6em;
	font-size: 1em;
	background-color: #2b6a3f;
	color: #fff;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	width: 100%;
	max-width: 320px;
}

.rscout-search-submit:hover {
	background-color: #235433;
}

/* ---------- Grille de résultats ---------- */

.rscout-results-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 1.2em;
}

.rscout-card {
	display: block;
	text-decoration: none;
	color: inherit;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 8px;
	overflow: hidden;
	background-color: #fff;
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.rscout-card:hover {
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
	transform: translateY(-2px);
}

.rscout-card-img {
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background-color: #f1f1f1;
}

.rscout-card-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.rscout-card-img-placeholder {
	width: 100%;
	height: 100%;
	background: repeating-linear-gradient(45deg, #f1f1f1, #f1f1f1 10px, #e6e6e6 10px, #e6e6e6 20px);
}

.rscout-card-body {
	padding: 0.8em 1em 1em;
}

.rscout-card-title {
	margin: 0 0 0.5em;
	font-size: 1.05em;
}

.rscout-card-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35em;
}

.rscout-no-results {
	font-style: italic;
}

/* ---------- Badges (communs recherche + fiche) ---------- */

.rscout-badge {
	display: inline-block;
	padding: 0.2em 0.7em;
	border-radius: 999px;
	font-size: 0.78em;
	line-height: 1.6;
	background-color: #eef3ee;
	color: #2b6a3f;
	border: 1px solid #cfe0d2;
}

.rscout-badge-type_cuisson {
	background-color: #fdf2e5;
	color: #8a5a12;
	border-color: #f0dab3;
}

.rscout-badge-regime {
	background-color: #eef1fb;
	color: #37458a;
	border-color: #d2d9f2;
}

/* ---------- Fiche recette ---------- */

.rscout-badges-box {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
	margin: 0 0 1.5em;
	padding: 1em;
	background-color: #f8f8f6;
	border-radius: 8px;
}

.rscout-ingredients-block {
	margin: 0 0 2em;
	padding: 1.2em;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 8px;
}

.rscout-ingredients-title {
	margin-top: 0;
}

.rscout-personnes-control {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.6em;
	margin-bottom: 0.6em;
}

.rscout-personnes-control input[type="number"] {
	width: 5em;
	min-height: 44px;
	padding: 0.4em 0.5em;
	font-size: 1em;
	border: 1px solid rgba(0, 0, 0, 0.25);
	border-radius: 6px;
	box-sizing: border-box;
}

.rscout-personnes-note {
	font-size: 0.9em;
	color: rgba(0, 0, 0, 0.6);
	margin-top: 0;
}

.rscout-personnes-note-warning {
	color: #8a4b12;
}

.rscout-ingredients-list {
	list-style: none;
	margin: 1em 0 0;
	padding: 0;
}

.rscout-ingredient-row {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.3em 0.5em;
	padding: 0.5em 0;
	border-bottom: 1px dashed rgba(0, 0, 0, 0.12);
}

.rscout-ingredient-row:last-child {
	border-bottom: none;
}

.rscout-ingredient-nom {
	flex: 1 1 auto;
}

.rscout-ingredient-qty,
.rscout-ingredient-qty-static {
	font-weight: 600;
	min-width: 3em;
	text-align: right;
}

.rscout-ingredient-unite {
	min-width: 3em;
}

/* Déroulé de la recette : étapes numérotées mises en avant */

.rscout-recette-content ol {
	counter-reset: rscout-step;
	list-style: none;
	margin: 0;
	padding: 0;
}

.rscout-recette-content ol > li {
	counter-increment: rscout-step;
	position: relative;
	margin: 0 0 1em;
	padding: 0.2em 0 0.2em 2.6em;
	min-height: 2em;
}

.rscout-recette-content ol > li::before {
	content: counter(rscout-step);
	position: absolute;
	left: 0;
	top: 0;
	width: 1.9em;
	height: 1.9em;
	line-height: 1.9em;
	text-align: center;
	border-radius: 50%;
	background-color: #2b6a3f;
	color: #fff;
	font-weight: 600;
	font-size: 0.9em;
}

/* ---------- Ajustements tablette (<= 768px) ---------- */

@media (max-width: 768px) {

	.rscout-results-grid {
		gap: 1em;
	}

	.rscout-search-form {
		padding: 0.9em;
	}
}

/* ---------- Ajustements téléphone (<= 480px) ---------- */

@media (max-width: 480px) {

	.rscout-search-page {
		margin: 1em 0;
	}

	.rscout-search-form {
		padding: 0.8em;
		border-radius: 6px;
	}

	.rscout-filter-group legend {
		font-size: 0.95em;
	}

	.rscout-pill label {
		padding: 0.5em 0.9em;
		font-size: 0.88em;
	}

	.rscout-search-submit {
		max-width: none;
	}

	.rscout-results-grid {
		grid-template-columns: 1fr;
		gap: 0.9em;
	}

	.rscout-card-title {
		font-size: 1em;
	}

	.rscout-badges-box,
	.rscout-ingredients-block {
		padding: 0.9em;
	}

	.rscout-personnes-control {
		width: 100%;
	}

	.rscout-personnes-control input[type="number"] {
		width: 4.5em;
	}

	.rscout-ingredient-nom {
		flex: 1 1 100%;
	}

	.rscout-ingredient-qty,
	.rscout-ingredient-qty-static,
	.rscout-ingredient-unite {
		text-align: left;
	}
}
