:root {
  --cinefi-alert-bar-height: 0px;
  --cinefi-alert-info-bg: var(--cinefi-color-primary, #026d8b);
  --cinefi-alert-info-fg: #fff;
  --cinefi-alert-neutral-bg: var(--cinefi-color-primary-dark, #1e2a33);
  --cinefi-alert-neutral-fg: #fff;
  --cinefi-alert-critical-bg: #b42318;
  --cinefi-alert-critical-fg: #fff;
  --cinefi-alert-warning-bg: #f4d35e;
  --cinefi-alert-warning-fg: #1e2a33;
}

.cinefi-alert-bars {
  position: relative;
  z-index: 101;
  width: 100%;
}

.cinefi-alert-bar {
  display: grid;
  grid-template-rows: 0fr;
  overflow: hidden;
  visibility: hidden;
  transition:
    grid-template-rows 0.45s ease,
    visibility 0s linear 0.45s;
}

.cinefi-alert-bar[aria-hidden="false"] {
  grid-template-rows: 1fr;
  visibility: visible;
  transition:
    grid-template-rows 0.45s ease,
    visibility 0s linear 0s;
}

.cinefi-alert-bar__collapse {
  min-height: 0;
}

.cinefi-alert-bar--blue {
  --cinefi-alert-current-bg: var(--cinefi-alert-info-bg);

  background: var(--cinefi-alert-info-bg);
  color: var(--cinefi-alert-info-fg);
}

.cinefi-alert-bar--slate {
  --cinefi-alert-current-bg: var(--cinefi-alert-neutral-bg);

  background: var(--cinefi-alert-neutral-bg);
  color: var(--cinefi-alert-neutral-fg);
}

.cinefi-alert-bar--red {
  --cinefi-alert-current-bg: var(--cinefi-alert-critical-bg);

  background: var(--cinefi-alert-critical-bg);
  color: var(--cinefi-alert-critical-fg);
}

.cinefi-alert-bar--yellow {
  --cinefi-alert-current-bg: var(--cinefi-alert-warning-bg);

  background: var(--cinefi-alert-warning-bg);
  color: var(--cinefi-alert-warning-fg);
}

.cinefi-alert-bar--custom {
  --cinefi-alert-current-bg: var(--cinefi-alert-custom-bg);

  background: var(--cinefi-alert-custom-bg);
  color: var(--cinefi-alert-custom-fg);
}

.cinefi-alert-bar__inner {
  display: grid;
  grid-template-columns: minmax(32px, 1fr) minmax(0, auto) minmax(32px, 1fr);
  align-items: center;
  column-gap: 16px;
  width: min(100%, 1310px);
  min-height: 56px;
  margin-inline: auto;
  padding: 10px clamp(18px, 2.5vw, 32px);
  box-sizing: border-box;
  font-family: inherit;
}

.cinefi-alert-bar .cinefi-alert-bar__message {
  grid-column: 2;
  margin: 0;
  color: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.45;
  text-align: center;
}

.cinefi-alert-bar .cinefi-alert-bar__cta {
  margin-inline-start: 0.5em;
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

.cinefi-alert-bar .cinefi-alert-bar__cta:hover,
.cinefi-alert-bar .cinefi-alert-bar__cta:focus-visible {
  color: inherit;
  text-decoration-thickness: 2px;
}

.cinefi-alert-bar .cinefi-alert-bar__close {
  display: inline-grid;
  grid-column: 3;
  justify-self: end;
  place-items: center;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 55%);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  appearance: none;
  cursor: pointer;
  transition:
    color 0.2s ease,
    background-color 0.2s ease,
    transform 0.2s ease;
}

.cinefi-alert-bar .cinefi-alert-bar__close:hover {
  background: currentcolor;
  transform: scale(1.04);
}

.cinefi-alert-bar .cinefi-alert-bar__close:hover svg {
  color: var(--cinefi-alert-current-bg);
}

.cinefi-alert-bar .cinefi-alert-bar__close:focus-visible {
  outline: 3px solid currentcolor;
  outline-offset: 3px;
}

/* CineFi's Elementor header is fixed at top: 0. Keep both its wrapper and
 * Elementor's independently-fixed sticky nav below the live alert stack.
 * WordPress exposes the toolbar height as a custom property for signed-in
 * visitors; it falls back to zero for public visitors. Elementor writes an
 * inline top value on the sticky nav, so pin its top at zero and apply the
 * alert offset with the independent translate property. Animating top on the
 * sticky child conflicts with Elementor's relative-to-fixed state change. */
/* stylelint-disable custom-property-pattern -- WordPress core variable. */
html body header.elementor-location-header {
  top: calc(
    var(--wp-admin--admin-bar--height, 0px) +
      var(--cinefi-alert-bar-height, 0px)
  );
  transition: top 0.45s ease;
}

html body header.elementor-location-header .elementor-sticky--active {
  top: 0 !important;
  translate: 0
    calc(
      var(--wp-admin--admin-bar--height, 0px) +
        var(--cinefi-alert-bar-height, 0px)
    );
}

/* stylelint-enable custom-property-pattern */

@media (width <= 576px) {
  .cinefi-alert-bar__inner {
    grid-template-columns: minmax(0, 1fr) 32px;
    column-gap: 12px;
    min-height: 58px;
    padding-block: 12px;
  }

  .cinefi-alert-bar .cinefi-alert-bar__message {
    grid-column: 1;
    font-size: 14px;
    text-align: start;
  }

  .cinefi-alert-bar .cinefi-alert-bar__close {
    grid-column: 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cinefi-alert-bar,
  .cinefi-alert-bar__close,
  html body header.elementor-location-header,
  html body header.elementor-location-header .elementor-sticky--active {
    transition-duration: 0s;
  }
}
