/* Dépend de bioetlocal-espace-contributeur */

/* ── Fond de page ────────────────────────────────────────────────────────── */
.ecs-page {
	padding: 48px 0 64px;
}

/* ── Variables locales ───────────────────────────────────────────────────── */
.ec-wrapper {
	--ec-primary:    #D2097A;
	--ec-primary-dk: #a8065f;
	--vert:          #009C50;
	--rose:          #D2097A;
	--ft:            'Boogaloo', 'Arial Rounded MT Bold', sans-serif;
	--fb:            system-ui, -apple-system, 'Segoe UI', sans-serif;

	font-family: var(--fb);
	/* max-width géré par la colonne Bootstrap col-lg-10 */
	max-width: none;
	margin:    0;
}

/* ── Titre en Boogaloo rose ──────────────────────────────────────────────── */
.ec-title {
	font-family: var(--ft);
	font-weight: 400;
	color: #D2097A;
	text-transform: uppercase;
	letter-spacing: .02em;
}

/* ── Labels en noir ──────────────────────────────────────────────────────── */
.ec-field > label,
.ec-field label,
.ec-date-col label,
.ec-field-col label {
	color: #111;
	font-family: var(--fb);
}

/* ── Inputs / select / textarea : contour rose épais ────────────────────── */
.ec-form input[type="text"],
.ec-form input[type="email"],
.ec-form input[type="tel"],
.ec-form input[type="url"],
.ec-form input[type="date"],
.ec-form input[type="time"],
.ec-form select,
.ec-form textarea,
.acf-form input[type="text"],
.acf-form input[type="email"],
.acf-form input[type="tel"],
.acf-form input[type="url"],
.acf-form input[type="number"],
.acf-form select,
.acf-form textarea,
.ec-geo-search input {
	border:        2px solid color-mix(in srgb, #D2097A 40%, transparent);
	font-family:   var(--fb);
	padding:       .55rem .75rem;
	border-radius: 6px;
	font-size:     .875rem;
	color:         #111;
	background:    #fff;
	width:         100%;
	box-sizing:    border-box;
	transition:    border-color .15s, box-shadow .15s;
}

.ec-form input[type="text"]:focus,
.ec-form input[type="email"]:focus,
.ec-form input[type="tel"]:focus,
.ec-form input[type="url"]:focus,
.ec-form input[type="date"]:focus,
.ec-form input[type="time"]:focus,
.ec-form select:focus,
.ec-form textarea:focus,
.acf-form input[type="text"]:focus,
.acf-form input[type="email"]:focus,
.acf-form input[type="tel"]:focus,
.acf-form input[type="url"]:focus,
.acf-form input[type="number"]:focus,
.acf-form select:focus,
.acf-form textarea:focus,
.ec-geo-search input:focus {
	outline:      none;
	border-color: #D2097A;
	box-shadow:   0 0 0 3px rgba(210, 9, 122, .14);
}

/* ── Select2 : contour rose ──────────────────────────────────────────────── */
.acf-form .select2-container--default .select2-selection--single,
.acf-form .select2-container--default .select2-selection--multiple {
	border:        2px solid color-mix(in srgb, #D2097A 40%, transparent);
	border-radius: 6px;
	transition:    border-color .15s, box-shadow .15s;
}

.acf-form .select2-container--default.select2-container--focus .select2-selection--single,
.acf-form .select2-container--default.select2-container--focus .select2-selection--multiple,
.acf-form .select2-container--default.select2-container--open .select2-selection--single {
	border-color: #D2097A;
	box-shadow:   0 0 0 3px rgba(210, 9, 122, .14);
	outline:      none;
}

/* ── Leaflet geocoder : contour rose ─────────────────────────────────────── */
.leaflet-control-geocoder-form input[type="text"] {
	border:        2px solid color-mix(in srgb, #D2097A 40%, transparent) !important;
	border-radius: 6px 0 0 6px !important;
	padding:       .45rem .65rem !important;
	font-family:   var(--fb) !important;
	font-size:     .875rem !important;
	transition:    border-color .15s, box-shadow .15s !important;
}

.acf-osm-above .leaflet-control-geocoder > .leaflet-control-geocoder-form input {
	border-top-right-radius:    unset !important;
	border-bottom-right-radius: unset !important;
}

.leaflet-control-geocoder-form input[type="text"]:focus {
	border-color: #D2097A !important;
	box-shadow:   0 0 0 3px rgba(210, 9, 122, .14) !important;
	outline:      none !important;
}

.leaflet-control-geocoder-icon {
	background: #D2097A !important;
}

/* ── Carte Leaflet : contour rose ────────────────────────────────────────── */
.acf-form .leaflet-map {
	border:        2px solid color-mix(in srgb, #D2097A 40%, transparent);
	border-radius: 6px;
	overflow:      hidden;
}

/* ── Select : flèche rose ────────────────────────────────────────────────── */
.ec-form select,
.acf-form select {
	appearance:          none;
	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 1l5 5 5-5' stroke='%23D2097A' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat:   no-repeat;
	background-position: right .75rem center;
	padding-right:       2.25rem;
	cursor:              pointer;
}

/* ── Instructions ACF en italique ───────────────────────────────────────── */
.acf-form .acf-field p.description {
	font-style: italic;
}

/* ── Labels ACF en noir ──────────────────────────────────────────────────── */
.acf-form .acf-label label {
	color:       #111;
	font-family: var(--fb);
	font-weight: 600;
}

/* ── Éditeur WYSIWYG : contour rose ─────────────────────────────────────── */
.acf-form .wp-editor-container {
	border:        2px solid color-mix(in srgb, #D2097A 40%, transparent);
	border-radius: 6px;
	overflow:      hidden;
}

.acf-form .wp-editor-container:focus-within {
	border-color: #D2097A;
	box-shadow:   0 0 0 3px rgba(210, 9, 122, .14);
}

/* ── Bouton primary (Soumettre) ──────────────────────────────────────────── */
.ec-btn {
	font-family: var(--fb);
}

/* ── Bouton outline (Retour / Annuler) : fond blanc, texte rose ──────────── */
.ec-btn--outline {
	background:   #fff;
	border:       2px solid #D2097A;
	color:        #D2097A;
	font-weight:  600;
}
.ec-btn--outline:hover {
	background: #D2097A;
	color:      #fff;
}

/* ── Nature de la structure : checkboxes à sélection unique ─────────────── */
.acf-form .acf-field[data-name="nature_structure"] .categorychecklist-holder {
	border:     none;
	background: none;
	padding:    0;
}

.acf-form .acf-field[data-name="nature_structure"] .acf-input ul.acf-checkbox-list {
	display:               grid;
	grid-template-columns: 1fr 1fr;
	gap:                   .5rem .75rem;
	list-style:            none;
	padding:               0;
	margin:                0;
	border:                none;
	background:            none;
	height:                auto;
	max-height:            none;
}

.acf-form .acf-field[data-name="nature_structure"] .acf-input ul.acf-checkbox-list li {
	margin: 0;
}

.acf-form .acf-field[data-name="nature_structure"] .acf-bl:before,
.acf-form .acf-field[data-name="nature_structure"] .acf-bl:after {
	content: none !important;
	display: none !important;
}

.acf-form .acf-field[data-name="nature_structure"] .acf-input ul.acf-checkbox-list li label {
	display:     flex;
	align-items: center;
	gap:         .4rem;
	font-family: var(--fb);
	cursor:      pointer;
}

.acf-form .acf-field[data-name="nature_structure"] .acf-input ul.acf-checkbox-list li input[type="checkbox"] {
	accent-color: #D2097A;
	width:        16px;
	height:       16px;
	flex-shrink:  0;
	cursor:       pointer;
}

/* ── Filet rose à gauche du repeater réseaux ─────────────────────────────── */
.ec-date-row {
	border-left: 3px solid color-mix(in srgb, #D2097A 35%, transparent);
}

/* ── Adresse géolocalisée ────────────────────────────────────────────────── */
.ec-geo-address span {
	color: #D2097A;
}

/* ── Colonne URL plus large dans le repeater réseaux ─────────────────────── */
.ec-date-col--wide {
	flex: 2;
}

/* ── Compte utilisateur readonly (contributeur) ──────────────────────────── */
.acf-form input.ecs-compte-readonly {
	background: #f5f5f5;
	color:      #666;
	cursor:     not-allowed;
}

/* ── Table repeater ACF : contour rose ───────────────────────────────────── */
.acf-form .acf-table {
	border:          2px solid color-mix(in srgb, #D2097A 40%, transparent);
	border-radius:   6px;
	overflow:        hidden;
	border-collapse: separate;
	border-spacing:  0;
}

.acf-form .acf-table thead tr th {
	border-bottom: 2px solid color-mix(in srgb, #D2097A 40%, transparent);
}

.acf-form .acf-table tbody tr + tr td {
	border-top: 1px solid color-mix(in srgb, #D2097A 20%, transparent);
}

/* ── Galerie ACF : contour rose ──────────────────────────────────────────── */
.acf-form .acf-gallery-main {
	border:        2px solid color-mix(in srgb, #D2097A 40%, transparent);
	border-radius: 6px;
	overflow:      hidden;
}

.acf-form .acf-gallery-main .acf-gallery-toolbar {
	border-top: 2px solid color-mix(in srgb, #D2097A 40%, transparent);
}

.acf-form .acf-gallery-add {
	color: #D2097A !important;
}

/* ── Image de mise en avant ──────────────────────────────────────────────── */
.ecs-thumb-field {
	margin-bottom: 1.5rem;
}

.ecs-thumb-wrap {
	margin-bottom: .75rem;
}

.ecs-thumb-wrap img#ecs-thumb-preview {
	width:         100%;
	max-width:     320px;
	height:        200px;
	object-fit:    cover;
	border-radius: 8px;
	border:        2px solid color-mix(in srgb, #D2097A 40%, transparent);
	display:       block;
}

.ecs-thumb-placeholder {
	width:           320px;
	max-width:       100%;
	height:          200px;
	border:          2px dashed #ddd;
	border-radius:   8px;
	display:         flex;
	align-items:     center;
	justify-content: center;
	background:      #fafafa;
}

.ecs-thumb-actions {
	display:     flex;
	gap:         .5rem;
	flex-wrap:   wrap;
	align-items: center;
}

/* ── Grille labels / certifications ──────────────────────────────────────── */
.ecs-labels-grid {
	display:               grid;
	grid-template-columns: repeat(4, 1fr);
	gap:                   12px;
}

.ecs-label-card {
	display:        flex;
	flex-direction: column;
	align-items:    center;
	gap:            6px;
	cursor:         pointer;
	border:         2px solid color-mix(in srgb, #D2097A 35%, transparent);
	border-radius:  10px;
	padding:        12px 14px;
	min-width:      80px;
	text-align:     center;
	transition:     border-color .15s, background .15s;
	background:     #fff;
}

.ecs-label-card input[type="checkbox"] {
	display: none;
}

.ecs-label-card img {
	width:      56px;
	height:     56px;
	object-fit: contain;
}

/* Fallback : initiale quand aucune image */
.ecs-label-card__icon {
	width:           52px;
	height:          52px;
	display:         flex;
	align-items:     center;
	justify-content: center;
	background:      color-mix(in srgb, #D2097A 10%, transparent);
	color:           #D2097A;
	font-family:     var(--ft);
	font-size:       1.6rem;
	border-radius:   50%;
}

.ecs-label-card__name {
	font-size:   .75rem;
	font-family: var(--fb);
	color:       #555;
	line-height: 1.2;
	max-width:   80px;
}

/* Sélectionné */
.ecs-label-card.is-checked,
.ecs-label-card:has(input:checked) {
	border-color: #D2097A;
	background:   color-mix(in srgb, #D2097A 8%, transparent);
}

.ecs-label-card.is-checked .ecs-label-card__name,
.ecs-label-card:has(input:checked) .ecs-label-card__name {
	color:       #D2097A;
	font-weight: 600;
}
