/* RSVP panel + comments (T2.3): the "Are you going?" aside and the Comments
   section of docs/design/website/project/Event-Detail-*. Tokens and shared
   components live in app.css. */

/* Avatar fills from the design, in order. */
.rsvp-tint-1 {
  background: var(--pc-accent);
}

.rsvp-tint-2 {
  background: var(--pc-link-tint);
}

.rsvp-tint-3 {
  background: var(--pc-chip-bg);
}

/* ---------- Panel ---------- */

.rsvp {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--pc-surface);
  border-radius: var(--pc-radius-lg);
  box-shadow: var(--pc-shadow);
}

.rsvp__title {
  margin: 0;
  font-weight: 800;
  font-size: 20px;
}

.rsvp__summary {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rsvp__avatars {
  display: flex;
}

.rsvp__avatar {
  width: 36px;
  height: 36px;
  border: 2px solid var(--pc-surface);
  border-radius: var(--pc-radius-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 13px;
  line-height: 1;
  color: var(--pc-text);
}

.rsvp__avatar + .rsvp__avatar {
  margin-left: -10px;
}

.rsvp__count {
  font-weight: 700;
  font-size: 15px;
  color: var(--pc-text-2);
}

.rsvp__limits {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-weight: 600;
  font-size: 14px;
  color: var(--pc-muted);
}

.rsvp__warning {
  font-weight: 800;
  color: var(--pc-warning);
}

.rsvp__join,
.rsvp__toggle-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* The design toggle: primary when not going, green outline when going. */
.rsvp__toggle {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1.5px solid var(--pc-primary);
  border-radius: var(--pc-radius-sm);
  background: var(--pc-primary);
  color: #ffffff;
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
}

.rsvp__toggle:hover {
  background: #b93a3a;
}

.rsvp__toggle[aria-pressed="true"] {
  border-color: var(--pc-wa);
  background: var(--pc-surface);
  color: var(--pc-wa);
}

.rsvp__toggle[aria-pressed="true"]:hover {
  background: var(--pc-wa-tint);
}

.rsvp__toggle:disabled {
  opacity: 0.55;
  cursor: progress;
}

/* Closed (ended or cancelled): the button stays visible, disabled. */
.rsvp__toggle:disabled:not([aria-pressed]) {
  cursor: not-allowed;
}

.rsvp__closed {
  padding: 10px 12px;
  border-radius: var(--pc-radius-sm);
  background: var(--pc-chip-bg);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.45;
  color: var(--pc-text-2);
}

.rsvp__hint {
  margin-top: -6px;
  font-weight: 600;
  font-size: 14px;
  color: var(--pc-text-2);
}

.rsvp__note {
  padding: 10px 12px;
  border-radius: var(--pc-radius-sm);
  background: var(--pc-warning-tint);
  font-weight: 500;
  font-size: 14px;
  line-height: 1.45;
  color: var(--pc-text-2);
}

/* Inline link inside a sentence (WCAG 2.5.8 inline exception). */
.rsvp__note-link {
  color: var(--pc-primary);
  font-weight: 800;
}

/* Guests stepper (app.js steps the input; the input works without JS). */
.rsvp__guests {
  padding: 8px 8px 8px 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  border-radius: var(--pc-radius-md);
  background: var(--pc-chip-bg);
}

.rsvp__guests-label {
  flex: 1 1 auto;
  font-weight: 800;
  font-size: 15px;
}

.rsvp__guests-error {
  flex-basis: 100%;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 4px;
}

.stepper__btn {
  width: var(--pc-target);
  height: var(--pc-target);
  border: 0;
  border-radius: var(--pc-radius-sm);
  background: var(--pc-surface);
  color: var(--pc-primary);
  font-weight: 900;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.stepper__btn:hover {
  background: var(--pc-border);
}

.stepper__btn:disabled,
.stepper__input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.stepper__btn:disabled:hover {
  background: var(--pc-surface);
}

.stepper__input {
  width: 52px;
  height: var(--pc-target);
  border: 1.5px solid var(--pc-border);
  border-radius: var(--pc-radius-sm);
  background: var(--pc-surface);
  text-align: center;
  font-weight: 800;
  font-size: 17px;
  color: var(--pc-text);
  appearance: textfield;
  -moz-appearance: textfield;
}

.stepper__input::-webkit-inner-spin-button,
.stepper__input::-webkit-outer-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.stepper__input[aria-invalid="true"] {
  border-color: var(--pc-danger);
}

/* "See who's going" */
.rsvp__who {
  border-top: 1px solid var(--pc-border);
  padding-top: 4px;
}

.rsvp__who-summary {
  min-height: var(--pc-target);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 800;
  font-size: 15px;
  color: var(--pc-primary);
  cursor: pointer;
  list-style: none;
}

.rsvp__who-summary::-webkit-details-marker {
  display: none;
}

.rsvp__chevron {
  transition: transform 0.15s ease;
}

.rsvp__who[open] .rsvp__chevron {
  transform: rotate(180deg);
}

.rsvp__empty {
  padding: 8px 0;
  font-weight: 600;
  font-size: 15px;
  color: var(--pc-text-2);
}

.rsvp__list {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rsvp__row {
  min-height: var(--pc-target);
  padding: 0 4px 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--pc-radius-sm);
  background: var(--pc-bg);
}

.rsvp__row--waitlist {
  background: var(--pc-warning-tint);
}

.rsvp__waitlist-heading {
  padding: 6px 0 0;
  font-weight: 800;
  font-size: 14px;
  color: var(--pc-warning);
}

.rsvp__pos {
  min-width: 24px;
  font-weight: 800;
  font-size: 12px;
  color: var(--pc-muted);
}

.rsvp__waitlist-icon {
  display: inline-flex;
  color: var(--pc-warning);
}

.rsvp__name {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
  font-size: 15px;
}

.rsvp__plus {
  color: var(--pc-text-2);
}

.rsvp__remove {
  display: flex;
}

.rsvp__remove-btn,
.comment__delete-btn {
  width: var(--pc-target);
  height: var(--pc-target);
  border: 0;
  border-radius: var(--pc-radius-pill);
  background: transparent;
  color: var(--pc-text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.rsvp__remove-btn:hover,
.comment__delete-btn:hover {
  background: var(--pc-chip-bg);
  color: var(--pc-danger);
}

/* ---------- Comments ---------- */

.comments {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.comments__title {
  margin: 0;
  font-weight: 800;
  font-size: 20px;
}

.comments__empty {
  font-weight: 600;
  font-size: 16px;
  color: var(--pc-text-2);
}

.comments__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comment {
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--pc-surface);
  border-radius: var(--pc-radius-md);
}

.comment__avatar {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: var(--pc-radius-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 14px;
  line-height: 1;
  color: var(--pc-text);
}

.comment__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.comment__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
}

.comment__name {
  font-weight: 800;
  font-size: 16px;
}

.comment__time {
  font-weight: 600;
  font-size: 13px;
  color: var(--pc-muted);
}

.comment__text {
  font-weight: 500;
  font-size: 16px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.comment__edited {
  font-weight: 600;
  font-size: 13px;
  color: var(--pc-muted);
}

/* Own comment: Edit link, and the inline edit form. */
.comment__edit-link {
  align-self: flex-start;
  margin-bottom: -10px;
  font-size: 14px;
}

.comment__edit {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.comment__edit-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}

.comment__delete {
  display: flex;
  margin: -10px -10px 0 0;
}

.comments__form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* "Commenting as" + the name in a pill (old CommentForm). */
.comments__as {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  font-weight: 700;
  font-size: 15px;
}

.comments__as-name {
  padding: 4px 12px;
  border-radius: var(--pc-radius-pill);
  background: var(--pc-chip-bg);
  font-weight: 800;
  color: var(--pc-text);
}

.comments__submit {
  align-self: flex-start;
}

.comments__signin {
  padding: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--pc-surface);
  border-radius: var(--pc-radius-md);
  font-weight: 600;
  font-size: 15px;
  color: var(--pc-text-2);
}

/* ---------- No-JS error page (routes/rsvp.tsx) ---------- */

.rsvp-page {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rsvp-page__back {
  align-self: flex-start;
  min-height: var(--pc-target);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
}
