/* OMSAG Elements · Störer-Banner (sitewide Notice Bar)
   Fixiert am oberen Bildschirmrand. Farben kommen aus den globalen
   OMSAG-LP-Tokens, lassen sich pro Banner per Inline-Variablen überschreiben. */

.omsag-noticebar {
  --b:      var(--omsag-lp-brand, #50aa3c);
  --bl:     var(--omsag-lp-lime, #aad337);
  --ink:    var(--omsag-lp-ink, #232730);
  --grad:   var(--omsag-lp-brand-grad-r, linear-gradient(90deg, #50aa3c 0%, #aad337 100%));
  --ez:     var(--omsag-lp-ease, cubic-bezier(.2,.7,.2,1));
  --font:   var(--omsag-lp-font, 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif);

  /* Variantenwerte — von den Modifiern unten gesetzt */
  --nb-bg: var(--grad);
  --nb-fg: var(--ink);
  --nb-h: 52px;

  position: fixed;
  inset: 0 0 auto 0;
  /* Über typischen Theme-Kopfzeilen (meist 999–10000), unter der WP-Adminleiste. */
  z-index: 99990;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--nb-h);
  padding: 9px 56px 9px 20px;
  margin: 0 !important;
  background: var(--nb-bg);
  color: var(--nb-fg);
  font-family: var(--font);
  line-height: 1.3;
  box-shadow: 0 1px 0 rgba(15, 17, 21, .08), 0 10px 30px -22px rgba(15, 17, 21, .5);
  /* Kleiner Versatz: verhindert ein Aufblitzen, bevor das Skript einen
     zuvor geschlossenen Banner entfernen konnte. */
  animation: omsag-nb-in .42s var(--ez) .12s both;
}

.omsag-noticebar,
.omsag-noticebar *,
.omsag-noticebar *::before,
.omsag-noticebar *::after { box-sizing: border-box; }

@keyframes omsag-nb-in {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

/* Der Balken schiebt die Seite nach unten (Wert setzt das Skript).
   Im Modus „nur Kopfzeile schieben" wird die Klasse nicht gesetzt. */
html.omsag-nb-active body { padding-top: var(--omsag-noticebar-h, 0px); }

/* Ein-/Ausblenden: der Inhalt gleitet mit, statt zu springen. Die Klasse
   setzt das Skript nur für die Dauer der Bewegung. */
html.omsag-nb-anim body { transition: padding-top .42s cubic-bezier(.2, .7, .2, 1); }

/* Beim Schließen sauber nach oben herausfahren */
.omsag-noticebar.is-closing {
  transform: translateY(-100%);
  opacity: 0;
  transition: transform .42s var(--ez), opacity .3s var(--ez);
}

/* Admin-Bar nicht überdecken */
body.admin-bar .omsag-noticebar { top: 32px; }
@media screen and (max-width: 782px) {
  body.admin-bar .omsag-noticebar { top: 46px; }
}

/* ── Inhalt ─────────────────────────────────────────────────────────── */

.omsag-noticebar__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  width: 100%;
  max-width: 1320px;
}

/* Auf dem Desktop ist die Textspalte keine eigene Box — Label, Text und
   Button liegen gemeinsam in einer zentrierten Reihe. Erst mobil wird
   daraus eine echte linke Spalte. */
.omsag-noticebar__main { display: contents; }

/* Bild statt Label — etwa ein Messelogo. Die Hoehe kommt aus den
   Einstellungen, die Breite ergibt sich aus dem Bild. flex: 0 0 auto, damit
   es neben dem Text nicht zusammengedrueckt wird. */
.omsag-noticebar__badge-img {
  display: block;
  flex: 0 0 auto;
  width: auto;
  max-width: 46vw;
  object-fit: contain;
}

.omsag-noticebar__badge {
  /* inline-block statt flex: sonst schluckt der Flex-Container die
     Leerzeichen um einen Countdown-Platzhalter herum. */
  display: inline-block;
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 4px;
  background: color-mix(in srgb, currentColor 14%, transparent);
  border: 1px solid color-mix(in srgb, currentColor 26%, transparent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.omsag-noticebar__text {
  margin: 0 !important;
  padding: 0;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -.005em;
  color: inherit;
  text-wrap: balance;
}
.omsag-noticebar__text strong,
.omsag-noticebar__text b { font-weight: 800; }

.omsag-noticebar__cd {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  white-space: nowrap;
}

/* ── Button ─────────────────────────────────────────────────────────── */

.omsag-noticebar__cta {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  border-radius: var(--omsag-lp-pill, 999px);
  border: 1.6px solid var(--nb-accent-border, currentColor);
  background: var(--nb-accent, transparent);
  color: var(--nb-accent-fg, currentColor);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.01em;
  text-decoration: none !important;
  white-space: nowrap;
  transition: background-color .3s var(--ez), color .3s var(--ez), transform .3s var(--ez), box-shadow .3s var(--ez);
}
.omsag-noticebar__cta:hover,
.omsag-noticebar__cta:focus-visible {
  background: var(--nb-cta-hover-bg, currentColor);
  /* Ohne eigene Hover-Rahmenfarbe nimmt der Rahmen die Hover-Fläche an —
     dann ist im Hover kein Ring zu sehen, die Größe bleibt aber stabil. */
  border-color: var(--nb-cta-hover-border, var(--nb-cta-hover-bg, currentColor));
  color: var(--nb-cta-hover-fg, var(--nb-bg-flat, #fff));
  transform: translateY(-1px);
  box-shadow: 0 8px 18px -10px rgba(15, 17, 21, .55);
}

/* ── Schließen ──────────────────────────────────────────────────────── */

.omsag-noticebar__close {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  opacity: .65;
  cursor: pointer;
  transition: opacity .25s var(--ez), background-color .25s var(--ez);
}
.omsag-noticebar__close:hover { opacity: 1; background: color-mix(in srgb, currentColor 14%, transparent); }
.omsag-noticebar__close svg { width: 17px; height: 17px; display: block; }

/* ── Varianten ──────────────────────────────────────────────────────── */

/* Verlauf Grün → Limette, dunkle Schrift (Standard) */
.omsag-noticebar--gradient {
  --nb-bg: var(--grad);
  --nb-fg: var(--ink);
  --nb-cta-hover-fg: #fff;
  --nb-cta-hover-bg: var(--ink);
}

/* Brand-Grün, weiße Schrift */
.omsag-noticebar--solid {
  --nb-bg: var(--b);
  --nb-fg: #fff;
  --nb-cta-hover-bg: #fff;
  --nb-cta-hover-fg: var(--b);
}

/* Dunkel, weiße Schrift, gefüllter Brand-Button */
.omsag-noticebar--dark {
  --nb-bg: var(--ink);
  --nb-fg: #fff;
  --nb-accent: var(--grad);
  --nb-accent-fg: #fff;
  --nb-accent-border: transparent;
  --nb-cta-hover-bg: #fff;
  --nb-cta-hover-fg: var(--ink);
}

/* Hell / Creme, dunkle Schrift, gefüllter Brand-Button */
.omsag-noticebar--light {
  --nb-bg: var(--omsag-lp-bg-cream, #f0f4ee);
  --nb-fg: var(--ink);
  --nb-accent: var(--grad);
  --nb-accent-fg: #fff;
  --nb-accent-border: transparent;
  --nb-cta-hover-bg: var(--ink);
  --nb-cta-hover-fg: #fff;
  border-bottom: 1px solid var(--omsag-lp-line, #e6e8ec);
}

/* ── Vorschau im Backend: nicht fixiert ─────────────────────────────── */

.omsag-noticebar--preview {
  position: relative;
  inset: auto;
  animation: none;
  box-shadow: none;
  z-index: 1;
}
body.admin-bar .omsag-noticebar--preview { top: auto; }

/* ── Responsive ─────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .omsag-noticebar { padding: 10px 50px 10px 16px; }
  .omsag-noticebar__inner { gap: 8px 12px; }
  .omsag-noticebar__text { font-size: 14px; }
  .omsag-noticebar__cta { font-size: 13.5px; padding: 7px 17px; }
}

/* Mobil zwei Spalten: links Label + Text, rechts der Button.
   So bleibt der Zeilenabstand im Text durchgehend gleich — der Button
   sitzt neben dem Absatz statt mitten in der letzten Zeile. */
@media (max-width: 600px) {
  .omsag-noticebar {
    --nb-h: 44px;
    padding: 9px 38px 9px 13px;
  }
  .omsag-noticebar__inner {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    text-align: left;
  }
  /* Linke Spalte: nimmt den freien Platz, darf schrumpfen (min-width:0). */
  .omsag-noticebar__main {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
  }
  .omsag-noticebar__main::after { content: ""; display: block; clear: both; }
  /* Wie das Textlabel rueckt auch das Bild links neben den Text. */
  .omsag-noticebar__badge-img {
    float: left;
    margin: 0 8px 0 0;
    max-height: 20px;
    max-width: 38vw;
  }
  .omsag-noticebar__badge {
    float: left;
    margin: 1px 7px 1px 0;
    font-size: 9px;
    padding: 2px 6px;
    letter-spacing: .05em;
  }
  .omsag-noticebar__text {
    display: block;
    font-size: 11px;
    line-height: 1.45;
    text-wrap: pretty;
  }
  /* Rechte Spalte: fester Button, bricht nicht um. */
  .omsag-noticebar__cta {
    flex: 0 0 auto;
    align-self: center;
    margin: 0;
    padding: 7px 13px;
    font-size: 11.5px;
    line-height: 1.2;
    white-space: nowrap;
  }
  .omsag-noticebar__close { top: 6px; right: 4px; transform: none; width: 28px; height: 28px; }
  .omsag-noticebar__close svg { width: 15px; height: 15px; }
}

/* Sehr schmale Displays: Button darf zweizeilig brechen, statt die
   Textspalte zu erdrücken. */
@media (max-width: 380px) {
  .omsag-noticebar__cta { white-space: normal; text-align: center; padding: 7px 11px; }
}

.omsag-noticebar--no-mobile {
  /* per Option: mobil komplett aus */
}
@media (max-width: 760px) {
  .omsag-noticebar--no-mobile { display: none !important; }
  .omsag-noticebar--badge-no-mobile .omsag-noticebar__badge { display: none !important; }
  .omsag-noticebar--badgeimg-no-mobile .omsag-noticebar__badge-img { display: none !important; }
}

@media print {
  .omsag-noticebar { display: none !important; }
  html.omsag-nb-active body { padding-top: 0 !important; }
}

@media (prefers-reduced-motion: reduce) {
  .omsag-noticebar,
  .omsag-noticebar__cta,
  .omsag-noticebar__close { animation: none !important; transition: none !important; }
}

/* Fallback für Browser ohne color-mix() */
@supports not (color: color-mix(in srgb, red 50%, blue)) {
  .omsag-noticebar__badge { background: rgba(255, 255, 255, .22); border-color: rgba(255, 255, 255, .38); }
  .omsag-noticebar--gradient .omsag-noticebar__badge,
  .omsag-noticebar--light .omsag-noticebar__badge { background: rgba(15, 17, 21, .1); border-color: rgba(15, 17, 21, .18); }
  .omsag-noticebar__close:hover { background: rgba(127, 127, 127, .22); }
}
