/* ─────────────────────────────────────────────────────────────────────────────
   TechBBQ 2026 announcement ribbon — Copenhagen, 25–27 August 2026.

   Time-boxed feature. The whole thing is this file plus
   app/views/layouts/_techbbq_banner.html.erb; deleting both (and the two
   `render "layouts/techbbq_banner"` lines in the ascent / zion_revamp layouts)
   removes it completely.

   It is server-rendered ABOVE #root, so it precedes the site nav in the
   document — and it is sticky at top:0, with the nav (itself sticky at top:0)
   pushed down by --zs-tbq-h so the two stack instead of overlapping.

   --zs-tbq-h is the ribbon's FULL outer height, border included. The values
   below are per-breakpoint fallbacks; the partial's script overwrites the token
   with the actually-rendered height on load, on resize and once webfonts settle,
   so the nav stays exactly flush rather than relying on a hand-tuned number.

   Pinning the height per breakpoint also means a webfont swap can't reflow the
   ribbon, so it adds no measurable CLS.

   Brand system: consumes the design-system tokens (--font-display, --font-body,
   --container-max) with fallbacks, so it renders correctly under both the
   Ascent (Geist / Schibsted Grotesk) and the older revamp (Inter) type stacks.
   ────────────────────────────────────────────────────────────────────────── */

:root { --zs-tbq-h: 68px; }

.zs-tbq {
  position: sticky;
  top: 0;
  /* Above the Ascent nav (40) and the revamp nav (50). */
  z-index: 1100;
  width: 100%;
  /* --gradient-ink, inlined so the bar is correct in layouts that don't load
     the Ascent design-system tokens. */
  background: linear-gradient(104deg, #101534 0%, #0B1633 54%, #0A1A40 100%);
  border-bottom: 1px solid rgba(183, 156, 247, 0.16);
  -webkit-font-smoothing: antialiased;
}

/* Spectrum thread along the top edge — the brand's violet → azure → cyan. */
.zs-tbq::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, #7C3AED, #2447C9 46%, #0FB5D8 74%, #7C3AED);
  opacity: 0.9;
}

/* Soft violet bloom behind the copy, so the ribbon reads as part of the dark
   brand surfaces rather than a flat promotional strip. */
.zs-tbq::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(52% 190% at 14% 50%, rgba(130, 80, 230, 0.22), transparent 70%),
    radial-gradient(40% 170% at 84% 50%, rgba(15, 181, 216, 0.14), transparent 72%);
}

.zs-tbq-link {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: var(--container-max, 1200px);
  min-height: calc(var(--zs-tbq-h) - 1px);
  margin: 0 auto;
  padding: 11px 32px;
  text-decoration: none;
  color: inherit;
}

.zs-tbq-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1 1 auto;
}

.zs-tbq-headline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

/* Delegation credential — the piece that makes this an announcement and not an ad. */
.zs-tbq-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  padding: 4px 11px 4px 9px;
  border: 1px solid rgba(183, 156, 247, 0.38);
  border-radius: 999px;
  background: rgba(130, 80, 230, 0.16);
  font-family: var(--font-body, "Segoe UI", system-ui, sans-serif);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: #D6C6FB;
  white-space: nowrap;
}

.zs-tbq-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #18A8D8;
  box-shadow: 0 0 0 0 rgba(24, 168, 216, 0.55);
  animation: zs-tbq-pulse 2.6s var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1)) infinite;
}

@keyframes zs-tbq-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(24, 168, 216, 0.5); }
  70%  { box-shadow: 0 0 0 7px rgba(24, 168, 216, 0); }
  100% { box-shadow: 0 0 0 0 rgba(24, 168, 216, 0); }
}

.zs-tbq-title {
  font-family: var(--font-display, "Segoe UI", system-ui, sans-serif);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.32;
  letter-spacing: -0.008em;
  color: #FFFFFF;
}

.zs-tbq-flag {
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-weight: 400;
}

.zs-tbq-sub {
  font-family: var(--font-body, "Segoe UI", system-ui, sans-serif);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  color: rgba(226, 231, 246, 0.7);
}

/* Date chip: only surfaces on small screens, where the sentence is dropped. */
.zs-tbq-when { display: none; }

.zs-tbq-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 9px 18px;
  border-radius: 999px;
  background: linear-gradient(120deg, #7C3AED, #2447C9);
  box-shadow: 0 8px 22px -10px rgba(130, 80, 230, 0.9);
  font-family: var(--font-body, "Segoe UI", system-ui, sans-serif);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.006em;
  color: #FFFFFF;
  white-space: nowrap;
  transition: background 250ms var(--ease-out, ease), box-shadow 250ms var(--ease-out, ease);
}

.zs-tbq-cta svg { transition: transform 150ms var(--ease-out, ease); }

.zs-tbq-link:hover .zs-tbq-cta {
  background: linear-gradient(120deg, #8250E6, #2E58E6);
  box-shadow: 0 10px 26px -9px rgba(130, 80, 230, 1);
}

.zs-tbq-link:hover .zs-tbq-cta svg { transform: translateX(3px); }

.zs-tbq-link:focus-visible {
  outline: 2px solid #9B84F2;
  outline-offset: -3px;
  border-radius: 4px;
}

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

/* Narrow desktop / landscape tablet: the full delegation sentence no longer fits
   beside the CTA, so it collapses to the location + dates. The badge keeps
   carrying the Startup India / DPIIT credential at every width. */
@media (max-width: 1160px) {
  .zs-tbq-sub-full { display: none; }
}
@media (min-width: 1161px) {
  .zs-tbq-sub-short { display: none; }
}

/* Stacked from tablet down. The threshold is 1000px rather than 900: at 17px the
   headline plus the badge and the CTA no longer share a row below ~950px, and a
   wrapped headline would make the ribbon taller in that band only.

   The tokens pin the ribbon to its tallest possible layout at each width, so if
   a webfont swap re-wraps the headline the bar keeps the same height and nothing
   below it moves — no layout shift. */
@media (max-width: 1000px) {
  :root { --zs-tbq-h: 119px; }
  .zs-tbq-link {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 12px;
    padding: 13px 24px;
  }
  .zs-tbq-copy { width: 100%; }
}

/* Phones: drop the sentence entirely and inline a compact date chip next to the
   badge, so the ribbon stays around three lines instead of five. */
@media (max-width: 620px) {
  :root { --zs-tbq-h: 114px; }
  .zs-tbq-link { gap: 11px; padding: 12px 16px; }
  /* Tight enough that the credential badge and the date chip share one line at
     360px, which keeps the ribbon to three rows on a phone. */
  .zs-tbq-headline { gap: 7px; row-gap: 7px; }
  .zs-tbq-badge {
    gap: 6px;
    padding: 3px 8px 3px 7px;
    font-size: 9px;
    letter-spacing: 0.05em;
  }
  .zs-tbq-dot { width: 5px; height: 5px; }
  .zs-tbq-title { font-size: 15px; line-height: 1.34; }
  .zs-tbq-sub { display: none; }
  .zs-tbq-when {
    display: inline-block;
    font-family: var(--font-body, "Segoe UI", system-ui, sans-serif);
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1.35;
    color: rgba(226, 231, 246, 0.66);
    white-space: nowrap;
  }
  .zs-tbq-cta { padding: 8px 15px; font-size: 12.5px; }
}

/* Below ~395px the headline wraps to two lines. */
@media (max-width: 400px) {
  :root { --zs-tbq-h: 134px; }
}

/* Very small phones (~320px): the badge and the date chip stop sharing a line
   too, so the ribbon gains one more row. */
@media (max-width: 350px) {
  :root { --zs-tbq-h: 157px; }
}

@media (prefers-reduced-motion: reduce) {
  .zs-tbq-dot { animation: none; }
  .zs-tbq-cta, .zs-tbq-cta svg { transition: none; }
}

/* ── Sticky header offsets ────────────────────────────────────────────────────
   Both layouts that render the ribbon have their own sticky header anchored at
   top:0. Push each down by the ribbon's height so they stack rather than
   overlap. The Ascent nav sets top:0 as an inline style, hence !important.

   The Ascent nav hides itself on scroll-down by translating up by its own
   height (~68px); --zs-tbq-h is at least that at every breakpoint, so the
   hidden nav lands behind the ribbon instead of peeking out below it.
   ────────────────────────────────────────────────────────────────────────── */

/* Ascent site nav. */
#root > div > nav { top: var(--zs-tbq-h) !important; }

/* zion_revamp prototype nav. */
.zs-navwrap { top: var(--zs-tbq-h); }
