/* ---------------------------------------------------------------------------
   The "…" post menu and the inline edit form.

   Colours come from the same custom properties app.css defines, so the staff
   retheme feature (/admin/theme -> /theme.css) keeps applying here.

   z-index: the dropdown must clear the feed and the sticky topbar (10) and the
   tab bar (100), but stay BELOW the drawer backdrop/panel (150/151) so opening
   the side menu covers it rather than fighting it.
   --------------------------------------------------------------------------- */

.post-menu { display: inline-flex; margin: 0; position: relative; }
.post-menu-corner { margin-left: auto; }
.comment-row .post-menu { align-self: center; }

.post-menu-btn {
  background: none;
  border: 0;
  padding: 2px 8px;
  min-height: 0;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  opacity: 0.6;
  border-radius: 999px;
}
.post-menu-btn:hover,
.post-menu-btn:focus-visible {
  opacity: 1;
  background: var(--amber-100);
  color: var(--amber-700);
}

/* Fixed, not absolute: `.card` is overflow:hidden and would clip an absolutely
   positioned dropdown. postmenu.js sets top/left from the button's rect. */
.post-menu-dropdown {
  position: fixed;
  z-index: 120;
  min-width: 150px;
  background: var(--card, #fff);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(13, 36, 71, 0.18);
  padding: 4px;
}
.post-menu-dropdown[hidden] { display: none; }
/* app.css still styles .delete-form as inline-flex (it used to wrap the lone
   🗑️ button); inside the dropdown it must be a full-width row. */
.post-menu-dropdown form,
.post-menu-dropdown .delete-form { margin: 0; display: block; width: 100%; }

.post-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-radius: 6px;
  padding: 9px 12px;
  min-height: 40px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
}
.post-menu-item:hover,
.post-menu-item:focus-visible {
  background: var(--amber-100);
  color: var(--amber-700);
}
.post-menu-item-danger { color: #b42318; }
.post-menu-item-danger:hover,
.post-menu-item-danger:focus-visible {
  background: #fdeceb;
  color: #b42318;
}

/* The "Edited" marker next to a timestamp -- quiet, but never hidden. */
.edited-marker {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ---------------------------------------------------------------------------
   Inline edit form (swapped in by /messages/{id}/edit)
   --------------------------------------------------------------------------- */

.post-edit-form { margin: 0 0 4px; }

.post-edit-input {
  width: 100%;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.45;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  resize: vertical;
}
.post-edit-input:focus {
  outline: none;
  border-color: var(--amber-700);
}

.post-edit-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.post-edit-save,
.post-edit-cancel {
  padding: 6px 16px;
  min-height: 36px;
  font-size: 0.9rem;
  border-radius: 999px;
  cursor: pointer;
}
.post-edit-save {
  background: var(--amber-700);
  color: #fff;
  border: 0;
}
.post-edit-save:hover { background: var(--amber-600); }
.post-edit-cancel {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: inherit;
}
.post-edit-cancel:hover { background: var(--amber-100); }

.post-edit-error {
  margin: 0 0 6px;
  font-size: 0.85rem;
  color: #b42318;
}
