/* ── Offline banner — ARKAN UI core ───────────────────────────────
   Mounted via services/offline.js's mountOfflineBanner(container).
   Visible-but-unobtrusive: a thin strip, not a modal or toast.

   Fixed (not sticky-in-flow): every page in this codebase fully replaces
   #app-main's innerHTML on its own render (main.innerHTML = ...), so a
   banner living inside that container would vanish on the next
   navigation. Mounting it once into a persistent shell container (see
   the integration note in this project's build report — header.js is
   the one function every page already calls) and positioning it fixed
   under the header is what makes it survive route changes without
   editing 80+ individual page files. Still perfectly usable mounted
   inline inside a single page's own container too — `position: fixed`
   there would just visually detach it from that flow, so prefer that
   only for the persistent global instance. */

.offline-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  max-height: 0;
  padding: 0 var(--space-4);
  overflow: hidden;
  color: var(--status-warning);
  background: var(--status-warning-bg);
  border-bottom: 1px solid transparent;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  line-height: 1.3;
  z-index: 190; /* below the mobile sidebar drawer (200) and bottom-nav (210), above page content */
  opacity: 0;
  transition: max-height var(--transition-md), opacity var(--transition-md), padding var(--transition-md);
}

.offline-banner--visible {
  max-height: 44px;
  padding: 10px var(--space-4);
  opacity: 1;
  border-bottom-color: var(--border-default);
}

.offline-banner svg {
  flex-shrink: 0;
}

.offline-banner__text {
  min-width: 0;
}

/* Reserve the matching space at the top of the content area so the fixed
   banner doesn't overlap the first line of whatever page is showing.
   Toggled by services/offline.js's apply() alongside the visibility class. */
body.has-offline-banner #app-main {
  padding-top: 44px;
  transition: padding-top var(--transition-md);
}

@media (prefers-reduced-motion: reduce) {
  .offline-banner,
  body.has-offline-banner #app-main {
    transition: none;
  }
}

@media (max-width: 480px) {
  .offline-banner__text {
    font-size: 12.5px;
  }
}
