/* A creator's community: the posts, the box to write one and the bell beside "Following" (js/community.js, js/alerts.js). */

/* three tabs on a profile: they stay on one line on narrow phones */
.tabs .tab { flex: 1 1 auto; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-inline: 4px; }
@media (max-width: 400px) { .tabs .tab { font-size: 13px; padding-inline: 2px; } }

.post-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 6px; margin-top: 16px; }
.post-head { display: flex; align-items: center; gap: 10px; }
.post-avatar {
  position: relative; width: 40px; height: 40px; flex: none; border-radius: 50%; overflow: hidden; text-decoration: none;
  display: grid; place-items: center; background: var(--panel-2); font-size: 22px;
}
.post-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-who { min-width: 0; display: grid; }
.post-name { font-weight: 800; text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.post-name:hover, .post-time:hover { text-decoration: underline; }
.post-time { color: var(--muted); font-size: 12px; text-decoration: none; }
.post-body { margin: 12px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.post-body.clamp { display: -webkit-box; -webkit-line-clamp: 10; -webkit-box-orient: vertical; overflow: hidden; }
.post-image { display: block; width: 100%; margin: 12px 0 0; padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: var(--panel-2); cursor: zoom-in; }
.post-image img { display: block; width: 100%; height: auto; max-height: 520px; object-fit: contain; }

.poll { display: grid; gap: 8px; margin-top: 12px; }
.poll-option {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 42px;
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); overflow: hidden;
  font: inherit; font-weight: 700; color: inherit; text-align: left;
}
button.poll-option { cursor: pointer; }
button.poll-option:hover { border-color: var(--brand-2); }
.poll-option.chosen { border-color: var(--brand); }
.poll-bar { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--brand-2) 26%, transparent); transition: width .3s; }
.poll-option.chosen .poll-bar { background: color-mix(in srgb, var(--brand) 30%, transparent); }
.poll-label, .poll-percent { position: relative; }
.poll-label { overflow-wrap: anywhere; }
.poll-percent { flex: none; font-variant-numeric: tabular-nums; }

.post-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 4px; margin: 10px -8px 0; padding-top: 4px; border-top: 1px solid var(--line); }
.post-act {
  display: inline-flex; align-items: center; justify-content: center; min-width: 38px; min-height: 38px; padding: 0 8px; border: 0; border-radius: 9px; background: none;
  font: inherit; font-size: 14px; font-weight: 700; color: var(--muted); cursor: pointer; white-space: nowrap;
}
button.post-act:hover { background: var(--fill-2); color: var(--text); }
.post-act.still { cursor: default; }
.post-act.on { color: var(--err); }
.post-gap { flex: 1; }

/* writing a post */
.compose textarea {
  display: block; width: 100%; min-height: 84px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel-2); resize: vertical; outline: none;
}
.compose textarea:focus, .compose input:focus, .compose select:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-2) 30%, transparent); }
.compose-preview { position: relative; margin-top: 10px; border-radius: 12px; overflow: hidden; background: var(--panel-2); }
.compose-preview img { display: block; width: 100%; max-height: 320px; object-fit: contain; }
.compose-preview .compose-x { position: absolute; top: 8px; right: 8px; background: #000a; color: #fff; }
.compose-x { width: 34px; height: 34px; flex: none; border: 0; border-radius: 50%; background: var(--panel-2); font-size: 13px; cursor: pointer; }
.compose-poll { display: grid; gap: 8px; margin-top: 10px; justify-items: start; }
.compose-options { display: grid; gap: 8px; width: 100%; }
.compose-option { display: flex; align-items: center; gap: 8px; }
.compose-option input, .compose-ends select {
  min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); outline: none; font: inherit; color: inherit;
}
.compose-option input { flex: 1; min-width: 0; }
.compose-ends { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.compose-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.compose-bar [aria-pressed="true"] { border-color: var(--brand-2); }
.compose > p.compose-hint { margin: 12px 0 0; }

/* the bell beside "Following" */
.actions .btn.alert-btn { min-width: 0; padding: 0 12px; }
.people-row .btn.alert-btn { min-height: 34px; padding: 0 8px; border-radius: 10px; font-size: 13px; }
dialog.alert-dialog { display: grid; gap: 8px; }
dialog.alert-dialog:not([open]) { display: none; }
dialog.alert-dialog h2 { font-size: 17px; margin-bottom: 4px; }
dialog.alert-dialog p { margin: 4px 0; }
.alert-option {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel-2); font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.alert-option:hover { border-color: var(--brand-2); }
.alert-option[aria-pressed="true"] { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 14%, var(--panel-2)); }
.alert-option small { display: block; color: var(--muted); font-size: 12px; }
.alert-icon { width: 44px; flex: none; text-align: center; font-size: 19px; white-space: nowrap; }
