/*
 * events.css
 *
 * Styles for the stand‑alone upcoming events page.  The palette and
 * typography are inspired by the existing CharlestonHacks theme found
 * throughout the site.  The layout is responsive and designed to
 * allow long lists of events to scroll within the viewport without
 * causing the entire page to scroll.
 */

/* Theme variables.  Feel free to adjust these to better match your
   brand colours. */
:root {
  --bg-color: #0d1b2a;
  --fg-color: #f5f7fa;
  --section-bg: #1e324d;
  --card-bg: #162945;
  --accent-color: #ffc678;
  --muted-color: #8fa3bf;
}

/* Global resets */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--fg-color);
  line-height: 1.5;
}

.container {
  width: 90%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 1rem 0 3rem;
}

h1 {
  margin: 1rem 0 0.5rem;
  text-align: center;
  font-size: 2rem;
  color: var(--accent-color);
}

#lastUpdated {
  text-align: center;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--muted-color);
}

/* Scrollable list container.  The height is calculated relative to the
   viewport so that the page header remains visible.  Adjust the
   subtraction value if the header size changes. */
#events-list {
  max-height: calc(100vh - 220px);
  overflow-y: auto;
  padding-right: 0.5rem;
}

.section {
  margin-bottom: 2rem;
}

.section-header {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--accent-color);
}

.event-card {
  background-color: var(--card-bg);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.event-title {
  font-size: 1.25rem;
  margin: 0 0 0.25rem 0;
  color: var(--fg-color);
}

.event-date,
.event-location,
.event-source {
  font-size: 0.9rem;
  margin: 0.25rem 0;
  color: var(--muted-color);
}

.event-description {
  font-size: 0.9rem;
  margin: 0.5rem 0;
  color: var(--fg-color);
}

.event-link {
  display: inline-block;
  margin-top: 0.5rem;
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.event-link:hover {
  text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  #events-list {
    max-height: calc(100vh - 180px);
  }
  h1 {
    font-size: 1.6rem;
  }
  .section-header {
    font-size: 1.3rem;
  }
  .event-title {
    font-size: 1.1rem;
  }
}

/* ── CharlestonHacks Event Cards (eventsFeed.js render) ─────────────── */

.ch-event-card {
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  background: rgba(22, 41, 69, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: border-color 0.3s ease;
}

.ch-event-card:hover {
  border-color: rgba(0, 224, 255, 0.2);
}

.ch-event-date {
  font-size: 0.75rem;
  color: #00e0ff;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ch-event-title {
  margin: 0 0 8px 0;
  font-size: 1.1rem;
}

.ch-event-title a {
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid #444;
  transition: border-color 0.3s;
}

.ch-event-title a:hover {
  border-color: #00e0ff;
}

.ch-event-location {
  font-size: 0.85rem;
  color: #aaa;
  margin: 4px 0;
}

.ch-event-desc {
  font-size: 0.9rem;
  color: #888;
  margin-top: 5px;
  line-height: 1.4;
}

/* ── CTA Section ────────────────────────────────────────────────────── */

.ch-event-cta {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

/* Nearify badge label */
.ch-nearify-badge {
  display: inline-block;
  width: 100%;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #a78bfa;
  margin-bottom: -0.25rem;
}

/* Primary CTA — Nearify Join */
.ch-btn-nearify {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  border-radius: 6px;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

.ch-btn-nearify:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.45);
}

.ch-btn-nearify:active {
  transform: translateY(0);
}

/* Secondary link — View on Meetup (when Nearify is primary) */
.ch-link-meetup {
  font-size: 0.8rem;
  color: #8fa3bf;
  text-decoration: none;
  border-bottom: 1px dashed #555;
  transition: color 0.2s, border-color 0.2s;
}

.ch-link-meetup:hover {
  color: #00e0ff;
  border-color: #00e0ff;
}

/* Fallback CTA — Meetup only (no Nearify) */
.ch-btn-meetup {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: #fff;
  background: rgba(0, 224, 255, 0.12);
  border: 1px solid rgba(0, 224, 255, 0.3);
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}

.ch-btn-meetup:hover {
  background: rgba(0, 224, 255, 0.2);
  border-color: rgba(0, 224, 255, 0.5);
}

/* ── Responsive ─────────────────────────────────────────────────────── */

@media (max-width: 600px) {
  .ch-event-cta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .ch-btn-nearify,
  .ch-btn-meetup {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
}
