/* --- Body & container --- */
body {
  font-family: 'Inter', sans-serif;
  background: url("images/bg.webp") no-repeat left center fixed;
  background-size: cover;
  min-height: 100vh;
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 3rem;
  box-sizing: border-box;
  position: relative;
  overflow-x: hidden;
}

/* Overlay gradient */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to bottom right, #00416599, #00609499);
  z-index: 0;
}

.container {
  position: relative;
  z-index: 1;
  text-align: center;
  background: rgba(255, 255, 255, 0.95);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  width: 100%;
  max-width: 580px;
  min-width: 280px;
}

/* Profile */
.profile-img {
  border-radius: 50%;
  width: 120px;
  height: 120px;
  object-fit: cover;
  margin: 1rem 0 1rem 0;
}

/* Headings */
h1 {
  margin: 0 0 2rem 0;
  color: #004165;
  font-size: 1.75rem;
}

h2 {
  margin: 1rem 0 0.5rem 0; /* tighter spacing above and below */
  color: #004165;
  font-size: 1.5rem;
}

/* Buttons */
.link-button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  padding: 14px 20px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.2rem;
  color: white;
  background-color: #004165;
  transition: transform 0.2s, background 0.2s;
  margin-bottom: 16px;
  width: 100%;
  box-sizing: border-box;
}

.link-button:hover {
  transform: scale(1.03);
  background-color: #772432;
}

.link-button .icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  font-size: 36px;
}

.link-button span {
  flex: 1;
  text-align: center;
}

/* Events grid */
#eventsContainer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-start;
}

#eventsContainer h2 {
  flex: 0 0 100%;
  margin: 0.5rem 0 0.5rem 0;
}

/* Event cards 50% width */
.event-card {
  flex: 0 0 calc(50% - 0.375rem);
  box-sizing: border-box;
  background: rgba(255,255,255,0.9);
  padding: 1rem 1rem 0.75rem 1rem !important;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  text-align: left;
  font-size: 1rem;
}

.event-title {
  font-weight: 600;
  font-size: 1.3rem;
  color: #004165;
  margin-bottom: 0.5rem;
}

.event-meta {
  color: #333;
  margin-bottom: 0.5rem;
}

.event-badges {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.event-badge {
  display: inline-block;
  background: #004165;
  color: white;
  padding: 0.3rem 0.7rem;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-right: 1px;
  margin-bottom: 0.25rem;
}

.event-badge.ticket {
  background: #e67e22;
}

.event-badge.members-only {
  background: #772432; /* Toastmasters maroon */
  color: white;
}

.events-divider {
  border: 0;
  height: 2px;
  border-radius: 8px;
  background-color: rgba(0, 65, 101, 0.75); /* Toastmasters blue, 75% opacity */
  margin: 2rem 0 1rem 0; /* 1rem above, 0.5rem below */
}

/* Loading & No events message */
#loadingMessage {
  font-size: 1.1rem;
  font-weight: 600;
  color: #004165;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  text-align: center;
}

/* Mobile */
@media (max-width: 768px) {
  body {
    padding: 1.5rem;
  }

  .container {
    width: 95%;
    padding: 1.5rem;
  }

  .profile-img {
    width: 100px;
    height: 100px;
  }

  .link-button {
    font-size: 1rem;
    padding: 12px 16px;
  }

  .link-button .icon {
    width: 28px;
    height: 28px;
    font-size: 28px;
  }

  .event-card {
    flex: 0 0 100% !important;
    padding: 1rem;
  }

  .event-title {
    font-size: 1.1rem;
  }

  .event-meta {
    font-size: 0.85rem;
  }

  .event-badge {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
  }
}