/* Ayra ix — compact share control (dark, teal accent)
   All rules scoped under .ayx-share. Icons capped at 18px — never inherit page svg sizing. */
.ayx-share {
  --ayx-share-bg: rgba(10, 12, 20, 0.96);
  --ayx-share-border: rgba(255, 255, 255, 0.1);
  --ayx-share-text: rgba(244, 244, 245, 0.92);
  --ayx-share-muted: rgba(244, 244, 245, 0.55);
  --ayx-share-hover: rgba(0, 232, 219, 0.12);
  --ayx-share-accent: var(--accent, #00e8db);
  position: relative;
  display: inline-flex;
  align-items: center;
  margin: 0.85rem 0 1.5rem;
  z-index: 40;
  max-width: 100%;
  font-family: var(--font-body, Inter, system-ui, sans-serif);
  color: var(--ayx-share-text);
}

.ayx-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.38rem 0.72rem;
  border: 1px solid var(--ayx-share-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--ayx-share-text);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.ayx-share-btn:hover,
.ayx-share-btn:focus-visible,
.ayx-share-btn[aria-expanded="true"] {
  border-color: color-mix(in srgb, var(--ayx-share-accent) 45%, transparent);
  background: var(--ayx-share-hover);
  color: #fff;
  outline: none;
}

.ayx-share svg,
.ayx-share-btn svg,
.ayx-share-menu svg {
  width: 18px !important;
  height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  flex-shrink: 0;
  display: block;
  overflow: hidden;
  opacity: 0.9;
  color: inherit;
  fill: currentColor;
}

.ayx-share-btn svg {
  width: 14px !important;
  height: 14px !important;
  max-width: 14px !important;
  max-height: 14px !important;
}

/* Closed by default — never leave channel list inline */
.ayx-share-menu {
  position: fixed;
  z-index: 50;
  box-sizing: border-box;
  width: max-content;
  min-width: 200px;
  max-width: min(220px, calc(100vw - 32px));
  padding: 0.45rem;
  border: 1px solid var(--ayx-share-border);
  border-radius: 12px;
  background: var(--ayx-share-bg);
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  list-style: none;
  margin: 0;
  display: none !important;
  visibility: hidden;
  pointer-events: none;
}

/* .is-open is set on the menu itself (it's appended to <body>, not root —
   see assets/share.js positionMenu()), not on an ancestor. */
.ayx-share-menu.is-open {
  display: block !important;
  visibility: visible;
  pointer-events: auto;
}

.ayx-share-menu a,
.ayx-share-menu button {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  margin: 0;
  padding: 0.5rem 0.6rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ayx-share-text);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease;
}

.ayx-share-menu a:hover,
.ayx-share-menu a:focus-visible,
.ayx-share-menu button:hover,
.ayx-share-menu button:focus-visible {
  background: var(--ayx-share-hover);
  outline: none;
}

.ayx-share-menu span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ayx-share-note {
  margin: 0.15rem 0.35rem 0.2rem;
  padding: 0.45rem 0.5rem 0.35rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--ayx-share-muted);
}

.ayx-share-toast {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 51;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--ayx-share-accent) 35%, transparent);
  background: rgba(6, 18, 18, 0.96);
  color: var(--ayx-share-accent);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.ayx-share-toast.is-on {
  opacity: 1;
  transform: translateY(0);
}

/* Sit cleanly in common meta rows */
.hub-article-meta .ayx-share,
.post-meta + .ayx-share,
.article .meta .ayx-share,
.article .author + .ayx-share {
  margin-top: 0.65rem;
}

/* Community hub hero — compact row under stats; accent inherits community --accent */
.community-page .cm-hub-share,
.community-page .hero-masthead-copy > .ayx-share {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 0.65rem;
  margin-bottom: 0;
}

.community-page .cm-hub-share .ayx-share {
  margin: 0;
}

/* AI Hub listing hero — left-aligned under title */
.ai-hub-page .hub-home-share {
  display: flex;
  justify-content: flex-start;
  width: 100%;
  margin-top: 0.75rem;
  margin-bottom: 0;
}

.ai-hub-page .hub-home-share .ayx-share {
  margin: 0;
  z-index: 5;
}

.hub-article-meta {
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.85rem;
}

@media (max-width: 640px) {
  .ayx-share-menu {
    min-width: 190px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ayx-share-btn,
  .ayx-share-menu a,
  .ayx-share-menu button,
  .ayx-share-toast {
    transition: none;
  }
}
