/* Elecciones Resultados — Colombia template + 728x90 banner.
   Scoped under .er-results / .er-banner to avoid theme collisions.
   Mobile-first friendly: fluid container, no horizontal overflow,
   long names wrap, photos/typography scale down on small screens. */

.er-wrap, .er-wrap *, .er-banner, .er-banner * { box-sizing: border-box; }
.er-wrap { width: 100%; max-width: 760px; margin: 0 auto; }
.er-results { overflow-x: hidden; }
.er-card__name, .er-card__vp, .er-card__party,
.er-row__name, .er-row__vp, .er-row__party { overflow-wrap: anywhere; word-break: break-word; }
.er-wrap.er-flash .er-card__numbers, .er-wrap.er-flash .er-row__numbers,
.er-inner.er-flash .er-card__numbers, .er-inner.er-flash .er-row__numbers { animation: erFlash .6s ease; }
@keyframes erFlash { 0% { background: #fff7d6; } 100% { background: transparent; } }

/* Round tabs + ámbito selector (chrome) */
.er-chrome { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.er-tabs { display: inline-flex; background: #e9eaed; border-radius: 8px; padding: 3px; gap: 2px; }
.er-tab { border: 0; background: transparent; color: #444; font: inherit; font-weight: 700; font-size: 13px; padding: 8px 16px; border-radius: 6px; cursor: pointer; line-height: 1; }
.er-tab:hover { color: #003057; }
.er-tab.is-active { background: #003057; color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.er-ambito { display: inline-flex; align-items: center; gap: 8px; }
.er-ambito__label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #7a7a7a; }
.er-ambito__select { font: inherit; font-size: 14px; padding: 7px 30px 7px 12px; border: 1px solid #c3c4c7; border-radius: 6px; background: #fff; color: #1a1a1a; cursor: pointer; max-width: 240px; }
.er-head__ambito { margin: 4px 0 0; font-size: 13px; font-weight: 700; color: #003057; text-transform: uppercase; letter-spacing: .03em; }

.er-results {
	font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	color: #1a1a1a;
	background: #f4f5f7;
	padding: 16px;
	border-radius: 8px;
}

/* Header */
.er-head { display: flex; align-items: center; gap: 12px; padding: 14px 8px 18px; }
.er-head__flag { display: flex; flex-direction: column; width: 8px; height: 44px; border-radius: 2px; overflow: hidden; flex: 0 0 auto; }
.er-head__flag span { display: block; flex: 1; }
.er-flag-yellow { background: #FCD116; } .er-flag-blue { background: #003893; } .er-flag-red { background: #CE1126; }
.er-head__kicker { margin: 0; font-size: 14px; font-weight: 800; letter-spacing: .12em; color: #003057; text-transform: uppercase; }
.er-head__title { margin: 2px 0 0; font-size: 20px; font-weight: 800; line-height: 1.15; color: #111; }

/* Table head */
.er-table__head { display: flex; justify-content: space-between; padding: 6px 14px; font-size: 11px; font-weight: 700; letter-spacing: .08em; color: #7a7a7a; }

/* Highlighted candidate cards */
.er-card { background: #fff; border-radius: 10px; margin: 0 0 12px; box-shadow: 0 1px 3px rgba(0,0,0,.08); overflow: hidden; position: relative; }
.er-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--er-accent, #888); }
.er-card__rank { font-size: 10px; font-weight: 800; letter-spacing: .06em; color: #555; padding: 8px 14px 0 18px; text-transform: uppercase; }
.er-card__body { display: flex; align-items: center; gap: 12px; padding: 6px 16px 14px 18px; }
.er-card__photo { width: 86px; height: 86px; border-radius: 6px; flex: 0 0 auto; overflow: hidden; display: flex; align-items: flex-end; justify-content: center; }
.er-card__photo img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.er-card__info { flex: 1 1 auto; min-width: 0; }
.er-card__name { margin: 0; font-size: 17px; font-weight: 800; line-height: 1.1; color: #111; }
.er-card__vp { margin: 3px 0 0; font-size: 12px; font-weight: 700; color: #333; }
.er-card__party { margin: 3px 0 0; font-size: 12px; color: #777; text-transform: uppercase; letter-spacing: .02em; }
.er-card__numbers { text-align: right; flex: 0 0 auto; }
.er-card__pct { margin: 0; font-size: 30px; font-weight: 800; line-height: 1; color: #111; }
.er-card__votes-label { margin: 6px 0 0; font-size: 11px; color: #888; }
.er-card__votes { margin: 0; font-size: 16px; font-weight: 800; color: #111; }

/* Others list */
.er-others__title { margin: 16px 6px 8px; font-size: 11px; font-weight: 800; letter-spacing: .08em; color: #7a7a7a; }
.er-others { list-style: none; margin: 0; padding: 0; background: #fff; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.08); overflow: hidden; }
.er-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid #eee; position: relative; }
.er-row:last-child { border-bottom: 0; }
.er-row__rank { width: 18px; text-align: center; font-weight: 800; color: #999; font-size: 13px; flex: 0 0 auto; }
.er-row__photo { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex: 0 0 auto; background: var(--er-accent, #ddd); }
.er-row__photo img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.er-row__info { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.er-row__name { font-size: 14px; font-weight: 800; color: #111; }
.er-row__vp { font-size: 11px; font-weight: 700; color: #444; }
.er-row__party { font-size: 11px; color: #888; text-transform: uppercase; }
.er-row__numbers { text-align: right; flex: 0 0 auto; }
.er-row__pct { display: block; font-size: 18px; font-weight: 800; color: #111; }
.er-row__votes-label { display: block; font-size: 10px; color: #999; }
.er-row__votes { display: block; font-size: 13px; font-weight: 700; color: #222; }

/* Totals */
.er-totales { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.er-totales__item { flex: 1 1 120px; background: #fff; border-radius: 8px; padding: 10px 12px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.er-totales__label { display: block; font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: .04em; }
.er-totales__value { display: block; font-size: 16px; font-weight: 800; color: #111; }
.er-totales__pct { display: block; font-size: 12px; color: #555; }

/* Footer */
.er-foot { margin-top: 14px; font-size: 11px; color: #888; line-height: 1.5; }
.er-foot p { margin: 0; }
.er-foot__meta { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: #444; }

.er-empty, .er-results--error { padding: 24px; text-align: center; color: #666; }

/* ---------- 728x90 banner ---------- */
.er-banner {
	display: flex; align-items: center; gap: 16px;
	width: 728px; max-width: 100%; height: 90px; box-sizing: border-box;
	margin: 0 auto; padding: 0 22px;
	background: linear-gradient(135deg, #003057 0%, #00509e 100%);
	color: #fff; text-decoration: none; border-radius: 6px; overflow: hidden;
	font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	transition: transform .15s ease, box-shadow .15s ease;
}
.er-banner:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.er-banner__flag { display: flex; flex-direction: column; width: 10px; height: 54px; border-radius: 2px; overflow: hidden; flex: 0 0 auto; }
.er-banner__flag i { display: block; flex: 1; }
.er-banner__flag i:nth-child(1) { background: #FCD116; }
.er-banner__flag i:nth-child(2) { background: #fff; }
.er-banner__flag i:nth-child(3) { background: #CE1126; }
.er-banner__text { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.er-banner__text strong { font-size: 20px; font-weight: 800; letter-spacing: .08em; }
.er-banner__text small { font-size: 13px; font-weight: 600; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.er-banner__cta { flex: 0 0 auto; background: #FCD116; color: #003057; font-weight: 800; font-size: 14px; padding: 10px 18px; border-radius: 4px; white-space: nowrap; }

/* ---------- Responsive ---------- */

/* Tablets / large phones */
@media (max-width: 760px) {
	.er-results { padding: 12px; }
	.er-head { padding: 10px 4px 14px; }
	.er-head__title { font-size: 18px; }

	/* Banner: allow the row to wrap so text + CTA never overflow. */
	.er-banner { height: auto; min-height: 80px; padding: 12px 14px; gap: 12px; flex-wrap: wrap; }
	.er-banner__text { flex-basis: calc(100% - 80px); }
	.er-banner__text strong { font-size: 16px; }
	.er-banner__text small { white-space: normal; }
	.er-banner__cta { font-size: 13px; padding: 8px 14px; }

	/* Highlighted card: photo + info on one row, numbers wrap below. */
	.er-card__body { flex-wrap: wrap; }
	.er-card__photo { width: 64px; height: 64px; }
	.er-card__name { font-size: 16px; }
	.er-card__numbers { width: 100%; text-align: left; display: flex; align-items: baseline; gap: 8px; margin-top: 4px; }
	.er-card__pct { font-size: 26px; }
	.er-card__votes-label { margin: 0; }
}

/* Small phones */
@media (max-width: 480px) {
	.er-results { padding: 10px; border-radius: 0; }
	.er-head__kicker { font-size: 12px; }
	.er-head__title { font-size: 16px; }

	.er-banner { gap: 10px; padding: 10px 12px; }
	.er-banner__flag { height: 40px; }
	.er-banner__text strong { font-size: 15px; }
	.er-banner__text small { font-size: 11px; }
	.er-banner__cta { width: 100%; text-align: center; }

	.er-card__rank { padding-left: 14px; }
	.er-card__body { padding: 6px 12px 12px 14px; gap: 10px; }
	.er-card__pct { font-size: 22px; }

	/* Others rows: tighter, smaller avatar, numbers stay aligned right. */
	.er-row { padding: 10px; gap: 8px; }
	.er-row__photo { width: 34px; height: 34px; }
	.er-row__rank { width: 14px; font-size: 12px; }
	.er-row__name { font-size: 13px; }
	.er-row__pct { font-size: 16px; }

	/* Totals: two per row on small screens. */
	.er-totales__item { flex: 1 1 calc(50% - 8px); }

	/* Chrome stacks: tabs + ámbito selector full width. */
	.er-chrome { flex-direction: column; align-items: stretch; }
	.er-tabs { justify-content: center; }
	.er-tab { flex: 1 1 auto; text-align: center; }
	.er-ambito { justify-content: space-between; }
	.er-ambito__select { max-width: none; flex: 1 1 auto; }
}

/* Respect reduced-motion preferences. */
@media (prefers-reduced-motion: reduce) {
	.er-wrap.er-flash .er-card__numbers,
	.er-wrap.er-flash .er-row__numbers { animation: none; }
	.er-banner { transition: none; }
}
