/* Alcaldes Vot — estils dels blocs de votació.
   Peces independents per al Listing Item: .av-part-puntuacio, .av-part-botons,
   .av-part-barra, i el bloc clàssic .av-part-completa.
   Personalitzable amb variables CSS. */

.av-votacio {
	--av-radi: 12px;
	--av-amunt: #16a34a;   /* fletxa amunt quan guanya l'ofici */
	--av-avall: #dc2626;   /* fletxa avall quan guanya el benefici */
	--av-gris: #c4c4c4;    /* fletxa perdedora / empat */
	font-size: 16px;
	line-height: 1.4;
	/* Tipografia per defecte del lloc (Elementor): Elksell Display. */
	font-family: "Elksell Display", var(--e-global-typography-primary-font-family), Georgia, serif;
}

/* ---------- Puntuació (Ofici / Benefici amb percentatge) ---------- */

.av-score {
	display: block;
	width: 100%;
}

.av-fila {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1.5em;
}

.av-etiqueta-punt {
	font-weight: 700;
}

/* Percentatges: per defecte grisos; el guanyador, del seu color. */
.av-pct-dalt,
.av-pct-baix {
	font-weight: 700;
	line-height: 1;
	font-size: 1.8em;
	color: var(--av-gris);
}

.av-guanya-ofici .av-pct-ofici {
	color: var(--av-amunt);
}

.av-guanya-benefici .av-pct-benefici {
	color: var(--av-avall);
}

.av-score-linia {
	display: block;
	width: 100%;
	height: 2px;
	background: #000;
	margin: .45em 0;
}

/* Text «Vota», només visible quan encara no hi ha cap vot. */
.av-vota-text {
	display: none;
	font-weight: 700;
	font-size: 1.8em;
	line-height: 1;
}

.av-part-puntuacio.av-sense-vots .av-score {
	display: none;
}

.av-part-puntuacio.av-sense-vots .av-vota-text {
	display: inline-block;
}

.av-num-total {
	font-size: 1.25em;
	font-weight: 400;
}

/* ---------- Botons de thumbs (d'ofici / de benefici) ---------- */

.av-part-botons .av-botons {
	display: flex;
	gap: 14px;
}

.av-part-botons .av-opcio {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
}

.av-part-botons .av-etiqueta {
	font-size: .85em;
	line-height: 1.15;
	text-align: center;
}

.av-part-botons .av-boto {
	width: 46px;
	height: 46px;
	padding: 0;
	border: 2px solid #000;
	border-radius: 50%;
	background: #fff;
	color: #000;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background .15s ease, color .15s ease, opacity .15s ease;
}

.av-part-botons .av-boto svg {
	fill: currentColor;
}

.av-part-botons .av-boto:hover {
	background: #000;
	color: #fff;
}

.av-part-botons.av-enviant .av-boto {
	opacity: .5;
	pointer-events: none;
}

/* Un cop votat: el triat queda ple, l'altre s'esvaeix. */
.av-part-botons.av-votat .av-boto {
	pointer-events: none;
	opacity: .35;
}

.av-part-botons.av-votat-ofici .av-boto-ofici,
.av-part-botons.av-votat-benefici .av-boto-benefici {
	opacity: 1;
	background: #000;
	color: #fff;
}

/* Mode un sol vot: botons inactius en alcaldes que no s'han votat. */
.av-part-botons.av-bloquejat .av-boto {
	opacity: .35;
	pointer-events: none;
}

/* ---------- Bloc clàssic complet (single / pàgina) ---------- */

.av-part-completa {
	max-width: 560px;
}

.av-part-completa .av-pregunta {
	font-weight: 600;
	margin: 0 0 14px;
}

.av-part-completa .av-botons {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}

.av-part-completa .av-boto {
	flex: 1 1 0;
	min-width: 140px;
	padding: 12px 18px;
	border: 2px solid #000;
	border-radius: var(--av-radi);
	cursor: pointer;
	font-size: 1em;
	line-height: 1.2;
	font-weight: var(--e-global-typography-text-font-weight, 600);
	transition: background .15s ease, color .15s ease, opacity .15s ease;
}

.av-part-completa .av-boto-ofici {
	background: #fff;
	color: #000;
}

.av-part-completa .av-boto-ofici:hover {
	background: #000;
	color: #fff;
}

.av-part-completa .av-boto-benefici {
	background: #000;
	color: #fff;
}

.av-part-completa .av-boto-benefici:hover {
	background: #fff;
	color: #000;
}

.av-part-completa.av-enviant .av-boto {
	opacity: .5;
	pointer-events: none;
}

.av-part-completa.av-votat .av-boto {
	pointer-events: none;
	opacity: .35;
}

.av-part-completa.av-votat-ofici .av-boto-ofici,
.av-part-completa.av-votat-benefici .av-boto-benefici {
	opacity: 1;
}

/* ---------- Imatge de l'alcalde (foto/escut) ---------- */

/* Marc quadrat uniforme: la foto omple i es retalla; l'escut es mostra sencer. */
.av-escut-quadrada {
	aspect-ratio: 1 / 1;
	display: block;
}

.av-escut-quadrada.av-es-foto {
	object-fit: cover;
	object-position: top;
}

.av-escut-quadrada.av-es-escut {
	object-fit: contain;
}

/* ---------- Honeypot i Turnstile ---------- */

.av-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.av-turnstile {
	margin-top: 10px;
}

.av-turnstile:empty {
	margin-top: 0;
}

/* ---------- Barra de resultats ---------- */

.av-resultats {
	margin-top: 16px;
}

.av-barra {
	display: flex;
	height: 14px;
	border: 1px solid #000;
	border-radius: calc(var(--av-radi) / 2);
	overflow: hidden;
	background: #fff;
}

.av-barra-ofici {
	background: #fff;
	border-right: 1px solid #000;
	transition: width .6s ease;
}

.av-barra-benefici {
	background: #000;
	transition: width .6s ease;
}

.av-sense-vots .av-barra-ofici,
.av-sense-vots .av-barra-benefici {
	opacity: .2;
}

.av-llegenda {
	display: flex;
	justify-content: space-between;
	gap: 10px;
	margin-top: 8px;
	font-size: .875em;
	flex-wrap: wrap;
}

.av-leg-ofici,
.av-leg-benefici {
	color: #000;
	font-weight: 600;
}

.av-total {
	margin: 4px 0 0;
	font-size: .8em;
	opacity: .7;
}

/* ---------- Missatge ---------- */

.av-missatge {
	margin: 10px 0 0;
	font-size: .875em;
}

.av-missatge.av-error {
	color: #b91c1c;
	font-weight: 600;
}
