/* Singular article: reading time, share bar, scroll progress */

.mh-read-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  pointer-events: none;
  padding-top: env(safe-area-inset-top, 0px);
}

.mh-read-progress[hidden] {
  display: none !important;
}

.mh-read-progress__track {
  height: 3px;
  background: color-mix(in srgb, currentColor 12%, transparent);
}

.mh-read-progress__bar {
  height: 100%;
  width: 0%;
  background: #e85d04;
  transform-origin: left center;
  transition: width 0.08s linear;
}

html[data-mh-theme="dark"] .mh-read-progress__bar {
  background: #ff8c42;
}

.mh-read-progress__label {
  display: none;
}

@media (max-width: 768px) {
  .mh-read-progress__label {
    display: inline-block;
    margin: 0.35rem 0.75rem 0;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: color-mix(in srgb, Canvas 88%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid color-mix(in srgb, currentColor 14%, transparent);
    font-size: 0.75rem;
    line-height: 1.2;
    opacity: 0.9;
    pointer-events: none;
  }

  html[data-mh-theme="dark"] .mh-read-progress__label {
    background: rgba(18, 18, 20, 0.88);
  }
}

.mh-reading-time {
  display: inline-block;
  margin-inline-start: 0.65rem;
  font-size: 0.9em;
  opacity: 0.72;
  white-space: nowrap;
}

.mh-reading-time::before {
  content: "·";
  margin-inline-end: 0.65rem;
  opacity: 0.55;
}

.entry-meta .mh-reading-time {
  margin-top: 0;
}

.mh-share-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.75rem 0 0.5rem;
  padding: 0.85rem 0 0;
  border-top: 1px solid color-mix(in srgb, currentColor 14%, transparent);
}

.mh-share-bar__btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.mh-share-bar__btn:hover,
.mh-share-bar__btn:focus-visible {
  background: color-mix(in srgb, currentColor 8%, transparent);
  outline: none;
}

.mh-share-bar__btn--tg {
  border-color: color-mix(in srgb, #0088cc 55%, currentColor);
}

.mh-share-bar__btn.is-done,
.mh-share-bar__btn.is-saved {
  border-color: color-mix(in srgb, #2e7d32 50%, currentColor);
}

.mh-share-bar__btn--list {
  opacity: 0.88;
}

.mh-reading-list {
  margin: 0.65rem 0 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid color-mix(in srgb, currentColor 16%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, currentColor 5%, transparent);
}

.mh-reading-list[hidden] {
  display: none !important;
}

.mh-reading-list__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.mh-reading-list__close {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.88rem;
  opacity: 0.75;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.mh-reading-list__hint {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  opacity: 0.65;
}

.mh-reading-list__empty {
  margin: 0;
  font-size: 0.92rem;
  opacity: 0.8;
}

.mh-reading-list__items {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mh-reading-list__items li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.45rem 0;
  border-top: 1px solid color-mix(in srgb, currentColor 10%, transparent);
}

.mh-reading-list__items li:first-child {
  border-top: 0;
  padding-top: 0;
}

.mh-reading-list__items a {
  flex: 1 1 auto;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  line-height: 1.35;
}

.mh-reading-list__remove {
  appearance: none;
  flex: 0 0 auto;
  width: 1.75rem;
  height: 1.75rem;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 8%, transparent);
  color: inherit;
  font: inherit;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
}

/* Sticky mobile share — thumb-reach row above browser chrome */
@media (max-width: 768px) {
  .mh-share-bar {
    position: sticky;
    bottom: 0;
    z-index: 40;
    flex-wrap: nowrap;
    gap: 0.4rem;
    margin: 1.25rem -0.75rem 0;
    padding: 0.65rem 0.75rem calc(0.65rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid color-mix(in srgb, currentColor 16%, transparent);
    background: color-mix(in srgb, Canvas 92%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .mh-share-bar__btn {
    flex: 0 0 auto;
    min-height: 2.75rem;
    padding: 0.5rem 0.85rem;
    font-size: 0.88rem;
  }
}

@media (max-width: 768px) {
  html[data-mh-theme="dark"] .mh-share-bar {
    background: rgba(18, 18, 20, 0.92);
  }
}
