/* components/reading-progress.css — the reading-progress bar on posts.
   The <progress data-progress-bar> and its script come from Ghost admin's
   site-footer code injection (not this repo), so the attribute isn't ours
   to rename. reading-progress.js moves it into .site-header, where it hangs
   under the bar. Shown only while the post header is condensed and the menu
   is closed. --color-fg, not the invert pair, which in dark mode would
   vanish on the bar. */

[data-progress-bar] {
  display: none;
}

body.post-template[data-header-condensed]:not([data-menu-open]) .site-header > [data-progress-bar] {
  display: block;
}

/* Only the moved element is positioned; one left at the end of <body> stays
   hidden. Absolute, over the header's bottom hairline, so it adds nothing
   to the header's height. Anchored by the bottom, with no percentage
   inset: iOS Safari resolves a % top against the sticky header's height
   and dropped the bar a full header below. */
.site-header > [data-progress-bar] {
  appearance: none;
  position: absolute;
  inset-block-end: calc(-1 * var(--border-width));
  inset-inline: 0;
  inline-size: 100%;
  block-size: 2px;
  border: 0;
  background-color: transparent;
  /* Firefox's fill; WebKit/Blink use ::-webkit-progress-value. */
  color: var(--color-fg);
}

/* Vendor pseudo-elements, kept as separate rules: an unknown one in a
   selector list would drop the whole list. */
.site-header > [data-progress-bar]::-webkit-progress-bar {
  background-color: transparent;
}

.site-header > [data-progress-bar]::-webkit-progress-value {
  background-color: var(--color-fg);
}

.site-header > [data-progress-bar]::-moz-progress-bar {
  background-color: var(--color-fg);
}
