/* CCPLM – Offres d'emploi (Emploi-Territorial)
   S'appuie sur les variables --cc-* du thème ; les valeurs de repli sont celles du site. */

.ccplm-oe {
	--oe-teal: var(--cc-teal, #206269);
	--oe-teal-nuit: var(--cc-teal-nuit, #1C4A4F);
	--oe-encre: var(--cc-encre, #1C3436);
	--oe-texte: var(--cc-texte, #23393B);
	--oe-texte-2: var(--cc-texte-2, #3F5759);
	--oe-label: var(--cc-gris-label, #6E8A8D);
	--oe-trait: var(--cc-trait, #DCE7E6);
	--oe-pastille: var(--cc-pastille, #EDF4F3);
	--oe-pastille-h: var(--cc-pastille-h, #DCE9E8);
	--oe-orange: var(--cc-orange, #F28B41);
	--oe-orange-fonce: var(--cc-orange-fonce, #E57A2E);
	--oe-pilule: var(--cc-rayon-pilule, 30px);
	--oe-f-texte: var(--cc-f-texte, 'Avenir', system-ui, sans-serif);
	--oe-f-cn: var(--cc-f-cn, 'Avenir Cn', 'Avenir', sans-serif);
	--oe-f-titre: var(--cc-f-titre, 'Comfortaa', 'Avenir', sans-serif);
	--oe-ease: var(--cc-ease, cubic-bezier(.2, .7, .2, 1));

	font-family: var(--oe-f-texte);
	color: var(--oe-texte);
}

.ccplm-oe *,
.ccplm-oe *::before,
.ccplm-oe *::after { box-sizing: border-box; }

/* ---------- Filtres ---------- */

.ccplm-oe__filtres {
	display: grid;
	grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr)) auto;
	gap: 16px 20px;
	align-items: end;
	margin: 0 0 28px;
}

.ccplm-oe__champ { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

.ccplm-oe__champ label {
	font-size: 14px;
	font-weight: 800;
	color: var(--oe-teal-nuit);
}

.ccplm-oe .ccplm-oe__input {
	width: 100%;
	height: 52px;
	margin: 0;
	padding: 0 22px;
	font: inherit;
	font-size: 15px;
	color: var(--oe-texte);
	background: #fff;
	border: 1.5px solid var(--oe-trait);
	border-radius: var(--oe-pilule);
	box-shadow: 0 2px 10px rgba(32, 98, 105, .07);
	transition: border-color .2s, box-shadow .2s;
}

.ccplm-oe .ccplm-oe__input::placeholder { color: var(--oe-label); opacity: 1; }

.ccplm-oe .ccplm-oe__input:hover { border-color: var(--oe-pastille-h); }

.ccplm-oe .ccplm-oe__input:focus {
	outline: none;
	border-color: var(--oe-teal);
	box-shadow: 0 0 0 3px rgba(32, 98, 105, .18);
}

.ccplm-oe__champ--recherche .ccplm-oe__input {
	padding-left: 50px;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%23206269' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='7.8' cy='7.8' r='6'/%3E%3Cpath d='m12.3 12.3 4.2 4.2'/%3E%3C/svg%3E") no-repeat 22px center;
}

.ccplm-oe__date {
	padding-right: 48px !important;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%23206269' stroke-width='2' stroke-linejoin='round'%3E%3Crect x='1.5' y='3' width='15' height='13.5' rx='2.5'/%3E%3Cpath d='M1.5 7.5h15M5.5 1v4M12.5 1v4' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat calc(100% - 22px) center !important;
	cursor: pointer;
}

.ccplm-oe__reset {
	height: 52px;
	padding: 0 26px;
	font: inherit;
	font-size: 15px;
	font-weight: 800;
	line-height: 1;
	color: var(--oe-teal);
	background: var(--oe-pastille);
	border: 0;
	border-radius: var(--oe-pilule);
	cursor: pointer;
	transition: background .2s;
	white-space: nowrap;
}

.ccplm-oe__reset:hover { background: var(--oe-pastille-h); }

.ccplm-oe__compteur {
	margin: 0 0 18px;
	font-size: 15px;
	color: var(--oe-texte-2);
}

.ccplm-oe__compteur:focus { outline: none; }

/* ---------- Grille ---------- */

.ccplm-oe .ccplm-oe__grille {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 600px), 1fr));
	gap: 30px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ccplm-oe__item { margin: 0; padding: 0; }
.ccplm-oe__item[hidden] { display: none; }

.ccplm-oe__carte {
	display: flex;
	flex-direction: column;
	height: 100%;
	padding: 28px 28px 26px;
	background: #fff;
	border: 1.5px solid var(--oe-trait);
	border-radius: 10px;
	transition: border-color .25s var(--oe-ease);
}

.ccplm-oe__carte:hover,
.ccplm-oe__carte:focus-within { border-color: var(--oe-teal); }

.ccplm-oe .ccplm-oe__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 16px;
	padding: 0;
	list-style: none;
}

.ccplm-oe__tags li {
	margin: 0;
	padding: 6px 12px 5px;
	font-family: var(--oe-f-cn);
	font-size: 13px;
	font-weight: 700;
	line-height: 1.2;
	color: var(--oe-teal);
	background: var(--oe-pastille);
	border-radius: var(--oe-pilule);
}

.ccplm-oe .ccplm-oe__titre {
	margin: 0 0 18px;
	font-family: var(--oe-f-texte);
	font-size: 21px;
	font-weight: 800;
	line-height: 1.3;
	color: var(--oe-teal-nuit);
	text-transform: none;
	letter-spacing: 0;
}

.ccplm-oe .ccplm-oe__infos {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin: 0 0 22px;
	padding: 0;
}

.ccplm-oe__info { margin: 0; }

.ccplm-oe .ccplm-oe__info dt {
	margin: 0 0 2px;
	font-size: 13px;
	font-weight: 600;
	color: var(--oe-label);
}

.ccplm-oe .ccplm-oe__info dd {
	margin: 0;
	font-size: 15px;
	line-height: 1.45;
	color: var(--oe-texte);
}

.ccplm-oe__info--long dd {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
}

.ccplm-oe__pied {
	margin-top: auto;
	padding-top: 20px;
	border-top: 1.5px solid var(--oe-trait);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 14px 16px;
}

.ccplm-oe__limite {
	margin: 0;
	font-size: 14px;
	line-height: 1.35;
	color: var(--oe-texte-2);
}

.ccplm-oe__limite time {
	display: block;
	font-size: 16px;
	font-weight: 800;
	color: var(--oe-encre);
}

/* Bouton pilule orange : reprend .ccplm-btn--orange du thème, avec repli si la classe n'est pas chargée */
.ccplm-oe .ccplm-oe__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 13px 26px;
	font-family: var(--oe-f-texte);
	font-size: 15px;
	font-weight: 800;
	line-height: 1.55;
	color: var(--oe-encre) !important;
	text-decoration: none !important;
	background: var(--oe-orange);
	border-radius: var(--oe-pilule);
	transition: background .2s;
}

.ccplm-oe .ccplm-oe__btn:hover { background: var(--oe-orange-fonce); }

.ccplm-oe a:focus-visible,
.ccplm-oe button:focus-visible {
	outline: 3px solid var(--oe-teal);
	outline-offset: 3px;
}

/* ---------- Vignette en deux colonnes : image à gauche, texte à droite ---------- */

.ccplm-oe__corps {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-width: 0;
}

.ccplm-oe__carte--image {
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
	padding: 0;
	overflow: hidden;
}

.ccplm-oe__carte--image .ccplm-oe__corps { padding: 28px 28px 26px; }

.ccplm-oe .ccplm-oe__image {
	margin: 0;
	padding: 24px;
	border-right: 1.5px solid var(--oe-trait);
}

/* Image affichée en entier, proportions d'origine, mêmes coins arrondis que sur la single */
.ccplm-oe .ccplm-oe__image img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 10px;
}

.ccplm-oe__description {
	margin: 0 0 22px;
	font-size: 15px;
	line-height: 1.55;
	color: var(--oe-texte-2);
}

.ccplm-oe__description > :first-child { margin-top: 0; }
.ccplm-oe__description > :last-child { margin-bottom: 0; }
.ccplm-oe__description p,
.ccplm-oe__description ul,
.ccplm-oe__description ol { margin: 0 0 10px; }
.ccplm-oe__description a { color: var(--oe-teal); }

/* ---------- [ccplm_offre_infos] ---------- */

.ccplm-oe-infos {
	margin: 0 0 32px;
	padding: 28px;
	font-family: var(--cc-f-texte, 'Avenir', system-ui, sans-serif);
	background: var(--cc-pastille, #EDF4F3);
	border-radius: 10px;
}

.ccplm-oe-infos .ccplm-oe-infos__liste {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
	gap: 18px 28px;
	margin: 0;
	padding: 0;
}

.ccplm-oe-infos__item { margin: 0; }

.ccplm-oe-infos .ccplm-oe-infos__item dt {
	margin: 0 0 2px;
	font-size: 13px;
	font-weight: 600;
	color: var(--cc-gris-label, #6E8A8D);
}

.ccplm-oe-infos .ccplm-oe-infos__item dd {
	margin: 0;
	font-size: 16px;
	line-height: 1.45;
	color: var(--cc-texte, #23393B);
}

.ccplm-oe-infos__action { margin: 24px 0 0; }

.ccplm-oe-infos .ccplm-oe-infos__btn {
	display: inline-flex;
	padding: 13px 26px;
	font-size: 15px;
	font-weight: 800;
	line-height: 1.55;
	color: var(--cc-encre, #1C3436) !important;
	text-decoration: none !important;
	background: var(--cc-orange, #F28B41);
	border-radius: var(--cc-rayon-pilule, 30px);
	transition: background .2s;
}

.ccplm-oe-infos .ccplm-oe-infos__btn:hover { background: var(--cc-orange-fonce, #E57A2E); }
.ccplm-oe-infos .ccplm-oe-infos__btn:focus-visible { outline: 3px solid var(--cc-teal, #206269); outline-offset: 3px; }

/* ---------- [ccplm_offre_infos] : description + image ---------- */

.ccplm-oe-detail {
	display: grid;
	gap: 40px;
	margin: 0 0 32px;
	background: #fff;
}

.ccplm-oe-detail--2col {
	grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
	align-items: start;
}

.ccplm-oe-detail__texte {
	min-width: 0;
	font-size: 16px;
	line-height: 1.65;
	color: var(--cc-texte, #23393B);
}

.ccplm-oe-detail__texte > :first-child { margin-top: 0; }
.ccplm-oe-detail__texte > :last-child { margin-bottom: 0; }

.ccplm-oe-detail .ccplm-oe-detail__image { margin: 0; }

.ccplm-oe-detail:not(.ccplm-oe-detail--2col) .ccplm-oe-detail__image { max-width: 480px; }

/* Image affichée en entier, proportions d'origine */
.ccplm-oe-detail__image img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 10px;
}

/* Lien d'agrandissement + visionneuse */
.ccplm-oe-detail__zoom {
	position: relative;
	display: block;
	border-radius: 10px;
	cursor: zoom-in;
}

.ccplm-oe-detail__zoom::after {
	content: "";
	position: absolute;
	right: 12px;
	bottom: 12px;
	width: 40px;
	height: 40px;
	background: rgba(28, 52, 54, .75) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='8.5' cy='8.5' r='6'/%3E%3Cpath d='m13 13 5 5M8.5 6v5M6 8.5h5'/%3E%3C/svg%3E") no-repeat center;
	border-radius: 50%;
	transition: background-color .2s;
}

.ccplm-oe-detail__zoom:hover::after { background-color: var(--cc-teal, #206269); }

.ccplm-oe-detail__zoom:focus-visible {
	outline: 3px solid var(--cc-teal, #206269);
	outline-offset: 3px;
}

.ccplm-oe-lb {
	width: 100vw;
	max-width: 100vw;
	height: 100vh;
	max-height: 100vh;
	margin: 0;
	padding: 56px 24px 24px;
	background: transparent;
	border: 0;
}

.ccplm-oe-lb::backdrop { background: rgba(14, 26, 27, .9); }

.ccplm-oe-lb[open] {
	display: flex;
	align-items: center;
	justify-content: center;
}

.ccplm-oe-lb img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	border-radius: 10px;
	cursor: zoom-out;
}

.ccplm-oe-lb__fermer {
	position: absolute;
	top: 12px;
	right: 12px;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 18px;
	font: inherit;
	font-family: var(--cc-f-texte, 'Avenir', system-ui, sans-serif);
	font-size: 15px;
	font-weight: 800;
	color: var(--cc-encre, #1C3436);
	background: #fff;
	border: 0;
	border-radius: var(--cc-rayon-pilule, 30px);
	cursor: pointer;
}

.ccplm-oe-lb__fermer:hover { background: var(--cc-pastille, #EDF4F3); }
.ccplm-oe-lb__fermer:focus-visible { outline: 3px solid var(--cc-orange, #F28B41); outline-offset: 3px; }

@media (max-width: 782px) {
	.ccplm-oe-detail--2col { grid-template-columns: 1fr; gap: 28px; }
	.ccplm-oe-detail__image { max-width: 480px; }
}

/* ---------- États vides ---------- */

.ccplm-oe__aucun {
	padding: 48px 24px;
	text-align: center;
	background: var(--oe-pastille);
	border-radius: 10px;
}

.ccplm-oe__aucun[hidden] { display: none; }
.ccplm-oe__aucun p { margin: 0 0 18px; font-size: 17px; color: var(--oe-texte-2); }
.ccplm-oe__aucun .ccplm-oe__reset { background: #fff; }

.ccplm-oe--vide {
	max-width: 720px;
	padding: 40px;
	background: var(--oe-pastille);
	border-radius: 10px;
}

.ccplm-oe--vide p { margin: 0 0 22px; font-size: 16px; line-height: 1.6; color: var(--oe-texte-2); }

.ccplm-oe .ccplm-oe__vide-titre {
	margin-bottom: 10px;
	font-family: var(--oe-f-titre);
	font-size: 22px;
	font-weight: 700;
	line-height: 1.35;
	color: var(--oe-teal-nuit);
}

/* ---------- Pagination ---------- */

.ccplm-oe__pagination {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 8px;
	margin-top: 44px;
}

.ccplm-oe__pagination[hidden] { display: none; }

.ccplm-oe__page {
	min-width: 44px;
	height: 44px;
	padding: 0 12px;
	font: inherit;
	font-size: 15px;
	font-weight: 800;
	color: var(--oe-teal);
	background: var(--oe-pastille);
	border: 0;
	border-radius: var(--oe-pilule);
	cursor: pointer;
	transition: background .2s, color .2s;
}

.ccplm-oe__page:hover { background: var(--oe-pastille-h); }

.ccplm-oe__page[aria-current="page"] {
	color: #fff;
	background: var(--oe-teal);
	cursor: default;
}

.ccplm-oe__page:disabled { opacity: .4; cursor: default; }
.ccplm-oe__page--fleche svg { display: block; }
.ccplm-oe__ellipse { padding: 0 4px; color: var(--oe-label); }

/* ---------- Datepicker (flatpickr) ---------- */

.flatpickr-calendar.ccplm-oe-cal {
	font-family: var(--cc-f-texte, 'Avenir', system-ui, sans-serif);
	border-radius: 10px;
	box-shadow: 0 10px 30px rgba(28, 52, 54, .16);
}

.ccplm-oe-cal .flatpickr-day.selected,
.ccplm-oe-cal .flatpickr-day.selected:hover,
.ccplm-oe-cal .flatpickr-day.selected:focus {
	background: var(--cc-teal, #206269);
	border-color: var(--cc-teal, #206269);
	color: #fff;
}

.ccplm-oe-cal .flatpickr-day.today { border-color: var(--cc-orange, #F28B41); }
.ccplm-oe-cal .flatpickr-day.today:hover { background: var(--cc-orange, #F28B41); border-color: var(--cc-orange, #F28B41); color: var(--cc-encre, #1C3436); }
.ccplm-oe-cal .flatpickr-months .flatpickr-month,
.ccplm-oe-cal .flatpickr-current-month { color: var(--cc-teal-nuit, #1C4A4F); font-weight: 800; }

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
	.ccplm-oe__filtres { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.ccplm-oe__champ--recherche { grid-column: 1 / -1; }
	.ccplm-oe__reset { justify-self: start; }
}

@media (max-width: 600px) {
	.ccplm-oe__filtres { grid-template-columns: 1fr; }
	.ccplm-oe__carte { padding: 24px 22px 22px; }
	.ccplm-oe__carte--image { grid-template-columns: 1fr; }
	.ccplm-oe__carte--image .ccplm-oe__corps { padding: 24px 22px 22px; }
	.ccplm-oe .ccplm-oe__image { border-right: 0; border-bottom: 1.5px solid var(--oe-trait); }
	.ccplm-oe .ccplm-oe__image { padding: 22px 22px 0; border-bottom: 0; }
	.ccplm-oe .ccplm-oe__image img { width: auto; max-width: 100%; max-height: 320px; margin: 0 auto; }
	.ccplm-oe__pied { flex-direction: column; align-items: stretch; }
	.ccplm-oe .ccplm-oe__btn { width: 100%; }
	.ccplm-oe--vide { padding: 28px 22px; }
}

@media (prefers-reduced-motion: reduce) {
	.ccplm-oe *, .ccplm-oe-cal * { transition: none !important; }
}
