/*
 * itu-pse/elections block.
 *
 * Cards reuse the theme's `.ituCard.candidate` styles; this only adjusts what
 * differs from the hand-built pages (cards without a photo: country candidates,
 * or people with no photo yet) and marks the elected.
 */

/*
 * Section rhythm: a clear gap after each position's cards before the next
 * position subheading, and a larger one between groups (SG, DSG, Bureaux,
 * RRB, Council) so the hierarchy reads at a glance.
 */
.itu-pse-elections__group + .itu-pse-elections__group {
	margin-top: 4.5rem;
}

/* The theme's 3rem top margin leaves room for an overlapping photo; tighten it when there is none. */
.itu-pse-elections .ituCard.candidate:not(:has(> img, > .itu-pse-elections__flag)) {
	margin-top: 1.5rem;
}

/*
 * Country candidates: the flag overlaps the card's top edge like a person's
 * photo, in a slightly rounded frame. Right-aligned: country cards carry
 * little text, so a left flag stacked on the title felt heavy. Fixed height,
 * natural width: most files are 16:9, but Cyprus (3:2), Ireland, Montenegro,
 * Seychelles (2:1) and Micronesia (1.9:1) are not, and cropping them would
 * cut Montenegro's border.
 */
.itu-pse-elections .ituCard.candidate > .itu-pse-elections__flag {
	position: relative;
	flex-shrink: 0;
	align-self: flex-end;
	height: 2.835rem;
	margin: -1.4175rem 1rem 0.5rem 0;
	border-radius: 0.5rem;
	overflow: hidden;
	box-shadow: 0 0 1.25rem rgba(0, 0, 0, 0.12);
}

.itu-pse-elections .itu-pse-elections__flag img {
	display: block;
	width: auto;
	height: 100%;
}

/* Hairline inner border, so white-edged flags (Japan, Cyprus, …) keep a crisp edge on the white card. */
.itu-pse-elections .itu-pse-elections__flag::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
	pointer-events: none;
}

/* Non-rectangular flag (Nepal): no frame; the shadow follows the shape. */
.itu-pse-elections .ituCard.candidate > .itu-pse-elections__flag.is-shaped {
	border-radius: 0;
	overflow: visible;
	box-shadow: none;
}

.itu-pse-elections .itu-pse-elections__flag.is-shaped::after {
	content: none;
}

.itu-pse-elections .itu-pse-elections__flag.is-shaped img {
	filter: drop-shadow(0 0 0.5rem rgba(0, 0, 0, 0.15));
}

.itu-pse-elections .ituCard.candidate .content .main .title {
	margin-bottom: 1rem;
}

.itu-pse-elections__position {
	margin-bottom: 3rem;
}

.itu-pse-elections__position:last-child {
	margin-bottom: 0;
}

@media screen and (min-width: 769px) {
	.itu-pse-elections__group + .itu-pse-elections__group {
		margin-top: 6rem;
	}

	.itu-pse-elections__position {
		margin-bottom: 4.5rem;
	}
}

.itu-pse-elections .itu-pse-elections__elected {
	font-weight: 700;
}

/*
 * Keep the photo a 6rem circle. The card is a flex column and
 * wp_get_attachment_image() adds width/height attributes, which let the image
 * shrink vertically into an oval; the hand-built cards had no attributes.
 */
.itu-pse-elections .ituCard.candidate > img {
	flex-shrink: 0;
	width: 6rem;
	height: 6rem;
	object-fit: cover;
	object-position: center top;
}

/* Position subheadings (Bureau directors, RRB/Council regions) centred like the group headings. */
.itu-pse-elections .itu-pse-elections__position-heading,
.itu-pse-elections h3.heading-5 {
	text-align: center;
}

/*
 * Each position's cards: a centred, wrapping flex row instead of the theme's
 * 12-column grid (which left-aligns rows of one or two cards). One card per
 * row on phones, two on tablets, three from the theme's 992px breakpoint
 * (the theme's card width: a third of the row minus the two 2rem gaps).
 */
.itu-pse-elections .itu-pse-elections__position > .ituContainer.grid {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 1rem;
}

.itu-pse-elections .itu-pse-elections__position > .ituContainer.grid > .ituCard.candidate {
	flex: 0 0 100%;
	max-width: 100%;
}

@media screen and (min-width: 576px) {
	.itu-pse-elections .itu-pse-elections__position > .ituContainer.grid {
		gap: 2rem;
	}

	.itu-pse-elections .itu-pse-elections__position > .ituContainer.grid > .ituCard.candidate {
		flex-basis: calc((100% - 2rem) / 2);
		max-width: calc((100% - 2rem) / 2);
	}
}

@media screen and (min-width: 992px) {
	.itu-pse-elections .itu-pse-elections__position > .ituContainer.grid > .ituCard.candidate {
		flex-basis: calc((100% - 4rem) / 3);
		max-width: calc((100% - 4rem) / 3);
	}
}

/*
 * Results display: the three Bureau directors in a row of three. Each column
 * (a Bureau position) is a heading and one card; subgrid rows keep the cards
 * level when one heading wraps to two lines, and the cards stretch to the
 * tallest. Below the breakpoint the columns stack and keep the regular
 * single-position layout.
 */
.itu-pse-elections__row > .itu-pse-elections__column + .itu-pse-elections__column {
	margin-top: 3rem;
}

@media screen and (min-width: 992px) {
	.itu-pse-elections__row--3 {
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		column-gap: 2rem;
	}
}

@media screen and (min-width: 992px) {
	.itu-pse-elections .itu-pse-elections__row--3 > .itu-pse-elections__column {
		display: grid;
		grid-row: span 2;
		grid-template-rows: subgrid;
		margin-top: 0;
	}

	.itu-pse-elections .itu-pse-elections__row--3 .itu-pse-elections__position {
		display: flex;
		flex-direction: column;
	}

	.itu-pse-elections .itu-pse-elections__row--3 .itu-pse-elections__position > .ituContainer.grid {
		flex: 1;
	}

	.itu-pse-elections .itu-pse-elections__row--3 .itu-pse-elections__position > .ituContainer.grid > .ituCard.candidate {
		flex-basis: 100%;
		max-width: 100%;
	}
}

/* ==========================================================================
 * Complete election results popup (pse-election-results-popup D5/D6).
 *
 * The base rules hold the final state (bar width, colour, number). The
 * animations only define their `from` frame, so they interpolate to that
 * final state, and run only on the shown round of an open dialog while the
 * script has set `.is-animating`. Without animations (reduced motion, no
 * script, old browsers) the chart is simply shown in its final state.
 * ========================================================================== */

@property --n {
	syntax: "<integer>";
	inherits: false;
	initial-value: 0;
}

.itu-pse-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.itu-pse-elections .itu-pse-elections__results-action {
	margin: 1rem 0 0;
}

/* Regional positions (pse-election-regional-rounds D4): one button below the region's cards. */
.itu-pse-elections .itu-pse-elections__region-action {
	margin-top: 1.5rem;
}

.itu-pse-elections .itu-pse-elections__region-action .itu-pse-elections__results-action {
	margin: 0;
	text-align: center;
}

/* ---- Dialog ---------------------------------------------------------------- */

.itu-pse-results-dialog {
	--itu-pse-blue: #009cd6;
	--itu-pse-blue-dark: #0076a1;
	--itu-pse-neutral: #b4bcc4;
	--itu-pse-ink: #1d2733;
	--itu-pse-muted: #5b6672;
	--itu-pse-duration: 1.2s;
	--itu-pse-delay: 0.25s;

	box-sizing: border-box;
	width: min(860px, 90vw);
	max-width: none;
	max-height: 90vh;
	max-height: 90dvh;
	padding: 0;
	border: 0;
	border-radius: 16px;
	overflow: hidden;
	color: var(--itu-pse-ink);
	background: #fff;
	box-shadow: 0 1.5rem 4rem rgba(0, 32, 39, 0.35);
	opacity: 0;
	transform: translateY(1rem) scale(0.96);
	transition:
		opacity 0.25s ease-out,
		transform 0.25s ease-out,
		overlay 0.25s ease-out allow-discrete,
		display 0.25s ease-out allow-discrete;
}

.itu-pse-results-dialog[open] {
	display: flex;
	flex-direction: column;
	opacity: 1;
	transform: none;
}

@starting-style {
	.itu-pse-results-dialog[open] {
		opacity: 0;
		transform: translateY(1rem) scale(0.96);
	}
}

.itu-pse-results-dialog::backdrop {
	background-color: rgba(0, 32, 39, 0);
	transition:
		background-color 0.25s ease-out,
		overlay 0.25s ease-out allow-discrete,
		display 0.25s ease-out allow-discrete;
}

.itu-pse-results-dialog[open]::backdrop {
	background-color: rgba(0, 32, 39, 0.6);
}

@starting-style {
	.itu-pse-results-dialog[open]::backdrop {
		background-color: rgba(0, 32, 39, 0);
	}
}

.itu-pse-results-dialog *,
.itu-pse-results-dialog *::before,
.itu-pse-results-dialog *::after {
	box-sizing: border-box;
}

/* Header: theme blue, darkening like the 2022 "elected" banners. */
.itu-pse-results-dialog__header {
	position: relative;
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 1.25rem;
	padding-block: 1.75rem;
	padding-inline: 2rem 4rem;
	color: #fff;
	background: linear-gradient(120deg, var(--itu-pse-blue) 0%, var(--itu-pse-blue-dark) 70%, #00566f 100%);
}

.itu-pse-results-dialog__photo {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 6rem;
	height: 6rem;
	overflow: hidden;
	border: 3px solid rgba(255, 255, 255, 0.85);
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.2);
	font-size: 2rem;
	font-weight: 600;
	color: #fff;
}

.itu-pse-results-dialog__photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center top;
}

.itu-pse-results-dialog__heading {
	min-width: 0;
}

.itu-pse-results-dialog .itu-pse-results-dialog__title {
	margin: 0 0 0.25rem;
	font-size: 1.75rem;
	line-height: 1.2;
	color: #fff;
}

.itu-pse-results-dialog .itu-pse-results-dialog__subtitle {
	margin: 0;
	font-size: 1.125rem;
	line-height: 1.4;
	color: #fff;
}

.itu-pse-results-dialog__close {
	position: absolute;
	top: 0.75rem;
	inset-inline-end: 0.75rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
	font-size: 1.75rem;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.15s ease-out;
}

.itu-pse-results-dialog__close:hover {
	background: rgba(255, 255, 255, 0.3);
}

.itu-pse-results-dialog__close:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

/* The body scrolls, not the dialog: a click on a scrollbar then never lands on the dialog itself. */
.itu-pse-results-dialog__body {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 2rem;
}

.itu-pse-results-dialog__description {
	margin-bottom: 2rem;
}

.itu-pse-results-dialog__description p:last-child {
	margin-bottom: 0;
}

.itu-pse-results-dialog .itu-pse-results-dialog__section-title {
	margin: 2rem 0 1rem;
	font-size: 1.25rem;
}

/* ---- Round tabs ------------------------------------------------------------ */

.itu-pse-results-rounds__tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem;
	margin-bottom: 1.5rem;
	border-bottom: 1px solid #d9dee3;
}

.itu-pse-results-rounds__tab {
	margin: 0 0 -1px;
	padding: 0.5rem 1rem;
	border: 0;
	border-bottom: 3px solid transparent;
	background: none;
	color: var(--itu-pse-muted);
	font: inherit;
	font-weight: 500;
	cursor: pointer;
}

.itu-pse-results-rounds__tab:hover {
	color: var(--itu-pse-blue-dark);
}

.itu-pse-results-rounds__tab[aria-selected="true"] {
	border-bottom-color: var(--itu-pse-blue);
	color: var(--itu-pse-blue-dark);
}

.itu-pse-results-rounds__tab:focus-visible,
.itu-pse-results-round:focus-visible {
	outline: 2px solid var(--itu-pse-blue);
	outline-offset: 2px;
}

/* Only listed in the no-script fallback, where the tabs are hidden. */
.itu-pse-results-round__label {
	display: none;
}

.itu-pse-results-dialog .itu-pse-results-round__heading {
	margin: 0 0 0.75rem;
	font-size: 1.0625rem;
	line-height: 1.4;
}

.itu-pse-results-round__legend {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1.5rem;
	margin: 0 0 1rem;
	padding: 0;
	list-style: none;
	color: var(--itu-pse-muted);
	font-size: 0.9375rem;
}

.itu-pse-results-round__legend li {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0;
}

.itu-pse-results-round__line {
	display: inline-block;
	width: 0;
	height: 1.1em;
	border-inline-start: 2px dashed var(--itu-pse-ink);
}

.itu-pse-results-round__withdrawn {
	margin: 1rem 0 0;
	color: var(--itu-pse-muted);
	font-size: 0.9375rem;
}

/* ---- Chart ----------------------------------------------------------------- */

.itu-pse-results-chart__rows {
	margin: 0;
	padding: 0;
	list-style: none;
}

.itu-pse-results-chart__row {
	display: grid;
	grid-template-columns: 2.5rem minmax(7rem, 13rem) 1fr;
	align-items: stretch;
	column-gap: 0.75rem;
	margin: 0;
}

.itu-pse-results-chart__avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	align-self: center;
	width: 2.5rem;
	height: 2.5rem;
	overflow: hidden;
	border-radius: 50%;
	background: #e6eaee;
	color: var(--itu-pse-muted);
	font-size: 0.875rem;
	font-weight: 600;
}

.itu-pse-results-chart__avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center top;
}

/* Country rows: the flag in the avatar's column, whole (not cropped), in a small rounded frame. */
.itu-pse-results-chart__avatar.is-flag {
	position: relative;
	height: 1.75rem;
	border-radius: 4px;
	background: none;
}

.itu-pse-results-chart__avatar.is-flag img {
	object-fit: contain;
}

/* Hairline frame, so white-edged flags keep a crisp edge on the white dialog. */
.itu-pse-results-chart__avatar.is-flag::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
	pointer-events: none;
}

.itu-pse-results-chart__avatar.is-flag.is-shaped {
	border-radius: 0;
}

.itu-pse-results-chart__avatar.is-flag.is-shaped::after {
	content: none;
}

.itu-pse-results-chart__name {
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-width: 0;
	padding: 0.5rem 0;
	line-height: 1.25;
}

.itu-pse-results-chart__candidate {
	font-weight: 600;
	overflow-wrap: anywhere;
}

.itu-pse-results-chart__country {
	color: var(--itu-pse-muted);
	font-size: 0.875rem;
}

/*
 * The track spans the full row height, so the majority line drawn in each
 * track joins into one continuous line down the chart. The right margin
 * leaves room for the number after the longest bar.
 */
.itu-pse-results-chart__track {
	position: relative;
	display: flex;
	align-items: center;
	margin-inline-end: 2.5rem;
}

.itu-pse-results-chart.has-majority .itu-pse-results-chart__track::after {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	inset-inline-start: calc(var(--maj-pct) * 1%);
	border-inline-start: 2px dashed var(--itu-pse-ink);
	pointer-events: none;
}

.itu-pse-results-chart__bar {
	position: relative;
	display: block;
	width: calc(var(--pct) * 1%);
	height: 1.75rem;
	border-start-end-radius: 4px;
	border-end-end-radius: 4px;
	background-color: var(--itu-pse-neutral);
}

.itu-pse-results-chart__row.is-majority .itu-pse-results-chart__bar,
.itu-pse-results-chart__row[data-elected] .itu-pse-results-chart__bar {
	background-color: var(--itu-pse-blue);
}

/* The number rides at the end of the bar (inside a bar it would not fit the short ones). */
.itu-pse-results-chart__num {
	--n: var(--v);
	position: absolute;
	top: 50%;
	inset-inline-start: 100%;
	z-index: 1; /* Above the majority line when a bar ends right before it. */
	margin-inline-start: 0.2rem;
	padding: 0 0.2rem;
	border-radius: 3px;
	background: #fff;
	line-height: 1.4;
	transform: translateY(-50%);
	counter-reset: n var(--n);
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.itu-pse-results-chart__num::after {
	content: counter(n);
}

/*
 * Inside the bar when it is wide enough (row class set in PHP): the number is
 * pinned to the bar's end and clipped by it, so it slides in as the bar grows.
 * Dark on the neutral bar, white once the bar turns blue.
 */
.itu-pse-results-chart__row.is-label-inside .itu-pse-results-chart__track {
	container-type: inline-size;
}

.itu-pse-results-chart__row.is-label-inside .itu-pse-results-chart__bar {
	overflow: hidden;
	color: var(--itu-pse-ink);
}

.itu-pse-results-chart__row.is-label-inside.is-majority .itu-pse-results-chart__bar,
.itu-pse-results-chart__row.is-label-inside[data-elected] .itu-pse-results-chart__bar {
	color: #fff;
}

.itu-pse-results-chart__row.is-label-inside .itu-pse-results-chart__num {
	inset-inline-start: auto;
	inset-inline-end: 0.5rem;
	margin-inline-start: 0;
	padding: 0;
	background: none;
	color: inherit;
}

/* Narrow charts: only bars past 30% keep the number inside. */
@container (max-width: 360px) {
	.itu-pse-results-chart__row.is-label-inside:not(.is-label-inside-narrow) .itu-pse-results-chart__bar {
		overflow: visible;
	}

	.itu-pse-results-chart__row.is-label-inside:not(.is-label-inside-narrow) .itu-pse-results-chart__num {
		inset-inline-start: 100%;
		inset-inline-end: auto;
		margin-inline-start: 0.2rem;
		padding: 0 0.2rem;
		background: #fff;
		color: var(--itu-pse-ink);
	}
}

@keyframes itu-pse-bar-grow {
	from {
		width: 0;
	}
}

@keyframes itu-pse-count-up {
	from {
		--n: 0;
	}
}

/* Neutral for the whole growth up to the crossing point, then the base blue. */
@keyframes itu-pse-bar-cross {
	from {
		background-color: var(--itu-pse-neutral);
		color: var(--itu-pse-ink);
	}
}

.itu-pse-results-dialog[open] .itu-pse-results-round.is-animating .itu-pse-results-chart__bar {
	animation: itu-pse-bar-grow var(--itu-pse-duration) linear var(--itu-pse-delay) both;
}

.itu-pse-results-dialog[open] .itu-pse-results-round.is-animating .itu-pse-results-chart__num {
	animation: itu-pse-count-up var(--itu-pse-duration) linear var(--itu-pse-delay) both;
}

.itu-pse-results-dialog[open] .itu-pse-results-round.is-animating .is-majority .itu-pse-results-chart__bar {
	animation:
		itu-pse-bar-grow var(--itu-pse-duration) linear var(--itu-pse-delay) both,
		itu-pse-bar-cross calc(var(--cross) * var(--itu-pse-duration)) steps(1, end) var(--itu-pse-delay) both;
}

/* Regional rounds (no majority): an elected candidate's bar turns blue once it has finished growing. */
.itu-pse-results-dialog[open] .itu-pse-results-round.is-animating [data-elected] .itu-pse-results-chart__bar {
	animation:
		itu-pse-bar-grow var(--itu-pse-duration) linear var(--itu-pse-delay) both,
		itu-pse-bar-cross var(--itu-pse-duration) steps(1, end) var(--itu-pse-delay) both;
}

/* ---- Videos and resources --------------------------------------------------- */

.itu-pse-results-media {
	margin-top: 2.5rem;
}

/* Small rounded tab buttons: active in blue, others light grey. */
.itu-pse-results-media__tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 1.25rem;
}

.itu-pse-results-dialog .itu-pse-results-media__tab {
	padding: 0.4rem 1rem;
	border: 0;
	border-radius: 999px;
	background: #eef1f4;
	color: var(--itu-pse-ink);
	font: inherit;
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1.3;
	cursor: pointer;
	transition: background-color 0.15s ease-out, color 0.15s ease-out;
}

.itu-pse-results-dialog .itu-pse-results-media__tab:hover {
	background: #e1e6eb;
}

.itu-pse-results-dialog .itu-pse-results-media__tab[aria-selected="true"] {
	background: var(--itu-pse-blue);
	color: #fff;
}

.itu-pse-results-dialog .itu-pse-results-media__tab:focus-visible {
	outline: 2px solid var(--itu-pse-blue-dark);
	outline-offset: 2px;
}

/* Visible only in the no-JS listing, where every panel shows at once. */
.itu-pse-results-media__label {
	display: none;
}

/* Horizontal video scroller: cards at most 75% of the row, so the next one peeks. */
.itu-pse-results-dialog .itu-pse-results-videos__track {
	display: flex;
	gap: 1rem;
	margin: 0;
	padding: 0 0 0.5rem;
	list-style: none;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scroll-padding-inline: 0;
	scrollbar-width: thin;
}

.itu-pse-results-videos__track:focus-visible {
	outline: 2px solid var(--itu-pse-blue);
	outline-offset: 4px;
}

.itu-pse-results-dialog .itu-pse-results-video {
	flex: 0 0 min(75%, 20rem);
	margin: 0;
	scroll-snap-align: start;
}

.itu-pse-results-video__link {
	display: block;
	height: 100%;
	border-radius: 10px;
	overflow: hidden;
	background: #f4f6f8;
	color: var(--itu-pse-ink);
	text-decoration: none;
	transition: box-shadow 0.15s ease-out, transform 0.15s ease-out;
}

.itu-pse-results-video__link:hover,
.itu-pse-results-video__link:focus-visible {
	box-shadow: 0 0.5rem 1.25rem rgba(0, 32, 39, 0.18);
	transform: translateY(-2px);
	color: var(--itu-pse-ink);
}

.itu-pse-results-video__link:focus-visible {
	outline: 2px solid var(--itu-pse-blue);
	outline-offset: 2px;
}

.itu-pse-results-video__thumb {
	position: relative;
	display: block;
	aspect-ratio: 16 / 9;
	background: linear-gradient(135deg, var(--itu-pse-blue) 0%, var(--itu-pse-blue-dark) 100%);
}

.itu-pse-results-video__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Round play badge (a headphones-like note for audio). */
.itu-pse-results-video__play {
	position: absolute;
	inset-block-start: 50%;
	inset-inline-start: 50%;
	width: 3rem;
	height: 3rem;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.6);
	transform: translate(-50%, -50%);
	transition: background-color 0.15s ease-out;
}

.itu-pse-results-video__play::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 54%;
	border-style: solid;
	border-width: 0.6rem 0 0.6rem 1rem;
	border-color: transparent transparent transparent #fff;
	transform: translate(-50%, -50%);
}

.itu-pse-results-video__link:hover .itu-pse-results-video__play {
	background: var(--itu-pse-blue);
}

.itu-pse-results-video.is-audio .itu-pse-results-video__play {
	background: rgba(255, 85, 0, 0.85); /* SoundCloud orange. */
}

.itu-pse-results-video__meta {
	display: block;
	padding: 0.75rem 0.9rem 0.9rem;
}

.itu-pse-results-video__title {
	display: -webkit-box;
	overflow: hidden;
	font-weight: 600;
	line-height: 1.35;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.itu-pse-results-video__source {
	display: block;
	margin-top: 0.25rem;
	color: var(--itu-pse-muted);
	font-size: 0.85rem;
}

/* Previous / next for mice without a horizontal wheel (shown by the script on overflow). */
.itu-pse-results-videos__controls {
	display: flex;
	justify-content: flex-end;
	gap: 0.5rem;
	margin-top: 0.75rem;
}

.itu-pse-results-videos__controls[hidden] {
	display: none;
}

.itu-pse-results-dialog .itu-pse-results-videos__nav {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #eef1f4;
	color: var(--itu-pse-ink);
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.15s ease-out, color 0.15s ease-out;
}

.itu-pse-results-dialog .itu-pse-results-videos__nav:hover:not(:disabled) {
	background: var(--itu-pse-blue);
	color: #fff;
}

.itu-pse-results-dialog .itu-pse-results-videos__nav:disabled {
	opacity: 0.4;
	cursor: default;
}

/* RTL: the arrows point the reading way. */
[dir="rtl"] .itu-pse-results-videos__nav span {
	display: inline-block;
	transform: scaleX(-1);
}

.itu-pse-results-dialog .itu-pse-results-resources {
	margin: 0;
	padding: 0;
	list-style: none;
}

.itu-pse-results-dialog .itu-pse-results-resources li {
	margin: 0 0 0.5rem;
}

/* ---- Small screens: full width ----------------------------------------------- */

@media screen and (max-width: 575.98px) {
	.itu-pse-results-dialog {
		width: 100vw;
		max-height: 100vh;
		max-height: 100dvh;
		margin: auto 0 0;
		border-radius: 16px 16px 0 0;
	}

	.itu-pse-results-dialog__header {
		gap: 1rem;
		padding: 1.25rem 3.5rem 1.25rem 1.25rem;
	}

	.itu-pse-results-dialog__photo {
		width: 4.5rem;
		height: 4.5rem;
		font-size: 1.5rem;
	}

	.itu-pse-results-dialog .itu-pse-results-dialog__title {
		font-size: 1.25rem;
	}

	.itu-pse-results-dialog .itu-pse-results-dialog__subtitle {
		font-size: 1rem;
	}

	.itu-pse-results-dialog__body {
		padding: 1.25rem;
	}

	.itu-pse-results-chart__row {
		grid-template-columns: 2rem minmax(5.5rem, 7.5rem) 1fr;
		column-gap: 0.5rem;
	}

	.itu-pse-results-chart__avatar {
		width: 2rem;
		height: 2rem;
		font-size: 0.75rem;
	}

	.itu-pse-results-chart__candidate {
		font-size: 0.875rem;
	}

	.itu-pse-results-chart__country {
		font-size: 0.8125rem;
	}

	.itu-pse-results-chart__track {
		margin-inline-end: 2.25rem;
	}

	.itu-pse-results-chart__bar {
		height: 1.5rem;
	}
}

/* ---- Reduced motion: final state at once ------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.itu-pse-results-dialog,
	.itu-pse-results-dialog::backdrop,
	.itu-pse-results-dialog *,
	.itu-pse-results-dialog *::after {
		animation: none !important;
		transition: none !important;
	}
}

/*
 * ---- No-script fallback -------------------------------------------------------
 * The button is a link to the dialog's fragment; without the script the
 * targeted dialog is shown inline with every round listed. Scoped to
 * Scoped to html:not(.itu-pse-results-js) — the class the script sets once it
 * drives the dialogs — so the fallback also covers a blocked or failed script.
 * With the script running, replaceState() does not change :target, and a
 * closed dialog would otherwise stay "targeted".
 */
@supports selector(:target) {
	html:not(.itu-pse-results-js) .itu-pse-results-dialog:target:not([open]) {
		position: static;
		display: block;
		width: auto;
		max-width: 860px;
		max-height: none;
		margin: 2rem auto 0;
		overflow: visible;
		opacity: 1;
		transform: none;
		box-shadow: 0 0.5rem 2rem rgba(0, 32, 39, 0.15);
	}

	html:not(.itu-pse-results-js) .itu-pse-results-dialog__close,
	html:not(.itu-pse-results-js) .itu-pse-results-rounds__tabs,
	html:not(.itu-pse-results-js) .itu-pse-results-media__tabs {
		display: none;
	}

	html:not(.itu-pse-results-js) .itu-pse-results-dialog .itu-pse-results-round[hidden] {
		display: block;
	}

	html:not(.itu-pse-results-js) .itu-pse-results-dialog .itu-pse-results-round + .itu-pse-results-round {
		margin-top: 2rem;
	}

	html:not(.itu-pse-results-js) .itu-pse-results-round__label {
		display: block;
		margin: 0 0 0.5rem;
		color: var(--itu-pse-blue-dark);
		font-weight: 600;
	}

	html:not(.itu-pse-results-js) .itu-pse-results-media__panel[hidden] {
		display: block;
	}

	html:not(.itu-pse-results-js) .itu-pse-results-media__label {
		display: block;
		margin: 1.5rem 0 0.75rem;
		font-size: 1.1rem;
	}
}
