/*
 * Events & polls view styles, built on the pastel-consumer tokens.
 */

body:not([data-view="events"]) .events-only {
  display: none !important;
}

/* Starts on the title's left edge and fills the canvas; no centring. */
.events-container {
  width: 100%;
  max-width: 1200px;
  margin: 0;
  padding: 0 0 48px;
}

/* Two-column side-by-side layout at 1440, stacked on phone */
.events-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  align-items: start;
}

.events-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.events-col-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border); /* taste-skill-ignore */
}

.events-col-title {
  font-size: var(--fs-section);
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

.events-list,
.polls-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Event cards */
.event-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.event-title {
  font-size: var(--fs-body);
  font-weight: 600;
  color: var(--text);
  margin: 0;
  line-height: 1.35;
}

.event-meta {
  font-size: var(--fs-small);
  color: var(--muted);
  line-height: 1.4;
}

.event-desc {
  font-size: var(--fs-small);
  color: var(--text);
  line-height: 1.45;
  margin: 0;
}

/* Segmented control for Going / Maybe / Can't go */
.event-rsvp-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.rsvp-segmented {
  display: inline-flex;
  border: 1px solid var(--control);
  border-radius: var(--radius-control);
  background: var(--surface);
  overflow: hidden;
}

.rsvp-btn {
  height: 32px;
  padding: 0 14px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-right: 1px solid var(--control); /* taste-skill-ignore */
}

.rsvp-btn:last-child {
  border-right: none;
}

.rsvp-btn:hover {
  background: var(--ground);
  color: var(--text);
}

.rsvp-btn.selected {
  background: var(--primary);
  color: var(--surface);
  font-weight: 600;
}

.event-attendees {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

.event-attendees-line {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.event-attendees-label {
  font-weight: 500;
  color: var(--muted);
}

.event-person-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
}

/* Poll cards */
.poll-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.poll-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.poll-question {
  font-size: var(--fs-body);
  font-weight: 600;
  color: var(--text);
  margin: 0;
  line-height: 1.35;
}

.poll-total {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.poll-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.poll-option-btn {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border);
  background: var(--raised);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}

.poll-option-btn:hover {
  background: var(--active);
}

.poll-option-btn.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.poll-option-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  font-size: var(--fs-small);
}

.poll-option-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  color: var(--text);
}

.poll-option-check {
  color: var(--accent-ink);
  display: inline-flex;
  align-items: center;
}

.poll-option-stats {
  font-size: 13px;
  color: var(--muted);
}

.poll-option-btn.selected .poll-option-stats {
  color: var(--accent-ink);
  font-weight: 600;
}

.poll-bar-track {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.poll-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--muted);
}

.poll-option-btn.selected .poll-bar-fill {
  background: var(--accent);
}

.poll-voters {
  font-size: 12px;
  color: var(--muted);
}

/* Empty states */
.events-empty-card {
  background: var(--surface);
  border: 1px dashed var(--control);
  border-radius: var(--radius-card);
  padding: 32px 24px;
  text-align: center;
  color: var(--muted);
  font-size: var(--fs-small);
}

.events-empty-card p {
  margin: 0;
}

@media (max-width: 980px) {
  .events-columns {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}
