.square-main.is-masonry-ready {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-flow: dense;
  grid-auto-rows: 4px;
  column-gap: 8px;
  row-gap: 8px;
  align-items: start;
  padding-inline: 8px;
}

.square-main.is-masonry-ready > * {
  align-self: start;
  min-width: 0;
}

.square-main.is-masonry-ready > .masonry-wide {
  grid-column: 1 / -1;
  width: calc(100% + 16px);
  margin-left: -8px;
}

.square-main.is-masonry-ready > .fresh-post {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 1px solid #e9eceb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(28, 38, 34, 0.04);
}

.square-main.is-masonry-ready .fresh-post .photo-grid,
.square-main.is-masonry-ready .fresh-post .feed-media,
.square-main.is-masonry-ready .fresh-post .music-link {
  order: 1;
}

.square-main.is-masonry-ready .fresh-post .post-copy {
  order: 2;
}

.square-main.is-masonry-ready .fresh-post .author-row {
  order: 3;
}

.square-main.is-masonry-ready .fresh-post .post-actions {
  order: 4;
}

.square-main.is-masonry-ready .fresh-post .moderation-notice {
  order: 0;
}

.square-main.is-masonry-ready .photo-grid {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  overflow: hidden;
  background: #eef1ef;
}

.square-main.is-masonry-ready .photo-grid img {
  display: none;
}

.square-main.is-masonry-ready .photo-grid img:first-child {
  display: block;
  width: 100%;
  height: auto;
  max-height: 330px;
  aspect-ratio: auto;
  border-radius: 0;
  object-fit: cover;
}

.square-main.is-masonry-ready .photo-grid[data-image-count]::after {
  content: attr(data-image-count);
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 7px;
  border-radius: 10px;
  color: #fff;
  background: rgba(24, 31, 28, 0.68);
  font-size: 10px;
  line-height: 1;
  pointer-events: none;
}

.square-main.is-masonry-ready .feed-media {
  width: 100%;
  max-height: none;
  margin: 0;
  aspect-ratio: 4 / 5;
  border-radius: 0;
}

.square-main.is-masonry-ready .feed-media > img,
.square-main.is-masonry-ready .feed-media > video {
  object-fit: cover;
}

.square-main.is-masonry-ready .ui-play {
  width: 36px;
  height: 36px;
}

.square-main.is-masonry-ready .fresh-post .post-copy {
  display: -webkit-box;
  padding: 10px 10px 4px;
  overflow: hidden;
  color: #252c38;
  font-size: 13px;
  font-weight: 600;
  line-height: 19px;
  white-space: normal;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.square-main.is-masonry-ready .fresh-post .author-row {
  min-height: 38px;
  padding: 3px 10px 0;
  gap: 6px;
}

.square-main.is-masonry-ready .fresh-post .author-row > img {
  width: 24px;
  height: 24px;
}

.square-main.is-masonry-ready .fresh-post .author-row b {
  display: block;
  overflow: hidden;
  font-size: 11px;
  font-weight: 500;
  line-height: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.square-main.is-masonry-ready .fresh-post .author-row small {
  margin-top: 0;
  font-size: 9px;
  line-height: 13px;
}

.square-main.is-masonry-ready .fresh-post .delete-post {
  display: none !important;
}

.square-main.is-masonry-ready .fresh-post .post-actions {
  min-height: 32px;
  padding: 0 10px 4px 40px;
  margin-top: -34px;
  justify-content: flex-end;
  gap: 0;
  font-size: 10px;
}

.square-main.is-masonry-ready .fresh-post .post-actions > a,
.square-main.is-masonry-ready .fresh-post .post-actions > .collect-action {
  display: none !important;
}

.square-main.is-masonry-ready .fresh-post .post-actions > button:first-child {
  min-height: 30px;
  padding: 0 2px 0 8px;
}

.square-main.is-masonry-ready .fresh-post .post-actions svg {
  width: 16px;
  height: 16px;
}

.square-main.is-masonry-ready .fresh-post.is-text-only {
  background: linear-gradient(145deg, #f5faf7 0%, #fff 78%);
}

.square-main.is-masonry-ready .fresh-post.is-text-only .post-copy {
  min-height: 88px;
  padding: 16px 12px 8px;
  font-size: 14px;
  line-height: 21px;
  -webkit-line-clamp: 5;
}

.square-main.is-masonry-ready .fresh-post .music-link {
  margin: 8px 10px 0;
  padding: 12px 10px;
  border-radius: 6px;
  background: #f2f7f4;
}

@media (max-width: 380px) {
  .square-main.is-masonry-ready {
    column-gap: 6px;
    row-gap: 6px;
    padding-inline: 6px;
  }

  .square-main.is-masonry-ready > .masonry-wide {
    width: calc(100% + 12px);
    margin-left: -6px;
  }

  .square-main.is-masonry-ready .fresh-post .post-copy {
    padding-inline: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .square-main.is-masonry-ready * {
    scroll-behavior: auto !important;
  }
}
