/* ─────────────────────────────────────────────────────────────
   FXS Live-Tweets Widget — 4 Animations-Modi
   Nutzt fxmag-Theme-CSS-Variablen (--bloom-*) für Dark/Light-Mode.
   Settings tweets_bg_mode (auto/light/dark) erzwingt ggf. Werte.
   ───────────────────────────────────────────────────────────── */

.fxmag-tweets,
.fxmag-tweets-hero {
  /* Default: Dark (passend zum fxmag-Default), Light wird per [data-theme="light"] gesetzt */
  --fxmag-tw-bg:        #111111;
  --fxmag-tw-bg-alt:    #181818;
  --fxmag-tw-text:      #f0f0f0;
  --fxmag-tw-text-soft: #c8c8c8;
  --fxmag-tw-muted:     #8a8a8a;
  --fxmag-tw-border:    #262626;
  --fxmag-tw-accent:    #f97316;
  --fxmag-tw-radius:    6px;
  --fxmag-tw-duration:  35s;

  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--fxmag-tw-text);
  background: var(--fxmag-tw-bg);
  border: 1px solid var(--fxmag-tw-border);
  border-radius: var(--fxmag-tw-radius);
  overflow: hidden;
  position: relative;
}

/* Light-Mode: automatisch via data-theme="light" (fxmag-Theme-Toggle) */
html[data-theme="light"] .fxmag-tweets,
html[data-theme="light"] .fxmag-tweets-hero {
  --fxmag-tw-bg:        #ffffff;
  --fxmag-tw-bg-alt:    #fafafa;
  --fxmag-tw-text:      #1a1a1a;
  --fxmag-tw-text-soft: #444444;
  --fxmag-tw-muted:     #777777;
  --fxmag-tw-border:    #e5e5e5;
}

/* Erzwungener Light-Mode (Settings bg_mode=light, überschreibt auch im Dark-Theme) */
.fxmag-tweets.fxmag-tweets--bg-light,
.fxmag-tweets-hero.fxmag-tweets--bg-light {
  --fxmag-tw-bg:        #ffffff;
  --fxmag-tw-bg-alt:    #fafafa;
  --fxmag-tw-text:      #1a1a1a;
  --fxmag-tw-text-soft: #444444;
  --fxmag-tw-muted:     #777777;
  --fxmag-tw-border:    #e5e5e5;
}

/* Erzwungener Dark-Mode (Settings bg_mode=dark) — bleibt dark auch im Light-Theme */
.fxmag-tweets.fxmag-tweets--bg-dark,
.fxmag-tweets-hero.fxmag-tweets--bg-dark {
  --fxmag-tw-bg:        #111111;
  --fxmag-tw-bg-alt:    #181818;
  --fxmag-tw-text:      #f0f0f0;
  --fxmag-tw-text-soft: #c8c8c8;
  --fxmag-tw-muted:     #8a8a8a;
  --fxmag-tw-border:    #262626;
}

/* Schriftgrößen */
.fxmag-tweets--size-s .fxmag-tweets__text { font-size: .82rem; }
.fxmag-tweets--size-m .fxmag-tweets__text { font-size: .92rem; }
.fxmag-tweets--size-l .fxmag-tweets__text { font-size: 1.05rem; }

/* ─── Title-Header ─── */
.fxmag-tweets__title {
  display: flex; align-items: center; gap: .5rem;
  padding: .55rem .8rem;
  background: var(--fxmag-tw-bg-alt);
  border-bottom: 1px solid var(--fxmag-tw-border);
  font-size: .72rem; text-transform: uppercase; letter-spacing: .12em;
  color: var(--fxmag-tw-muted); font-weight: 600;
}
.fxmag-tweets__dot {
  display: inline-block; width: 8px; height: 8px;
  background: #ef4444; border-radius: 50%;
  animation: fxmagTwPulse 1.6s infinite;
  box-shadow: 0 0 6px rgba(239,68,68,.6);
}
@keyframes fxmagTwPulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.4;transform:scale(.8)} }
.fxmag-tweets__more {
  margin-left: auto; color: var(--fxmag-tw-muted); text-decoration: none;
  font-size: .68rem; font-weight: 500;
}
.fxmag-tweets__more:hover { color: var(--fxmag-tw-accent); }

/* ─── Viewport + Track (für Animationen) ─── */
.fxmag-tweets__viewport { overflow: hidden; }
.fxmag-tweets__track { display: flex; flex-direction: column; }

/* ─── Item ─── */
.fxmag-tweets__item {
  padding: .65rem .8rem;
  border-bottom: 1px solid var(--fxmag-tw-border);
  transition: background .15s ease;
}
.fxmag-tweets__item:last-child { border-bottom: 0; }
.fxmag-tweets__item:hover { background: var(--fxmag-tw-bg-alt); }
.fxmag-tweets__item-link {
  display: flex; gap: .65rem; align-items: baseline;
  text-decoration: none; color: var(--fxmag-tw-text);
}
.fxmag-tweets__time {
  flex-shrink: 0;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: .7rem; color: var(--fxmag-tw-muted);
  font-weight: 600; letter-spacing: .04em;
  min-width: 3em;
}
.fxmag-tweets__text { line-height: 1.45; color: var(--fxmag-tw-text); }
.fxmag-tweets__text strong { color: var(--fxmag-tw-accent); font-weight: 700; }

/* ─── Modus: vertical_scroll ─── */
.fxmag-tweets--vertical-scroll .fxmag-tweets__viewport { height: 220px; }
.fxmag-tweets--vertical-scroll .fxmag-tweets__track {
  animation: fxmagTwScrollY var(--fxmag-tw-duration) linear infinite;
}
@keyframes fxmagTwScrollY {
  0%   { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}
.fxmag-tweets--vertical-scroll.fxmag-tweets--pause-hover:hover .fxmag-tweets__track {
  animation-play-state: paused;
}

/* ─── Modus: horizontal_marquee ─── */
.fxmag-tweets--horizontal-marquee .fxmag-tweets__track {
  flex-direction: row; flex-wrap: nowrap; width: max-content;
  animation: fxmagTwScrollX var(--fxmag-tw-duration) linear infinite;
}
.fxmag-tweets--horizontal-marquee .fxmag-tweets__item {
  flex-shrink: 0; border-bottom: 0;
  border-right: 1px solid var(--fxmag-tw-border);
  padding: .55rem 1rem;
}
.fxmag-tweets--horizontal-marquee .fxmag-tweets__item-link {
  flex-direction: row; gap: .55rem; white-space: nowrap;
  max-width: 600px; overflow: hidden; text-overflow: ellipsis;
}
.fxmag-tweets--horizontal-marquee .fxmag-tweets__text {
  overflow: hidden; text-overflow: ellipsis; display: inline-block;
  max-width: 540px; white-space: nowrap;
}
@keyframes fxmagTwScrollX {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.fxmag-tweets--horizontal-marquee.fxmag-tweets--pause-hover:hover .fxmag-tweets__track {
  animation-play-state: paused;
}

/* ─── Modus: fade_carousel ─── */
.fxmag-tweets--fade-carousel .fxmag-tweets__viewport { min-height: 90px; position: relative; }
.fxmag-tweets--fade-carousel .fxmag-tweets__track { position: relative; }
.fxmag-tweets--fade-carousel .fxmag-tweets__item {
  position: absolute; left: 0; right: 0; top: 0;
  opacity: 0; transition: opacity .45s ease;
  border-bottom: 0;
}
.fxmag-tweets--fade-carousel .fxmag-tweets__item.is-active { opacity: 1; }

/* ─── Modus: static_list ─── */
.fxmag-tweets--static-list .fxmag-tweets__viewport { max-height: none; }

/* ─────────────────────────────────────────────────────────────
   Hero-Box (Homepage) — 1-Zeilen-Teaser, optional Marquee
   ───────────────────────────────────────────────────────────── */
.fxmag-tweets-hero {
  display: block;
  max-width: 1200px;
  margin: .35rem auto 1rem;
  border-top: 1px solid var(--fxmag-tw-border);
  border-bottom: 1px solid var(--fxmag-tw-border);
  background: transparent;
  text-decoration: none; color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  transition: border-color .15s ease;
  overflow: hidden;
}
.fxmag-tweets-hero:hover {
  border-color: var(--fxmag-tw-accent);
}

.fxmag-tweets-hero__bar {
  display: flex; align-items: stretch; gap: 0;
  min-height: 36px;
  position: relative;
}

/* LIVE-Pille links — eigene Box */
.fxmag-tweets-hero__tag-box {
  flex-shrink: 0;
  display: flex; align-items: center; gap: .35rem;
  padding: 0 .65rem;
  border-right: 1px solid var(--fxmag-tw-border);
}
.fxmag-tweets-hero__dot {
  flex-shrink: 0;
  display: inline-block; width: 6px; height: 6px;
  background: #ef4444; border-radius: 50%;
  animation: fxmagTwPulse 1.6s infinite;
  box-shadow: 0 0 4px rgba(239,68,68,.6);
}
.fxmag-tweets-hero__tag {
  font-size: .62rem; font-weight: 800;
  letter-spacing: .14em; text-transform: uppercase;
  color: #ef4444;
}

.fxmag-tweets-hero__viewport {
  flex: 1 1 auto; min-width: 0;
  overflow: hidden;
  position: relative;
  padding: 0 .5rem;
  /* Sanftes Fade-Out an den Rändern */
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 4%, #000 96%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 4%, #000 96%, transparent 100%);
}

.fxmag-tweets-hero__track {
  display: flex; flex-wrap: nowrap;
  align-items: center;
  white-space: nowrap;
  gap: 2.5rem;
  height: 100%;
}

.fxmag-tweets-hero__item {
  display: inline-flex; align-items: center;
  gap: .45rem;
  flex-shrink: 0;
  /* Pro Tweet max ~320px → 3-4 sichtbar nebeneinander auf Desktop */
  max-width: 320px;
}

.fxmag-tweets-hero__time {
  flex-shrink: 0;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: .68rem; color: var(--fxmag-tw-muted);
  font-weight: 700;
}

.fxmag-tweets-hero__ticker {
  flex-shrink: 0;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: .62rem; font-weight: 600;
  padding: 0 .3rem;
  border: 1px solid var(--fxmag-tw-border);
  border-radius: 2px;
  color: var(--fxmag-tw-text-soft);
}

.fxmag-tweets-hero__text {
  font-size: 1rem; line-height: 1.3;
  color: #ffffff;
  overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;
}
html[data-theme="light"] .fxmag-tweets-hero__text { color: #1a1a1a; }
.fxmag-tweets-hero__text strong { color: var(--fxmag-tw-accent); font-weight: 700; }

.fxmag-tweets-hero__cta {
  flex-shrink: 0;
  display: flex; align-items: center;
  font-size: .62rem; text-transform: uppercase; letter-spacing: .1em;
  font-weight: 700; color: var(--fxmag-tw-accent);
  padding: 0 .65rem;
  border-left: 1px solid var(--fxmag-tw-border);
}

/* Static-Mode: nur EIN Item sichtbar, rest fade-out */
.fxmag-tweets-hero:not(.fxmag-tweets-hero--marquee) .fxmag-tweets-hero__item ~ .fxmag-tweets-hero__item {
  display: none;
}

/* Marquee-Mode: rolling stream nach links — schnell genug für visuelle Bewegung */
.fxmag-tweets-hero--marquee .fxmag-tweets-hero__track {
  animation: fxmagTwHeroScroll 22s linear infinite;
  width: max-content;
  will-change: transform;
}
.fxmag-tweets-hero--marquee:hover .fxmag-tweets-hero__track {
  animation-play-state: paused;
}
@keyframes fxmagTwHeroScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@media (max-width: 720px) {
  .fxmag-tweets-hero__bar { flex-wrap: wrap; gap: .5rem; padding: .5rem .65rem; }
  .fxmag-tweets-hero__cta { border-left: 0; padding-left: 0; width: 100%; }
}
