/*
 * Sticky bar below 1024 px: date line and registration button fixed to the bottom of the viewport. The sticky-bar
 * module un-hides it once the facts box has scrolled out of view and adds .has-sticky-bar to <html>, which reserves
 * room so the bar never covers content (also for focused elements: scroll-padding).
 */
@layer components {
  .sticky-bar {
    position: fixed;
    inset-inline: 0;
    inset-block-end: 0;
    z-index: var(--z-bar);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-16);
    padding: var(--space-12) var(--layout-margin);
    border-block-start: var(--border-width-thin) solid var(--color-border-default);
    background-color: var(--color-background-default);
  }

  .sticky-bar[hidden] {
    display: none;
  }

  .sticky-bar__text {
    min-inline-size: 0;
    font-weight: var(--font-weight-bold);
    font-size: var(--type-label-s-size);
    line-height: var(--type-label-s-line-height);
  }

  .sticky-bar .button {
    flex: none;
  }

  html.has-sticky-bar {
    scroll-padding-block-end: calc(var(--component-control-height-m) + 2 * var(--space-12) + var(--space-16));
  }

  html.has-sticky-bar body {
    padding-block-end: calc(var(--component-control-height-m) + 2 * var(--space-12));
  }

  @media (min-width: 1024px) {
    .sticky-bar {
      display: none;
    }

    html.has-sticky-bar {
      scroll-padding-block-end: 0;
    }

    html.has-sticky-bar body {
      padding-block-end: 0;
    }
  }
}
