/*
 * Announcement bar (includes/notice.php).
 *
 * Fixed above the theme's fixed header. Its height goes into
 * --hibot-top-offset: hibot-child moves the header down by it and counts it
 * when scrolling to anchors; the body padding moves the page down by it, so
 * the bar covers nothing.
 *
 * Sizes follow the theme: 1rem = 10px at 1440px wide on desktop and at
 * 390px wide on mobile. The theme sets a font size on every element, so
 * each one here sets its own.
 */

body.has-hibot-notice {
  --hibot-top-offset: 5rem;
  padding-top: var(--hibot-top-offset);
}

.hb-notice {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100; /* above the header (99) */
  height: 5rem;
  background-color: #FF521C;
  font-size: 1.4rem;
}

.hb-notice--en,
.hb-notice--en * {
  font-family: "Roboto Slab", serif;
}

.hb-notice__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.6rem;
  height: 100%;
  padding: 0 8rem;
  color: #fff;
  font-size: 1.4rem;
}

.hb-notice__label {
  flex-shrink: 0;
  padding: .4rem .8rem .3rem;
  background-color: #fff;
  color: #FF521C;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.hb-notice__text {
  overflow: hidden;
  color: #fff;
  font-size: 1.4rem;
  line-height: 1.5; /* the theme's line-height 1 would clip descenders here */
  white-space: nowrap;
  text-overflow: ellipsis;
}

.hb-notice__more {
  flex-shrink: 0;
  color: #fff;
  font-size: 1.4rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: underline;
  text-underline-offset: .3rem;
}

.hb-notice__more span {
  font-size: inherit;
}

a.hb-notice__inner:hover .hb-notice__more {
  text-decoration: none;
}

.hb-notice__short,
.hb-notice__arrow {
  display: none;
}

/* Shown to editors while the status is "Preview". */
.hb-notice__preview {
  position: absolute;
  top: 50%;
  right: 2rem;
  transform: translateY(-50%);
  padding: .3rem .6rem;
  border: .1rem solid #fff;
  color: #fff;
  font-size: 1rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

@media (max-width: 767px) {
  body.has-hibot-notice {
    --hibot-top-offset: 4.4rem;
  }

  .hb-notice {
    height: 4.4rem;
  }

  .hb-notice__inner {
    gap: .8rem;
    padding: 0 2rem;
  }

  .hb-notice__label,
  .hb-notice__text,
  .hb-notice__more {
    display: none;
  }

  .hb-notice__short {
    display: block;
    overflow: hidden;
    color: #fff;
    font-size: 1.3rem;
    line-height: 1.5;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .hb-notice__arrow {
    display: inline;
    flex-shrink: 0;
    color: #fff;
    font-size: 1.3rem;
  }

  .hb-notice__preview {
    right: .6rem;
    font-size: .8rem;
  }
}
