/*
 * NRWZ Dossierband 1.3.0
 * Alle Farben laufen über lokale Variablen mit Fallback:
 * definiert das Theme --rot, --papier usw., werden diese genutzt.
 *
 * Neu in 1.3.0: Alle Beschriftungen in der Textschrift, normal geschrieben und
 * mindestens 11 px groß, jede Schrift mit mindestens 4,5:1 Kontrast. Keine
 * Monospace-Versalien, keine Zierpunkte mehr; „neu“ steht als Wort.
 * Die Bandhöhe bleibt bei 52 px, der Header springt also nicht.
 */

.nrwz-band{
  --band-rot:        var(--rot,        #BB2727);
  --band-rot-tief:   var(--rot-tief,   #8E1D1D);
  --band-rot-tint:   var(--rot-tint,   #F8EBEB);
  --band-papier:     var(--papier,     #FFFFFF);
  --band-papier-0:   rgba(255,255,255,0);
  --band-flaeche:    #FAFAFA;
  --band-grau:       var(--grau,       #5E646B);
  --band-grau-hell:  #646A70;            /* 4,7:1 auf allen Bandflächen, vorher 3,2:1 */
  --band-grau-aus:   #C4C8CA;            /* nur für deaktivierte Pfeile */
  --band-linie:      var(--linie,      #DBDDDC);
  --band-linie-fein: var(--linie-fein, #EAECEB);
  --band-tinte:      var(--tinte,      #17181A);
  --band-zone:       var(--zone,       #DCE1E4);
  --band-zone-linie: var(--zone-linie, #C1C9CE);
  --band-sans:       var(--sans,       'NRWZ Headline', system-ui, sans-serif);
  --band-breite:     1180px;
  --band-rand:       24px;
  --band-klein:      11px;               /* kleinste Schrift im Band */

  position: relative;
  z-index: 20;
  background: var(--band-papier);
  border-bottom: 1px solid var(--band-linie);
  font-family: var(--band-sans);
}

.nrwz-band *,
.nrwz-band *::before,
.nrwz-band *::after{ box-sizing: border-box; }

.nrwz-band__inner{
  display: flex;
  align-items: stretch;
  max-width: var(--band-breite);
  margin: 0 auto;
  padding: 0 var(--band-rand);
}

/* ---------- Kopf ---------- */
.nrwz-band__kopf{
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding-right: 16px;
  border-right: 1px solid var(--band-linie);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--band-rot);
}

/* ---------- Scrollfenster ---------- */
.nrwz-band__fenster{
  position: relative;
  flex: 1;
  min-width: 0;
}

.nrwz-band__spur{
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
}
.nrwz-band__spur::-webkit-scrollbar{ display: none; }

/* ---------- Eintrag ---------- */
.nrwz-band__dos{
  flex-shrink: 0;
  min-width: 0;
  padding: 8px 16px;
  border-right: 1px solid var(--band-linie-fein);
  text-decoration: none;
  transition: background-color .15s ease;
}
.nrwz-band__dos:hover,
.nrwz-band__dos:focus-visible{ background: var(--band-rot-tint); }
.nrwz-band__dos:active{ background: var(--band-linie-fein); }

.nrwz-band__name{
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  color: var(--band-tinte);
  transition: color .15s ease;
}
.nrwz-band__dos:hover .nrwz-band__name,
.nrwz-band__dos:focus-visible .nrwz-band__name{ color: var(--band-rot-tief); }

.nrwz-band__zahl{
  display: block;
  margin-top: 2px;
  font-size: var(--band-klein);
  font-weight: 400;
  line-height: 1.2;
  white-space: nowrap;
  color: var(--band-grau-hell);
  font-variant-numeric: tabular-nums;
}

/* Dossier mit Beitrag aus den letzten 24 Stunden: das Wort „neu“ in Rot */
.nrwz-band__neu{
  margin-left: 6px;
  font-weight: 600;
  color: var(--band-rot);
}

/* ---------- Gruppentrenner ---------- */
.nrwz-band__gruppe{
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding: 0 16px;
  background: var(--band-flaeche);
  border-right: 1px solid var(--band-linie-fein);
  font-size: var(--band-klein);
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  color: var(--band-grau);
}
.nrwz-band__gruppe--aktuell{
  color: var(--band-rot-tief);
  background: var(--band-rot-tint);
}

/* ---------- Abschluss ---------- */
.nrwz-band__alle{
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 0 20px;
  white-space: nowrap;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--band-tinte);
  transition: color .15s ease;
}
.nrwz-band__alle svg{ width: 6px; height: 10px; flex-shrink: 0; }
.nrwz-band__alle:hover,
.nrwz-band__alle:focus-visible{ color: var(--band-rot); }
.nrwz-band__alle:active{ color: var(--band-rot-tief); }

/* ---------- Randverläufe ---------- */
.nrwz-band__hauch{
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  width: 36px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.nrwz-band__hauch--l{
  left: 0;
  background: linear-gradient(90deg, var(--band-papier) 15%, var(--band-papier-0));
}
.nrwz-band__hauch--r{
  right: 0;
  background: linear-gradient(270deg, var(--band-papier) 15%, var(--band-papier-0));
}
.nrwz-band__hauch.is-an{ opacity: 1; }

/* ---------- Schiene: Pfeile + Sponsor ---------- */
.nrwz-band__rail{
  display: flex;
  align-items: stretch;
  flex-shrink: 0;
  border-left: 1px solid var(--band-linie);
}
.nrwz-band__rail.is-aus .nrwz-band__pfeil{ display: none; }

.nrwz-band__pfeil{
  width: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  background: none;
  border: none;
  border-right: 1px solid var(--band-linie-fein);
  color: var(--band-grau);
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.nrwz-band__pfeil:hover:not(:disabled){
  background: var(--band-rot-tint);
  color: var(--band-rot);
}
.nrwz-band__pfeil:active:not(:disabled){ background: var(--band-linie-fein); }
.nrwz-band__pfeil:disabled{
  color: var(--band-grau-aus);
  cursor: default;
}
.nrwz-band__pfeil svg{ width: 7px; height: 12px; display: block; }

/* ---------- Sponsor ----------
 * Label „Anzeige" steht über dem Logo, nicht darauf, in lesbarer Größe.
 * Höhe: 2 + 11 + 2 + 34 + 2 = 51 px, das Band bleibt bei 52 px.
 * Ist eine Zieladresse gesetzt, ist der ganze Block der Link.
 */
.nrwz-band{
  --band-logo-b: 142px;
  --band-logo-h: 32px;
}
.nrwz-band__sponsor{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  flex-shrink: 0;
  padding: 2px 0 2px 16px;
  text-decoration: none;
}
.nrwz-band__sponsor-label{
  font-size: var(--band-klein);
  font-weight: 400;
  line-height: 1;
  color: var(--band-grau);
}
.nrwz-band__logo{
  display: flex;
  background: var(--band-zone);
  border: 1px solid var(--band-zone-linie);
  transition: opacity .15s ease;
}
.nrwz-band__logo img{
  display: block;
  width: auto;
  height: auto;
  max-width: var(--band-logo-b);
  max-height: var(--band-logo-h);
}
a.nrwz-band__sponsor:hover .nrwz-band__logo,
a.nrwz-band__sponsor:focus-visible .nrwz-band__logo{ opacity: .88; }

/* ---------- Mehrere Sponsoren im Wechsel ----------
 * Alle Blöcke liegen im selben Rasterfeld übereinander. Sichtbar ist nur der
 * Block mit .is-aktiv; das Skript hinter den Blöcken setzt ihn, bevor der
 * Browser die Stelle zeichnet. Fehlt das Skript, zeigt die Animation nach
 * 1,2 Sekunden den ersten Block.
 */
.nrwz-band__sponsoren{
  display: grid;
  align-items: center;
  justify-items: end;
  flex-shrink: 0;
}
.nrwz-band__sponsoren > .nrwz-band__sponsor{
  grid-area: 1 / 1;
  visibility: hidden;
}
.nrwz-band__sponsoren > .nrwz-band__sponsor.is-aktiv{ visibility: visible; }
.nrwz-band__sponsoren:not([data-gewaehlt]) > .nrwz-band__sponsor:first-child{
  animation: nrwz-band-zeigen 0s linear 1.2s forwards;
}
@keyframes nrwz-band-zeigen{ to{ visibility: visible; } }

/* ---------- Fokus ---------- */
.nrwz-band a:focus-visible,
.nrwz-band button:focus-visible{
  outline: 2px solid var(--band-rot);
  outline-offset: -2px;
}

/* ---------- Responsiv ---------- */
@media (max-width: 720px){
  .nrwz-band{
    --band-rand: 14px;
    --band-logo-b: 104px;
    --band-logo-h: 24px;
  }

  /* Der Kopf entfällt mobil ganz. Bis 1.2.x blieb hier ein roter Punkt ohne
     Bedeutung stehen. */
  .nrwz-band__kopf{ display: none; }

  /* Schiene: Ohne Sponsor entfällt sie. Mit Sponsor bleibt nur das Logo
     stehen – gewischt wird ohnehin, die Pfeile braucht es hier nicht. */
  .nrwz-band__rail{ display: none; }
  .nrwz-band__rail--sponsor{ display: flex; }
  .nrwz-band__pfeil{ display: none; }
  .nrwz-band__sponsor{ padding-left: 10px; }

  .nrwz-band__spur{
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    padding-right: 14px;
  }
  .nrwz-band__dos,
  .nrwz-band__gruppe{ scroll-snap-align: start; }

  /* Touchfläche: 9 + 18 + 2 + 13 + 9 = 51 px hoch, das Band bleibt bei 52 px */
  .nrwz-band__dos{ padding: 9px 14px; }
  .nrwz-band__gruppe{ padding: 0 12px; }
}

/* Sehr schmale Geräte: Logo noch etwas kleiner, damit die Dossiers Platz behalten */
@media (max-width: 359px){
  .nrwz-band{
    --band-logo-b: 88px;
    --band-logo-h: 21px;
  }
  .nrwz-band__sponsor{ padding-left: 8px; }
}

@media (prefers-reduced-motion: reduce){
  .nrwz-band__spur{ scroll-behavior: auto; }
  .nrwz-band *{ transition: none !important; }
}

@media print{
  .nrwz-band{ display: none; }
}
