/* Social layer components (action bar, who-liked sheet, quote composer).
 *
 * Scoped: every rule lives under .social-*, and the tokens are --social-*
 * so this file layers cleanly under the redesign's move.css design system
 * once the design-system PR lands on the epic branch. Values are
 * transcribed from docs/design/redesign-2026-11/move.css (the authoritative
 * tokens); when move.css ships as app CSS, these fall back to its variables.
 */
:root {
  --social-ink: var(--ink, #1f1f1f);
  --social-ink2: var(--ink2, #37352f);
  --social-mute: var(--mute, #787774);
  --social-surface: var(--surface, #ffffff);
  --social-raise: var(--raise, #ffffff);
  --social-fill: var(--fill, #f4f3ef);
  --social-hair: var(--hair, rgba(55, 53, 47, 0.09));
  --social-divider: var(--divider, rgba(55, 53, 47, 0.08));
  --social-danger: var(--danger, #d94f4a);
  --social-success: var(--success, #2f9d5c);
  --social-overlay: var(--overlay, rgba(31, 31, 31, 0.4));
  --social-btn: var(--btn, #171717);
  --social-btn-ink: var(--btn-ink, #fbfbfa);
  --social-r-sheet: var(--r-sheet, 26px);
  --social-r-card: var(--r-card, 16px);
  --social-r-input: var(--r-input, 12px);
  --social-sh-sheet: var(--sh-sheet, 0 -8px 32px rgba(0, 25, 53, 0.16));
}
html.dark {
  --social-ink: var(--ink, rgba(255, 255, 255, 0.86));
  --social-ink2: var(--ink2, rgba(255, 255, 255, 0.72));
  --social-mute: var(--mute, #9b9a97);
  --social-surface: var(--surface, #1c1c1e);
  --social-raise: var(--raise, #232326);
  --social-fill: var(--fill, #2a2a2e);
  --social-hair: var(--hair, rgba(255, 255, 255, 0.1));
  --social-divider: var(--divider, rgba(255, 255, 255, 0.08));
  --social-danger: var(--danger, #f07a7a);
  --social-success: var(--success, #45bda9);
  --social-overlay: var(--overlay, rgba(0, 0, 0, 0.55));
  --social-btn: var(--btn, rgba(255, 255, 255, 0.92));
  --social-btn-ink: var(--btn-ink, #191919);
  --social-sh-sheet: var(--sh-sheet, 0 -8px 32px rgba(0, 0, 0, 0.6));
}

/* ── Action bar (X-style: comment · reshare · like · share) ─────────────── */
.social-actions {
  display: flex;
  align-items: center;
  gap: 26px;
  color: var(--social-mute);
  font-size: 13px;
  line-height: 18px;
}
.social-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: color 0.15s ease-out;
  text-decoration: none;
}
.social-action svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.social-action:hover { color: var(--social-ink2); }
.social-action.is-on.social-action--like { color: var(--social-danger); }
.social-action.is-on.social-action--like svg { fill: var(--social-danger); stroke: var(--social-danger); }
.social-action.is-on.social-action--reshare { color: var(--social-success); }
.social-action[disabled] { opacity: 0.35; cursor: not-allowed; }
/* A button and its count read as one item (the feed spreads the items). */
.social-pair { display: inline-flex; align-items: center; gap: 5px; }
.social-count {
  font-variant-numeric: tabular-nums;
}
/* The count is its own hit target: it opens the who-liked / who-reshared sheet. */
button.social-count {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0;
  cursor: pointer;
}
button.social-count:hover { text-decoration: underline; }

/* ── Sheet (who liked / who reshared / quote composer) ──────────────────── */
.social-scrim {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: var(--social-overlay);
  opacity: 0;
  transition: opacity 0.22s ease-out;
}
.social-sheet {
  position: fixed;
  z-index: 71;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  background: var(--social-raise);
  color: var(--social-ink);
  border-radius: var(--social-r-sheet) var(--social-r-sheet) 0 0;
  box-shadow: var(--social-sh-sheet);
  padding: 8px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateY(16px);
  opacity: 0;
  transition: transform 0.22s ease-out, opacity 0.22s ease-out;
}
.social-sheet.is-open, .social-scrim.is-open { opacity: 1; transform: none; }
@media (min-width: 768px) {
  /* Desktop: centered modal instead of a bottom sheet. */
  .social-sheet {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 50%;
    width: 400px;
    max-height: 60vh;
    transform: translate(-50%, calc(-50% + 12px));
    border-radius: var(--social-r-card);
    padding: 12px 16px 16px;
  }
  .social-sheet.is-open { transform: translate(-50%, -50%); }
}
@media (prefers-reduced-motion: reduce) {
  .social-sheet, .social-scrim { transition: none; }
}
.social-sheet__grip {
  width: 36px;
  height: 5px;
  border-radius: 3px;
  background: var(--social-hair);
  margin: 0 auto 10px;
}
@media (min-width: 768px) { .social-sheet__grip { display: none; } }
.social-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 10px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.2px;
}
.social-sheet__close {
  border: 0;
  background: var(--social-fill);
  color: var(--social-ink2);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.social-sheet__body { overflow-y: auto; min-height: 60px; }
.social-sheet__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 2px;
  border-top: 1px solid var(--social-divider);
  color: inherit;
  text-decoration: none;
}
.social-sheet__row:first-child { border-top: 0; }
.social-sheet__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--social-fill);
  color: var(--social-ink2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex: none;
}
.social-sheet__name { font-size: 15px; font-weight: 600; }
.social-sheet__meta { font-size: 13px; color: var(--social-mute); overflow-wrap: anywhere; }
.social-sheet__empty, .social-sheet__loading {
  padding: 24px 0;
  text-align: center;
  color: var(--social-mute);
  font-size: 14px;
}

/* Quote composer inside the sheet */
.social-quote__textarea {
  width: 100%;
  min-height: 84px;
  resize: vertical;
  border: 1px solid var(--social-hair);
  border-radius: var(--social-r-input);
  background: var(--social-surface);
  color: var(--social-ink);
  font: inherit;
  font-size: 15px;
  line-height: 20px;
  padding: 10px 12px;
}
.social-quote__textarea:focus { outline: 2px solid var(--social-ink2); outline-offset: -1px; }
.social-quote__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}
.social-quote__submit {
  border: 0;
  background: var(--social-btn);
  color: var(--social-btn-ink);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  cursor: pointer;
}
.social-quote__cancel {
  border: 0;
  background: var(--social-fill);
  color: var(--social-ink2);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  cursor: pointer;
}

/* Reshare menu (Reshare / Quote / Undo) rendered inside the sheet as rows */
.social-sheet__option {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  border: 0;
  background: transparent;
  color: var(--social-ink);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  padding: 14px 2px;
  border-top: 1px solid var(--social-divider);
  cursor: pointer;
  text-align: left;
}
.social-sheet__option:first-child { border-top: 0; }
.social-sheet__option svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.social-sheet__option--danger { color: var(--social-danger); }
