/* ============================================================
   Global version-update banner
   Shared across all product pages. Canonical codex variables
   are defined by each page's own CSS :root.
   ============================================================ */

.version-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  /* Was 1000 — above every layer in the app, including true modals (the reader's
     settings panel is 200, its episode-list overlay 60). A passive "a new version
     is ready" notice must not paint over a dialog the reader is using. 120 keeps
     it above page content and the mid panels, below anything modal. */
  z-index: 120;
  /* Was a bare rgba(201,160,85,0.05) — five percent gold over nothing, so page
     content read straight through it. The tint is a tint; it needs ground. */
  background-color: var(--bg);
  background-image: linear-gradient(rgba(201, 160, 85, 0.05), rgba(201, 160, 85, 0.05));
  border-bottom: 0.5px solid var(--container-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 32px;
  min-height: 44px;
}

.version-banner[hidden] {
  display: none;
}

.version-banner-text {
  font-family: var(--font-body);
  font-size: 14px;
  font-style: italic;
  color: var(--fg-muted);
  margin: 0;
  line-height: 1.4;
}

.version-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.version-banner-refresh {
  background: transparent;
  border: 0.5px solid var(--gold);
  color: var(--gold);
  /* WCAG 2.5.5 — it was ~28px tall. The hit area is grown to 44px and pulled back
     visually with a negative block margin, so the banner's painted height is
     unchanged and nothing downstream shifts. */
  padding: 6px 14px;
  min-height: 44px;
  margin-block: -8px;
  display: inline-flex;
  align-items: center;
  border-radius: 2px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.version-banner-refresh:hover {
  background: var(--gold);
  color: var(--bg);
}

.version-banner-dismiss {
  background: transparent;
  border: none;
  color: var(--fg-dim);
  cursor: pointer;
  padding: 4px 8px;
  font-size: 16px;
  line-height: 1;
  transition: color 0.15s;
}

.version-banner-dismiss:hover {
  color: var(--fg);
}

/* Push page content below banner when active. Measured — see publishHeight() in
   version-banner.js. The fallback covers the frame before the first measurement. */
body.has-version-banner {
  padding-top: var(--version-banner-h, 44px);
}

@media (max-width: 480px) {
  .version-banner {
    padding: 10px 20px;
    min-height: 40px;
  }

  .version-banner-text {
    font-size: 13px;
  }

  /* No padding-top override here any more — it is measured, so the narrow-screen
     height flows through on its own. The old hard-coded 40px is what disagreed
     with reader.css's 479px breakpoint at exactly 480px wide. */
}
