/*
 * Look of the site features drawn by script: the share menu and its "Link copied" note (share.js), the
 * like button's pressed heart (counters.js), the subscribe box's answer (subscribe.js) and the search
 * highlights (search.js; the same rules as docs search.css, repeated for pages without docs.css).
 * Company design language: square corners, 1px hairlines, Manrope text, company blues. Colours are the
 * docs tokens, so the dark theme (theme.css) applies on its own. Load after docs.css and research.css.
 */

/* ---------- share menu ---------- */
.orz-share-menu {
  position: fixed;
  z-index: 300;
  min-width: 232px;
  padding: 6px;
  border: 1px solid var(--line-strong, #c5d1e3);
  background: var(--panel, #fff);
  box-shadow: var(--rs-menu-shadow, 0 18px 50px rgba(5, 8, 13, 0.18));
  color: var(--ink, #07101d);
  font: 600 13px/1.3 var(--body, sans-serif);
}
.orz-share-menu[hidden] {
  display: none;
}
.orz-share-menu button {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 14px;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.orz-share-menu button[hidden] {
  display: none;
}
.orz-share-menu button:hover {
  background: var(--paper-blue, #eaf0fb);
}
.orz-share-menu button:focus-visible {
  outline: 2px solid var(--focus, #2473ff);
  outline-offset: -2px;
  background: var(--paper-blue, #eaf0fb);
}
.orz-share-menu button > svg {
  width: 18px;
  height: 18px;
}
.orz-share-menu .orz-share-menu__out {
  width: 14px;
  height: 14px;
  color: var(--muted, #59677b);
}

/* "Link copied": a short note next to the button; it is also the polite live region for screen readers. */
.orz-share-toast {
  position: fixed;
  z-index: 310;
  top: -100px;
  right: auto;
  bottom: auto;
  left: 0;
  width: auto;
  height: auto;
  max-width: calc(100vw - 16px);
  padding: 8px 12px;
  background: var(--ink, #07101d);
  color: var(--rs-on-ink, #fff);
  font: 700 12px/1.2 var(--body, sans-serif);
  letter-spacing: 0.02em;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 160ms ease, transform 160ms ease;
}
.orz-share-toast.is-on {
  opacity: 1;
  transform: none;
}

/* ---------- like ---------- */
[data-like][aria-pressed="true"] svg path {
  fill: currentColor;
}
[data-like].is-popping svg {
  animation: orz-like-pop 380ms ease;
}
@keyframes orz-like-pop {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.28);
  }
  100% {
    transform: scale(1);
  }
}
/* Numbers fill in after load; the reserved width keeps the button from changing size. */
[data-like-count],
[data-share-count] {
  display: inline-block;
  min-width: 2ch;
  font-variant-numeric: tabular-nums;
  text-align: left;
}

/* ---------- subscribe ---------- */
/* The answered form steps aside for the message (a display rule such as .rs-form's flex would keep it). */
form[data-subscribe][hidden] {
  display: none !important;
}
.orz-subscribe-done {
  display: grid;
  gap: 6px;
  padding: 18px 20px;
  border: 1px solid var(--line-strong, #c5d1e3);
  background: var(--panel, #fff);
}
.orz-subscribe-done:focus {
  outline: none;
}
.orz-subscribe-done strong {
  color: var(--ink, #07101d);
  font-family: var(--display, sans-serif);
  font-size: 22px;
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.orz-subscribe-done span {
  color: var(--ink-soft, #314056);
  font-size: 14px;
  line-height: 1.6;
}
.orz-subscribe-done small {
  color: var(--muted, #59677b);
  font-size: 12px;
}
.orz-subscribe-error {
  margin: 10px 0 0;
  color: var(--caution-label, #8c3a25);
  font-size: 13px;
  font-weight: 600;
}
form[data-subscribe][aria-busy="true"] [type="submit"] {
  opacity: 0.6;
  cursor: progress;
}

/* ---------- search highlights on the opened article (docs search.css) ---------- */
::highlight(docs-search-word) {
  background-color: var(--mark-bg);
}
::highlight(docs-search-line) {
  background-color: color-mix(in srgb, var(--blue) 25%, transparent);
  text-decoration-color: var(--blue);
  text-decoration-line: underline;
  text-decoration-thickness: 2px;
}
html[data-theme="dark"] ::highlight(docs-search-line) {
  background-color: color-mix(in srgb, var(--blue) 45%, transparent);
  text-decoration-color: var(--cyan);
}

@media (prefers-reduced-motion: reduce) {
  [data-like].is-popping svg {
    animation: none;
  }
  .orz-share-toast {
    transition: none;
  }
}
