/**
 * Referendum Barra Widget — Compact bar
 * Desktop + Mobile responsive stylesheet
 * Plugin: IFQ Voting Widgets
 */

/* ========================= */
/* VARIABLES                 */
/* ========================= */

.ifq-ref-barra {
  --si:       #1f6f78;
  --no:       #d97706;
  --text:     #262424;
  --muted:    #5c5c5c;
  --rule:     #e5e7eb;
  --accent:   #e11d48;
}

.ifq-ref-barra *,
.ifq-ref-barra *::before,
.ifq-ref-barra *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ========================= */
/* CARD SHELL                */
/* ========================= */

.ifq-ref-barra {
  display: block;
  width: 100%;
  max-width: 1040px;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
  font-family: "TT Norms", system-ui, sans-serif;
  cursor: pointer;
  margin-bottom: 1rem;
}

.ifq-ref-barra-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.ifq-ref-barra-link:hover {
  text-decoration: none;
}

/* ========================= */
/* MAIN ROW                  */
/* ========================= */

.ifq-ref-barra-main {
  padding: 16px 28px;
  display: flex;
  align-items: center;
  gap: 20px;
}

/* ========================= */
/* TITLE BLOCK (left)        */
/* ========================= */

.ifq-ref-barra-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ifq-ref-barra-name {
  font-family: "EB Garamond", serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
  text-transform: none;
  display: flex;
  align-items: center;
  gap: 7px;
}

/* ========================= */
/* LIVE DOT                  */
/* ========================= */

.ifq-ref-barra-dot {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ifq-ref-barra-dot::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--accent);
  z-index: 1;
}
.ifq-ref-barra-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: rgba(225,29,72,0.25);
  animation: ifq-ref-barra-pulse 2s ease-out infinite;
}

@keyframes ifq-ref-barra-pulse {
  0%        { transform: scale(0.5); opacity: 0.9; }
  70%, 100% { transform: scale(1.7); opacity: 0; }
}

/* ========================= */
/* BAR ROW                   */
/* ========================= */

.ifq-ref-barra-row {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 14px;
}

/* ========================= */
/* PERCENTAGES               */
/* ========================= */

.ifq-ref-barra-pct {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  width: auto;
  text-align: center;
  flex-shrink: 0;
  line-height: 1;
}

/* ========================= */
/* LABELS SÌ / NO            */
/* ========================= */

.ifq-ref-barra-lbl {
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ========================= */
/* TRACK + FILL              */
/* ========================= */

.ifq-ref-barra-track {
  flex: 1;
  height: 8px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.ifq-ref-barra-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 999px;
}

/* ========================= */
/* RESPONSIVE — mobile ≤640  */
/* ========================= */

.ifq-ref-barra[data-layout="mobile"] .ifq-ref-barra-main {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 10px;
}

.ifq-ref-barra[data-layout="mobile"] .ifq-ref-barra-title {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.ifq-ref-barra[data-layout="mobile"] .ifq-ref-barra-row {
  gap: 4px;
}

.ifq-ref-barra[data-layout="mobile"] .ifq-ref-barra-pct {
  font-size: 16px;
  text-align: left;
  width: auto;
}

.ifq-ref-barra[data-layout="mobile"] .ifq-ref-barra-lbl {
  font-size: 10px;
}
