/* ============================================================
   Events browse filters, Stack Overflow-style discussion,
   attendee lists, and profile "My events" section.
   ============================================================ */

/* ---------- Browse filters ---------- */
.ef-search {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 14px 0 10px;
}
.ef-search-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elev);
}
.ef-search-box:focus-within { border-color: var(--accent); }
.ef-search-box input {
  flex: 1;
  min-width: 0;
  padding: 10px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
}

.ef-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 6px 0 10px;
}
.ef-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elev);
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  list-style: none;
}
.ef-control:hover { border-color: var(--border-strong); color: var(--text); text-decoration: none; }
.ef-control.is-active { background: var(--text); border-color: var(--text); color: #fff; }
.ef-control.is-active .event-filter-count { background: rgba(255, 255, 255, .18); }

.ef-seg {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elev);
}
.ef-seg-btn {
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.ef-seg-btn:hover { color: var(--text); text-decoration: none; }
.ef-seg-btn.is-on { background: var(--text); color: #fff; }

.ef-audience { margin: 4px 0 10px; }

.ef-note {
  margin: 4px 0 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--accent-soft, #eef7f1);
  color: var(--text-soft);
  font-size: 13px;
}

.ef-active {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
}
.ef-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-hover);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}
.ef-tag span { color: var(--text-muted); font-size: 14px; line-height: 1; }
.ef-tag:hover { text-decoration: none; background: var(--border); }
.ef-clear { margin-left: 4px; color: var(--text-muted); font-size: 13px; font-weight: 600; }

.ef-count { margin: 0 0 12px; }

.event-country-option.is-near { color: var(--accent); font-weight: 600; }

@media (max-width: 640px) {
  .ef-search { flex-wrap: wrap; }
  .ef-search .btn { width: 100%; }
  .ef-seg { flex: 1 1 auto; justify-content: space-between; }
  .ef-seg-btn { padding: 6px 8px; }
}

/* ---------- Stack Overflow-style discussion ---------- */
.ed-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.ed-title { margin: 0; font-size: 20px; font-weight: 600; }
.ed-head p { margin: 4px 0 0; }
.ed-sort { display: inline-flex; gap: 2px; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.ed-sort-tab {
  padding: 6px 12px;
  color: var(--text-soft);
  font-size: 13px;
  background: var(--bg-elev);
}
.ed-sort-tab:hover { text-decoration: none; background: var(--bg-hover); color: var(--text); }
.ed-sort-tab.is-on { background: var(--accent-soft, #eef7f1); color: var(--accent); font-weight: 700; }

.ed-list { margin-top: 4px; }
.ed-post {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.ed-post:last-child { border-bottom: 0; }
.ed-post.ed-reply {
  grid-template-columns: 40px 1fr;
  padding: 12px 0 12px 4px;
  border-bottom: 0;
}
.ed-post.event-update { border-bottom: 0; }

.ed-votes { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ed-votes form { margin: 0; }
.ed-vote {
  width: 34px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-elev);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}
.ed-vote:hover { border-color: var(--accent); color: var(--accent); }
.ed-vote.is-liked { background: var(--accent); border-color: var(--accent); color: #fff; }
.ed-score { font-size: 16px; font-weight: 700; color: var(--text); }

.ed-text { line-height: 1.6; white-space: pre-wrap; word-wrap: break-word; }
.ed-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 10px;
  font-size: 13px;
}
.ed-actions { display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ed-actions form { margin: 0; }
.ed-actions .event-reply-box summary { color: var(--text-muted); font-size: 13px; cursor: pointer; }
.ed-actions .event-reply-box form { min-width: min(440px, 70vw); margin-top: 8px; }
.ed-actions .event-reply-box textarea { width: 100%; box-sizing: border-box; }
.ed-byline { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.ed-byline a, .ed-byline strong { color: var(--accent); }

.ed-post .event-replies {
  margin: 12px 0 0;
  padding-left: 0;
  border-left: 0;
  border-top: 1px solid var(--border);
}
.ed-post .event-replies .ed-post { border-bottom: 1px solid var(--border); }
.ed-post .event-replies .ed-post:last-child { border-bottom: 0; }

@media (max-width: 600px) {
  .ed-post { grid-template-columns: 40px 1fr; gap: 10px; }
  .ed-vote { width: 30px; height: 26px; }
  .ed-byline { margin-left: 0; }
}

/* ---------- Attendees ---------- */
.ev-attend-head { font-size: 13px; font-weight: 700; color: var(--text-soft); margin: 14px 0 8px; text-transform: uppercase; letter-spacing: .03em; }
.ev-attendees .ev-people { grid-template-columns: 1fr 1fr; }
a.ev-person { color: inherit; padding: 4px; margin: -4px; border-radius: 8px; }
a.ev-person:hover { text-decoration: none; background: var(--bg-hover); }

/* ---------- Profile: My events ---------- */
.profile-events { margin-top: 8px; }
.pe-head-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.pe-group { margin: 14px 0 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.pe-list { list-style: none; margin: 0; padding: 0; }
.pe-item {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.pe-item.is-past { opacity: .8; }
.pe-date { margin: 0; }
.pe-body { min-width: 0; }
.pe-title { font-weight: 600; color: var(--text); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pe-status {
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  background: var(--bg-hover);
  color: var(--text-soft);
}
.pe-going { background: var(--accent-soft, #eef7f1); color: var(--accent); }
@media (max-width: 480px) {
  .pe-item { grid-template-columns: 44px 1fr; }
  .pe-status { grid-column: 2; justify-self: start; }
}

/* Going count sits under the last line of each event card. */
.event-going-line { margin-top: 8px; font-size: 13px; color: var(--text-muted); }
.event-going-line strong { color: var(--accent); }
