/* Community Submissions — public submit page styles.
   The shared editor's modal/button shell comes from mp-editor.css (loaded by
   mp_editor()); this file only styles the page layout + the community media picker
   and "my submissions" modal. Uses the public design tokens from style.css. */

/* ---- Page width + two-column form layout ---- */
.cs-page { max-width: 72rem; width: 100%; }
.cs-layout { display: grid; grid-template-columns: 1fr; gap: 20px; align-items: start; }
.cs-main { min-width: 0; }
.cs-side { min-width: 0; }
@media (min-width: 1024px) { .cs-layout { grid-template-columns: minmax(0, 1fr) 340px; } }

/* ---- Community media picker + my-submissions modal ---- */
.cs-modal {
  position: fixed; inset: 0; z-index: 120; display: none; background: rgba(20, 15, 10, .55);
  align-items: flex-start; justify-content: center; padding: 40px 16px; overflow: auto;
}
.cs-modal.open { display: flex; }
.cs-modal-box { background: var(--card); border-radius: calc(var(--radius) + 4px); width: 100%; max-width: 600px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.cs-modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.cs-modal-head h3 { margin: 0; font-size: 1.05rem; font-weight: 700; }
.cs-modal-x { background: none; border: 0; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--muted-foreground); }
.cs-modal-body { padding: 20px; max-height: 62vh; overflow: auto; }
.cs-modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

.cs-btn { display: inline-flex; align-items: center; gap: 7px; border-radius: 999px; padding: 8px 16px; font-weight: 600; font-size: 13px; cursor: pointer; border: 1px solid transparent; transition: .15s; line-height: 1; }
.cs-btn-primary { background: var(--primary); color: var(--primary-foreground); }
.cs-btn-primary:hover { filter: brightness(1.08); }
.cs-btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.cs-btn-ghost { background: transparent; color: var(--muted-foreground); }
.cs-btn-ghost:hover { background: var(--muted); }
.cs-btn-outline { background: var(--card); border: 1px solid var(--border); color: var(--foreground); }
.cs-btn-outline:hover { background: var(--muted); }

.cs-upload-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.cs-muted { color: var(--muted-foreground); font-size: .85rem; }
.cs-err-text { color: var(--destructive); font-size: .88rem; }

.cs-media-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 480px) { .cs-media-grid { grid-template-columns: repeat(3, 1fr); } }
.cs-media-item { padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; cursor: pointer; background: var(--muted); aspect-ratio: 1; }
.cs-media-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cs-media-item.selected { border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 35%, transparent); }

/* ---- My submitted articles list ---- */
.cs-sub-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.cs-sub-list li { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.cs-sub-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.cs-sub-meta { margin-top: 6px; display: flex; justify-content: space-between; gap: 10px; font-size: .82rem; color: var(--muted-foreground); }
.cs-sub-meta a { color: var(--primary); font-weight: 600; }
.cs-badge { font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.cs-badge-green { background: #dcfce7; color: #166534; }
.cs-badge-amber { background: #fef3c7; color: #92400e; }
.cs-badge-red { background: #fee2e2; color: #991b1b; }
