/*! Strand UI | MIT License | dillingerstaffing.com */

/* cf: banner */

.strand-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 101;
  padding: var(--strand-space-3) var(--strand-space-4);
  font-family: var(--strand-font-sans);
  font-size: var(--strand-text-sm);
  line-height: var(--strand-leading-normal);
  text-align: center;
  border-bottom: 1px solid transparent;
}

.strand-banner ~ .strand-nav--glass {
  top: var(--strand-banner-height, 0px);
}

.strand-banner ~ .strand-nav:not(.strand-nav--glass) {
  margin-top: var(--strand-banner-height, 0px);
}

body:has(.strand-banner) .strand-instrument-viewport--full-bleed {
  height: calc(100vh - var(--strand-nav-height) - var(--strand-banner-height, 0px));
  height: calc(100dvh - var(--strand-nav-height) - var(--strand-banner-height, 0px));
}

/* JS-managed fallback for browsers without :has() */
body.strand-banner-active .strand-instrument-viewport--full-bleed {
  height: calc(100vh - var(--strand-nav-height) - var(--strand-banner-height, 0px));
  height: calc(100dvh - var(--strand-nav-height) - var(--strand-banner-height, 0px));
}

/* ── Variants ── */
.strand-banner--info {
  background: var(--strand-blue-glow);
  color: var(--strand-blue-deep);
  border-bottom-color: var(--strand-blue-indicator);
}

.strand-banner--warning {
  background: var(--strand-amber-tint);
  color: var(--strand-on-amber-tint);
  border-bottom-color: var(--strand-amber-caution);
}

.strand-banner--critical {
  background: var(--strand-red-tint);
  color: var(--strand-on-red-tint);
  border-bottom-color: var(--strand-red-alert);
}

.strand-banner__text {
  margin: 0 auto;
  max-width: 65ch;
  font-weight: var(--strand-weight-medium);
}

/* ── Dismiss button ── */
.strand-banner__dismiss {
  position: absolute;
  right: var(--strand-space-4);
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
  padding: var(--strand-space-2);
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--strand-radius-md);
  transition: opacity var(--strand-duration-fast) ease;
}

.strand-banner__dismiss:hover {
  opacity: 1;
}

.strand-banner__dismiss:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}
