.ms-events-wrap { margin: 12px 0; }
.ms-events-heading { margin: 22px 0 12px; }
.ms-events-heading-closed { margin-top: 28px; }

.ms-events-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

/* Card layout: thumbnail left, content right, actions row spans full width */
.ms-event-card {
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  padding: 14px;
  background: #fff;

  display: grid;
  grid-template-columns: 140px 1fr;
  grid-template-areas:
    "thumb title"
    "thumb meta"
    "thumb excerpt"
    "actions actions";
  column-gap: 14px;
  row-gap: 8px;
  align-items: start;
}

.ms-event-card.is-closed { opacity: 0.82; }

.ms-event-thumb {
  grid-area: thumb;
  margin: 0;
  border-radius: 10px;
  overflow: hidden;
}

.ms-event-thumb img {
  width: 140px;
  height: 95px;
  object-fit: cover;
  display: block;
}

/* Typography + spacing */
.ms-event-title {
  grid-area: title;
  margin: 0;
  line-height: 1.1;
}

.ms-event-title a {
  text-decoration: none;
}

.ms-event-meta {
  grid-area: meta;
  font-size: 0.92em;
  color: #555;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0;
}

.ms-event-excerpt {
  grid-area: excerpt;
  margin: 0;
}

/* Actions row */
.ms-event-actions {
  grid-area: actions;
  display: flex;
  gap: 10px;
  justify-content: flex-start;
}

.ms-event-register-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 10px 16px;
  border-radius: 10px;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  background: #111;
  color: #fff;

  width: auto;
  max-width: 280px;
}

.ms-event-view-btn { background: #333; }

.ms-closed-badge {
  display: inline-block;
  font-size: 0.9em;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f2f2f2;
  color: #333;
}

/* Single event details */
.ms-event-details {
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 12px 14px;
  margin: 0 0 16px 0;
  background: #fafafa;
}

.ms-register-wrap { margin-top: 18px; }

.ms-closed-note {
  border-left: 4px solid #999;
  background: #f6f6f6;
  padding: 10px 12px;
  border-radius: 6px;
  margin: 10px 0 16px;
}

.ms-events-warning {
  margin-top: 14px;
  padding: 10px 12px;
  border-left: 4px solid #f0ad4e;
  background: #fff8e8;
}

/* Mobile: stack image above */
@media (max-width: 520px) {
  .ms-event-card {
    grid-template-columns: 1fr;
    grid-template-areas:
      "thumb"
      "title"
      "meta"
      "excerpt"
      "actions";
  }
  .ms-event-thumb img { width: 100%; height: auto; }
}

/* Modal */
.ms-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: none;
  z-index: 9999;
  padding: 24px;
}

.ms-modal-overlay.is-open { display: flex; align-items: center; justify-content: center; }

.ms-modal {
  width: min(760px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: 14px;
  padding: 18px;
  position: relative;
}

.ms-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 26px;
  line-height: 1;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.ms-modal-sub { color: #666; margin-bottom: 12px; }

.ms-modal-placeholder,
.ms-modal-error {
  padding: 14px;
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 10px;
}

.ms-modal-notice {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #eee;
  background: #fafafa;
}

.ms-modal-notice.is-success { border-color: #cde8d4; background: #eef9f1; }
.ms-modal-notice.is-error   { border-color: #f0c9c9; background: #fff0f0; }
