/* Task 29.3/29.4 + Task 33/33.5 Israel Edition — seamless ticker; brand on screen-right */
:root {
  --hnw-h: 38px;
  --hnw-bg: #141518;
  --hnw-bg-2: #0f1013;
  --hnw-gold: #B89A59;
  --hnw-gold-line: rgba(184, 154, 89, 0.35);
  --hnw-ink: #E8E0D2;
  --hnw-muted: #9A948A;
  --hnw-sans: "Assistant", "Heebo", Inter, system-ui, sans-serif;
}

.he-news-wire {
  box-sizing: border-box;
  height: var(--hnw-h);
  min-height: var(--hnw-h);
  max-height: var(--hnw-h);
  width: 100%;
  max-width: 100%;
  display: flex;
  align-items: stretch;
  background: linear-gradient(180deg, var(--hnw-bg) 0%, var(--hnw-bg-2) 100%);
  border-bottom: 1px solid var(--hnw-gold-line);
  color: var(--hnw-ink);
  font-family: var(--hnw-sans);
  overflow: hidden;
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 110;
}

.he-news-wire[hidden] {
  display: none !important;
}

.he-news-wire * { box-sizing: border-box; }

/*
 * Fixed brand on the RIGHT edge of the strip.
 * Gold hairline on the brand's left separates labels from the ticker.
 * News stream fills all remaining space to the left (flex-grow track-wrap).
 */
.he-news-wire__brand {
  flex: 0 0 auto;
  order: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start; /* RTL: toward screen-right */
  padding: 0 10px 0 8px;
  border-left: 1px solid var(--hnw-gold-line);
  background: rgba(184, 154, 89, 0.06);
  min-width: 0;
  max-width: 118px;
  direction: rtl;
}

.he-news-wire__label {
  font-size: 10px;
  letter-spacing: 0.03em;
  color: var(--hnw-gold);
  white-space: nowrap;
  line-height: 1.15;
}

.he-news-wire__meta {
  font-size: 9px;
  color: var(--hnw-muted);
  white-space: nowrap;
  line-height: 1.15;
  margin-top: 1px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.he-news-wire__meta[data-live="true"]::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--hnw-gold);
  opacity: 0.75;
  display: inline-block;
  flex: 0 0 auto;
}

.he-news-wire__track-wrap {
  order: 1;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 12px), transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 12px), transparent);
}

/*
 * Track is LTR flex for stable px math.
 * Each set is RTL so Hebrew headlines read correctly.
 * Animation shifts exactly --hnw-shift (one set width).
 */
.he-news-wire__track {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  width: max-content;
  height: 100%;
  will-change: transform;
  direction: ltr;
}

.he-news-wire__track.is-ready {
  animation: he-news-marquee-rtl var(--hnw-duration, 60s) linear infinite;
}

.he-news-wire:hover .he-news-wire__track.is-ready,
.he-news-wire:focus-within .he-news-wire__track.is-ready {
  animation-play-state: paused;
}

.he-news-wire__set {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  flex: 0 0 auto;
  height: 100%;
  direction: rtl;
}

@keyframes he-news-marquee-rtl {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(calc(-1 * var(--hnw-shift, 0px)), 0, 0); }
}

.he-news-wire__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  text-decoration: none;
  color: var(--hnw-ink);
  font-size: 13px;
  line-height: 1;
  max-width: min(56vw, 520px);
  flex: 0 0 auto;
  border-left: 1px solid var(--hnw-gold-line);
}

.he-news-wire__item:hover,
.he-news-wire__item:focus-visible {
  color: #F3EBD8;
  outline: none;
}

.he-news-wire__title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  min-width: 0;
}

.he-news-wire__source {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  line-height: 0;
  color: transparent;
  /* no glow / filter — clean blue Magen David */
}

.he-news-wire__star {
  display: block;
  width: 20px;
  height: 20px;
  object-fit: contain;
  object-position: center;
  flex: 0 0 auto;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.he-news-wire__time {
  flex: 0 0 auto;
  font-size: 10px;
  color: var(--hnw-muted);
  font-variant-numeric: tabular-nums;
}

.he-news-wire__empty {
  padding: 0 16px;
  font-size: 12px;
  color: var(--hnw-muted);
  display: flex;
  align-items: center;
  height: 100%;
}

body.he-news-wire-above-active .app-header {
  top: var(--hnw-h);
}

body.he-news-wire-above-active {
  overflow-x: hidden;
}

@media (max-width: 720px) {
  :root { --hnw-h: 36px; }
  .he-news-wire__brand { max-width: 96px; padding: 0 6px 0 8px; }
  .he-news-wire__label { font-size: 9px; }
  .he-news-wire__meta { display: none; }
  .he-news-wire__item { font-size: 12px; padding: 0 10px; max-width: 78vw; }
}

@media (prefers-reduced-motion: reduce) {
  .he-news-wire__track.is-ready {
    animation: none !important;
    transform: none !important;
  }
  .he-news-wire__track-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    mask-image: none;
    -webkit-mask-image: none;
  }
}
