/* Alanews Trends Bar — v2.0
   Layout: 3 sezioni fisse — ULTIM'ORA (rosso) | TREND (Corriere) | LIVE (Repubblica). */

.alanews-trends-bar-wrap {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #fff;
  display: block !important;
  box-sizing: border-box;
  border-bottom: 1px solid #e5e7eb;
}

.alanews-trends-bar {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  flex-wrap: wrap;
  row-gap: 6px;
  column-gap: 20px;
  padding: 8px 0 !important;
  width: 100%;
  max-width: var(--wp--style--global--content-size, 1200px) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  text-align: left !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 13px;
  line-height: 1.3;
  min-height: 36px;
  box-sizing: border-box;
}
.alanews-trends-bar > * { flex-shrink: 0; }

/* Spaziatore: spinge TREND + LIVE a destra, ULTIM'ORA resta a sinistra. */
.alanews-tb-spacer { flex: 1 1 auto; min-width: 0; }

/* Gap per-sezione configurabile dal feed Mirror+ (style.gap_before_px). */
.alanews-trends-bar > [style*="--alanews-tb-gap-before"] {
  margin-left: var(--alanews-tb-gap-before, 0);
}

/* Pills per titoli AI con separatore "|" (sezione TREND). */
.alanews-tb-pill {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(29, 78, 216, 0.08);
}
.alanews-tb-pill-sep { margin: 0 4px; color: #9ca3af; }

/* Wrapper icona (override color/size dal feed). */
.alanews-tb-icon-wrap { display: inline-flex; align-items: center; }

/* ─────────── ULTIM'ORA ─────────── */
.alanews-tb-breaking {
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  min-width: 0;
  flex: 0 1 auto;
  max-width: 100%;
}
.alanews-tb-breaking__badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px;
  background: #dc2626;
  color: #fff;
  padding: 6px 12px !important;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 12px;
  line-height: 1 !important;
  height: auto !important;
  vertical-align: middle;
  box-sizing: border-box;
  white-space: nowrap;
  border-radius: 2px 0 0 2px;
}
.alanews-tb-breaking__icon {
  width: 14px;
  height: 14px;
  display: block;
}
.alanews-tb-breaking__label { display: inline-block; }
.alanews-tb-breaking__badge .alanews-tb-breaking__label {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  margin: 0 !important;
  padding: 0 !important;
}
.alanews-tb-breaking__headline {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  color: #111827;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.alanews-tb-breaking__headline:hover { text-decoration: underline; }

/* ─────────── Sezioni TREND / LIVE ─────────── */
.alanews-tb-section {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.alanews-tb-section__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  font-size: 13px;
  line-height: 1;
}
.alanews-tb-section__label--trend { color: #1d4ed8; }
.alanews-tb-section__label--live  { color: #dc2626; }

/* Pallino LIVE pulsante */
.alanews-tb-live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #dc2626;
  box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.6);
  animation: alanews-tb-pulse 1.6s ease-out infinite;
}
@keyframes alanews-tb-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
  100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .alanews-tb-live-dot { animation: none; }
}

/* Items list */
.alanews-tb-items {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.alanews-tb-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
}
.alanews-tb-item a {
  color: #111827;
  text-decoration: none;
}
.alanews-tb-item a:hover { text-decoration: underline; }
.alanews-tb-sep {
  color: #9ca3af;
  font-weight: 300;
}

/* ─────────── Mobile ─────────── */
@media (max-width: 640px) {
  .alanews-trends-bar-wrap.is-desktop-only { display: none; }
  .alanews-trends-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    column-gap: 12px;
    padding: 6px 12px !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    row-gap: 0;
  }
  .alanews-trends-bar::-webkit-scrollbar { display: none; }
  .alanews-tb-breaking { flex: 0 0 auto; }
  .alanews-tb-breaking__headline {
    max-width: 60vw;
  }
}
