/* net-status.css — the connection notice.
 *
 * WHAT IT REPLACES. When the content service did not answer, the visitor was
 * thrown onto a full-page 503: whatever they were reading was gone, and a
 * fault that usually lasts seconds cost them their place. The page they were
 * on now stays exactly where it is and this says, quietly and at the top,
 * that the site could not reach its content.
 *
 * It is a notice, not a dialogue: it never takes focus, never blocks a click
 * anywhere else on the page, and it leaves on its own.
 */

.ul-net {
  /* Fixed, so it is at the top of the VIEW rather than the top of the
     document — a visitor halfway down a page would never see the latter. */
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 2147483000;

  display: flex;
  justify-content: center;
  padding: 14px 16px;

  /* The bar is a positioning frame; only the pill inside it is a surface. */
  pointer-events: none;
}

.ul-net-pill {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  max-width: min(100%, 560px);
  padding: 11px 18px;
  border-radius: 999px;

  /* Transparent on purpose: the page behind it stays readable, which is the
     whole point of having kept the visitor on it. The blur is what keeps the
     text legible over whatever happens to be underneath; browsers without it
     still have the tint. */
  background: rgba(11, 37, 78, 0.82);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  backdrop-filter: blur(10px) saturate(140%);
  border: 1px solid rgba(254, 190, 53, 0.42);
  box-shadow: 0 10px 30px -14px rgba(4, 28, 51, 0.55);

  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
  text-align: start;

  /* Only the pill is interactive — the retry button lives in it. */
  pointer-events: auto;

  /* Resting state: lifted out of sight, so the first frame after it is added
     is already correct and the entrance has somewhere to come from. */
  opacity: 0;
  transform: translateY(-14px);
  transition: opacity 0.26s ease, transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

.ul-net.is-on .ul-net-pill {
  opacity: 1;
  transform: translateY(0);
}

/* The dot pulses while the connection is the problem, and settles when it
   comes back — the one moving part, small enough not to pull the eye off the
   page. */
.ul-net-dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #febe35;
  box-shadow: 0 0 0 0 rgba(254, 190, 53, 0.55);
  animation: ul-net-pulse 1.9s ease-out infinite;
}

.ul-net.is-back .ul-net-dot {
  background: #43c478;
  box-shadow: none;
  animation: none;
}

.ul-net.is-back .ul-net-pill {
  border-color: rgba(67, 196, 120, 0.45);
}

@keyframes ul-net-pulse {
  0% { box-shadow: 0 0 0 0 rgba(254, 190, 53, 0.5); }
  70% { box-shadow: 0 0 0 9px rgba(254, 190, 53, 0); }
  100% { box-shadow: 0 0 0 0 rgba(254, 190, 53, 0); }
}

.ul-net-text {
  min-width: 0;
}

.ul-net-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.ul-net-btn:hover,
.ul-net-btn:focus-visible {
  background: #febe35;
  border-color: #febe35;
  color: #0b254e;
}

/* Dismiss: a bare glyph, because the notice already leaves on its own and
   this is only for a visitor who wants it gone now. */
.ul-net-close {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin-inline-start: -4px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.ul-net-close:hover,
.ul-net-close:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* A header that is already fixed at the top would sit under the notice; 14px
   of clearance is enough that the two read as stacked rather than collided. */
@media (max-width: 575px) {
  .ul-net {
    padding: 10px 12px;
  }

  .ul-net-pill {
    width: 100%;
    gap: 9px;
    padding: 10px 14px;
    font-size: 13px;
  }

  .ul-net-btn {
    padding: 5px 11px;
    font-size: 12px;
  }
}

/* The entrance is a convenience, not information. */
@media (prefers-reduced-motion: reduce) {
  .ul-net-pill {
    transition: none;
    transform: none;
  }

  .ul-net-dot {
    animation: none;
  }
}
