/* Posts (specs/post.allium): the editor, a post's page and the wall card. */

.post-editor,
.post-detail {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.post-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.post-editor-form {
  border: none;
  margin: 0;
  padding: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.post-title-input {
  font-size: 1.2rem;
  font-weight: 600;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

.post-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.post-toolbar-spacer {
  flex: 1;
}

.post-tool {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.post-tool:hover {
  background: var(--surface-alt);
}

.post-tool-danger {
  color: var(--danger);
}

.post-mode {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.post-mode-btn {
  padding: 4px 10px;
  border: none;
  background: var(--surface);
  color: var(--text-muted);
  font: inherit;
  cursor: pointer;
}

.post-mode-btn.active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

.post-body-input {
  min-height: 16rem;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  line-height: 1.5;
  resize: vertical;
}

.post-preview {
  min-height: 16rem;
  padding: 8px 12px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.post-gallery-editor,
.post-gallery {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.post-gallery-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.post-gallery-title {
  font-size: 1rem;
  margin: 0;
}

.post-gallery-count {
  color: var(--text-muted);
  font-size: 0.85rem;
  flex: 1;
}

.post-gallery-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}

.post-gallery-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.post-gallery-item .post-media {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  background: var(--surface-sunken);
}

.post-media-pending {
  display: block;
}

.post-gallery-controls {
  display: flex;
  gap: 4px;
  justify-content: center;
}

.post-remove-warning {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--danger-soft);
}

.post-remove-warning p {
  margin: 0;
  flex-basis: 100%;
}

/* The body as read: markdown, its photos at the column's width. */
.post-body {
  line-height: 1.55;
}

.post-body .md-photo {
  display: block;
  max-width: 100%;
  border-radius: 8px;
  margin: 0.4em 0;
}

.post-detail-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.post-detail-title {
  font-size: 1.6rem;
  line-height: 1.2;
  margin: 0;
}

.post-owner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.post-body-unavailable .post-unavailable-note {
  color: var(--text-muted);
  font-style: italic;
}

/* The wall card. */
.post-wall-card {
  border-left: 3px solid var(--brand);
}

.post-excerpt {
  margin: 0 16px 12px;
  color: var(--text-muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-thumb {
  margin: 0 16px 12px;
}

.post-card-thumb img {
  display: block;
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  border-radius: 8px;
}
