/* A client's social grid (components/social/social.tsx), over the case studies' stylesheet (study.css: the header, the
   feed's profile, rings and grid, the reveals, the sound switch): the avatar's story ring, the tabs, a reel's preview
   under the pointer, the post viewer and the story viewer. social.js gives them their motion; without it every post
   is a link to its own picture or film. */

.sg-page { padding-top: clamp(120px, 16vh, 180px); }
.sg-open { width: min(100% - 2 * var(--gutter), 1080px); margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 10px 24px; }
.sg-feed { margin-top: clamp(40px, 6vw, 72px); margin-bottom: clamp(72px, 10vw, 140px); }

/* ---------------------------------------------------------------- the profile */
/* the avatar wears the ring an account's stories give it, in the brand's own orange; once watched it goes quiet */
.sg-avatar { position: relative; display: block; width: clamp(84px, 11vw, 150px); aspect-ratio: 1; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.sg-avatar img { position: absolute; inset: 7px; width: calc(100% - 14px); height: calc(100% - 14px); border-radius: 50%; object-fit: cover; transition: transform 0.8s var(--ease); }
.sg-avatar__ring { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 200deg, #b85838, #e3a05a, #f3e7d3, #d9774a, #b85838); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.6px), #000 calc(100% - 2.2px)); mask: radial-gradient(farthest-side, transparent calc(100% - 2.6px), #000 calc(100% - 2.2px)); transition: transform 1.2s var(--ease), opacity 0.6s; }
.sg-avatar:hover .sg-avatar__ring, .sg-avatar:focus-visible .sg-avatar__ring { transform: rotate(120deg); }
.sg-avatar:hover img { transform: scale(0.96); }
.sg-avatar.is-seen .sg-avatar__ring { background: rgba(255, 255, 255, 0.32); }
.sg-handle { margin-top: 0.45em; color: var(--dim); letter-spacing: 0.01em; }
.sg-head .st-feed__place a { border-bottom: 1px solid var(--line-strong); padding-bottom: 1px; transition: color 0.3s, border-color 0.3s; }
.sg-head .st-feed__place a:hover { color: var(--ink); border-color: var(--ink); }
.sg-highlights a { -webkit-tap-highlight-color: transparent; }
.sg-highlights a.is-seen .st-feed__ring { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16); }
.sg-highlights a.is-seen .st-feed__chapter { color: var(--dim); }

/* ---------------------------------------------------------------- the tabs */
.sg-tabs { display: flex; justify-content: center; gap: clamp(44px, 7vw, 72px); border-top: 1px solid var(--line); }
.sg-tabs button { position: relative; display: inline-flex; align-items: center; gap: 0.6em; padding: 15px 2px 16px; border: 0; background: none; color: var(--dim); font: inherit; font-size: 0.78em; letter-spacing: 0.14em; text-transform: uppercase; line-height: 1.3; cursor: pointer; transition: color 0.35s; -webkit-tap-highlight-color: transparent; }
.sg-tabs button::before { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 1px; background: var(--ink); transform: scaleX(0); transition: transform 0.7s var(--ease); }
.sg-tabs button:hover, .sg-tabs button[aria-selected="true"] { color: var(--ink); }
.sg-tabs button[aria-selected="true"]::before { transform: none; }
.sg-tabs svg { width: 1.35em; height: 1.35em; }

/* ---------------------------------------------------------------- the grid */
.sg-grid { transition: opacity 0.24s var(--ease); }
.sg-grid.is-leaving { opacity: 0; }
.sg-grid.is-reels > li:not([data-type="REEL"]) { display: none; }
.sg-post .st-post__mark { z-index: 1; }
.sg-post__preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.5s var(--ease); pointer-events: none; }
.sg-post__preview.is-on { opacity: 1; }
.sg-post:has(.sg-post__preview.is-on)::after { opacity: 0; }

/* ---------------------------------------------------------------- the post viewer */
.sg-viewer { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #000; color: var(--ink); overflow: hidden; }
.sg-viewer[open] { display: grid; place-items: center; animation: st-viewer-in 0.45s var(--ease); }
.sg-viewer::backdrop { background: #000; }
.sg-viewer__ground { position: absolute; inset: -8%; background: center / cover no-repeat; filter: blur(44px) brightness(0.34) saturate(1.15); transform: scale(1.06); transition: background-image 0.6s; }
.sg-round { position: absolute; z-index: 2; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.1); color: #fff; cursor: pointer; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: background 0.3s, color 0.3s; }
.sg-round:hover { background: rgba(255, 255, 255, 0.92); color: #111; }
.sg-round svg { width: 20px; height: 20px; }
.sg-viewer__close { right: var(--gutter); top: 16px; }
.sg-viewer__arrow { top: 50%; transform: translateY(-50%); }
.sg-viewer__arrow--prev { left: clamp(14px, 2vw, 40px); }
.sg-viewer__arrow--next { right: clamp(14px, 2vw, 40px); }
.sg-viewer__count { position: absolute; z-index: 2; left: var(--gutter); top: 26px; color: #d9d9d9; font-variant-numeric: tabular-nums; }
.sg-viewer__sound { position: absolute; z-index: 2; right: calc(var(--gutter) + 56px); top: 18px; display: none; }
.sg-viewer.is-reel .sg-viewer__sound { display: inline-flex; }

/* the card: the post at the height of the window (a reel at 9:16, a post at 4:5), what it says beside it */
.sg-card { --ratio: 0.8; --h: min(calc(100dvh - 128px), 920px, calc((100vw - 190px - 340px) / var(--ratio))); position: relative; display: flex; height: var(--h); max-width: calc(100vw - 32px); overflow: hidden; border-radius: 3px; background: #0b0b0b; box-shadow: 0 50px 110px -40px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.06); }
.sg-card.is-in { animation: sg-card-in 0.6s var(--ease); }
.sg-card.from-next { animation: sg-card-next 0.6s var(--ease); }
.sg-card.from-prev { animation: sg-card-prev 0.6s var(--ease); }
@keyframes sg-card-in { from { opacity: 0; transform: translateY(14px) scale(0.985); } }
@keyframes sg-card-next { from { opacity: 0; transform: translateX(36px); } }
@keyframes sg-card-prev { from { opacity: 0; transform: translateX(-36px); } }
.sg-card__media { position: relative; flex: none; width: calc(var(--h) * var(--ratio)); height: 100%; background: #000; }
.sg-slides { display: flex; height: 100%; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; }
.sg-slides::-webkit-scrollbar { display: none; }
.sg-slides[hidden] { display: none; }
.sg-slides > li { flex: 0 0 100%; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; }
.sg-slides img { width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.sg-card__film { width: 100%; height: 100%; object-fit: cover; cursor: pointer; }
.sg-card__film[hidden] { display: none; }
.sg-card__step { position: absolute; top: 50%; z-index: 1; width: 32px; height: 32px; margin-top: -16px; padding: 0; border: 0; border-radius: 50%; display: none; place-items: center; background: rgba(255, 255, 255, 0.86); color: #111; cursor: pointer; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3); transition: opacity 0.3s, transform 0.4s var(--ease); }
.sg-card__step:hover { transform: scale(1.08); }
.sg-card__step svg { width: 16px; height: 16px; }
.sg-card__step--prev { left: 12px; }
.sg-card__step--next { right: 12px; }
.sg-card.is-carousel .sg-card__step { display: grid; }
.sg-card__step[disabled] { opacity: 0; pointer-events: none; }
.sg-dots { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.sg-dots li { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, 0.42); box-shadow: 0 0 4px rgba(0, 0, 0, 0.35); transition: background 0.3s, transform 0.4s var(--ease); }
.sg-dots li.is-at { background: #fff; transform: scale(1.15); }
.sg-card__panel { flex: none; width: 340px; display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); }
.sg-card__who { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); font-size: 0.95em; }
.sg-card__who img { width: 32px; height: 32px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18); }
.sg-card__who b { font-weight: 500; }
.sg-card__kind { margin-left: auto; color: var(--dim); font-size: 0.86em; white-space: nowrap; }
.sg-card__words { flex: 1; min-height: 0; overflow-y: auto; padding: 18px; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.2) transparent; }
.sg-card__caption { white-space: pre-line; line-height: 1.5; }
.sg-card__tags { margin-top: 1em; color: var(--dim); font-size: 0.92em; line-height: 1.5; }
.sg-card__tags:empty { display: none; }
.sg-card__date { padding: 14px 18px 18px; border-top: 1px solid var(--line); }

/* ---------------------------------------------------------------- the story viewer */
.sg-story { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #080808; color: #fff; overflow: hidden; }
.sg-story[open] { display: flex; align-items: center; justify-content: center; gap: clamp(28px, 4.5vw, 72px); animation: sg-story-in 0.55s var(--ease); }
@keyframes sg-story-in { from { opacity: 0; transform: scale(1.025); } }
.sg-story::backdrop { background: #000; }
.sg-story__ground { position: absolute; inset: -10%; background: center / cover no-repeat; filter: blur(64px) brightness(0.3) saturate(1.2); transform: scale(1.1); transition: background-image 0.8s; }
.sg-story__frame { --w: min(calc((100dvh - 48px) * 9 / 16), 470px); position: relative; flex: none; width: var(--w); aspect-ratio: 9 / 16; overflow: hidden; border-radius: 12px; background: #000; box-shadow: 0 60px 120px -40px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(255, 255, 255, 0.06); touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; transform-origin: 50% 50%; }
.sg-story__frame.from-next { animation: sg-cube-next 0.62s var(--ease); }
.sg-story__frame.from-prev { animation: sg-cube-prev 0.62s var(--ease); }
@keyframes sg-cube-next { from { opacity: 0.35; transform: perspective(1600px) translateX(42%) rotateY(-32deg) scale(0.94); } }
@keyframes sg-cube-prev { from { opacity: 0.35; transform: perspective(1600px) translateX(-42%) rotateY(32deg) scale(0.94); } }
.sg-story__blur { position: absolute; inset: -14%; background: center / cover no-repeat; filter: blur(30px) brightness(0.5) saturate(1.1); transform: scale(1.1); }
.sg-story__picture { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
video.sg-story__picture { object-fit: cover; }
.sg-story__picture[hidden] { display: none; }
.sg-story__tap { position: absolute; top: 0; bottom: 0; z-index: 1; padding: 0; border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.sg-story__tap--prev { left: 0; width: 32%; }
.sg-story__tap--next { right: 0; width: 68%; }
.sg-story__tap:focus, .sg-story__frame:focus { outline: none; } /* the story itself shows where the visitor is */
.sg-story__top { position: absolute; left: 0; right: 0; top: 0; z-index: 2; padding: 10px 10px 48px; background: linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0)); pointer-events: none; transition: opacity 0.35s var(--ease); }
.sg-story.is-held .sg-story__top { opacity: 0; }
.sg-story__bars { display: flex; gap: 3px; }
.sg-story__bars li { flex: 1; height: 2px; overflow: hidden; border-radius: 2px; background: rgba(255, 255, 255, 0.34); }
.sg-story__bars i { display: block; height: 100%; background: #fff; transform: scaleX(0); transform-origin: 0 50%; }
.sg-story__who { display: flex; align-items: center; gap: 9px; margin-top: 10px; font-size: 14px; line-height: 1.2; }
.sg-story__who img { width: 30px; height: 30px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25); }
.sg-story__who b { font-weight: 500; }
.sg-story__who span { color: rgba(255, 255, 255, 0.72); }
.sg-story__icon { width: 36px; height: 36px; padding: 0; border: 0; display: grid; place-items: center; background: none; color: #fff; cursor: pointer; pointer-events: auto; filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.4)); }
.sg-story__icon svg { width: 22px; height: 22px; }
.sg-story__sound { margin-left: auto; }
.sg-story__sound .st-sound__off { display: none; }
.sg-story__sound[aria-pressed="false"] .st-sound__wave { display: none; }
.sg-story__sound[aria-pressed="false"] .st-sound__off { display: inline; }
html.st-sound-waiting .sg-story__sound { animation: sg-ask 2.4s var(--ease) infinite; }
@keyframes sg-ask { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
/* the highlights either side, to go to with a click */
.sg-story__side { position: relative; flex: none; display: grid; justify-items: center; gap: 12px; width: 112px; padding: 0; border: 0; background: none; color: #fff; font: inherit; font-size: 14px; cursor: pointer; opacity: 0.5; transition: opacity 0.4s, transform 0.7s var(--ease); }
.sg-story__side:hover { opacity: 1; transform: scale(1.05); }
.sg-story__side.is-empty { visibility: hidden; }
.sg-story__side-ring { width: 84px; aspect-ratio: 1; padding: 3px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.45); }
.sg-story__side-ring img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.sg-story__side img:not([src]) { visibility: hidden; }

@media (max-width: 1000px) {
  .sg-story__side { display: none; }
}

/* ---------------------------------------------------------------- a phone */
@media (max-width: 760px) {
  .sg-page { padding-top: 96px; }
  .sg-open { width: auto; padding: 0 16px; }
  .sg-feed { margin-top: 28px; }
  .sg-avatar { width: 88px; }
  .sg-avatar img { inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); }
  .sg-tabs { gap: 0; }
  .sg-tabs button { flex: 1; justify-content: center; }

  /* the post: across the width at the top, what it says under it; a swipe goes on, a pull down puts it away */
  .sg-viewer[open] { place-items: stretch; }
  .sg-card { --h: auto; flex-direction: column; width: 100%; height: 100%; max-width: none; border-radius: 0; background: #000; box-shadow: none; padding-top: 68px; }
  .sg-card__media { width: min(100%, calc((100dvh - 68px - 170px) * var(--ratio))); height: auto; aspect-ratio: var(--ratio); margin: 0 auto; }
  .sg-card__panel { width: 100%; flex: 1 1 auto; border-left: 0; }
  .sg-card__who { padding: 14px 16px 6px; border-bottom: 0; }
  .sg-card__words { padding: 4px 16px 10px; font-size: 0.95em; }
  .sg-card__date { padding: 2px 16px max(18px, env(safe-area-inset-bottom)); border-top: 0; }
  .sg-card.is-carousel .sg-card__step, .sg-viewer__arrow { display: none; }
  .sg-viewer__count { left: 16px; top: max(24px, calc(env(safe-area-inset-top) + 12px)); }
  .sg-viewer__close { right: 12px; top: max(12px, env(safe-area-inset-top)); }
  .sg-viewer__sound { right: 64px; top: max(14px, calc(env(safe-area-inset-top) + 2px)); }
  @keyframes sg-card-next { from { opacity: 0; transform: translateX(24px); } }
  @keyframes sg-card-prev { from { opacity: 0; transform: translateX(-24px); } }

  /* the stories: the frame is the screen */
  .sg-story[open] { display: block; }
  .sg-story__ground { display: none; }
  .sg-story__frame { --w: 100%; width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; box-shadow: none; }
  .sg-story__top { padding-top: max(10px, calc(env(safe-area-inset-top) + 4px)); }
}

@media (prefers-reduced-motion: reduce) {
  .sg-viewer[open], .sg-story[open], .sg-card.is-in, .sg-card.from-next, .sg-card.from-prev, .sg-story__frame.from-next, .sg-story__frame.from-prev, html.st-sound-waiting .sg-story__sound { animation: none; }
  .sg-avatar__ring, .sg-avatar img, .sg-tabs button::before, .sg-grid, .sg-story__side { transition: none; }
}

/* ---------------------------------------------------------------- as the Kitzhof study shows its photographs (2026-11-09)
   The page opens on the run itself (study.css's .st-shoot, social.js), so the profile comes in closer under it. A post
   opens as Kitzhof's do: whole over its own colours blurred, with no card around it; what it says sits beside it (under
   it on a phone) on that same ground. */
.sg-page--after-shoot { padding-top: clamp(72px, 10vh, 128px); }
.sg-viewer__ground { filter: blur(36px) brightness(0.36) saturate(1.1); }
.sg-card { background: transparent; border-radius: 0; box-shadow: none; overflow: visible; }
.sg-card__media { overflow: hidden; box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.85); }
.sg-card__panel { width: 312px; margin-left: 28px; border-left: 0; }
.sg-card__who, .sg-card__date { padding-left: 0; padding-right: 0; border: 0; }
.sg-card__words { padding: 4px 0 18px; }
.sg-card__caption { text-shadow: 0 1px 14px rgba(0, 0, 0, 0.4); }
@media (max-width: 760px) {
  .sg-page--after-shoot { padding-top: 40px; }
  .sg-card { background: transparent; }
  .sg-card__panel { width: 100%; margin-left: 0; }
  .sg-card__who { padding: 14px 16px 6px; }
  .sg-card__words { padding: 4px 16px 10px; }
  .sg-card__date { padding: 2px 16px max(18px, env(safe-area-inset-bottom)); }
}
