/*
 * Atlas Site Banner. Matches the "Xmas Hours Banner" Figma (Atlas | Website Master Designs).
 *
 * The banner only shows once the <head> script has added .atlas-sb-on to <html>.
 * --atlas-sb-h is the banner's height: a guess here so the page makes room from the
 * first paint, then measured by banner.js. --atlas-sb-offset is how far the theme's
 * fixed nav sits below the top of the window: the banner's height at the top of the
 * page, shrinking to 0 as the banner scrolls away.
 */

html.atlas-sb-on {
  --atlas-sb-h: 81px;
}
@media (max-width: 767px) {
  html.atlas-sb-on {
    --atlas-sb-h: 116px;
  }
}

html.atlas-sb-on body {
  padding-top: var(--atlas-sb-h);
}

/* The atlas-labs theme's nav is fixed to the top of the window. */
html.atlas-sb-on .nav-container {
  top: var(--atlas-sb-offset, var(--atlas-sb-h));
}

html.atlas-sb-locked {
  overflow: hidden;
}

/* Banner */

.atlas-sb {
  display: none;
}

html.atlas-sb-on .atlas-sb {
  position: absolute;
  top: var(--wp-admin--admin-bar--height, 0px);
  left: 0;
  right: 0;
  z-index: 100000;
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 24px;
  min-height: 81px;
  padding: 16px;
  background: var(--atlas-sb-bg, #3963e0);
  color: #fff;
  font-family: "Sora", sans-serif;
  text-align: center;
  cursor: pointer;
}

.atlas-sb__text {
  margin: 0;
  font-size: 21px;
  font-weight: 600;
  line-height: 24px;
  text-wrap: balance;
}

.atlas-sb__button {
  margin: 0;
  padding: 10px 14px;
  border: 2px solid #fff;
  border-radius: 100px;
  background: transparent;
  color: #fff;
  font: 600 16px/24px "Sora", sans-serif;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.atlas-sb__button:hover,
.atlas-sb__button:focus-visible {
  background: #fff;
  color: var(--atlas-sb-bg, #3963e0);
}

.atlas-sb__button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

@media (max-width: 767px) {
  html.atlas-sb-on .atlas-sb {
    gap: 12px;
    min-height: 0;
    padding: 12px 16px;
  }

  .atlas-sb__text {
    font-size: 16px;
    line-height: 22px;
  }

  .atlas-sb__button {
    padding: 6px 14px;
    font-size: 14px;
    line-height: 20px;
  }
}

/* Pop-up */

.atlas-sb-dialog {
  box-sizing: border-box;
  width: min(968px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #fffcf7;
  color: #161616;
  font-family: "Sora", sans-serif;
  overflow: hidden;
}

/* Opening focuses the pop-up itself (banner.js); its buttons keep their focus rings. */
.atlas-sb-dialog:focus {
  outline: none;
}

.atlas-sb-dialog::backdrop {
  background: rgba(22, 22, 22, 0.5);
}

/* The inner box scrolls, not the <dialog>, so a click on the scrollbar isn't taken
   for a click on the backdrop. */
.atlas-sb-dialog__inner {
  box-sizing: border-box;
  max-height: calc(100dvh - 32px);
  padding: 32px;
  overflow: auto;
  overscroll-behavior: contain;
}

/* The theme trims line-height above and below text with ::before/::after; keep the
   pop-up's spacing to the design's line heights instead. */
.atlas-sb-dialog :is(h2, p)::before,
.atlas-sb-dialog :is(h2, p)::after,
.atlas-sb__text::before,
.atlas-sb__text::after {
  content: none;
}

.atlas-sb-dialog__close {
  float: right;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px 24px;
  padding: 10px 14px;
  border: 2px solid #3963e0;
  border-radius: 100px;
  background: transparent;
  color: #3963e0;
  font: 600 16px/24px "Sora", sans-serif;
  cursor: pointer;
  transition: background-color 0.2s;
}

.atlas-sb-dialog__close img {
  display: block;
  width: 24px;
  height: 24px;
}

.atlas-sb-dialog__close:hover,
.atlas-sb-dialog__close:focus-visible {
  background: rgba(57, 99, 224, 0.08);
}

.atlas-sb-dialog__close:focus-visible {
  outline: 2px solid #3963e0;
  outline-offset: 2px;
}

.atlas-sb-dialog__title {
  margin: 12px 0 0;
  font-size: 64px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
  color: #161616;
}

.atlas-sb-dialog__intro {
  clear: both;
  margin: 24px 0 0;
  font-size: 24px;
  font-weight: 600;
  line-height: 34px;
}

.atlas-sb-dialog__section {
  clear: both;
  margin-top: 40px;
}

.atlas-sb-dialog__body {
  font-size: 16px;
  font-weight: 300;
  line-height: 24px;
}

.atlas-sb-dialog__body > * {
  margin: 0;
}

.atlas-sb-dialog__body > * + * {
  margin-top: 24px;
}

.atlas-sb-dialog__body > :is(ul, ol) + * {
  margin-top: 40px;
}

.atlas-sb-dialog__body ul,
.atlas-sb-dialog__body ol {
  padding-left: 24px;
}

.atlas-sb-dialog__body ul {
  list-style: square;
}

.atlas-sb-dialog__body ol {
  list-style: decimal;
}

.atlas-sb-dialog__body li + li {
  margin-top: 24px;
}

.atlas-sb-dialog__body li::marker {
  font-size: 12px;
}

.atlas-sb-dialog__body :is(strong, b) {
  font-weight: 700;
}

.atlas-sb-dialog__body a {
  color: #3963e0;
  text-decoration: underline;
}

.atlas-sb-dialog__footer {
  margin: 40px 0 0;
  font-size: 24px;
  font-weight: 600;
  line-height: 34px;
}

@media (max-width: 767px) {
  .atlas-sb-dialog__inner {
    padding: 20px;
  }

  .atlas-sb-dialog__close {
    padding: 6px 12px;
    font-size: 14px;
    line-height: 20px;
  }

  .atlas-sb-dialog__title {
    margin-top: 0;
    font-size: 36px;
  }

  .atlas-sb-dialog__intro,
  .atlas-sb-dialog__footer {
    font-size: 19px;
    line-height: 27px;
  }

  /* Line breaks typed into the introduction are for the desktop width. */
  .atlas-sb-dialog__intro br {
    display: none;
  }

  .atlas-sb-dialog__section {
    margin-top: 28px;
  }

  .atlas-sb-dialog__body > :is(ul, ol) + * {
    margin-top: 24px;
  }

  .atlas-sb-dialog__body li + li {
    margin-top: 16px;
  }
}

@media print {
  html.atlas-sb-on body {
    padding-top: 0;
  }

  .atlas-sb,
  .atlas-sb-dialog {
    display: none !important;
  }
}
