/* C3.1-B UI polish — Community create-post image grid.
   Community only: Listings keeps its own .create-media-item rows in styles.css. */

.post-media-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 0.875rem;
}

.post-media-grid:empty {
  display: none;
}

@media (min-width: 480px) {
  .post-media-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.post-media-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  min-width: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  overflow: hidden;
}

.post-media-tile__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-media-tile__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.5rem 0.375rem;
  text-align: center;
  color: #fff;
  background: rgba(15, 23, 42, 0.45);
}

.post-media-tile__status {
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-media-tile.is-error {
  border-color: var(--color-error);
}

.post-media-tile.is-error .post-media-tile__overlay {
  color: var(--color-error);
  background: rgba(254, 242, 242, 0.94);
  padding-top: 1.75rem; /* keep the text clear of the × */
}

.post-media-tile__remove {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  font-family: inherit;
  font-size: 1.125rem;
  line-height: 1;
  color: #fff;
  background: rgba(15, 23, 42, 0.72);
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

/* 44px touch target around the 28px visual circle. */
.post-media-tile__remove::before {
  content: "";
  position: absolute;
  inset: -0.5rem;
}

.post-media-tile__remove:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.post-media-tile__retry {
  position: relative;
  min-height: 1.5rem;
  padding: 0.125rem 0.75rem;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  background: var(--color-primary);
  border: none;
  border-radius: 999px;
  cursor: pointer;
}

.post-media-tile__retry::before {
  content: "";
  position: absolute;
  inset: -0.5rem -0.25rem;
}

/* Simplified posting (PO 2026-10-23): 分享 / 求助 toggle, content first, extras folded. */
.create-type-toggle { display: inline-flex; gap: 0.25rem; padding: 0.25rem; border-radius: 999px; background: #eef2f7; margin: 0.25rem 0 1rem; }
.create-type-toggle__btn { border: 0; background: transparent; padding: 0.5rem 1.1rem; border-radius: 999px; font: inherit; font-weight: 600; color: #475569; cursor: pointer; min-height: 40px; }
.create-type-toggle__btn.is-active { background: #fff; color: #1d4ed8; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12); }
#createFormStep #content { min-height: 10rem; }
.create-more { border: 1px solid var(--color-border, #e2e8f0); border-radius: 12px; padding: 0.25rem 0.9rem; margin: 0.5rem 0 1rem; background: #f8fafc; }
.create-more__summary { cursor: pointer; padding: 0.7rem 0; font-weight: 600; color: #334155; list-style: none; }
.create-more__summary::-webkit-details-marker { display: none; }
.create-more__summary::after { content: " ▾"; color: #94a3b8; }
.create-more[open] .create-more__summary::after { content: " ▴"; }
.create-more .form-group:last-child { margin-bottom: 0.75rem; }
.form-hint { margin: 0.35rem 0 0; font-size: 0.85rem; color: #64748b; }

.create-type-summary[hidden] {
  display: none;
}

/* Draft / sensitive-check buttons (they had no styles) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
.btn--primary { background: var(--color-primary, #2563eb); color: #fff; }
.btn--ghost { background: transparent; color: var(--color-text-muted, #475569); border-color: var(--color-border, #e2e8f0); }
