
/* ============================================================
   banners.css – LJH Webb
   Nyhetsbanner med stabil rullning (Marquee)
   Version 4.0 – 2025-11-09
   ------------------------------------------------------------
   🎯 Funktioner:
   • Horisontell ticker med konstant hastighet (px/sek)
   • Sömlös loop (dubbelspår)
   • Startar omedelbart när sidan laddas
   • Pausas vid hover
   ============================================================ */


/* ============================================================
   [1] BASLAGER – Bannerutseende och färger
   ============================================================ */
.ljh-banner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 1rem;
  background: linear-gradient(to right, #2563eb, #3b82f6, #4338ca);
  color: #fff;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.shadow-banner {
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
}

/* --- Vänstra etiketten ("Nyheter") --- */
.ljh-banner .label {
  flex-shrink: 0;
  padding-right: 1rem;
  border-right: 1px solid rgba(255, 255, 255, 0.3);
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0.85;
}

/* --- Höger CTA-knapp ("Rösta & påverka") --- */
.ljh-banner a {
  flex-shrink: 0;
  margin-left: 1rem;
  background: rgba(255, 255, 255, 0.9);
  color: #2563eb;
  padding: 0.4rem 1rem;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  transition: background 0.3s ease;
}
.ljh-banner a:hover {
  background: #fff;
}

/* ============================================================
   [2] INFO-RUTA (för version-info-box om den finns)
   ============================================================ */
#version-info-box {
  animation: fadeInUp 0.8s ease;
}

@keyframes fadeInUp {
  0% { opacity: 0; transform: translateY(20px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================================
   [3] MARQUEE-TICKER – Själva rullningen
   ============================================================ */

/* --- [A] Viewport (mask) som klipper innehållet --- */
.ljh-ticker-viewport {
  position: relative;
  flex: 1 1 auto;
  height: 1.5rem;        /* höjden på ticker-raden */
  overflow: hidden;      /* döljer text utanför ramen */
  display: flex;
  align-items: center;
}

/* --- [B] Spår (track) – den rullande raden av text --- */
.ljh-ticker-track {
  position: absolute;
  top: 0;
  left: 0;
  white-space: nowrap;
  display: inline-block;
  will-change: transform;
  padding-right: 2rem;   /* lite luft i slutet */
  opacity: 1;
}

/* --- [C] Ticker-länkar (nyhetsrubriker) --- */
.ticker-item {
  color: #fff;
  text-decoration: none;
  margin-right: 1rem;
  font-weight: 500;
  font-size: 1rem;
}
.ticker-item:hover {
  text-decoration: underline;
}

/* --- [D] Separator mellan nyheter --- */
.sep {
  opacity: 0.75;
  margin: 0 0.75rem;
}

/* --- [E] När .is-running sätts på viewport --- */
.ljh-ticker-viewport.is-running .ljh-ticker-track {
  animation: ljh-marquee var(--scroll-duration, 20s) linear infinite;
}

/* --- [F] Klonen (andra spåret) för sömlös loop --- */
.ljh-ticker-viewport.is-running #ljh-news-track-clone {
  animation-delay: calc(var(--scroll-duration, 20s) / 2);
}

/* --- [G] Själva rörelsen: konstant vänster-scroll --- */
@keyframes ljh-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(calc(-1 * var(--track-width, 1000px))); }
}

/* --- [H] Paus vid hover --- */
.ljh-ticker-viewport:hover .ljh-ticker-track {
  animation-play-state: paused;
}

/* ============================================================
   [4] RESPONSIV JUSTERING
   ============================================================ */
@media (max-width: 768px) {
  .ljh-ticker-viewport { height: 1.35rem; }
  .ticker-item { font-size: 0.9rem; margin-right: 0.75rem; }
}





