/* ================================================================
   CM Election Widget BANNER — prefisso .cm-ewb
   Dimensioni: 1020px × 120px
   ================================================================ */

.cm-ewb *,
.cm-ewb *::before,
.cm-ewb *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.cm-ewb {
  font-family: Arial, Helvetica, sans-serif;
  height: 120px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #1c1c1c;
  box-shadow: 0 3px 16px rgba(0,0,0,0.28);
  border-radius: 6px;
}

/* ---------- Header ---------- */
.cm-ewb__header {
  height: 22px;
  min-height: 22px;
  background: #bb0000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  border-bottom: 2px solid #7a0000;
  gap: 8px;
}

.cm-ewb__header-left {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.cm-ewb__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  flex-shrink: 0;
  animation: cm-ewb-pulse 1.6s ease-in-out infinite;
}

@keyframes cm-ewb-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}

.cm-ewb__title {
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.cm-ewb__subtitle {
  color: #ffcccc;
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.cm-ewb__sep {
  color: rgba(255,255,255,0.4);
  font-size: 10px;
}

.cm-ewb__header-right {
  color: rgba(255,255,255,0.55);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---------- Cards ---------- */
.cm-ewb__cards {
  flex: 1;
  display: flex;
  overflow: hidden;
  /* loading state */
  align-items: center;
  justify-content: center;
}

.cm-ewb__card {
  flex: 1 1 0;
  height: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  overflow: hidden;
  border-right: 1px solid #2e2e2e;
  cursor: default;
  transition: flex 0.3s ease;
}

.cm-ewb__card:last-child {
  border-right: none;
}

/* Foto intera a sinistra */
.cm-ewb__photo-wrap {
  height: 100%;
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.cm-ewb__photo-wrap img {
  height: 100%;
  width: auto;
  display: block;
  border: none;
}

/* Info a destra della foto */
.cm-ewb__overlay {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 0 8px;
  gap: 4px;
  min-width: 0;
}

.cm-ewb__name {
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
  line-height: 1;
}

.cm-ewb__pct-row {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 1px;
  line-height: 1;
}

.cm-ewb__pct-num {
  font-size: 26px;
  font-weight: 900;
  color: #ff4444;
  line-height: 1;
}

.cm-ewb__pct-sym {
  font-size: 13px;
  font-weight: 700;
  color: #ff4444;
  line-height: 1;
}

.cm-ewb__bar-bg {
  width: 100px;
  height: 5px;
  background: rgba(255,255,255,0.18);
  border-radius: 3px;
  overflow: hidden;
}

.cm-ewb__bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #880000 0%, #ee2222 100%);
  width: 0%;
  transition: width 1.1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Loading / errore */
.cm-ewb__loading,
.cm-ewb__error {
  color: #aaa;
  font-size: 12px;
  font-family: Arial, Helvetica, sans-serif;
}

.cm-ewb__error {
  color: #e87070;
}