/* ============================================================
   SOCIAL-BAR.CSS — Fixed right-edge social icon bar
   ============================================================ */

/* ── Container: right-anchored column.
   align-items: flex-end keeps every item's RIGHT edge at the viewport
   right edge, so width growth expands LEFT (into the viewport).
   overflow: visible lets the widened item escape the 46px container
   without pushing its siblings. ── */
.social-bar {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 800;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  width: 46px;
  overflow: visible;
  pointer-events: auto;
}

/* ── Each item: collapses to icon-only width, expands LEFT on hover ── */
.social-bar__item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 46px;
  height: 46px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: var(--r-sm) 0 0 var(--r-sm);
  color: var(--text-2);
  cursor: pointer;
  text-decoration: none;
  overflow: hidden;
  /* Clip label when narrow; item overflows parent container when wide */
  transition:
    width       300ms var(--ease-spring),
    background  200ms ease,
    color       200ms ease,
    border-color 200ms ease;
  -webkit-tap-highlight-color: transparent;
}

/* Desktop hover: expand only this item — siblings stay at 46px */
@media (hover: hover) and (pointer: fine) {
  .social-bar__item:hover {
    width: 140px;
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--border-2);
    z-index: 1;
  }

  .social-bar__item:hover .social-bar__label {
    opacity: 1;
    transform: translateX(0);
  }
}

.social-bar__item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-right: 14px;
  position: relative;
  z-index: 1;
}

.social-bar__label {
  font-family: var(--font-heading);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  padding-left: 14px;
  opacity: 0;
  transform: translateX(-8px);
  transition:
    opacity   200ms ease,
    transform 200ms var(--ease-out);
  pointer-events: none;
  flex: 1;
}

/* Share — brief accent flash on success */
.social-bar__item--share.copied {
  color: var(--accent);
  border-color: rgba(76,201,240,0.3);
}

/* ── Mobile: show compact icon-only buttons ── */
@media (max-width: 768px) {
  .social-bar {
    gap: 4px;
    width: 40px;
  }

  .social-bar__item {
    width: 40px;
    height: 44px; /* 44px minimum touch target */
    justify-content: center;
    border-radius: 6px 0 0 6px;
    background: rgba(17, 17, 17, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  .social-bar__item svg {
    margin-right: 0;
    width: 16px;
    height: 16px;
  }

  .social-bar__label {
    display: none;
  }
}
