/* ============================================================
   ALGORAM – Offer bar (3 month free access, valid till 30 Sep 2026)
   Markup: partials/header.html (stitched into every page by build.js)
   Behaviour: assets/js/offer-bar.js
   ============================================================ */

.offer-bar {
  /* Out of flow, so it sits flush with the top-left of the page whatever margin <body> has
     (the site currently has the browser-default 8px). Its height is reserved on <html> below. */
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2; /* above the fixed particle canvas / dot-grid layers */
  overflow: hidden;
  background: #000;
  color: #fff;
  font-family: var(--f-body, 'Inter'), 'Exo 2', sans-serif;
  /* font-size sets the width of one message copy. If you change it, revisit COPIES_PER_HALF in
     offer-bar.js and the animation durations below: each half of the marquee track must stay
     wider than the widest screen, or the loop shows a gap. */
  font-size: 12px;
  line-height: 24px;
}

.offer-bar-link {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
.offer-bar-link:focus-visible {
  outline: 2px solid #FCD34D;
  outline-offset: -3px;
}

/* ── Marquee: right → left, seamless loop (track = 2 identical halves, moves -50%) ── */
.offer-marquee { overflow: hidden; }
.offer-marquee-track {
  display: flex;
  width: max-content;
  animation: offerMarquee 55s linear infinite;
  will-change: transform;
}
@keyframes offerMarquee { to { transform: translateX(-50%); } }

.offer-bar:hover .offer-marquee-track,
.offer-bar-link:focus-visible .offer-marquee-track { animation-play-state: paused; }

.offer-msg {
  flex: 0 0 auto;
  padding: 0 2.4em;
  white-space: nowrap;
}

/* "Click Now" pill */
.offer-cta {
  display: inline-block;
  margin-left: 0.6em;
  padding: 0 0.9em;
  border-radius: 999px;
  background: linear-gradient(135deg, #FCD34D 0%, #F59E0B 100%);
  color: #000;
  font-weight: 700;
  line-height: 1.5;
}
.offer-until { color: rgba(255, 255, 255, 0.78); }
.offer-until::before {
  content: '\2022';
  margin: 0 1em;
  color: #F59E0B;
}

@media (max-width: 768px) {
  .offer-bar { font-size: 16px; line-height: 34px; }
  .offer-marquee-track { animation-duration: 75s; }
  .offer-msg { padding: 0 2em; }
}

/* No motion: show the message once, centred and wrapped (JS-made copies are aria-hidden) */
@media (prefers-reduced-motion: reduce) {
  .offer-marquee-track { animation: none; width: auto; justify-content: center; }
  .offer-msg[aria-hidden="true"] { display: none; }
  .offer-msg { padding: 0.5rem 1rem; line-height: 1.45; text-align: center; white-space: normal; }
}

@media print {
  .offer-bar { display: none; }
  html { padding-top: 0 !important; }
}

/* ── Make room for the bar, and keep the fixed navbar directly under it ──
   --offer-h      = the bar's height (offer-bar.js keeps it current), reserved on <html>
   --offer-offset = the part of the bar still visible on screen, so the navbar is back at
                    top:0 once the bar has scrolled away.
   When the bar is absent (expired / excluded page) both variables are unset and these fall
   back to the original values. */
html { padding-top: var(--offer-h, 0px); }
.navbar { top: var(--offer-offset, 0px) !important; }
.mobile-menu { top: calc(68px + var(--offer-offset, 0px)) !important; }
@media (max-width: 768px) {
  .mobile-menu { top: calc(62px + var(--offer-offset, 0px)) !important; }
}
