/* CCPLM – Actes administratifs
   S'appuie sur les variables --cc-* du thème ; les valeurs de repli sont celles du site. */

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

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

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

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

.ccplm-actes__filtres {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 18px 20px;
	align-items: end;
	margin: 0 0 28px;
}

.ccplm-actes__champ { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ccplm-actes__champ--recherche { grid-column: span 2; }

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

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

.ccplm-actes .ccplm-actes__input::placeholder { color: var(--ac-label); opacity: 1; }
.ccplm-actes .ccplm-actes__input:hover { border-color: var(--ac-pastille-h); }

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

.ccplm-actes__champ--recherche .ccplm-actes__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-actes__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-actes .ccplm-actes__select {
	padding-right: 46px;
	-webkit-appearance: none;
	appearance: none;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%23206269' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 5 4 4 4-4'/%3E%3C/svg%3E") no-repeat calc(100% - 22px) center;
	cursor: pointer;
	text-overflow: ellipsis;
}

.ccplm-actes__boutons { display: flex; gap: 10px; }

.ccplm-actes .ccplm-actes__reset {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 52px;
	padding: 0 26px;
	font: inherit;
	font-size: 15px;
	font-weight: 800;
	line-height: 1;
	color: var(--ac-teal);
	text-decoration: none;
	background: var(--ac-pastille);
	border: 0;
	border-radius: var(--ac-pilule);
	cursor: pointer;
	transition: background .2s;
	white-space: nowrap;
}

.ccplm-actes .ccplm-actes__reset:hover { background: var(--ac-pastille-h); }

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

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

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

.ccplm-actes__zone { transition: opacity .2s; }
.ccplm-actes.is-loading .ccplm-actes__zone { opacity: .45; }

.ccplm-actes .ccplm-actes__grille {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 30px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ccplm-actes__item { margin: 0; padding: 0; }

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

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

.ccplm-actes__haut {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 18px;
}

.ccplm-actes__picto {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 50px;
	height: 50px;
	color: var(--ac-teal);
	background: var(--ac-pastille);
	border-radius: 50%;
}

.ccplm-actes__type {
	padding: 6px 12px 5px;
	font-family: var(--ac-f-cn);
	font-size: 13px;
	font-weight: 700;
	line-height: 1.2;
	color: var(--ac-encre);
	text-align: right;
	background: var(--ac-orange-pale);
	border-radius: var(--ac-pilule);
}

.ccplm-actes .ccplm-actes__titre {
	margin: 0 0 16px;
	font-family: var(--ac-f-texte);
	font-size: 19px;
	font-weight: 800;
	line-height: 1.35;
	color: var(--ac-teal-nuit);
	text-transform: none;
	letter-spacing: 0;
}

.ccplm-actes .ccplm-actes__meta {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 0 0 22px;
	padding: 0;
	list-style: none;
}

.ccplm-actes__meta li {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0;
	font-size: 15px;
	line-height: 1.4;
	color: var(--ac-texte-2);
}

.ccplm-actes__meta .ccplm-actes__ico {
	flex: none;
	margin-top: 1px;
	color: var(--ac-orange);
}

.ccplm-actes__pied {
	margin-top: auto;
	padding-top: 20px;
	border-top: 1.5px solid var(--ac-trait);
}

.ccplm-actes__actions { display: flex; flex-wrap: wrap; gap: 10px; }

.ccplm-actes .ccplm-actes__btn {
	flex: 1 1 130px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 46px;
	padding: 10px 16px;
	font-family: var(--ac-f-texte);
	font-size: 15px;
	font-weight: 800;
	line-height: 1.2;
	text-decoration: none !important;
	border-radius: var(--ac-pilule);
	transition: background .2s, color .2s;
}

.ccplm-actes .ccplm-actes__btn--feuilleter { color: var(--ac-teal) !important; background: var(--ac-pastille); }
.ccplm-actes .ccplm-actes__btn--feuilleter:hover { background: var(--ac-pastille-h); }
.ccplm-actes .ccplm-actes__btn--telecharger { color: var(--ac-encre) !important; background: var(--ac-orange); }
.ccplm-actes .ccplm-actes__btn--telecharger:hover { background: var(--ac-orange-fonce); }

.ccplm-actes__fichier {
	margin: 10px 0 0;
	font-size: 13px;
	color: var(--ac-label);
	text-align: center;
}

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

/* ---------- Aucun résultat ---------- */

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

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

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

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

.ccplm-actes__pagination:empty { display: none; }

.ccplm-actes .ccplm-actes__page {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	height: 44px;
	padding: 0 12px;
	font-size: 15px;
	font-weight: 800;
	color: var(--ac-teal);
	text-decoration: none;
	background: var(--ac-pastille);
	border-radius: var(--ac-pilule);
	transition: background .2s, color .2s;
}

.ccplm-actes a.ccplm-actes__page:hover { background: var(--ac-pastille-h); }
.ccplm-actes .ccplm-actes__page[aria-current="page"] { color: #fff; background: var(--ac-teal); }
.ccplm-actes .ccplm-actes__page.is-off { opacity: .4; }
.ccplm-actes__ellipse { padding: 0 4px; color: var(--ac-label); }

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

.flatpickr-calendar.ccplm-actes-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-actes-cal .flatpickr-day.selected,
.ccplm-actes-cal .flatpickr-day.selected:hover,
.ccplm-actes-cal .flatpickr-day.selected:focus {
	background: var(--cc-teal, #206269);
	border-color: var(--cc-teal, #206269);
	color: #fff;
}

/* Jours avec au moins un document : pastille orange discrète */
.ccplm-actes-cal .flatpickr-day:not(.flatpickr-disabled):not(.selected):not(.prevMonthDay):not(.nextMonthDay) {
	font-weight: 800;
	color: var(--cc-encre, #1C3436);
	background: #FDEBDD;
	border-color: transparent;
}

.ccplm-actes-cal .flatpickr-day:not(.flatpickr-disabled):not(.selected):hover { background: var(--cc-orange, #F28B41); }
.ccplm-actes-cal .flatpickr-day.flatpickr-disabled { color: rgba(57, 57, 57, .25); }
.ccplm-actes-cal .flatpickr-months .flatpickr-month,
.ccplm-actes-cal .flatpickr-current-month { color: var(--cc-teal-nuit, #1C4A4F); font-weight: 800; }

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

@media (max-width: 1024px) {
	.ccplm-actes__filtres { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.ccplm-actes .ccplm-actes__grille { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
	.ccplm-actes__filtres { grid-template-columns: 1fr; }
	.ccplm-actes .ccplm-actes__grille { grid-template-columns: 1fr; }
	.ccplm-actes__champ--recherche { grid-column: auto; }
	.ccplm-actes .ccplm-actes__reset { width: 100%; }
	.ccplm-actes__boutons { display: block; }
	.ccplm-actes__carte { padding: 22px 20px 20px; }
}

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