/* "Latest News" ticker in the website's top utility bar (home page + inner pages).
   Markup: resources/views/partials/header-ticker.blade.php. The bar keeps its existing height. */

/* Utility bar when the ticker is shown: thin navy line on top (inset, so the height is unchanged). */
.utility-bar.has-news,
.lp-utility-bar.has-news { box-shadow: inset 0 3px 0 #0b1b40; }
.utility-inner.has-news,
.lp-utility-inner.has-news { gap: 14px; }
.has-news > .contact-links,
.has-news > .lp-contact-links { flex: 0 0 auto; flex-wrap: nowrap; }

.nt {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  height: 30px;
  font-family: var(--font-cn, inherit);
}

/* Orange arrow label (fixed) */
.nt-label {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 24px 0 12px;
  background: linear-gradient(90deg, #ff9500 0%, #ff5900 100%);
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.1px;
  white-space: nowrap;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%);
}

/* Scrolling area: only this part moves */
.nt-viewport {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  margin-left: 8px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 22px), transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 22px), transparent 100%);
}
.nt-track {
  display: flex;
  width: max-content;
  height: 100%;
  animation: nt-scroll var(--nt-duration, 30s) linear infinite;
  will-change: transform;
}
.nt-group {
  flex: none;
  display: flex;
  align-items: center;
  height: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nt-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  color: #0b1b40;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.15px;
}
.nt-text { color: inherit; text-decoration: none; }
a.nt-text:hover { text-decoration: underline; text-underline-offset: 3px; }
a.nt-text:focus-visible { outline: 2px solid #0066ff; outline-offset: 3px; border-radius: 3px; }
.nt-badge {
  display: block;
  width: 42px;
  height: auto;
  margin: -2px 0 0 2px;
  animation: nt-pulse 1.6s ease-in-out infinite;
  transform-origin: 50% 50%;
}
.nt-sep {
  flex: none;
  width: 6px;
  height: 6px;
  margin: 0 15px;
  border-radius: 50%;
  background: #0066ff;
}

/* Pause / play control */
.nt-toggle {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin-left: 4px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #dce5f3;
  border-radius: 50%;
  background: #fff;
  color: #4b5d7a;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.nt-toggle:hover { color: #1769ff; border-color: #a9c7ff; }
.nt-toggle:focus-visible { outline: 2px solid #0066ff; outline-offset: 2px; }

/* Pause on hover, keyboard focus, or the pause button */
.nt-viewport:hover .nt-track,
.nt-viewport:focus-within .nt-track,
.nt.is-paused .nt-track { animation-play-state: paused; }
.nt.is-paused .nt-badge { animation-play-state: paused; }

@keyframes nt-scroll {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}
@keyframes nt-pulse {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50%      { transform: scale(1.12) rotate(-4deg); }
}

/* Tablet: the ticker gets its own row under contacts + buttons */
@media (max-width: 1150px) {
  .utility-inner.has-news,
  .lp-utility-inner.has-news { flex-wrap: wrap; row-gap: 6px; min-height: 0; padding-block: 6px 7px; }
  .has-news > .nt { order: 3; flex: 1 0 100%; }
  /* contacts share the first row with the buttons and wrap inside it, as before */
  .has-news > .contact-links,
  .has-news > .lp-contact-links { flex: 1 1 0; min-width: 0; flex-wrap: wrap; }
}

/* Mobile: compact row */
@media (max-width: 720px) {
  /* the bar is a column here; wrapping would size each line to its content */
  .utility-inner.has-news,
  .lp-utility-inner.has-news { flex-wrap: nowrap; padding-block: 8px; row-gap: 8px; }
  .has-news > .nt { flex: 0 0 auto; width: 100%; }
  .has-news > .contact-links,
  .has-news > .lp-contact-links { flex: 0 0 auto; flex-wrap: wrap; }
  .nt { height: 26px; }
  .nt-label { height: 26px; padding: 0 19px 0 9px; font-size: 11.5px; clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 50%, calc(100% - 11px) 100%, 0 100%); }
  .nt-item { font-size: 12px; }
  .nt-badge { width: 34px; }
  .nt-sep { width: 5px; height: 5px; margin: 0 12px; }
  .nt-toggle { width: 20px; height: 20px; font-size: 10px; }
}

/* Reduced motion: no scrolling or pulsing; the list can be swiped / scrolled by hand */
@media (prefers-reduced-motion: reduce) {
  .nt-track { animation: none; }
  .nt-badge { animation: none; }
  .nt-group[aria-hidden="true"], .nt-group > .nt-sep:last-child { display: none; }
  .nt-viewport { overflow-x: auto; scrollbar-width: none; }
  .nt-viewport::-webkit-scrollbar { display: none; }
  .nt-toggle { display: none; }
}
