/*
 * Page front CST (/cst-maj/… ou article/page avec shortcode) :
 * formulaire complet + scroll du document (pas une zone interne).
 * Contre Attire / TinyMCE / éventuel overflow du thème.
 */
html:has(body.cst-tables-front-page),
html:has([data-cst-front-root]) {
	height: auto !important;
	max-height: none !important;
	overflow-x: hidden !important;
	overflow-y: scroll !important;
}

body.cst-tables-front-page,
body:has([data-cst-front-root]) {
	height: auto !important;
	max-height: none !important;
	min-height: 0 !important;
	overflow-x: hidden !important;
	overflow-y: visible !important;
	position: static !important;
}

body.cst-tables-front-page.modal-open,
body:has([data-cst-front-root]).modal-open {
	overflow-y: visible !important;
	padding-right: 0 !important;
}

body.cst-tables-front-page #mainframe,
body.cst-tables-front-page #attire-content,
body.cst-tables-front-page .attire-content,
body.cst-tables-front-page .attire-post-and-comments,
body.cst-tables-front-page .entry-content,
body.cst-tables-front-page .cst-front-layout,
body.cst-tables-front-page #cst-tables-front,
body.cst-tables-front-page .cst-front-shell,
body:has([data-cst-front-root]) #mainframe,
body:has([data-cst-front-root]) #attire-content,
body:has([data-cst-front-root]) .attire-content,
body:has([data-cst-front-root]) .attire-post-and-comments,
body:has([data-cst-front-root]) .entry-content,
body:has([data-cst-front-root]) .cst-front-shell,
[data-cst-front-root] {
	height: auto !important;
	max-height: none !important;
	overflow: visible !important;
	position: relative !important;
}

.cst-front-shell {
	width: 100%;
	max-width: 100%;
	min-width: 0;
	margin: 1.5rem auto 4rem;
	padding: 0 0 4rem;
	box-sizing: border-box;
	color: var(--ast-global-color-3, inherit);
}

/*
 * Astra : même largeur « colonne centrale » que les pages du site
 * (évite le plein écran sur /cst-maj/… vs shortcode dans une page).
 */
body.cst-tables-front-page #content.site-content > .ast-container,
body.cst-tables-front-page .cst-front-layout,
body.cst-tables-front-page #primary.cst-front-layout {
	width: 100% !important;
	max-width: var(--ast-normal-container-width, 1200px) !important;
	margin-left: auto !important;
	margin-right: auto !important;
	float: none !important;
	box-sizing: border-box !important;
	min-width: 0 !important;
}

body.cst-tables-front-page.ast-separate-container #content > .ast-container {
	max-width: var(--ast-normal-container-width, 1200px);
}

.cst-front-nav {
	margin-bottom: 1rem;
	max-width: 100%;
	min-width: 0;
	box-sizing: border-box;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.cst-front-menu {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 1rem;
	list-style: none;
	margin: 0;
	padding: 0.5rem 0 0.85rem;
	border-bottom: 1px solid rgba(0, 0, 0, 0.1);
	max-width: 100%;
	min-width: 0;
	box-sizing: border-box;
}

.cst-front-menu > li {
	flex: 0 1 auto;
	max-width: 100%;
}

.cst-front-menu a {
	text-decoration: none;
	font-weight: 600;
}

.cst-front-menu .current-menu-item > a,
.cst-front-menu a:hover {
	color: var(--ast-global-color-0, #2271b1);
}

.cst-front-header {
	margin: 0 0 0.5rem;
}

.cst-table-comment {
	margin: 0 0 1.25rem;
}

.cst-table-comment-body {
	margin: 0 0 0.75rem;
	line-height: 1.55;
}

.cst-table-comment-body p:last-child {
	margin-bottom: 0;
}

/* Liens du commentaire : soulignés, surbrillance au survol, nouvel onglet (target en HTML). */
.cst-table-comment-body a {
	text-decoration: underline;
	text-underline-offset: 0.15em;
	text-decoration-thickness: 1.5px;
	font-weight: 600;
	color: var(--ast-global-color-0, #2271b1);
	border-radius: 2px;
	padding: 0 0.1em;
	transition:
		color 0.15s ease,
		background-color 0.15s ease,
		filter 0.15s ease,
		text-shadow 0.15s ease,
		box-shadow 0.15s ease;
}

.cst-table-comment-body a:hover,
.cst-table-comment-body a:focus-visible {
	filter: brightness(1.45);
	background-color: rgba(255, 236, 80, 0.55);
	text-shadow:
		0 0 0.2em rgba(255, 255, 220, 0.95),
		0 0 0.55em rgba(255, 240, 120, 0.85);
	box-shadow: 0 0 0 2px rgba(255, 236, 80, 0.35);
	outline: none;
}

.cst-table-comment-edit {
	margin: 0.5rem 0 0;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 4px;
	padding: 0.35rem 0.85rem 0.85rem;
	background: rgba(0, 0, 0, 0.02);
}

.cst-table-comment-edit > summary {
	cursor: pointer;
	font-weight: 600;
	padding: 0.45rem 0;
	list-style-position: outside;
}

.cst-front-comment-form {
	margin-top: 0.5rem;
}

.cst-front-comment-form .wp-editor-wrap {
	margin-bottom: 0.75rem;
}

/*
 * Barre éditeur + mise en forme : défilent avec la page et disparaissent
 * derrière l’entête sticky (pas de barre collante au viewport).
 */
.cst-front-shell .wp-editor-wrap,
.cst-front-shell .wp-editor-wrap .wp-editor-tools,
.cst-front-shell .wp-editor-wrap .wp-editor-container,
.cst-front-shell .wp-editor-wrap .mce-tinymce,
.cst-front-shell .wp-editor-wrap .mce-toolbar-grp,
.cst-front-shell .wp-editor-wrap .mce-toolbar,
.cst-front-shell .wp-editor-wrap .mce-stack-layout,
.cst-front-shell .wp-editor-wrap .quicktags-toolbar,
.cst-front-shell .wp-editor-wrap .mce-top-part,
.cst-front-shell .wp-editor-wrap .mce-container,
.cst-front-shell .wp-editor-wrap .mce-panel {
	position: static !important;
	top: auto !important;
	bottom: auto !important;
	z-index: 0 !important;
}

/* L’entête doit couvrir l’éditeur au scroll. */
body.cst-tables-front-page #masthead,
body.cst-tables-front-page #masthead.element-is-sticky,
body:has([data-cst-front-root]) #masthead,
body:has([data-cst-front-root]) #masthead.element-is-sticky {
	z-index: 200 !important;
	background-color: var(--ast-global-color-5, #fff);
}

.cst-front-shell .wp-editor-wrap .mce-floatpanel,
.cst-front-shell .wp-editor-wrap .mce-menu,
.cst-front-shell .wp-editor-wrap .mce-popover {
	z-index: 100050 !important;
}

.cst-front-header .cst-page-title,
.cst-front-header h1 {
	margin: 0;
	font-size: 1.75rem;
	line-height: 1.25;
}

.cst-form-panel {
	margin: 0 0 1rem;
}

.cst-form-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.3rem 0.45rem;
	margin: 0 0 0.5rem;
}

.cst-readonly-select-toolbar {
	margin: 0 0 0.75rem;
}

.cst-form-panel-body {
	margin: 0;
}

.cst-form-panel-body[hidden] {
	display: none !important;
}

.cst-form-mode-banner {
	margin: 0 0 0.85rem;
	padding: 0.55rem 0.75rem;
	font-weight: 600;
	font-size: 0.95em;
	border-left: 4px solid #3182ce;
	background: #ebf8ff;
}

.cst-form-mode-banner.cst-form-mode-new {
	border-left-color: #38a169;
	background: #f0fff4;
}

.cst-form-mode-banner.cst-form-mode-edit {
	border-left-color: #dd6b20;
	background: #fffaf0;
}

.cst-front-form-below-title {
	margin: 0 0 1.5rem;
}

.cst-front-actions-top {
	margin: 0 0 1rem;
}

.cst-front-actions-bottom {
	margin: 1rem 0 0;
}

.cst-select-range,
.cst-select-date-range {
	display: flex;
	flex-wrap: nowrap;
	flex-direction: row;
	gap: 0.75rem 1.25rem;
	align-items: center;
}

.cst-select-range-bound,
.cst-select-date-bound {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 0.4rem;
	font-weight: 500;
	font-size: 0.9em;
	white-space: nowrap;
}

.cst-select-range-bound input[type="date"],
.cst-select-date-bound input[type="date"] {
	width: 10.5rem;
	min-width: 10.5rem;
}

.cst-select-range-bound input[type="number"] {
	width: 7.5rem;
	min-width: 6rem;
}

.cst-front-data-below {
	margin-top: 0.25rem;
}

.cst-front-table-wrap {
	overflow-x: auto;
}

.cst-front-table {
	width: 100%;
	border-collapse: collapse;
	background: var(--ast-global-color-5, #fff);
}

.cst-front-table th,
.cst-front-table td {
	border: 1px solid rgba(0, 0, 0, 0.1);
	padding: 0.55rem 0.65rem;
	text-align: left;
	vertical-align: middle;
}

.cst-front-table thead th {
	background: rgba(0, 0, 0, 0.04);
	font-weight: 600;
}

.cst-front-form-table {
	margin-bottom: 0.75rem;
	font-size: 0.875rem; /* libellés + champs plus petits que le reste de la page */
}

.cst-field-separator-row > td {
	padding: 0.2rem 0.65rem;
	background: rgba(0, 0, 0, 0.05);
	border-top: none;
	vertical-align: middle;
}

.cst-field-separator {
	margin: 0;
	padding: 0;
	border-top: none;
}

.cst-field-separator-title {
	margin: 0;
	font-size: 0.95em;
	font-weight: 600;
	line-height: 1.25;
	color: var(--ast-global-color-3, #1e1e1e);
}

.cst-field-separator-text {
	margin: 0.1rem 0 0;
	font-size: 0.9em;
	line-height: 1.25;
	color: var(--ast-global-color-3, #50575e);
}

.cst-row-audit-form {
	margin: 1.25rem 0 1.5rem;
	padding: 0.85rem 1rem;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 4px;
	background: rgba(0, 0, 0, 0.02);
}

.cst-row-audit-title {
	margin: 0 0 0.65rem;
	font-size: 1rem;
	font-weight: 600;
}

.cst-row-audit-table {
	margin-bottom: 0;
}

.cst-row-audit-value {
	color: var(--ast-global-color-3, #50575e);
}

.cst-detail-audit {
	margin-top: 0.75rem;
	padding: 0.45rem 0.65rem 0.35rem;
	border-top: none;
	border-radius: 4px;
	background: rgba(0, 0, 0, 0.045);
}

.cst-detail-audit-row {
	border-top-color: rgba(0, 0, 0, 0.06);
}

.cst-detail-audit-row:first-child {
	border-top: none;
	padding-top: 0.2rem;
}

.cst-detail-audit-row:last-child {
	padding-bottom: 0.2rem;
}

.cst-detail-audit-row .cst-detail-label,
.cst-detail-audit-row .cst-detail-value {
	font-size: 0.9rem;
	color: var(--ast-global-color-3, #50575e);
}

.cst-front-form-table .cst-col-label,
.cst-front-form-table th[scope="row"] {
	width: 28%;
	min-width: 8rem;
	font-weight: 600;
	background: rgba(0, 0, 0, 0.03);
}

.cst-front-form-table th[scope="row"] label {
	font-size: inherit;
	font-family: inherit;
	font-weight: inherit;
}

.cst-front-form-table input[type="text"],
.cst-front-form-table input[type="email"],
.cst-front-form-table input[type="url"],
.cst-front-form-table input[type="number"],
.cst-front-form-table input[type="date"],
.cst-front-form-table input[type="datetime-local"],
.cst-front-form-table select,
.cst-front-form-table textarea,
.cst-front-form-table .cst-fixed-field-value,
.cst-front-form-table .cst-front-check {
	width: 100%;
	max-width: 100%;
	padding: 0.45rem 0.6rem;
	border: 1px solid rgba(0, 0, 0, 0.18);
	border-radius: 3px;
	background: #fff;
	box-sizing: border-box;
	font-size: inherit;
	font-family: inherit;
	line-height: inherit;
}

.cst-front-form-table .cst-fixed-field-value,
.cst-front-form-table .cst-front-check {
	width: auto;
	max-width: none;
	padding: 0;
	border: none;
	border-radius: 0;
	background: transparent;
}

.cst-front-datetime {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.35rem;
}

.cst-front-datetime-plain {
	display: block;
	font-variant-numeric: tabular-nums;
	line-height: 1.35;
}

.cst-front-datetime input[type="datetime-local"] {
	max-width: 16rem;
}

.cst-req {
	color: #b32d2e;
}

.cst-field-hint {
	margin: 0.35rem 0 0;
	color: #646970;
	font-size: 0.85rem;
	font-weight: 400;
	line-height: 1.35;
}

.cst-age-preview {
	display: block;
	margin: 0.25rem 0 0;
	color: #1d2327;
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1.35;
}

.cst-age-preview[hidden] {
	display: none;
}

.cst-select-age-range .cst-select-range-bound .cst-age-preview {
	margin-top: 0.2rem;
	font-weight: 500;
}

.cst-field-required-hint {
	margin: 0.4rem 0 0;
	color: #b32d2e;
	font-size: 0.9rem;
	font-weight: 600;
}

.cst-field-name-row input[aria-invalid="true"],
.cst-field-name-row textarea[aria-invalid="true"] {
	border-color: #d63638;
	box-shadow: 0 0 0 1px #d63638;
}

.cst-front-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 0.45rem;
	margin: 0.75rem 0 0;
}

.cst-front-filter-active {
	margin: 1rem 0 0.35rem;
	font-size: 0.95rem;
}

.cst-front-filter-active a {
	margin-left: 0.5rem;
}

.cst-select-dialog {
	border: none;
	border-radius: 6px;
	padding: 0;
	max-width: min(44rem, calc(100vw - 2rem));
	width: 100%;
	background: var(--ast-global-color-5, #fff);
	color: inherit;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.cst-select-dialog::backdrop {
	background: rgba(0, 0, 0, 0.45);
}

.cst-select-dialog-inner {
	position: relative;
	padding: 1.25rem 1.35rem 1.35rem;
	max-height: min(80vh, 40rem);
	overflow: auto;
}

.cst-select-dialog-inner .cst-detail-close {
	position: absolute;
	top: 0.45rem;
	right: 0.55rem;
}

.cst-select-dialog-inner h2 {
	margin: 0 1.75rem 0.5rem 0;
	font-size: 1.2rem;
}

.cst-select-reset-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4rem;
	margin: 0 0 0.75rem;
}

.cst-select-fields-table {
	margin: 0.75rem 0 0;
}

.cst-select-fields-table th {
	width: 38%;
	vertical-align: middle;
}

.cst-by-year-table .cst-num {
	text-align: right;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.cst-by-year-table tfoot th,
.cst-by-year-table tfoot td {
	font-weight: 600;
	border-top: 1px solid rgba(0, 0, 0, 0.12);
	padding-top: 0.55rem;
}

/* Boutons front : compacts / discrets (même taille partout) */
[data-cst-front-root] .cst-front-btn,
.cst-front-shell .cst-front-btn,
.cst-front-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.18rem 0.5rem;
	font-size: 0.8125rem;
	line-height: 1.35;
	font-weight: 500;
	border: 1px solid rgba(0, 0, 0, 0.14);
	border-radius: 2px;
	background: transparent;
	color: inherit;
	text-decoration: none;
	cursor: pointer;
	box-shadow: none;
}

[data-cst-front-root] .cst-front-btn:hover,
[data-cst-front-root] .cst-front-btn:focus,
.cst-front-shell .cst-front-btn:hover,
.cst-front-shell .cst-front-btn:focus,
.cst-front-btn:hover,
.cst-front-btn:focus {
	background: rgba(0, 0, 0, 0.04);
	border-color: rgba(0, 0, 0, 0.22);
	color: inherit;
}

[data-cst-front-root] .cst-front-btn-primary,
.cst-front-shell .cst-front-btn-primary,
.cst-front-btn-primary {
	background: transparent;
	border-color: rgba(0, 0, 0, 0.22);
	color: inherit;
	font-weight: 600;
}

[data-cst-front-root] .cst-front-btn-primary:hover,
[data-cst-front-root] .cst-front-btn-primary:focus,
.cst-front-shell .cst-front-btn-primary:hover,
.cst-front-shell .cst-front-btn-primary:focus,
.cst-front-btn-primary:hover,
.cst-front-btn-primary:focus {
	background: rgba(0, 0, 0, 0.05);
	border-color: rgba(0, 0, 0, 0.28);
	color: inherit;
}

.cst-front-btn-quiet {
	font-weight: 400;
}

.cst-front-notice {
	padding: 0.75rem 1rem;
	margin-bottom: 1rem;
	border-radius: 3px;
}

.cst-front-success {
	background: #edfaef;
	border: 1px solid #68de7c;
}

.cst-front-error {
	background: #fcf0f1;
	border: 1px solid #d63638;
}

.cst-front-empty {
	margin: 1rem 0;
}

.cst-front-row-actions {
	display: flex;
	align-items: center;
	gap: 0.3rem;
	white-space: nowrap;
}

.cst-inline-form {
	display: inline-flex;
	margin: 0;
}

/* Contre Bootstrap / Attire : a et button.cst-action-btn doivent être identiques. */
[data-cst-front-root] a.cst-action-btn,
[data-cst-front-root] button.cst-action-btn,
.cst-front-shell a.cst-action-btn,
.cst-front-shell button.cst-action-btn,
.cst-gallery-actions a.cst-action-btn,
.cst-gallery-actions button.cst-action-btn,
.cst-front-row-actions a.cst-action-btn,
.cst-front-row-actions button.cst-action-btn,
a.cst-action-btn,
button.cst-action-btn {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 1.7rem !important;
	height: 1.7rem !important;
	min-width: 1.7rem !important;
	min-height: 1.7rem !important;
	max-width: 1.7rem !important;
	max-height: 1.7rem !important;
	padding: 0 !important;
	margin: 0 !important;
	border: 1px solid rgba(0, 0, 0, 0.18) !important;
	border-radius: 3px !important;
	background: #fff !important;
	background-image: none !important;
	box-shadow: none !important;
	color: inherit !important;
	font-family: inherit !important;
	font-size: 12px !important;
	font-weight: 700 !important;
	line-height: 1 !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
	text-decoration: none !important;
	vertical-align: middle !important;
	cursor: pointer !important;
	box-sizing: border-box !important;
	appearance: none !important;
	-webkit-appearance: none !important;
}

a.cst-action-btn svg,
button.cst-action-btn svg,
.cst-action-btn svg {
	display: block;
	width: 14px;
	height: 14px;
	flex: 0 0 auto;
	pointer-events: none;
}

[data-cst-front-root] a.cst-action-btn:hover,
[data-cst-front-root] a.cst-action-btn:focus,
[data-cst-front-root] button.cst-action-btn:hover,
[data-cst-front-root] button.cst-action-btn:focus,
.cst-front-shell a.cst-action-btn:hover,
.cst-front-shell a.cst-action-btn:focus,
.cst-front-shell button.cst-action-btn:hover,
.cst-front-shell button.cst-action-btn:focus,
a.cst-action-btn:hover,
a.cst-action-btn:focus,
button.cst-action-btn:hover,
button.cst-action-btn:focus {
	border-color: var(--ast-global-color-0, #2271b1) !important;
	color: var(--ast-global-color-0, #2271b1) !important;
	background: #f6f7f7 !important;
}

[data-cst-front-root] a.cst-action-delete,
[data-cst-front-root] button.cst-action-delete,
.cst-front-shell a.cst-action-delete,
.cst-front-shell button.cst-action-delete,
.cst-gallery-actions a.cst-action-delete,
.cst-gallery-actions button.cst-action-delete,
a.cst-action-btn.cst-action-delete,
button.cst-action-btn.cst-action-delete {
	color: #b32d2e !important;
}

[data-cst-front-root] a.cst-action-delete:hover,
[data-cst-front-root] a.cst-action-delete:focus,
[data-cst-front-root] button.cst-action-delete:hover,
[data-cst-front-root] button.cst-action-delete:focus,
.cst-front-shell a.cst-action-delete:hover,
.cst-front-shell a.cst-action-delete:focus,
.cst-front-shell button.cst-action-delete:hover,
.cst-front-shell button.cst-action-delete:focus,
a.cst-action-btn.cst-action-delete:hover,
a.cst-action-btn.cst-action-delete:focus,
button.cst-action-btn.cst-action-delete:hover,
button.cst-action-btn.cst-action-delete:focus {
	border-color: #b32d2e !important;
	color: #b32d2e !important;
	background: #fcf0f1 !important;
}

.cst-front-media {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
}

.cst-front-media-preview img {
	display: block;
	max-width: 72px;
	height: auto;
	border-radius: 3px;
}

/*
 * Médiathèque WP ouverte en front : le thème (Attire / Astra / etc.)
 * force souvent color:#fff sur button — onglet « Téléverser » illisible.
 */
.media-modal.wp-core-ui {
	color: #1d2327;
}

.media-modal.wp-core-ui .media-frame,
.media-modal.wp-core-ui .media-frame a,
.media-modal.wp-core-ui .media-frame button:not(.button-primary):not(.media-button-select) {
	color: #1d2327;
}

.media-modal.wp-core-ui .media-router .media-menu-item {
	color: #2271b1 !important;
	background: transparent !important;
	text-shadow: none !important;
	box-shadow: none !important;
}

.media-modal.wp-core-ui .media-router .media-menu-item:hover {
	color: #135e96 !important;
}

.media-modal.wp-core-ui .media-router .media-menu-item.active {
	color: #1d2327 !important;
	border-bottom-color: #1d2327;
}

.media-modal.wp-core-ui .media-frame .button-primary,
.media-modal.wp-core-ui .media-button-select {
	color: #fff !important;
	background: #2271b1 !important;
	border-color: #2271b1 !important;
	text-shadow: none !important;
}

.media-modal.wp-core-ui .uploader-inline,
.media-modal.wp-core-ui .upload-ui,
.media-modal.wp-core-ui .upload-ui h2,
.media-modal.wp-core-ui .upload-ui h3,
.media-modal.wp-core-ui .upload-instructions {
	color: #1d2327 !important;
}

.cst-media-multi__slots {
	display: flex;
	flex-wrap: wrap;
	gap: 0.65rem;
	align-items: flex-start;
}

.cst-media-slot {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.35rem;
	width: 5.5rem;
}

.cst-media-slot__frame {
	width: 5.5rem;
	height: 5.5rem;
	border: 1px solid rgba(0, 0, 0, 0.18);
	border-radius: 4px;
	background: #f3f3f3;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

.cst-media-slot__frame img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.cst-media-slot__empty {
	color: #888;
	font-size: 1.4rem;
	line-height: 1;
	user-select: none;
}

.cst-media-slot__actions {
	display: flex;
	gap: 0.25rem;
}

.cst-media-multi__hint {
	margin: 0.35rem 0 0;
}

.cst-list-inline-input {
	width: 12rem;
	max-width: 40vw;
	padding: 0.35rem 0.5rem;
	border: 1px solid rgba(0, 0, 0, 0.18);
	border-radius: 3px;
}

.cst-list-edit-form {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
}

.cst-multi-picker {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	max-width: 100%;
}

.cst-multi-summary-wrap {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 0.5rem 0.75rem;
}

.cst-multi-summary {
	margin: 0;
	flex: 1 1 12rem;
	min-width: 0;
	line-height: 1.35;
}

.cst-multi-dialog {
	border: none;
	border-radius: 6px;
	padding: 0;
	max-width: min(28rem, calc(100vw - 2rem));
	width: 100%;
	background: var(--ast-global-color-5, #fff);
	color: inherit;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.cst-multi-dialog::backdrop {
	background: rgba(0, 0, 0, 0.45);
}

.cst-multi-dialog-inner {
	position: relative;
	padding: 1.25rem 1.35rem 1.35rem;
	max-height: min(80vh, 36rem);
	overflow: auto;
}

.cst-multi-dialog-inner .cst-detail-close {
	position: absolute;
	top: 0.45rem;
	right: 0.55rem;
}

.cst-multi-dialog-inner h2 {
	margin: 0 1.75rem 0.5rem 0;
	font-size: 1.15rem;
}

.cst-multi-dialog-inner .cst-select-reset-bar {
	margin: 0 0 0.65rem;
}

.cst-multi-dialog-lead {
	margin: 0 0 0.5rem;
}

.cst-multi-selected-count {
	margin: 0 0 0.65rem;
	font-size: 0.9em;
	font-weight: 600;
}

.cst-multi-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	min-height: 12rem;
}

.cst-multi-item-label {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	margin: 0;
	cursor: pointer;
	line-height: 1.35;
}

.cst-multi-item-label input {
	margin-top: 0.2rem;
	flex-shrink: 0;
}

.cst-multi-pager {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	margin: 0.85rem 0 0.25rem;
}

.cst-multi-page-info {
	font-size: 0.9em;
}

.cst-multi-dialog-actions {
	margin-top: 1rem;
}

.cst-ref-picker {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	max-width: 100%;
}

.cst-ref-search-label {
	display: block;
	margin: 0 0 0.65rem;
}

.cst-ref-search {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	padding: 0.45rem 0.6rem;
	font: inherit;
}

.cst-ref-option {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.2rem;
	width: 100%;
	text-align: left;
	padding: 0.45rem 0.55rem;
	margin: 0;
	border: 1px solid transparent;
	border-radius: 4px;
	background: transparent;
	font: inherit;
	color: inherit;
	cursor: pointer;
	line-height: 1.35;
}

.cst-ref-option-label {
	display: block;
	font-weight: inherit;
}

.cst-ref-option-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 0.65rem;
	font-size: 0.85em;
	opacity: 0.75;
	font-weight: 400;
}

.cst-ref-option-meta-item {
	display: inline-block;
}

.cst-ref-option:hover,
.cst-ref-option:focus {
	background: rgba(0, 0, 0, 0.06);
	outline: none;
}

.cst-ref-option.is-selected {
	border-color: currentColor;
	font-weight: 600;
}

.cst-ref-option.is-selected .cst-ref-option-meta {
	font-weight: 400;
}

.cst-front-check {
	font-weight: 400;
}

.cst-front-prix-wrap {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	max-width: 100%;
	font-weight: 400;
}

.cst-front-prix-wrap input[type="number"] {
	width: 10rem;
	max-width: calc(100% - 1.5rem);
}

.cst-front-prix-currency {
	font-weight: 700;
	color: var(--ast-global-color-3, #50575e);
}

/* Barre liste : compteur à gauche, lignes/page à droite. */
.cst-list-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem 1.25rem;
	margin: 0.25rem 0 0.75rem;
}

.cst-list-toolbar-count {
	margin: 0;
	font-size: 0.95rem;
	color: var(--ast-global-color-3, #50575e);
}

.cst-front-fixed-filter {
	margin: 0.35rem 0 0.75rem;
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--ast-global-color-3, #50575e);
}

.cst-field-readonly-row input[readonly],
.cst-field-readonly-row textarea[readonly] {
	background: rgba(0, 0, 0, 0.04);
	color: inherit;
	cursor: default;
}

.cst-field-label-wrap {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	flex-wrap: wrap;
}

.cst-field-help-q {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.35rem;
	height: 1.35rem;
	padding: 0;
	/* Couleurs fixes : ne pas hériter du thème (live souvent blanc sur fond sombre). */
	color: #111;
	border: 2px solid #111;
	border-radius: 3px;
	background: transparent;
	font: inherit;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	flex: 0 0 auto;
}

.cst-field-help-q:hover,
.cst-field-help-q:focus {
	color: #e6b800;
	border-color: #e6b800;
	background: rgba(230, 184, 0, 0.12);
	outline: none;
}

.cst-field-help-dialog {
	border: none;
	border-radius: 6px;
	padding: 0;
	max-width: min(40rem, calc(100vw - 2rem));
	width: 100%;
	background: #fff;
	color: inherit;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.cst-field-help-dialog::backdrop {
	background: rgba(0, 0, 0, 0.45);
}

.cst-field-help-dialog-inner {
	position: relative;
	padding: 1.25rem 1.35rem 1.1rem;
}

.cst-field-help-view {
	margin: 0.75rem 0;
	line-height: 1.5;
	max-height: min(50vh, 28rem);
	overflow: auto;
}

.cst-field-help-textarea {
	width: 100%;
	min-height: 10rem;
}

.cst-field-help-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	margin-top: 0.75rem;
}

.cst-field-help-status {
	font-size: 0.85em;
	opacity: 0.8;
}

.cst-fixed-field-value {
	margin: 0;
	font-weight: 600;
}

.cst-list-toolbar-controls {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem 1rem;
	margin: 0 0 0 auto;
}

.cst-per-page-form,
.cst-year-form {
	margin: 0;
}

.cst-per-page-label,
.cst-year-label {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	font-weight: 600;
	font-size: 0.95rem;
	cursor: pointer;
}

.cst-per-page-select,
.cst-year-select {
	min-width: 4.5rem;
	padding: 0.3rem 0.45rem;
	border: 1px solid rgba(0, 0, 0, 0.18);
	border-radius: 3px;
	background: #fff;
	font: inherit;
}

.cst-year-select {
	min-width: 5.5rem;
}

/* Pagination sous la liste. */
.cst-pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem 1.25rem;
	margin: 0.25rem 0 1.5rem;
	padding-top: 0.35rem;
}

.cst-pagination-info {
	margin: 0;
	font-size: 0.9rem;
	color: var(--ast-global-color-3, #50575e);
}

.cst-pagination-list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.cst-pagination-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.1rem;
	padding: 0.35rem 0.55rem;
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 3px;
	text-decoration: none;
	font-weight: 600;
	font-size: 0.9rem;
	color: inherit;
	background: #fff;
	box-sizing: border-box;
}

a.cst-pagination-link:hover,
a.cst-pagination-link:focus {
	border-color: rgba(0, 0, 0, 0.35);
	outline: none;
}

.cst-pagination-link.is-current {
	background: var(--ast-global-color-0, #0274be);
	border-color: var(--ast-global-color-0, #0274be);
	color: #fff;
}

.cst-pagination-link.is-disabled {
	opacity: 0.45;
	cursor: default;
}

.cst-pagination-ellipsis {
	padding: 0 0.25rem;
	color: #888;
}

/* Tableau (tables sans champ image) : une ligne par cellule, largeur selon le contenu. */
.cst-records-table-wrap {
	overflow-x: auto;
	margin: 0.75rem 0 1rem;
}

.cst-records-table {
	width: max-content;
	max-width: none;
	min-width: 0;
	table-layout: auto;
	/* separate requis pour position:sticky sur la colonne Actions. */
	border-collapse: separate;
	border-spacing: 0;
	background: var(--ast-global-color-5, #fff);
	font-size: 0.82rem;
}

.cst-records-table th,
.cst-records-table td {
	padding: 0.35rem 0.5rem;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
	text-align: left;
	vertical-align: middle;
	font-size: inherit;
	white-space: nowrap;
	width: 1%;
}

.cst-records-table thead th {
	font-weight: 600;
	border-bottom-width: 2px;
}

.cst-records-table tbody tr:hover {
	background: rgba(0, 0, 0, 0.03);
}

/* Colonne Actions fixe à gauche ; les infos défilent à droite. */
.cst-records-table th.cst-records-table-actions-col,
.cst-records-table td.cst-records-table-actions-col {
	position: sticky;
	left: 0;
	z-index: 2;
	background: var(--ast-global-color-5, #fff);
	box-shadow: 4px 0 6px -4px rgba(0, 0, 0, 0.18);
}

.cst-records-table thead th.cst-records-table-actions-col {
	z-index: 3;
	background: #f3f3f3;
}

.cst-records-table tbody tr:hover td.cst-records-table-actions-col {
	background: #f7f7f7;
}

.cst-records-table-name {
	font-weight: 600;
}

.cst-records-table-link {
	display: inline;
	padding: 0;
	margin: 0;
	border: none;
	background: none;
	color: var(--ast-global-color-0, #2271b1);
	font: inherit;
	font-weight: 600;
	text-align: left;
	text-decoration: underline;
	text-underline-offset: 0.12em;
	cursor: pointer;
}

.cst-records-table-link:hover,
.cst-records-table-link:focus-visible {
	color: inherit;
	outline: none;
}

.cst-detail-value .cst-detail-ref-link {
	font-weight: 600;
}

.cst-detail-ref-sep {
	color: inherit;
}

.cst-records-amount-link {
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.cst-donations-dialog,
.cst-related-list-dialog {
	max-width: min(52rem, calc(100vw - 2rem));
}

.cst-donations-dialog-total {
	margin: 0 0 0.85rem;
	font-weight: 600;
}

.cst-donations-dialog-table-wrap {
	overflow-x: auto;
	max-height: min(50vh, 24rem);
	margin: 0 0 0.25rem;
}

.cst-donations-dialog-table {
	margin: 0;
	font-size: 0.92em;
}

.cst-donations-dialog-table th,
.cst-donations-dialog-table td {
	padding: 0.35rem 0.5rem;
	white-space: nowrap;
}

.cst-records-table-actions-col {
	width: 1%;
	white-space: nowrap;
	text-align: center;
}

.cst-records-table-actions-col .cst-front-row-actions {
	justify-content: center;
}

/* Galerie : cartes ~240px, wrap ; peu de résultats n’impose pas une grille 4 colonnes vide. */
.cst-gallery {
	display: flex;
	flex-wrap: wrap;
	gap: 1.25rem 1rem;
	margin: 0.5rem 0 1.5rem;
	align-items: flex-start;
}

.cst-gallery-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	flex: 0 1 240px;
	width: 240px;
	max-width: 100%;
	min-width: 0;
	box-sizing: border-box;
}

.cst-gallery-photo {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 0;
	margin: 0;
	border: none;
	background: #f0f0f0;
	cursor: pointer;
	border-radius: 4px;
	overflow: hidden;
	line-height: 0;
	aspect-ratio: 1 / 1;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.cst-gallery-photo:hover,
.cst-gallery-photo:focus {
	outline: 2px solid var(--ast-global-color-0, #2271b1);
	outline-offset: 2px;
}

.cst-gallery-photo-img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
}

.cst-gallery-meta {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0;
	width: 100%;
	margin: 0.35rem 0 0;
}

.cst-gallery-meta p,
.cst-gallery-name {
	margin: 0;
	padding: 0;
	font-weight: 600;
	font-size: 0.95rem;
	line-height: 1.15;
	word-break: break-word;
}

.cst-gallery-name-sub {
	font-weight: 500;
	font-size: 0.85rem;
	line-height: 1.15;
	opacity: 0.9;
}

.cst-gallery-actions {
	margin-top: 0.25rem;
	justify-content: center;
}

/* Sablier / chargement de page (navigation, submit) */
.cst-page-loading {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: none;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	gap: 0.85rem;
	margin: 0;
	padding: 1rem;
	border: 0;
	background: rgba(255, 255, 255, 0.55);
	backdrop-filter: blur(1px);
	pointer-events: all;
	cursor: wait;
}

html.cst-is-loading,
html.cst-is-loading body {
	cursor: wait !important;
}

html.cst-is-loading .cst-page-loading {
	display: flex;
}

.cst-page-loading-hourglass {
	box-sizing: border-box;
	width: 2.6rem;
	height: 2.6rem;
	border: 3px solid rgba(29, 35, 39, 0.18);
	border-top-color: #1d2327;
	border-radius: 50%;
	animation: cst-hourglass-spin 0.75s linear infinite;
}

.cst-page-loading-label {
	font-size: 0.95rem;
	font-weight: 600;
	color: #1d2327;
	text-shadow: 0 0 8px #fff;
}

@keyframes cst-hourglass-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Pop-up détail */
.cst-detail-dialog {
	border: none;
	border-radius: 6px;
	padding: 0;
	max-width: min(40rem, calc(100vw - 2rem));
	width: 100%;
	background: var(--ast-global-color-5, #fff);
	color: inherit;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.cst-detail-dialog::backdrop {
	background: rgba(0, 0, 0, 0.45);
}

.cst-detail-inner {
	position: relative;
	padding: 1.25rem 1.25rem 2.25rem;
}

.cst-detail-close {
	position: absolute;
	top: 0.4rem;
	right: 0.5rem;
	z-index: 2;
	width: 2rem;
	height: 2rem;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	font-size: 1.4rem;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.cst-detail-photo {
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 0 0.55rem;
	border-radius: 4px;
	overflow: hidden;
	background: #f0f0f0;
	min-height: 8rem;
	max-height: min(22rem, 55vh);
}

.cst-detail-photo img {
	display: block;
	max-width: 100%;
	max-height: min(22rem, 55vh);
	width: auto;
	height: auto;
	object-fit: contain;
}

.cst-detail-thumbs {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.4rem;
	margin: 0 0 0.85rem;
}

.cst-detail-thumb {
	appearance: none;
	border: 2px solid transparent;
	padding: 0;
	width: 3.4rem;
	height: 3.4rem;
	border-radius: 4px;
	overflow: hidden;
	cursor: pointer;
	background: #eee;
}

.cst-detail-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.cst-detail-thumb:hover,
.cst-detail-thumb:focus {
	border-color: rgba(0, 0, 0, 0.35);
}

.cst-detail-thumb.is-active {
	border-color: #2271b1;
}

.cst-detail-title {
	margin: 0 0 0.85rem;
	font-size: 1.25rem;
	line-height: 1.3;
	text-align: center;
}

.cst-detail-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.cst-detail-row {
	padding: 0.45rem 0;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
	font-size: 0.95rem;
	line-height: 1.4;
	word-break: break-word;
}

.cst-detail-separator {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	margin-top: 0.25rem;
	padding: 0.25rem 0.55rem;
	border-top: none;
	border-radius: 3px;
	background: rgba(0, 0, 0, 0.05);
}

.cst-detail-separator .cst-field-separator-title {
	font-size: 0.95em;
	line-height: 1.25;
}

.cst-detail-separator .cst-field-separator-text {
	font-size: 0.9em;
	line-height: 1.25;
}

.cst-detail-label {
	font-weight: 600;
	color: var(--ast-global-color-3, #50575e);
}

.cst-detail-sep {
	font-weight: 600;
	color: var(--ast-global-color-3, #50575e);
}

.cst-detail-form-cta {
	margin: 1.15rem 0 0;
	padding-top: 0.85rem;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
	text-align: center;
}

.cst-detail-form-btn {
	display: inline-block;
	padding: 0.55rem 1.15rem;
	border-radius: 4px;
	background: var(--ast-global-color-0, #0274be);
	color: #fff !important;
	font-weight: 600;
	font-size: 0.95rem;
	line-height: 1.3;
	text-decoration: none !important;
	box-shadow: none;
}

.cst-detail-form-btn:hover,
.cst-detail-form-btn:focus {
	filter: brightness(0.92);
	color: #fff !important;
	text-decoration: none !important;
}

@media (max-width: 640px) {
	.cst-gallery {
		gap: 1rem 0.75rem;
	}

	.cst-gallery-card {
		flex-basis: calc(50% - 0.5rem);
		width: calc(50% - 0.5rem);
	}
}

@media (max-width: 380px) {
	.cst-gallery-card {
		flex-basis: 100%;
		width: 100%;
	}
}
