/* Reader UX widgets — share buttons, reading progress, back-to-top.
   Uses currentColor + CSS vars so they inherit the active theme. */

/* ── Reading progress bar ── */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--accent, #3b82f6);
  z-index: 9998;
  transition: width 0.1s linear;
  pointer-events: none;
}

/* ── Share bar ── */
.share-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 32px 0 0;
  padding: 16px 0;
  border-top: 1px solid var(--border, rgba(128,128,128,0.2));
  border-bottom: 1px solid var(--border, rgba(128,128,128,0.2));
}
.share-bar__label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  opacity: 0.7;
  margin-right: 4px;
}
.share-bar__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border, rgba(128,128,128,0.25));
  color: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, background-color 0.15s, color 0.15s, border-color 0.15s;
  padding: 0;
  font: inherit;
  position: relative;
}
.share-bar__btn:hover {
  transform: translateY(-2px);
  text-decoration: none;
}
.share-bar__btn:focus-visible {
  outline: 2px solid var(--accent, #3b82f6);
  outline-offset: 2px;
}
.share-bar__btn--x:hover        { background: #000; color: #fff; border-color: #000; }
.share-bar__btn--fb:hover       { background: #1877f2; color: #fff; border-color: #1877f2; }
.share-bar__btn--in:hover       { background: #0a66c2; color: #fff; border-color: #0a66c2; }
.share-bar__btn--copy:hover     { background: var(--accent, #3b82f6); color: #fff; border-color: var(--accent, #3b82f6); }
.share-bar__btn.is-copied {
  width: auto;
  padding: 0 12px;
  border-radius: 18px;
  background: var(--success, #188038);
  color: #fff;
  border-color: var(--success, #188038);
}
.share-bar__copied-label {
  font-size: 12px;
  font-weight: 600;
}

/* ── Back-to-top FAB ── */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent, #3b82f6);
  color: #fff;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
  z-index: 9997;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.18s ease, transform 0.18s ease, background-color 0.15s;
}
.back-to-top.show {
  opacity: 1;
  transform: translateY(0);
}
.back-to-top:hover {
  background: var(--accent-hover, var(--accent, #2563eb));
}
.back-to-top:focus-visible {
  outline: 2px solid var(--accent, #3b82f6);
  outline-offset: 3px;
}
@media (max-width: 600px) {
  .back-to-top {
    bottom: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .back-to-top,
  .share-bar__btn,
  .reading-progress {
    transition: none;
  }
}

/* ── Author social links (inside author box) ── */
.author-social {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.author-social__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border, rgba(128,128,128,0.25));
  color: inherit;
  opacity: 0.75;
  text-decoration: none;
  transition: transform 0.12s ease, background-color 0.15s, color 0.15s, border-color 0.15s, opacity 0.15s;
}
.author-social__btn:hover {
  opacity: 1;
  transform: translateY(-1px);
  text-decoration: none;
}
.author-social__btn:focus-visible {
  outline: 2px solid var(--accent, #3b82f6);
  outline-offset: 2px;
}
.author-social__btn--twitter:hover  { background: #000; color: #fff; border-color: #000; }
.author-social__btn--linkedin:hover { background: #0a66c2; color: #fff; border-color: #0a66c2; }
.author-social__btn--github:hover   { background: #24292e; color: #fff; border-color: #24292e; }
.author-social__btn--website:hover  { background: var(--accent, #3b82f6); color: #fff; border-color: var(--accent, #3b82f6); }

/* Allow the author box to stack avatar + body (body is now a div, not a plain node) */
.post-author-box__avatar-link {
  flex-shrink: 0;
  display: inline-block;
  border-radius: 50%;
}
.post-author-box__name-link {
  color: inherit;
  text-decoration: none;
}
.post-author-box__name-link:hover { text-decoration: underline; }

/* ── CTA blocks (D1) — embeddable in article Markdown via :::cta <slug> ── */
.cta-block {
  position: relative;
  margin: 2.25rem 0;
  padding: 1.25rem 1.35rem 1.35rem;
  border-radius: 10px;
  background: var(--bg, rgba(128, 128, 128, 0.05));
  border-left: 4px solid var(--accent, #3b82f6);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.cta-block--newsletter { border-left-color: #3b82f6; }
.cta-block--affiliate  { border-left-color: #16a34a; }
.cta-block--custom     { border-left-color: #f59e0b; }
.cta-block__title {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
  color: inherit;
}
.cta-block p {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: inherit;
  opacity: 0.85;
}
.cta-block p:last-child { margin-bottom: 0; }
.cta-block__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 0.25rem;
  padding: 0.55rem 1rem;
  background: var(--accent, #3b82f6);
  color: #fff !important;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none !important;
  transition: transform 0.08s, box-shadow 0.15s;
}
.cta-block--affiliate .cta-block__btn { background: #16a34a; }
.cta-block--custom    .cta-block__btn { background: #f59e0b; color: #1f2937 !important; }
.cta-block__btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.cta-block__btn::after {
  content: '→';
  display: inline-block;
  transition: transform 0.12s;
}
.cta-block__btn:hover::after { transform: translateX(2px); }
