/* GX Important Notifications — fixed notice bar.
   Matches the WPFront bar it replaces: full width, pinned, brand red with
   white text (6.91:1). Colours and height come from CSS variables the plugin
   prints inline from its settings. */

.gxn-bar {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--gxn-bg, #aa272f);
  color: var(--gxn-fg, #fff);
  min-height: var(--gxn-height, 55px);
  display: flex;
  align-items: center;
  box-sizing: border-box;
  padding: 0.5rem 1.25rem;
  font-size: 0.9375rem;
  line-height: 1.4;
}

.gxn-bar--bottom {
  bottom: 0;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.22);
}

.gxn-bar--top {
  top: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
}

.gxn-bar__inner {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin: 0 auto;
  max-width: 1400px;
  width: 100%;
  /* Keeps clear of the Google Translate floating tab. The plugin prints these
     from the translator's own position setting, so they are 0 when the tab is
     elsewhere or the translator is not active. */
  padding-left: var(--gxn-clear-left, 0px);
  padding-right: var(--gxn-clear-right, 0px);
  padding-bottom: var(--gxn-clear-bottom, 0px);
  box-sizing: border-box;
}

.gxn-bar__label {
  flex-shrink: 0;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid currentColor;
  border-radius: 11px;
  padding: 0.2rem 0.7rem;
}

.gxn-bar__list {
  flex: 1 1 auto;
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.gxn-bar__item {
  margin: 0;
  padding: 0;
}

/* Static mode (one notice, or rotation disabled): simply stack them. */
.gxn-bar__item + .gxn-bar__item {
  margin-top: 0.25rem;
}

.gxn-bar__link {
  color: var(--gxn-fg, #fff);
  font-weight: 700;
  text-decoration: none;
}

/* Underline is off by request, so hover/focus needs its own affordance —
   colour alone is not a sufficient indicator. */
.gxn-bar__link:hover,
.gxn-bar__link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
}

.gxn-bar__link:focus-visible {
  outline: 3px solid var(--gxn-fg, #fff);
  outline-offset: 3px;
}

/* Rotating mode: one visible at a time, stacked in the same box so the bar
   height never jumps. Items stay in the DOM for assistive tech. */
.gxn-bar--rotating .gxn-bar__list {
  display: grid;
}

.gxn-bar--rotating .gxn-bar__item {
  grid-area: 1 / 1;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 400ms ease, transform 400ms ease, visibility 0s linear 400ms;
}

.gxn-bar--rotating .gxn-bar__item.is-current {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 400ms ease, transform 400ms ease, visibility 0s;
}

.gxn-bar__pause {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.gxn-bar__pause:focus-visible {
  outline: 3px solid var(--gxn-fg, #fff);
  outline-offset: 2px;
}

/* Two bars = paused glyph; a triangle = play. Drawn in CSS to avoid an icon
   request for a 12px control. */
.gxn-bar__pause-icon {
  display: block;
  width: 10px;
  height: 12px;
  border-left: 3px solid currentColor;
  border-right: 3px solid currentColor;
}

.gxn-bar__pause[aria-pressed="true"] .gxn-bar__pause-icon {
  width: 0;
  height: 0;
  border-left: 11px solid currentColor;
  border-right: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  margin-left: 3px;
}

@media (max-width: 600px) {
  .gxn-bar {
    font-size: 0.875rem;
  }
  .gxn-bar__label {
    display: none;
  }
  /* The tab overlaps the full width here, so drop the notice above it instead
     of reserving horizontal space there is none of. */
  .gxn-bar__inner {
    padding-left: 0;
    padding-right: 0;
    padding-bottom: 34px;
  }
}

/* Respect a reduced-motion preference: cross-fade without the slide, and the
   script also stops auto-advancing. */
@media (prefers-reduced-motion: reduce) {
  .gxn-bar--rotating .gxn-bar__item {
    transition: opacity 1ms linear, visibility 0s;
    transform: none;
  }
}
