/* ===== BIBH News Bar — v1.3.0 ===== */
.bibh-newsbar{
  --bg:#1e293b; --fg:#fff; --muted:#d7d7d7; --h:40px;
  position: relative;
  width: auto;
  background: var(--bg);
  color: #f5a260;
  font: inherit;
  font-size: 20px;
  margin: 10px;                /* breathing room so pill shape is visible */
  border-radius: 9999px;       /* full pill */
  overflow: hidden;            /* clip the scrolling track to the pill */
  padding-right: 50px;         /* reserve space on the right for the × button */
}

/* Inner scrolling area */
.bibh-newsbar__inner{
  height: auto !important;
  display: block;
  overflow: hidden !important;
}

/* Scrolling track */
.bibh-newsbar__track{
  display: flex; gap: 28px; list-style: none; padding: 0; margin: 0;
  align-items: center;
  animation: bibh-newsbar-marquee linear infinite; will-change: transform;
}
.bibh-newsbar__track.is-paused{ animation-play-state: paused !important; }
.bibh-newsbar:hover .bibh-newsbar__track{ animation-play-state: paused; }

/* Individual items */
.bibh-newsbar__item{
  white-space: nowrap;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;              /* vertical breathing room inside the pill */
}

/* Separator between items */
.bibh-newsbar__sep{
  color: rgba(255,255,255,.25);
  font-size: 13px;
  flex: 0 0 auto;
  user-select: none;
}

/* Link */
.bibh-newsbar__link{ color:var(--fg); text-decoration:none; display:inline-flex; gap:10px; align-items:center; }
.bibh-newsbar__link:hover{ text-decoration:underline; }

/* ---- Pills ---- */
.bibh-newsbar__pill{
  background: rgba(255,255,255,.15);
  color: var(--fg);
  padding: 4px 10px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  flex: 0 0 auto;
}

/* Type variants */
.bibh-newsbar__pill--info    { background: #3b82f6; color: #fff; }
.bibh-newsbar__pill--success { background: #22c55e; color: #fff; }
.bibh-newsbar__pill--warning { background: #f59e0b; color: #111; }
.bibh-newsbar__pill--urgent  { background: #ef4444; color: #fff; animation: bibh-pulse 1.1s ease-in-out infinite; }
.bibh-newsbar__pill--event   { background: #8b5cf6; color: #fff; }

@keyframes bibh-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .65; }
}

/* Date */
.bibh-newsbar__date{ color:var(--muted); font-variant-numeric:tabular-nums; font-size:15px; }

/* "NEW" badge — auto-applied to fresh announcements */
.bibh-newsbar__new{
  display: inline-block;
  background: #fbbf24;
  color: #1e293b;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .05em;
  vertical-align: middle;
  line-height: 1.4;
  flex: 0 0 auto;
}

/* "Hide" button — pill in top-right of the bar */
.bibh-newsbar__dismiss{
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  z-index: 3;
  background: rgba(239, 68, 68, 0.12);
  border: 1.5px solid rgba(239, 68, 68, 0.45);
  cursor: pointer;
  color: #ef4444;                      /* red */
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  line-height: 1;
  padding: 6px 12px;
  border-radius: 9999px;               /* pill */
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .15s ease;
}
.bibh-newsbar__dismiss-icon{ font-size: 11px; }
.bibh-newsbar__dismiss:hover{
  background: #ef4444;
  border-color: #ef4444;
  color: #fff;
  transform: translateY(-50%) scale(1.05);
}

/* Reopener — shown when the bar is hidden.
   Anchored to the top-right of the VIEWPORT, below the site header. */
.bibh-newsbar-reopen{
  position: fixed;
  top: 110px;              /* below typical site header */
  right: 20px;
  z-index: 100;
  margin: 0;
}
.bibh-newsbar-reopen[hidden]{ display: none; }

/* Adjust for WordPress admin bar (logged-in users) */
body.admin-bar .bibh-newsbar-reopen{ top: 142px; }
@media screen and (max-width: 782px){
  body.admin-bar .bibh-newsbar-reopen{ top: 156px; }
}

.bibh-newsbar-reopen__btn{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #1e293b;
  color: #f5a260;
  border: 1.5px solid #f5a260;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all .2s ease;
  animation: bibh-reopen-attention 2.4s ease-in-out 1s 2;  /* gentle attention pulse twice then stop */
}
.bibh-newsbar-reopen__btn:hover{
  background: #f5a260;
  color: #1e293b;
  transform: scale(1.05);
}
.bibh-newsbar-reopen__icon{ font-size: 16px; line-height: 1; }

@keyframes bibh-reopen-attention {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 162, 96, 0); }
  50%      { box-shadow: 0 0 0 6px rgba(245, 162, 96, 0.25); }
}

@keyframes bibh-newsbar-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce){ .bibh-newsbar__track{ animation: none; } }

/* Mobile tweaks */
@media (max-width: 480px){
  .bibh-newsbar{ --h:38px; margin: 6px; padding-right: 70px; }
  .bibh-newsbar__track{ gap:16px; }
  .bibh-newsbar__pill{ font-size:11px; padding:3px 7px; }
  .bibh-newsbar__date{ display:none; }
  .bibh-newsbar__dismiss{ right: 8px; padding: 5px 9px; font-size: 10px; }
  .bibh-newsbar__dismiss-text{ display: none; }     /* icon-only on mobile */
  .bibh-newsbar-reopen{ top: 80px; right: 10px; }
  .bibh-newsbar-reopen__btn{ padding: 6px 12px; font-size: 11px; }
}
