/* ==========================================================================
   PCM Job Search — charte pcm.fr (orange / blanc), responsive.
   La mise en page s'adapte à la LARGEUR DU BLOC (container queries) :
   elle reste correcte dans une colonne Elementor étroite comme en pleine page.
   Police héritée du thème.
   ========================================================================== */

.pcm-js {
	--pcm-orange: #ff8a00;
	--pcm-orange-dark: #e67a00;
	--pcm-orange-soft: #fff3e3;
	--pcm-title: #1f1f1f;
	--pcm-text: #555555;
	--pcm-line: #ececec;
	--pcm-card: #ffffff;
	--pcm-radius: 12px;
	--pcm-shadow: 0 2px 18px rgba(0, 0, 0, .06);
	--pcm-gap: clamp(1rem, 3cqi, 1.5rem);
	--pcm-field-h: 50px;

	container-type: inline-size;
	container-name: pcm;
	width: 100%;
	margin: 2rem 0;
	color: var(--pcm-text);
}
.pcm-js *, .pcm-js *::before, .pcm-js *::after { box-sizing: border-box; }

/* ---------- Formulaire ---------- */
.pcm-js .pcm-js-form {
	margin: 0;
	padding: clamp(1.1rem, 4cqi, 1.75rem);
	background: var(--pcm-card);
	border-top: 4px solid var(--pcm-orange);
	border-radius: var(--pcm-radius);
	box-shadow: var(--pcm-shadow);
}
.pcm-js .pcm-js-title {
	margin: 0 0 1.25rem;
	color: var(--pcm-orange);
	font-size: clamp(1.35rem, 4cqi, 1.75rem);
	font-weight: 600;
	line-height: 1.2;
}

/* Mobile d'abord : un champ par ligne */
.pcm-js .pcm-js-fields {
	display: grid;
	grid-template-columns: 1fr;
	gap: .9rem;
	align-items: end;
}
.pcm-js .pcm-js-field {
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	min-width: 0;
	margin: 0;
}
.pcm-js .pcm-js-field label {
	display: block;
	margin: 0 0 .4rem;
	color: var(--pcm-title);
	font-size: .9rem;
	font-weight: 600;
	line-height: 1.3;
}
.pcm-js .pcm-js-field input,
.pcm-js .pcm-js-field select {
	display: block;
	width: 100%;
	max-width: 100%;
	height: var(--pcm-field-h);
	min-height: var(--pcm-field-h);
	margin: 0;
	padding: .6rem .9rem;
	border: 1px solid #dddddd;
	border-radius: 8px;
	background-color: #fff;
	color: var(--pcm-title);
	font: inherit;
	font-size: 16px; /* évite le zoom automatique sur iPhone */
	line-height: 1.3;
	box-shadow: none;
	transition: border-color .15s, box-shadow .15s;
}
.pcm-js .pcm-js-field select {
	-webkit-appearance: none;
	appearance: none;
	padding-right: 2.5rem;
	text-overflow: ellipsis;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%23ff8a00' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right .9rem center;
	background-size: 12px 8px;
}
.pcm-js .pcm-js-field input:focus,
.pcm-js .pcm-js-field select:focus {
	outline: none;
	border-color: var(--pcm-orange);
	box-shadow: 0 0 0 3px var(--pcm-orange-soft);
}

.pcm-js .pcm-js-actions {
	display: flex;
	flex-direction: column;
	gap: .25rem;
	margin-top: .35rem;
}

/* Boutons (style « Déposez une offre ») */
.pcm-js .pcm-js-submit,
.pcm-js .pcm-js-more {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: var(--pcm-field-h);
	margin: 0;
	padding: .7rem 1.8rem;
	border: 0;
	border-radius: 8px;
	background: var(--pcm-orange);
	color: #fff;
	font: inherit;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.2;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color .15s;
}
.pcm-js .pcm-js-submit:hover,
.pcm-js .pcm-js-more:hover { background: var(--pcm-orange-dark); color: #fff; }
.pcm-js .pcm-js-reset {
	min-height: 44px;
	margin: 0;
	padding: .5rem;
	border: 0;
	background: none;
	color: var(--pcm-text);
	font: inherit;
	font-size: .95rem;
	text-decoration: underline;
	cursor: pointer;
}
.pcm-js .pcm-js-reset:hover { background: none; color: var(--pcm-orange); }
.pcm-js :focus-visible { outline: 3px solid var(--pcm-orange); outline-offset: 2px; }

/* ---------- Compteur ---------- */
.pcm-js .pcm-js-count {
	margin: clamp(1.25rem, 4cqi, 2rem) 0 1rem;
	color: var(--pcm-title);
	font-weight: 600;
}

/* ---------- Offres ---------- */
.pcm-js .pcm-js-results {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.25rem;
	transition: opacity .2s;
}
.pcm-js.is-loading .pcm-js-results { opacity: .45; pointer-events: none; }

.pcm-js .pcm-js-card {
	display: flex;
	flex-direction: column;
	min-width: 0;
	margin: 0;
	padding: 1.1rem 1.1rem 0;
	background: var(--pcm-card);
	border-radius: var(--pcm-radius);
	box-shadow: var(--pcm-shadow);
}
.pcm-js .pcm-js-card-title {
	margin: 0;
	padding: 0 0 .85rem;
	border-bottom: 1px solid var(--pcm-line);
	font-size: clamp(1.2rem, 3.2cqi, 1.6rem);
	font-weight: 600;
	line-height: 1.25;
	overflow-wrap: anywhere;
	hyphens: auto;
}
.pcm-js .pcm-js-card-title a { color: var(--pcm-orange); text-decoration: none; }
.pcm-js .pcm-js-card-title a:hover { color: var(--pcm-orange-dark); }

.pcm-js .pcm-js-card-body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: .85rem;
	padding: 1.1rem 0 1.1rem;
}
.pcm-js .pcm-js-card-meta {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem .9rem;
	align-items: center;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: .9rem;
}
.pcm-js .pcm-js-card-meta li { margin: 0; }
.pcm-js .pcm-js-tag {
	padding: .2rem .7rem;
	border-radius: 999px;
	background: var(--pcm-orange-soft);
	color: var(--pcm-orange-dark);
	font-weight: 700;
}
.pcm-js .pcm-js-place::before {
	content: "";
	display: inline-block;
	width: .5em;
	height: .5em;
	margin-right: .45em;
	border-radius: 50%;
	background: var(--pcm-orange);
	vertical-align: middle;
}
.pcm-js .pcm-js-card-excerpt {
	margin: 0;
	color: var(--pcm-text);
	font-size: 1rem;
	line-height: 1.7;
}
.pcm-js .pcm-js-card-link {
	display: inline-flex;
	align-items: center;
	align-self: flex-start;
	gap: .5rem;
	min-height: 44px;
	margin-top: auto;
	color: var(--pcm-orange);
	font-size: 1.15rem;
	font-weight: 500;
	text-decoration: none;
}
.pcm-js .pcm-js-card-link:hover { color: var(--pcm-orange); text-decoration: underline; }
.pcm-js .pcm-js-card-link svg { flex: none; transition: transform .15s; }
.pcm-js .pcm-js-card-link:hover svg { transform: translateX(3px); }

.pcm-js .pcm-js-empty {
	grid-column: 1 / -1;
	margin: 0;
	padding: clamp(1.25rem, 5cqi, 2.5rem);
	border-radius: var(--pcm-radius);
	background: var(--pcm-orange-soft);
	color: var(--pcm-title);
	text-align: center;
}

.pcm-js .pcm-js-more-wrap { margin-top: 2rem; text-align: center; }
.pcm-js .pcm-js-more[hidden] { display: none; }
.pcm-js .pcm-js-more:disabled { opacity: .6; cursor: wait; }

/* ==========================================================================
   Tablette : bloc ≥ 560 px
   ========================================================================== */
@container pcm (min-width: 560px) {
	.pcm-js .pcm-js-fields { grid-template-columns: 1fr 1fr; gap: 1rem; }
	.pcm-js .pcm-js-field--keyword { grid-column: 1 / -1; }
	.pcm-js .pcm-js-actions {
		grid-column: 1 / -1;
		flex-direction: row;
		align-items: center;
		gap: .75rem;
		margin-top: 0;
	}
	.pcm-js .pcm-js-submit { width: auto; }
	.pcm-js .pcm-js-more { width: auto; min-width: 260px; }
	.pcm-js .pcm-js-card { padding: 1.4rem 1.4rem 0; }
}

/* Deux colonnes d'offres : bloc ≥ 760 px */
@container pcm (min-width: 760px) {
	.pcm-js .pcm-js-results { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 1.5rem; }
}

/* ==========================================================================
   Ordinateur : bloc ≥ 980 px → formulaire sur une seule ligne,
   cartes au style de la page actuelle (texte aligné sur le bord)
   ========================================================================== */
@container pcm (min-width: 980px) {
	.pcm-js .pcm-js-fields { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr) auto; }
	.pcm-js .pcm-js-field--keyword,
	.pcm-js .pcm-js-actions { grid-column: auto; }
	.pcm-js .pcm-js-actions { gap: .5rem; }
	.pcm-js .pcm-js-results { gap: 2.5rem 1.5rem; }
	.pcm-js .pcm-js-card-excerpt { font-size: 1.05rem; line-height: 1.8; }
	.pcm-js .pcm-js-card-link { font-size: 1.3rem; }
}

/* ==========================================================================
   Navigateurs anciens (sans container queries) : mêmes règles sur l'écran
   ========================================================================== */
@supports not (container-type: inline-size) {
	.pcm-js { --pcm-gap: 1.25rem; }
	@media (min-width: 600px) {
		.pcm-js .pcm-js-fields { grid-template-columns: 1fr 1fr; }
		.pcm-js .pcm-js-field--keyword,
		.pcm-js .pcm-js-actions { grid-column: 1 / -1; }
		.pcm-js .pcm-js-actions { flex-direction: row; align-items: center; gap: .75rem; }
		.pcm-js .pcm-js-submit,
		.pcm-js .pcm-js-more { width: auto; }
	}
	@media (min-width: 800px) {
		.pcm-js .pcm-js-results { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 1.5rem; }
	}
	@media (min-width: 1100px) {
		.pcm-js .pcm-js-fields { grid-template-columns: 1.6fr 1fr 1fr auto; }
		.pcm-js .pcm-js-field--keyword,
		.pcm-js .pcm-js-actions { grid-column: auto; }
	}
	.pcm-js .pcm-js-title,
	.pcm-js .pcm-js-card-title { font-size: 1.4rem; }
}

@media (prefers-reduced-motion: reduce) {
	.pcm-js *, .pcm-js .pcm-js-results { transition: none !important; }
}
