/*
 * Surcharge la largeur de la mise en page "contrainte" de WordPress (thème
 * par blocs). Le sélecteur du thème utilise :where(), qui a une spécificité
 * nulle par construction : à spécificité égale, la règle qui gagne est celle
 * chargée en dernier, ce qui dépend de l'ordre d'enregistrement des styles et
 * n'est pas garanti depuis le plugin. Le !important rend la priorité fiable
 * quel que soit cet ordre.
 */
.is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
	max-width: 900px !important;
}

.wcv-vote-app {
	max-width: 900px !important;
	width: 100%;
	box-sizing: border-box;
	margin: 0 auto;
	padding-bottom: 100px;
}

.wcv-toolbar {
	position: sticky;
	top: 0;
	z-index: 10;
	background: #f8f9fb;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 0.9rem 1.25rem;
	margin-bottom: 1.5rem;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.wcv-toolbar > * + * {
	margin-top: 0.75rem;
	padding-top: 0.75rem;
	border-top: 1px solid #e5e7eb;
}

.wcv-toolbar-label {
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #6b7280;
	flex: 0 0 auto;
}

.wcv-identity,
.wcv-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem 0.85rem;
	align-items: center;
}

.wcv-identity-input,
.wcv-filters select,
.wcv-filter-search {
	height: 2.3rem;
	padding: 0 0.9rem;
	border: 1px solid #d1d5db;
	border-radius: 999px;
	background: #fff;
	font-size: 0.9rem;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

/*
 * Un <select> sans contrainte de largeur se dimensionne sur son option la
 * plus longue (ex. les libellés de la taxonomie Format) : on force donc une
 * largeur homogène avec troncature, quelle que soit la longueur des options.
 */
.wcv-filters select {
	flex: 0 1 200px;
	max-width: 220px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wcv-identity-input:focus,
.wcv-filters select:focus,
.wcv-filter-search:focus {
	outline: none;
	border-color: #2271b1;
	box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.15);
}

.wcv-identity-input {
	flex: 0 1 170px;
}

.wcv-identity-hint {
	font-size: 0.8rem;
	color: #777;
	font-style: italic;
	flex-basis: 100%;
}

.wcv-identity-input:required {
	border-color: #b3123a;
	box-shadow: 0 0 0 1px rgba(179, 18, 58, 0.2);
}

.wcv-identity-input:required:valid {
	border-color: #d1d5db;
	box-shadow: none;
}

.wcv-identity-required {
	padding: 1rem 1.25rem;
	border: 1px dashed #b3123a;
	border-radius: 10px;
	color: #b3123a;
	background: #fdeaea;
	font-weight: 600;
}

.wcv-votes-locked {
	padding: 1rem 1.25rem;
	border: 1px dashed #6b7280;
	border-radius: 10px;
	color: #374151;
	background: #f3f4f6;
	font-weight: 600;
}

.wcv-filter-search {
	flex: 1 1 220px;
	min-width: 160px;
	border-radius: 999px;
}

.wcv-filter-unvoted-label {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	font-size: 0.9rem;
}

.wcv-filter-public-vise-group {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.15rem 0.75rem;
	padding: 0 0.9rem;
	height: 2.3rem;
	border: 1px solid #d1d5db;
	border-radius: 999px;
	background: #fff;
}

.wcv-filter-checkbox {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	font-size: 0.85rem;
	white-space: nowrap;
}

.wcv-filter-public-vise-label {
	font-size: 0.85rem;
	font-weight: 600;
	color: #4b5563;
	white-space: nowrap;
}

.wcv-counters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
}

.wcv-progress-counter,
.wcv-coup-de-coeur-counter {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	padding: 0.3rem 0.8rem;
	border-radius: 999px;
	font-weight: 600;
	font-size: 0.8rem;
}

.wcv-progress-counter {
	background: #e7f1fa;
	color: #135e96;
}

.wcv-coup-de-coeur-counter {
	background: #ffe1e9;
	color: #b3123a;
}

.wcv-talk-list {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.wcv-talk-card {
	position: relative;
	border: 1px solid #ddd;
	border-left: 5px solid #ddd;
	border-radius: 6px;
	padding: 1rem 1.25rem;
	background: #fff;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

/* Statut du vote : non votée / notée / abstention. Les conférences déjà
   traitées sont légèrement estompées pour mettre en avant celles qui
   restent à voter ; le coup de cœur reprend le dessus visuellement. */
.wcv-talk-card.wcv-status-unvoted {
	border-left-color: #ddd;
}

.wcv-talk-card.wcv-status-noted {
	border-left-color: #2271b1;
	box-shadow: 0 0 0 1px rgba(34, 113, 177, 0.15);
	opacity: 0.92;
}

.wcv-talk-card.wcv-status-abstain {
	border-left-color: #8c8f94;
	background: #fafafa;
	opacity: 0.85;
}

.wcv-talk-card.wcv-has-coup-de-coeur {
	border-left-color: #e63462;
	background: linear-gradient(90deg, rgba(230, 52, 98, 0.06), rgba(230, 52, 98, 0) 20%), #fff;
	box-shadow: 0 0 0 1px rgba(230, 52, 98, 0.25);
	opacity: 1;
}

.wcv-talk-header {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: 0.5rem 0.75rem;
	margin-bottom: 0.5rem;
}

.wcv-card-badges {
	display: flex;
	gap: 0.4rem;
	flex-wrap: wrap;
	justify-content: flex-end;
	flex: 0 0 auto;
}

.wcv-status-pill {
	font-size: 0.75rem;
	font-weight: 600;
	padding: 0.15rem 0.6rem;
	border-radius: 999px;
	white-space: nowrap;
}

.wcv-status-pill-coup-de-coeur {
	background: #ffe1e9;
	color: #b3123a;
}

.wcv-status-pill-noted {
	background: #e7f1fa;
	color: #135e96;
}

.wcv-status-pill-abstain {
	background: #eee;
	color: #555;
}

.wcv-talk-title {
	margin: 0;
	flex: 1 1 200px;
	min-width: 0;
}

.wcv-talk-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 0.5rem;
}

.wcv-badge {
	background: #f0f0f1;
	border-radius: 4px;
	padding: 0.2rem 0.6rem;
	font-size: 0.85rem;
}

.wcv-note-complementaire {
	font-style: italic;
	color: #555;
	margin: 0.25rem 0 0.75rem;
}

.wcv-description-wrapper {
	margin: 0.25rem 0 0.75rem;
}

.wcv-description-toggle {
	background: none;
	border: none;
	padding: 0;
	color: #2271b1;
	font-size: 0.85rem;
	font-weight: 600;
	cursor: pointer;
	text-decoration: underline;
}

.wcv-description-toggle:hover {
	color: #135e96;
}

.wcv-description-content {
	margin-top: 0.5rem;
	padding: 0.75rem 1rem;
	background: #f8f9fb;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	font-size: 0.9rem;
	line-height: 1.5;
}

.wcv-description-content > *:first-child {
	margin-top: 0;
}

.wcv-description-content > *:last-child {
	margin-bottom: 0;
}

.wcv-note-selector {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4rem 1.5rem;
	margin-top: 0.75rem;
}

.wcv-note-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 0.3rem;
}

.wcv-note-btn {
	width: 2rem;
	height: 2rem;
	border: 1px solid var(--wcv-note-color, #999);
	border-radius: 4px;
	background: #fff;
	color: var(--wcv-note-color, #333);
	font-weight: 600;
	cursor: pointer;
}

.wcv-note-btn.is-selected {
	background: var(--wcv-note-color, #2271b1);
	border-color: var(--wcv-note-color, #2271b1);
	color: #fff;
}

.wcv-note-btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
	background: #f5f5f5;
	color: #999;
	border-color: #ccc;
}

.wcv-abstain,
.wcv-coup-de-coeur {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	white-space: nowrap;
}

.wcv-abstain input:disabled,
.wcv-coup-de-coeur input:disabled {
	cursor: not-allowed;
}

.wcv-coup-de-coeur.is-disabled {
	opacity: 0.5;
}

.wcv-card-message {
	margin: 0.6rem 0 0;
	padding: 0.4rem 0.7rem;
	border-radius: 4px;
	background: #fdeaea;
	color: #b32d2e;
	font-size: 0.85rem;
}

.wcv-error,
.wcv-no-results {
	color: #b32d2e;
}

@media ( max-width: 480px ) {
	.wcv-note-selector {
		flex-direction: column;
		align-items: stretch;
		gap: 0.6rem;
	}

	.wcv-note-buttons {
		justify-content: space-between;
	}

	.wcv-note-btn {
		flex: 1 1 2.4rem;
		min-width: 2.4rem;
		height: 2.4rem;
	}

	.wcv-abstain,
	.wcv-coup-de-coeur {
		justify-content: flex-start;
	}

	.wcv-card-badges {
		justify-content: flex-start;
	}
}
