.social-case .website-case__sidebar { min-height: 0; }
.social-case .website-case__type { flex-wrap: wrap; font-size: 0.875rem; letter-spacing: 0.04em; }
.social-case .website-case__copy h1 { overflow-wrap: anywhere; }
.social-case .website-case__topline { font-size: 0.875rem; }

.social-stage {
  min-width: 0;
  min-height: 0;
  padding: 1.5rem 0;
}

.social-carousel {
  --post-width: min(400px, max(160px, calc((100svh - var(--header-h) - 18rem) * 0.8)), 72vw);
  position: relative;
  width: 100%;
  z-index: 2;
}

.social-carousel__track {
  align-items: start;
  display: flex;
  gap: clamp(1rem, 2.5vw, 2.5rem);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 0.75rem max(1rem, calc((100% - var(--post-width)) / 2)) 1rem;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: #747b82 transparent;
}

.social-post {
  flex: 0 0 var(--post-width);
  min-width: 0;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  transition: opacity 220ms ease;
}

.social-carousel.is-enhanced .social-post { opacity: 0.45; }
.social-carousel.is-enhanced .social-post.is-active,
.social-carousel.is-enhanced .social-post:focus-within { opacity: 1; }

.social-post__media {
  aspect-ratio: 4 / 5;
  background: rgba(13, 14, 18, 0.58);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18);
  display: grid;
  overflow: hidden;
  place-items: center;
  position: relative;
}

.social-post__media img,
.social-post__media video {
  display: block;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  width: 100%;
}

.social-video__controls {
  align-items: center;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  left: 0;
  padding: 0.75rem;
  pointer-events: none;
  position: absolute;
  right: 0;
  z-index: 2;
}

.social-video__button {
  align-items: center;
  background: rgba(13, 14, 18, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  flex: 0 0 44px;
  height: 44px;
  justify-content: center;
  padding: 0;
  pointer-events: auto;
  touch-action: manipulation;
  width: 44px;
}

.social-video__button:hover { background: var(--ink); border-color: var(--green); }
.social-video__button svg { fill: none; height: 20px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; width: 20px; }
.social-video__button [data-icon="play"] { fill: currentColor; stroke: none; }
.social-video__button[data-paused="true"] [data-icon="pause"],
.social-video__button[data-paused="false"] [data-icon="play"],
.social-video__button[data-muted="true"] [data-icon="sound"],
.social-video__button[data-muted="false"] [data-icon="muted"] { display: none; }
.social-video__fallback { background: var(--ink); bottom: 1rem; color: #fff; left: 1rem; padding: 0.75rem; position: absolute; }

.social-post__details { padding: 1rem 0 0; }
.social-post__details:empty { display: none; }
.social-post__details p {
  color: #e0e2e4;
  font-size: 1rem;
  line-height: 1.5;
  margin: 0 0 0.6rem;
  max-height: 4.5rem;
  overflow-y: auto;
}

.social-post__details a {
  align-items: center;
  display: inline-flex;
  font-size: 0.875rem;
  gap: 0.65rem;
  min-height: 30px;
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.social-post__details a:hover { color: var(--green); }
.social-post__error { font-size: 1rem; margin: 0; padding: 2rem; text-align: center; }
.social-post__media [hidden] { display: none; }

.social-carousel__controls {
  align-items: center;
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  margin-top: 1rem;
}

.social-carousel__controls[hidden] { display: none; }
.social-carousel__controls button {
  align-items: center;
  background: transparent;
  border: 1px solid #8e949a;
  border-radius: 50%;
  color: var(--paper);
  cursor: pointer;
  display: flex;
  height: 48px;
  justify-content: center;
  padding: 0;
  transition: background 180ms ease, color 180ms ease;
  width: 48px;
}

.social-carousel__controls button:not(:disabled):hover {
  background: var(--green);
  border-color: var(--green);
  color: var(--ink);
}

.social-carousel__controls button:disabled { cursor: default; opacity: 0.3; }
.social-carousel__controls svg { fill: none; height: 22px; stroke: currentColor; stroke-width: 1.5; width: 22px; }
.social-carousel__count { font-family: "DM Mono", monospace; font-size: 0.875rem; min-width: 5ch; text-align: center; }
.social-carousel :focus-visible { outline: 2px solid var(--green); outline-offset: 4px; }
.social-carousel__track:focus-visible { outline-offset: -3px; }
.social-stage__empty { padding: 2rem; position: relative; z-index: 2; }
.social-stage__empty > span { background: var(--green); display: block; height: 8px; width: 8px; }
.social-stage__empty p { font-size: clamp(2rem, 4vw, 4rem); font-weight: 400; letter-spacing: -0.055em; line-height: 1.05; margin: 1.5rem 0 0; }

@media (max-width: 1000px) {
  .social-case .website-case__sidebar { min-height: auto; padding-bottom: 3rem; }
  .social-case .website-case__copy { margin-top: 0; padding-top: 0; }
  .social-stage { height: auto; min-height: 420px; padding: 2.5rem 0; }
  .social-carousel { --post-width: min(380px, 72vw); }
}

@media (max-width: 720px) {
  .social-case .website-case__client { margin-top: 2rem; }
  .social-case .website-case__copy h1 { font-size: clamp(2.8rem, 10vw, 4rem); }
  .social-stage { padding: 2rem 0; }
  .social-carousel { --post-width: min(340px, 78vw); }
  .social-carousel__controls { margin-top: 0.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  .social-post,
  .social-carousel__controls button { transition: none; }
}

/* Fill the desktop stage; captions and controls keep their actual height. */
@media (min-width: 1001px) {
  .social-stage { align-items: stretch; }
  .social-carousel {
    --post-width: min(max(200px, calc((100svh - var(--header-h) - 10rem) * 0.8)), 60vw);
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    height: 100%;
    min-height: 0;
  }
  .social-carousel__track { align-items: stretch; min-height: 0; }
  .social-post {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    min-height: 0;
  }
  .social-post__media { aspect-ratio: auto; min-height: 0; }
}

@media (min-width: 1001px) and (max-height: 600px) {
  .social-stage { min-height: 520px; }
}
