/* THE HERALD — global announcement banner (profiles-banner lane).
 * Design: hidden_files/profiles-banner-DESIGN.md §4.
 * Site tokens mirrored from styles.css so the module stands alone on any
 * host page: --gold #c9a227, --gold-lt #e8c35a, --bone #ece0c4, --ink #0c0716.
 * Floors: item text .85rem Cinzel at full bone (opacity 1 — reading text),
 * dismiss target 40x40 (the bar's full height). */
.kg-herald {
  position: relative;
  z-index: 60;
  display: flex;
  align-items: stretch;
  height: 44px;
  overflow: hidden;
  background: linear-gradient(180deg, #17102a 0%, #0c0716 55%, #08040f 100%);
  border-top: 1px solid rgba(201, 162, 39, .42);
  border-bottom: 1px solid rgba(201, 162, 39, .42);
  color: #ece0c4;
  font-family: 'Cinzel', serif;
  pointer-events: none; /* never blocks play (§4.3) */
}
.kg-herald-badge {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  padding: 0 .8rem;
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #0c0716;
  background: linear-gradient(180deg, #e8c35a, #c9a227);
  white-space: nowrap;
  line-height: 1.3;
}
.kg-herald-viewport {
  flex: 1 1 auto;
  overflow: hidden;
  display: flex;
  align-items: center;
}
.kg-herald-track {
  display: flex;
  flex: 0 0 auto;
  white-space: nowrap;
  animation: kg-herald-scroll 30s linear infinite;
}
.kg-herald:hover .kg-herald-track, .kg-herald:focus-within .kg-herald-track { animation-play-state: paused; }
/* The reserved slot (ticker component batch): exactly the bar's box,
 * so swapping slot -> bar moves nothing on the page. */
.kg-herald-slot { height: 44px; }
.kg-herald-pass { display: inline-flex; align-items: center; }
.kg-herald-item {
  font-size: .85rem;
  letter-spacing: .06em;
  line-height: 1.5;
  padding: 0 .4rem;
  white-space: nowrap;
}
.kg-herald-ico { color: #e8c35a; display: inline-block; line-height: 1; font-size: .8rem; vertical-align: baseline; }
.kg-herald-sep { color: rgba(201, 162, 39, .9); padding: 0 .6rem; font-size: .7rem; line-height: 1; }
.kg-herald-x {
  pointer-events: auto; /* the one interactive pixel of the bar */
  flex: 0 0 auto;
  width: 40px;
  height: 44px;
  border: 0;
  background: transparent;
  color: #ece0c4;
  font-size: .85rem;
  cursor: pointer;
  opacity: .95;
}
.kg-herald-x:hover, .kg-herald-x:focus-visible { color: #e8c35a; opacity: 1; }
/* Reduced motion: static rotation (§4.4) */
.kg-herald-static { flex: 1 1 auto; display: flex; align-items: center; overflow: hidden; padding-left: .6rem; }
.kg-herald-static .kg-herald-item { display: none; }
.kg-herald-static .kg-herald-item.is-current { display: block; overflow: hidden; text-overflow: ellipsis; }
/* Batch 2 (playtest): a long announcement in the static rotation was
 * cut off at an ellipsis and never readable in full. An item wider
 * than the bar now drifts left and back, so every word passes through
 * the window; the drift distance and duration are set per item from
 * its measured overflow (see kg-announce.js fitStatic). */
.kg-herald-static .kg-herald-item.is-current.kg-drift { animation: kg-herald-drift var(--kg-drift-dur, 12s) ease-in-out infinite alternate; }
@keyframes kg-herald-drift {
  0%, 16% { transform: translateX(0); }
  84%, 100% { transform: translateX(calc(-1 * var(--kg-drift-x, 0px))); }
}
@keyframes kg-herald-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .kg-herald-track { animation: none; }
}
@media (max-width: 640px) {
  .kg-herald-badge { display: none; } /* the ribbon keeps its full width for names on phones */
  .kg-herald-item { font-size: .82rem; }
}

/* Urgent visual fix (Dec 3, 2026): when one pass of the feed fits the
 * viewport whole, the bar holds it still and centred: every word sits
 * inside the frame, nothing scrolls out at either edge. The class is
 * set by kg-announce.js and re-evaluated on resize and zoom. */
.kg-herald-fit .kg-herald-track { animation: none; }
.kg-herald-fit .kg-herald-viewport { justify-content: center; }
.kg-herald-fit .kg-herald-pass + .kg-herald-pass { display: none; }
