/* Posts: crop only the preview; keep the saved photo and editor intact. */
.social-post-card { scroll-margin-top: calc(var(--topbar-h, 74px) + 12px); }
.social-post-media[data-post-photo] { position: relative; }
.post-photo-viewport {
  position: relative;
  aspect-ratio: var(--post-photo-ratio, 16 / 9);
  overflow: hidden;
}
.social-post-media[data-post-photo] .post-photo-viewport > img {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  aspect-ratio: auto;
  object-fit: contain;
}
.social-post-media.is-expandable .post-photo-viewport > img { top: 0; transform: none; }
.social-post-media.is-expanded .post-photo-viewport { aspect-ratio: auto; }
.social-post-media.is-expanded .post-photo-viewport > img { position: static; }
.post-photo-reveal {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: min(50%, 140px);
  padding: 16px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .56));
  pointer-events: none;
}
.post-photo-reveal[hidden] { display: none; }
.post-photo-toggle {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-solid, #fff);
  color: var(--text);
  font: 700 12px/1.4 var(--font-body, sans-serif);
  box-shadow: 0 3px 12px rgba(0, 0, 0, .16);
  cursor: pointer;
  pointer-events: auto;
}
.post-photo-toggle:hover { border-color: var(--accent-strong); }
.post-photo-toggle:focus-visible,
.post-card-photo:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: -3px; }
.post-photo-toggle svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.is-expanded .post-photo-toggle svg { transform: rotate(180deg); }
.is-expanded .post-photo-reveal {
  position: static;
  height: auto;
  padding: 10px;
  background: var(--surface-2);
}
.is-expanded .post-photo-toggle { box-shadow: none; }

/* The publication list stays even, while the lightbox uses the original. */
.feed-post-card > [data-post-card-media][hidden] { display: none; }
.post-card-photo {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}
.feed-post-card .post-card-photo > img { object-position: center top; }
.post-card-photo-hint {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  background: var(--surface-solid, #fff);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
  pointer-events: none;
}
body[data-create-media-type="post"] .feed-post-media-preview {
  height: clamp(220px, 48dvh, 520px);
  max-height: none;
  aspect-ratio: auto;
}
body[data-create-media-type="post"] .feed-post-media-preview > img { object-fit: contain; }
html[data-theme="light"] body[data-create-media-type="post"] .su-lb { background: rgba(242, 244, 247, .97); }
html[data-theme="light"] body[data-create-media-type="post"] .su-lb__top { background: linear-gradient(rgba(255, 255, 255, .8), transparent); }
html[data-theme="light"] body[data-create-media-type="post"] .su-lb__bottom { background: linear-gradient(to top, rgba(255, 255, 255, .8), transparent); }
html[data-theme="light"] body[data-create-media-type="post"] :is(.su-lb__date, .su-lb__count) { color: #252a30; background: rgba(255, 255, 255, .9); }
@media (max-width: 700px) {
  .post-photo-reveal { padding: 10px; }
  .post-photo-toggle { min-height: 40px; font-size: 11px; padding: 8px 13px; }
}
