.BlueskyPostEmbed {
  border: 1px solid var(--accent-color, #999);
  border-radius: 8px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.02);
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  max-width: 100%;
  width: 100%;
  position: relative;
  isolation: isolate;
  cursor: default;
}

.BlueskyPostEmbed::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--accent-color, #999);
  border-radius: 8px;
  filter: var(--user-content-filter);
  z-index: -1;
}

@media (prefers-color-scheme: dark) {
  .BlueskyPostEmbed {
    background: rgba(255, 255, 255, 0.04);
  }
}

.BlueskyPostEmbed.loading,
.BlueskyPostEmbed.error {
  padding: 32px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}

.BlueskyPostEmbed-loading {
  opacity: 0.6;
}

.BlueskyPostEmbed-error {
  color: var(--text-muted);
}

.BlueskyPostEmbed-author {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.BlueskyPostEmbed-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.BlueskyPostEmbed-avatar--empty {
  background: rgba(0, 0, 0, 0.08);
}

@media (prefers-color-scheme: dark) {
  .BlueskyPostEmbed-avatar--empty {
    background: rgba(255, 255, 255, 0.12);
  }
}

.BlueskyPostEmbed-authorInfo {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.BlueskyPostEmbed-authorName {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.BlueskyPostEmbed-authorHandle {
  font-size: 13px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.BlueskyPostEmbed-content {
  margin-bottom: 12px;
}

.BlueskyPostEmbed-text {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-wrap: break-word;
  margin: 0;
}

.BlueskyPostEmbed-link,
.BlueskyPostEmbed-mention,
.BlueskyPostEmbed-tag {
  color: var(--text-secondary);
  text-decoration: none;
}

.BlueskyPostEmbed-link:hover,
.BlueskyPostEmbed-mention:hover,
.BlueskyPostEmbed-tag:hover {
  color: var(--text-primary);
}

.BlueskyPostEmbed-images {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  border-radius: 8px;
  overflow: hidden;
}

.BlueskyPostEmbed-images:has(> :nth-child(1):last-child) {
  grid-template-columns: 1fr;
}

.BlueskyPostEmbed-images:has(> :nth-child(2)) {
  grid-template-columns: 1fr 1fr;
}

.BlueskyPostEmbed-images:has(> :nth-child(3)) {
  grid-template-columns: repeat(3, 1fr);
}

.BlueskyPostEmbed-images:has(> :nth-child(4)) {
  grid-template-columns: 1fr 1fr;
}

.BlueskyPostEmbed-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 1;
}

.BlueskyPostEmbed-image--single {
  width: 100%;
  height: auto;
  max-height: 600px;
  object-fit: contain;
  display: block;
  border-radius: 8px;
}

.BlueskyPostEmbed-external {
  display: block;
  margin-top: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s;
  background: rgba(0, 0, 0, 0.02);
  position: relative;
  isolation: isolate;
}

@media (prefers-color-scheme: dark) {
  .BlueskyPostEmbed-external {
    background: rgba(255, 255, 255, 0.02);
  }
}

.BlueskyPostEmbed-external::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  pointer-events: none;
  z-index: -1;
  transition: all 0.2s;
}

.BlueskyPostEmbed-external:hover::before {
  border-color: var(--accent-color, #999);
  filter: var(--user-content-filter);
}

.BlueskyPostEmbed-externalThumb {
  width: 100%;
  height: auto;
  display: block;
}

.BlueskyPostEmbed-externalInfo {
  padding: 12px;
}

.BlueskyPostEmbed-externalTitle {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.BlueskyPostEmbed-externalDesc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.4;
}

.BlueskyPostEmbed-externalDomain {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.BlueskyPostEmbed-info {
  margin-top: 12px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

@media (prefers-color-scheme: dark) {
  .BlueskyPostEmbed-info {
    background: rgba(255, 255, 255, 0.03);
  }
}

.BlueskyPostEmbed-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  font-size: 13px;
}

.BlueskyPostEmbed-time {
  color: var(--text-secondary);
}

.BlueskyPostEmbed-externalLink {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
}

.BlueskyPostEmbed-externalLink:hover {
  color: var(--text-primary);
}

/* Delete button for edit mode */
.BlueskyPostEmbed-container {
  position: relative;
}

.BlueskyPostEmbed-deleteButton {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--text-tertiary);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.BlueskyPostEmbed-deleteButton:hover {
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.05);
}

@media (prefers-color-scheme: dark) {
  .BlueskyPostEmbed-deleteButton:hover {
    background: rgba(255, 255, 255, 0.05);
  }
}

.BlueskyPostEmbed-deleteButton:focus-visible {
  outline: 1px solid var(--accent-color);
}

.BlueskyPostEmbed-images--2 .BlueskyPostEmbed-image {
  aspect-ratio: 1;
}

.BlueskyPostEmbed-images--3 {
  grid-template-columns: 2fr 1fr;
}

.BlueskyPostEmbed-images--3 .BlueskyPostEmbed-image--large {
  grid-row: 1 / 3;
}

.BlueskyPostEmbed-images--3 .BlueskyPostEmbed-imageColumn {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.BlueskyPostEmbed-images--4 .BlueskyPostEmbed-image {
  aspect-ratio: 1;
}

/* GIF embed styles */
.BlueskyPostEmbed-gif {
  position: relative;
  margin-top: 12px;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

.BlueskyPostEmbed-gifVideo,
.BlueskyPostEmbed-gifImage {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.BlueskyPostEmbed-gifPlayOverlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
}

.BlueskyPostEmbed-gifPlayButton {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.BlueskyPostEmbed-gifLabel {
  position: absolute;
  bottom: 8px;
  left: 8px;
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* External player embed styles (YouTube, Spotify, etc.) */
.BlueskyPostEmbed-player {
  position: relative;
  width: 100%;
  margin-top: 12px;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

.BlueskyPostEmbed-playerIframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
}

/* Quote post (record embed) styles */
.BlueskyPostEmbed-quote {
  display: block;
  margin-top: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.02);
  cursor: default;
}

@media (prefers-color-scheme: dark) {
  .BlueskyPostEmbed-quote {
    background: rgba(255, 255, 255, 0.02);
  }
}

.BlueskyPostEmbed-quoteHeader {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.BlueskyPostEmbed-quoteAvatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.BlueskyPostEmbed-quoteAvatar--empty {
  background: rgba(0, 0, 0, 0.08);
}

@media (prefers-color-scheme: dark) {
  .BlueskyPostEmbed-quoteAvatar--empty {
    background: rgba(255, 255, 255, 0.12);
  }
}

.BlueskyPostEmbed-quoteMeta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex-wrap: wrap;
}

.BlueskyPostEmbed-quoteName {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.BlueskyPostEmbed-quoteHandle {
  font-size: 13px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.BlueskyPostEmbed-quoteType {
  font-size: 13px;
  color: var(--text-secondary);
}

.BlueskyPostEmbed-quoteText {
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-wrap: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.BlueskyPostEmbed-quoteDescription {
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.BlueskyPostEmbed-quoteViewLink {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
}

.BlueskyPostEmbed-quoteViewLink:hover {
  color: var(--text-primary);
}

/* Nested quote styling */
.BlueskyPostEmbed-quote .BlueskyPostEmbed-quote {
  margin-top: 8px;
  padding: 8px;
}

.BlueskyPostEmbed-quote .BlueskyPostEmbed-quote .BlueskyPostEmbed-quoteAvatar {
  width: 16px;
  height: 16px;
}

.BlueskyPostEmbed-quote .BlueskyPostEmbed-quote .BlueskyPostEmbed-quoteName {
  font-size: 13px;
}

.BlueskyPostEmbed-quote .BlueskyPostEmbed-quote .BlueskyPostEmbed-quoteHandle {
  font-size: 12px;
}

.BlueskyPostEmbed-quote .BlueskyPostEmbed-quote .BlueskyPostEmbed-quoteText {
  font-size: 13px;
  -webkit-line-clamp: 2;
}

/* Blocked, not found, detached states */
.BlueskyPostEmbed-quote--blocked,
.BlueskyPostEmbed-quote--notFound,
.BlueskyPostEmbed-quote--detached,
.BlueskyPostEmbed-quote--unknown {
  padding: 16px;
  text-align: center;
}

.BlueskyPostEmbed-quoteMessage {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
}

/* Record with media */
.BlueskyPostEmbed-recordWithMedia {
  margin-top: 12px;
}

.BlueskyPostEmbed-recordWithMedia > .BlueskyPostEmbed-images,
.BlueskyPostEmbed-recordWithMedia > .BlueskyPostEmbed-external {
  margin-top: 0;
}

.BlueskyPostEmbed-recordWithMedia > .BlueskyPostEmbed-quote {
  margin-top: 8px;
}

/* Feed and list embeds */
.BlueskyPostEmbed-quote--feed .BlueskyPostEmbed-quoteAvatar,
.BlueskyPostEmbed-quote--list .BlueskyPostEmbed-quoteAvatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

/* Compact media styles for quoted posts */
.BlueskyPostEmbed-compactMedia {
  position: relative;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.05);
}

@media (prefers-color-scheme: dark) {
  .BlueskyPostEmbed-compactMedia {
    background: rgba(255, 255, 255, 0.08);
  }
}

.BlueskyPostEmbed-compactImage {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.BlueskyPostEmbed-compactImage--empty {
  background: rgba(0, 0, 0, 0.1);
}

@media (prefers-color-scheme: dark) {
  .BlueskyPostEmbed-compactImage--empty {
    background: rgba(255, 255, 255, 0.1);
  }
}

.BlueskyPostEmbed-compactPlayIcon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

/* Quote with compact media layout - flexbox */
.BlueskyPostEmbed-quoteContent {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.BlueskyPostEmbed-quoteMedia {
  flex-shrink: 0;
}

.BlueskyPostEmbed-quoteContent .BlueskyPostEmbed-quoteText {
  flex: 1;
  min-width: 0;
}
