/* ==========================================================================
   A POST AS IT WILL LOOK (social-frames.mjs), 2026-10-23.

   Shared by the client's Social room, the one-tap page and the Office's
   Social desk, so it carries its own values rather than either page's
   tokens: the planes of the kernel (a panel #171717 on the stage, a 1px
   #2A2A2A edge, 8px corners), the site's greys, white the one emphasis. Each
   frame keeps a platform's SHAPE (proportions, where the words sit, where
   they are cut) and none of its colours (rule 18: no hue but for state).

   The CSP refuses style="": every rule is here, by class.
   ========================================================================== */

.sf-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(15.5rem, 18.5rem);
  gap: 1rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  /* Room on every side for a frame's focus edge, which the row's own scroll would cut. */
  padding: 0.25rem 0.25rem 0.75rem;
  scroll-padding-inline: 0.25rem;
  margin: 0;
}
/* Drawn inside the frame, so a row that scrolls never cuts it. */
.sf:focus-visible { outline: 1px solid var(--focus-edge); outline-offset: -1px; border-radius: var(--tk-r-md); }

.sf {
  margin: 0;
  scroll-margin: 24px 4px;
  min-width: 0;
  display: grid;
  gap: 0.5rem;
  align-content: start;
  color: var(--tk-grey-e6);
}
.sf-label { margin: 0; color: var(--tk-grey-a3); font-size: 0.8125rem; font-weight: 550; line-height: 1.3; }
.sf-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--tk-grey-2a);
  border-radius: var(--tk-r-md);
  background: var(--tk-grey-17);
  box-shadow: 0 1px 0 var(--tk-white-a040) inset, 0 18px 40px -24px var(--tk-black-a900);
  font-size: 0.875rem;
  line-height: 1.45;
}

/* The name and the avatar: initials in a quiet disc, never anybody's picture. */
.sf-head { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.75rem; min-height: 3rem; }
.sf-av {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--tk-grey-26);
  box-shadow: 0 0 0 1px var(--tk-grey-33);
  color: var(--tk-white);
  font-size: 0.6875rem;
  font-weight: 650;
  letter-spacing: 0;
}
.sf-av--sm { width: 1.75rem; height: 1.75rem; font-size: 0.625rem; }
.sf-who { display: grid; min-width: 0; }
/* A handle or a name is one word to a person: cut with an ellipsis at the frame's edge, never broken mid-word. */
.sf-handle, .sf-name { min-width: 0; color: var(--tk-white); font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-head .sf-handle { flex: 1 1 auto; }
.sf-tt .sf-handle { display: block; }
.sf-when { display: inline-flex; align-items: center; gap: 0.25rem; color: var(--tk-grey-a3); font-size: 0.75rem; }

/* The media, in the platform's proportions. */
.sf-media { position: relative; display: grid; place-items: center; background: var(--tk-grey-0e); overflow: hidden; }
.sf-media--square { aspect-ratio: 1 / 1; }
.sf-media--portrait { aspect-ratio: 4 / 5; }
.sf-media--tall { aspect-ratio: 9 / 16; }
.sf-media--wide { aspect-ratio: 16 / 9; }
.sf-x .sf-media { border: 1px solid var(--tk-grey-2a); border-radius: var(--tk-r-md); margin: 0.5rem 0 0; }
.sf-img, .sf-video { width: 100%; height: 100%; object-fit: cover; display: block; background: var(--tk-grey-0e); }
/* A post with words only draws no picture-sized box. */
.sf-media.is-empty { aspect-ratio: auto; min-height: 4rem; }
.sf-media__none { color: var(--tk-grey-8b); font-size: 0.8125rem; font-weight: 550; }
.sf-count { position: absolute; top: 0.5rem; right: 0.5rem; padding: 2px 0.5rem; border-radius: var(--tk-r-sm); background: var(--tk-grey-0b); color: var(--tk-grey-e6); font-size: 0.75rem; font-weight: 600; }

/* The words, cut where the platform cuts them. */
.sf-cap { margin: 0; padding: 0.5rem 0.75rem 0.75rem; color: var(--tk-grey-e6); white-space: pre-line; overflow-wrap: anywhere; text-wrap: pretty; }
.sf-cap__lead { color: var(--tk-white); font-weight: 650; }
.sf-tag { color: var(--tk-white); font-weight: 600; }
.sf-cap__none { color: var(--tk-grey-8b); }
.sf-more {
  min-height: 24px;
  padding: 0 0.25rem;
  border: 0;
  border-radius: var(--tk-r-sm);
  background: transparent;
  color: var(--tk-grey-a3);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.sf-more:hover { color: var(--tk-white); }
.sf-more:focus-visible { outline: 1px solid var(--focus-edge); outline-offset: 1px; }

/* The actions: marks only, no counts (the post has none yet). */
.sf-i { width: 1.125rem; height: 1.125rem; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.sf-acts { display: flex; gap: 1rem; padding: 0.5rem 0.75rem 0; color: var(--tk-grey-e6); }
.sf-acts--bar { justify-content: space-around; padding: 0.5rem 0.25rem; border-top: 1px solid var(--tk-grey-26); color: var(--tk-grey-a3); }
.sf-acts--x { justify-content: space-between; padding: 0.5rem 0 0; color: var(--tk-grey-a3); }
.sf-act { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.75rem; font-weight: 600; }

/* Facebook: the words before the media. */
.sf--facebook .sf-cap, .sf--linkedin .sf-cap { padding-top: 0; }

/* TikTok: the words over the foot of the video, the actions down the right. */
.sf--tiktok .sf-media { aspect-ratio: 9 / 16; }
.sf-tt {
  position: absolute;
  left: 0;
  right: 3.25rem;
  bottom: 0;
  padding: 2.5rem 0.75rem 0.75rem;
  border-top: 1px solid var(--tk-grey-26);
  background: var(--tk-grey-0b);
  color: var(--tk-white);
  pointer-events: none;
}
.sf-tt .sf-cap { padding: 0.25rem 0 0; color: var(--tk-white); }
.sf-tt .sf-more { pointer-events: auto; color: var(--tk-grey-e6); }
.sf-tt__sound { display: flex; align-items: center; gap: 0.25rem; margin: 0.5rem 0 0; font-size: 0.75rem; font-weight: 550; }
.sf-tt__rail {
  position: absolute;
  right: 0.5rem;
  bottom: 1rem;
  display: grid;
  justify-items: center;
  gap: 1rem;
  color: var(--tk-white);
  pointer-events: none;
}
.sf-tt__rail .sf-i { width: 1.375rem; height: 1.375rem; }
/* The player's own controls sit above the overlay's words. */
.sf--tiktok .sf-video { position: relative; z-index: 0; }

/* Google Business Profile: an update, and its button. */
.sf-gbp__btn {
  display: inline-flex;
  align-items: center;
  margin: 0 0.75rem 0.75rem;
  min-height: 2rem;
  padding: 0 1rem;
  border: 1px solid var(--tk-grey-3a);
  border-radius: var(--tk-r-sm);
  color: var(--tk-white);
  font-size: 0.8125rem;
  font-weight: 600;
}

/* X: the avatar beside the words. */
.sf-x { display: grid; grid-template-columns: 2rem minmax(0, 1fr); gap: 0.5rem; padding: 0.75rem; }
.sf-x__top { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf--x .sf-cap { padding: 0.25rem 0 0; }

@media (max-width: 520px) {
  .sf-row { grid-auto-columns: minmax(78%, 1fr); gap: 0.75rem; }
}
@media (prefers-reduced-motion: reduce) {
  .sf-row { scroll-behavior: auto; }
}
@media (forced-colors: active) {
  .sf-card { border: 1px solid CanvasText; }
  .sf-tt { background: Canvas; }
}
