/* ============================================================================
 * Global Freedom Bourbon promo — announcement bar + bottom-right callout.
 * Printed by header.php / footer.php via freedom-promo.php.
 *
 * Values taken from the approved mockup source (mockup_src_cpff.html). The one
 * Type uses the theme's own Typekit faces — lato for copy, industry-inc-base
 * for headings. Both are wider than the condensed stand-ins the mockup was
 * drawn with, so the title and copy sizes are trimmed from the mockup's 22px /
 * 14.5px to keep the title on one line and the copy unwrapped in the text
 * column. No extra webfont request is added.
 *
 * Kept out of main.css on purpose: main.css is a Prepros build of main.scss,
 * and recompiling it elsewhere would rewrite the whole file.
 * ==========================================================================*/

:root {
  --cpff-promo-bg: #04193a;
  --cpff-promo-red: #d81f26;
  --cpff-promo-red-hover: #e8353c;
  --cpff-promo-link: #ff5a60;
  --cpff-banner-h: 0px;
}

/* ============ Announcement bar ============ */

.promo-bar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  box-sizing: border-box;
  width: 100%;
  height: 42px;
  background: var(--cpff-promo-bg);
  border-bottom: 1px solid rgba(255, 255, 255, .10);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 56px;
  font-family: "lato", -apple-system, "Segoe UI", sans-serif;
}

.promo-bar__text {
  margin: 0;
  color: #e9eef6;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: .2px;
  line-height: 1;
  text-align: center;
}

.promo-bar__text a {
  color: var(--cpff-promo-link);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}

.promo-bar__text a:hover,
.promo-bar__text a:focus-visible { border-bottom-color: currentColor; }

.promo-bar__close {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: none;
  color: #9fb0c9;
  line-height: 1;
  cursor: pointer;
  transition: color .2s ease;
}

.promo-bar__close svg { width: 16px; height: 16px; display: block; }
.promo-bar__close:hover { color: #fff; }
.promo-bar__close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* The bar is fixed, so it no longer occupies space — padding-top on the body
   keeps the page from starting underneath it.

   #header-container is absolute at top:0 at rest and switches to fixed (via
   .is-stuck) past the first scrolled pixel. Because the bar stays put in both
   cases, the header is offset in both cases: at rest it clears the bar in the
   document, and when stuck it clears the bar in the viewport.

   The height here is a no-JS fallback; the script measures the bar and writes
   the real value inline on <body>, which outranks this rule. */
body.has-promo-bar { --cpff-banner-h: 42px; padding-top: var(--cpff-banner-h); }
body.has-promo-bar #header-container { top: var(--cpff-banner-h); }

/* ============ Bottom-right callout ============ */

/* Something on these pages resets this element's display to block, which
   collapsed the card into a vertical stack (bottle above the text) even though
   this rule is the only one in the CSSOM that matches it and sets display.
   Raising specificity to aside.promo-card was not enough, so display and
   flex-direction are pinned with !important. Verified in-browser. Do not drop
   these without re-checking the rendered card. */
aside.promo-card {
  position: fixed;
  right: 34px;
  bottom: 40px;
  z-index: 190;
  box-sizing: border-box;
  width: 340px;
  max-width: calc(100vw - 32px);
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 11px;
  padding: 16px 13px 18px 14px;
  background: linear-gradient(160deg, #0a284d 0%, #04193a 100%);
  border: 2px solid var(--cpff-promo-red);
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .45);
  font-family: "lato", -apple-system, "Segoe UI", sans-serif;
  opacity: 0;
  transform: translateY(20px) scale(.97);
  transform-origin: 100% 100%;
  will-change: opacity, transform;
  /* The fade is deliberately slower than the movement: the card drifts into
     place while the opacity is still coming up, so it never pops in. */
  transition: opacity .95s ease,
              transform .75s cubic-bezier(.16, 1, .3, 1);
}

aside.promo-card[hidden] { display: none !important; }
aside.promo-card.is-visible { opacity: 1; transform: translateY(0) scale(1); }

/* Contents settle a beat after the card itself, which reads softer than the
   whole block arriving at once. */
.promo-card__media,
.promo-card__body {
  opacity: 0;
  transform: translateY(7px);
  transition: opacity .8s ease .2s, transform .6s cubic-bezier(.16, 1, .3, 1) .2s;
}

.promo-card__body { transition-delay: .32s; }

aside.promo-card.is-visible .promo-card__media,
aside.promo-card.is-visible .promo-card__body {
  opacity: 1;
  transform: translateY(0);
}

.promo-card__media {
  flex: 0 0 72px;
  /* Flex items default to min-width:auto, which floors them at the image's
     intrinsic width and blows the column out. */
  min-width: 0;
  width: 72px;
  display: block;
  line-height: 0;
}

.promo-card__media img {
  width: 72px;
  height: 146px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .5));
}

.promo-card__body {
  flex: 1;
  min-width: 0;
  padding-top: 4px;
}

.promo-card__eyebrow {
  margin: 0 0 3px;
  font-family: industry-inc-base, sans-serif;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 2px;
  line-height: 1.2;
  text-transform: uppercase;
  color: #9fc0ef;
}

.promo-card__eyebrow i { font-style: normal; padding: 0 2px; }

.promo-card__title {
  margin: 0 0 6px;
  font-family: industry-inc-base, sans-serif;
  font-weight: 700;
  font-size: 20px;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  color: #fff;
}

.promo-card__copy {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.25;
  color: #c8d4e6;
}

.promo-card__cta {
  display: inline-block;
  font-family: industry-inc-base, sans-serif;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  background: var(--cpff-promo-red);
  color: #fff;
  padding: 9px 20px;
  border-radius: 6px;
  text-decoration: none;
  transition: background .2s ease;
}

.promo-card__cta:hover { background: var(--cpff-promo-red-hover); color: #fff; }
.promo-card__cta:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.promo-card__close {
  position: absolute;
  right: 12px;
  top: 10px;
  z-index: 2;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: none;
  color: #aebdd3;
  line-height: 1;
  cursor: pointer;
  transition: color .2s ease;
}

.promo-card__close svg { width: 16px; height: 16px; display: block; }
.promo-card__close:hover { color: #fff; }
.promo-card__close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ============ Responsive ============
   The mockup is a fixed 1920 desktop comp, so everything below is our own. */

@media (max-width: 1023px) {
  .promo-bar { height: auto; min-height: 42px; padding: 9px 46px 9px 16px; }
  .promo-bar__text { font-size: 14px; line-height: 1.35; }
  body.has-promo-bar { --cpff-banner-h: 56px; }
}

@media (max-width: 640px) {
  .promo-bar__text { font-size: 13px; }
  body.has-promo-bar { --cpff-banner-h: 64px; }

  aside.promo-card {
    right: 12px;
    left: 12px;
    bottom: 12px;
    width: auto;
    padding: 13px 14px 14px 12px;
    gap: 11px;
  }

  .promo-card__media { flex: 0 0 62px; width: 62px; }
  .promo-card__media img { width: 62px; height: 126px; }
  .promo-card__title { font-size: 20px; }
  .promo-card__copy { font-size: 13.5px; margin-bottom: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  aside.promo-card,
  .promo-card__media,
  .promo-card__body {
    transition: none;
    transform: none;
  }
}
