/* /connect/views/events.css — Member "Events" v2 ("Vibrant Community")
 * Refinement layer loaded AFTER views.css so it wins the cascade.
 * Calendar-forward event cards, a polished month grid, a friendly
 * segmented RSVP control and a scrimmed cover in the detail modal.
 *
 * Colour comes only from --bcc-* design tokens. The only literal colours are
 * neutral scrim/shadow alpha (rgba(0,0,0,a) / rgba(255,255,255,a)) and the
 * intentional on-gradient ink #fff — none are thematic brand hex.
 *
 * Breakpoints mirror the shell: desktop >= 1025 | tablet 768-1024 |
 * mobile 481-767 | small phone <= 480.
 * ================================================================ */

/* Hidden attribute must beat any display rules below. */
#bcc-view-events [hidden] { display: none !important; }

/* ================================================================
   1. PAGE + HERO
=============================================================== */
.evx-page { display: flex; flex-direction: column; }

.evx-hero {
  position:        relative;
  overflow:        hidden;
  display:         flex;
  align-items:     flex-end;
  justify-content: space-between;
  flex-wrap:       wrap;
  gap:             var(--bcc-s5);
  padding:         var(--bcc-s10) var(--bcc-s8);
  margin-bottom:   var(--bcc-s8);
  border:          1px solid var(--bcc-border-strong);
  border-radius:   var(--bcc-r-xl);
  background:      linear-gradient(135deg, var(--bcc-primary) 0%, var(--bcc-primary-hover) 52%, var(--bcc-accent) 132%);
  box-shadow:      var(--bcc-shadow-2);
}
.evx-hero::before {
  content:    '';
  position:   absolute;
  inset:      0;
  background: radial-gradient(ellipse at 88% 8%, rgba(255,255,255,.14) 0%, transparent 55%),
              linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,0,0,.22) 100%);
  pointer-events: none;
}
.evx-hero-inner { position: relative; z-index: 1; max-width: 520px; }
.evx-hero-chip {
  display:         inline-flex;
  align-items:     center;
  justify-content: center;
  width:           46px;
  height:          46px;
  margin-bottom:   var(--bcc-s3);
  border-radius:   var(--bcc-r-md);
  background:      rgba(255,255,255,.16);
  color:           #fff;
  backdrop-filter: blur(4px);
}
.evx-hero-title {
  font-family:    var(--bcc-font-display);
  font-size:      var(--bcc-t-4xl);
  font-weight:    600;
  letter-spacing: -.01em;
  line-height:    1.1;
  color:          #fff;
  margin:         0 0 var(--bcc-s1);
}
.evx-hero-sub {
  font-size: var(--bcc-t-md);
  color:     rgba(255,255,255,.85);
  margin:    0;
}

/* ── List / Calendar segmented toggle (on the hero) ──────────── */
.evx-seg {
  position:        relative;
  z-index:         1;
  display:         inline-flex;
  align-items:     center;
  gap:             var(--bcc-s1);
  padding:         4px;
  border-radius:   var(--bcc-r-pill);
  background:      rgba(255,255,255,.14);
  border:          1px solid rgba(255,255,255,.24);
  backdrop-filter: blur(6px);
}
.evx-seg .ev-toggle-btn {
  display:         inline-flex;
  align-items:     center;
  justify-content: center;
  gap:             var(--bcc-s2);
  height:          38px;
  padding:         0 var(--bcc-s4);
  border:          1px solid transparent;
  border-radius:   var(--bcc-r-pill);
  background:      transparent;
  color:           rgba(255,255,255,.86);
  font-size:       var(--bcc-t-sm);
  font-weight:     600;
  transition:      background var(--bcc-dur-2) var(--bcc-ease),
                   color      var(--bcc-dur-2) var(--bcc-ease),
                   box-shadow var(--bcc-dur-2) var(--bcc-ease);
}
.evx-seg .ev-toggle-btn:hover:not(.active) { background: rgba(255,255,255,.16); color: #fff; }
.evx-seg .ev-toggle-btn.active {
  background: #fff;
  color:      var(--bcc-primary);
  box-shadow: var(--bcc-shadow-1);
}
.evx-seg .ev-toggle-btn.active .bcc-icon { color: currentColor; }

/* ================================================================
   2. UPCOMING LIST — calendar-forward event cards
=============================================================== */
.ev-list { display: flex; flex-direction: column; gap: var(--bcc-s3); }

.evx-card {
  position:     relative;
  overflow:     hidden;
  display:      flex;
  align-items:  center;
  gap:          var(--bcc-s4);
  padding:      var(--bcc-s4) var(--bcc-s5);
  cursor:       pointer;
}
.evx-card::before {
  content:    '';
  position:   absolute;
  left: 0; top: 0; bottom: 0;
  width:      3px;
  background: linear-gradient(180deg, var(--bcc-primary), var(--bcc-accent));
  opacity:    0;
  transition: opacity var(--bcc-dur-2) var(--bcc-ease);
}
.evx-card:hover,
.evx-card:focus-within {
  border-color: var(--bcc-primary);
  box-shadow:   var(--bcc-shadow-2), 0 0 0 1px rgba(var(--bcc-primary-rgb),.28);
  transform:    translateY(-2px);
}
.evx-card:hover::before,
.evx-card:focus-within::before { opacity: 1; }

/* Date block — vivid gradient tile */
.evx-date {
  display:         flex;
  flex-direction:  column;
  align-items:     center;
  justify-content: center;
  gap:             1px;
  min-width:       64px;
  padding:         var(--bcc-s2);
  border-radius:   var(--bcc-r-md);
  background:      linear-gradient(160deg, var(--bcc-primary) 0%, var(--bcc-primary-hover) 100%);
  box-shadow:      0 4px 14px rgba(var(--bcc-primary-rgb),.35);
  flex-shrink:     0;
  text-align:      center;
}
.evx-date .ev-month { color: rgba(255,255,255,.85); }
.evx-date .ev-day   { color: #fff; }
.evx-date .ev-dow   { color: rgba(255,255,255,.72); }

.ev-item-info { flex: 1 1 auto; min-width: 0; }
.evx-item-title { margin: 0 0 var(--bcc-s1); line-height: 1.25; }
.evx-item-title-btn {
  font-family: var(--bcc-font-display);
  font-size:   var(--bcc-t-lg);
  font-weight: 600;
  color:       var(--bcc-ink);
  text-align:  left;
  line-height: inherit;
  border-radius: var(--bcc-r-xs);
}
.evx-item-title-btn:hover { color: var(--bcc-primary); }

.evx-item-meta {
  display:   flex;
  flex-wrap: wrap;
  gap:       var(--bcc-s1) var(--bcc-s4);
  font-size: var(--bcc-t-sm);
  color:     var(--bcc-ink-3);
}
.evx-meta-item { display: inline-flex; align-items: center; gap: 6px; }
.evx-meta-item .bcc-icon { color: var(--bcc-primary); }

.evx-item-media {
  flex:          0 0 auto;
  width:         104px;
  height:        68px;
  border-radius: var(--bcc-r-md);
  overflow:      hidden;
  border:        1px solid var(--bcc-border);
}
.evx-item-cover { width: 100%; height: 100%; object-fit: cover; display: block; }

.ev-item-actions { flex: 0 0 auto; margin-left: auto; }
.evx-past-badge { display: inline-flex; align-items: center; gap: 4px; }

/* ── Empty state ─────────────────────────────────────────────── */
.evx-empty { display: flex; flex-direction: column; align-items: center; }
.evx-empty-icon { color: var(--bcc-primary); opacity: .75; margin-bottom: var(--bcc-s3); }
.evx-empty-icon .bcc-icon { width: 2.5rem; height: 2.5rem; }

/* ================================================================
   3. CALENDAR — polished month grid
=============================================================== */
.evx-cal-nav {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  gap:             var(--bcc-s3);
  margin-bottom:   var(--bcc-s4);
  padding:         var(--bcc-s2) var(--bcc-s3);
  background:      var(--bcc-surface-1);
  border:          1px solid var(--bcc-border);
  border-radius:   var(--bcc-r-lg);
  box-shadow:      var(--bcc-shadow-1);
}
.evx-cal-navbtn { width: 40px; height: 40px; border-radius: var(--bcc-r-md); }

.evx-cal-grid {
  display:               grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap:                   var(--bcc-s2);
}
.evx-cal-grid .ev-cal-dow {
  text-align:    center;
  font-size:     var(--bcc-t-xs);
  font-weight:   600;
  text-transform:uppercase;
  letter-spacing:.06em;
  color:         var(--bcc-ink-3);
  padding:       var(--bcc-s2) 0;
}
.evx-cal-grid .ev-cal-cell {
  position:       relative;
  min-height:     84px;
  padding:        var(--bcc-s2);
  background:     var(--bcc-surface-1);
  border:         1px solid var(--bcc-border);
  border-radius:  var(--bcc-r-md);
  display:        flex;
  flex-direction: column;
  gap:            var(--bcc-s1);
  transition:     background var(--bcc-dur-1) var(--bcc-ease),
                  border-color var(--bcc-dur-1) var(--bcc-ease),
                  transform var(--bcc-dur-1) var(--bcc-ease);
}
.evx-cal-grid .ev-cal-cell.ev-cal-blank {
  background:   transparent;
  border-color: transparent;
  min-height:   0;
}
.evx-cal-grid .ev-cal-cell.ev-cal-has-events {
  cursor:  pointer;
  background: var(--bcc-surface-2);
}
.evx-cal-grid .ev-cal-cell.ev-cal-has-events:hover {
  background:   var(--bcc-surface-3);
  border-color: var(--bcc-primary);
  transform:    translateY(-1px);
}
.evx-cal-grid .ev-cal-cell.ev-cal-today {
  border-color: var(--bcc-accent);
  background:   var(--bcc-accent-soft);
}
.evx-cal-grid .ev-cal-day-num {
  font-size:   var(--bcc-t-sm);
  font-weight: 600;
  color:       var(--bcc-ink-2);
}
.evx-cal-grid .ev-cal-today .ev-cal-day-num { color: var(--bcc-accent); font-weight: 700; }
.evx-cal-grid .ev-cal-dots {
  display:     flex;
  flex-wrap:   wrap;
  align-items: center;
  gap:         3px;
  margin-top:  auto;
}
.evx-cal-grid .ev-cal-dot {
  width:         7px;
  height:        7px;
  border-radius: 50%;
  background:    linear-gradient(135deg, var(--bcc-primary), var(--bcc-accent));
}
.evx-cal-more { font-size: .6rem; font-weight: 700; color: var(--bcc-primary); margin-left: 2px; }

/* ================================================================
   4. EVENT DETAIL MODAL (cover + scrim)
=============================================================== */
.evx-detail-cover-wrap {
  position:      relative;
  border-radius: var(--bcc-r-lg);
  overflow:      hidden;
  margin-bottom: var(--bcc-s4);
}
.evx-detail-cover { width: 100%; max-height: 260px; object-fit: cover; display: block; }
.evx-detail-scrim {
  position:   absolute;
  inset:      0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,.45) 100%);
  pointer-events: none;
}
.evx-detail-meta { display: flex; flex-direction: column; gap: var(--bcc-s2); margin-bottom: var(--bcc-s4); }
.evx-detail-row {
  display:     flex;
  align-items: center;
  flex-wrap:   wrap;
  gap:         var(--bcc-s2);
  font-size:   var(--bcc-t-sm);
  color:       var(--bcc-ink-2);
}
.evx-detail-ic { display: inline-flex; align-items: center; color: var(--bcc-primary); }
.evx-detail-date { font-weight: 600; color: var(--bcc-ink); }
.evx-map-link {
  display:     inline-flex;
  align-items: center;
  gap:         4px;
  color:       var(--bcc-primary);
  font-weight: 600;
}
.evx-map-link:hover { text-decoration: underline; }
.evx-detail-desc {
  font-size:   var(--bcc-t-md);
  color:       var(--bcc-ink-2);
  line-height: 1.7;
  white-space: pre-wrap;
}
.evx-detail-rsvp {
  margin-top: var(--bcc-s5);
  padding-top:var(--bcc-s4);
  border-top: 1px solid var(--bcc-border);
}

/* ================================================================
   5. RSVP — friendly segmented control
=============================================================== */
.evx-rsvp-q { margin: 0 0 var(--bcc-s4); font-size: var(--bcc-t-md); color: var(--bcc-ink-2); }
.evx-rsvp-q strong { color: var(--bcc-ink); }

.evx-rsvp-seg {
  display:               grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:                   var(--bcc-s2);
}
.evx-rsvp-seg .evx-rsvp-opt {
  display:         inline-flex;
  align-items:     center;
  justify-content: center;
  gap:             6px;
  height:          48px;
  padding:         0 var(--bcc-s3);
  border:          1px solid var(--bcc-border-strong);
  border-radius:   var(--bcc-r-md);
  background:      var(--bcc-surface-2);
  color:           var(--bcc-ink-2);
  font-size:       var(--bcc-t-sm);
  font-weight:     600;
  transition:      background var(--bcc-dur-2) var(--bcc-ease),
                   color      var(--bcc-dur-2) var(--bcc-ease),
                   border-color var(--bcc-dur-2) var(--bcc-ease),
                   transform  var(--bcc-dur-2) var(--bcc-ease);
}
.evx-rsvp-seg .evx-rsvp-opt:hover {
  background:   var(--bcc-surface-3);
  color:        var(--bcc-ink);
  border-color: var(--bcc-primary);
}
.evx-rsvp-seg .evx-rsvp-opt.is-active {
  background:   linear-gradient(180deg, var(--bcc-primary), var(--bcc-primary-hover));
  color:        #fff;
  border-color: transparent;
  box-shadow:   0 4px 14px rgba(var(--bcc-primary-rgb),.35);
}

/* ================================================================
   6. DAY-EVENTS MODAL ROWS
=============================================================== */
.evx-day-list { display: flex; flex-direction: column; gap: var(--bcc-s2); }
.evx-day-row {
  position:     relative;
  overflow:     hidden;
  display:      flex;
  align-items:  center;
  gap:          var(--bcc-s3);
  width:        100%;
  text-align:   left;
  padding:      var(--bcc-s3) var(--bcc-s3) var(--bcc-s3) var(--bcc-s4);
  margin:       0;
  border:       1px solid var(--bcc-border);
  border-radius:var(--bcc-r-md);
  background:   var(--bcc-surface-2);
  color:        var(--bcc-ink);
  font-size:    var(--bcc-t-sm);
  transition:   background var(--bcc-dur-1) var(--bcc-ease),
                border-color var(--bcc-dur-1) var(--bcc-ease);
}
.evx-day-row:hover { background: var(--bcc-surface-3); border-color: var(--bcc-primary); }
.evx-day-accent {
  position:   absolute;
  left: 0; top: 0; bottom: 0;
  width:      3px;
  background: linear-gradient(180deg, var(--bcc-primary), var(--bcc-accent));
}
.evx-day-row-title { font-weight: 600; }
.evx-day-time {
  display:     inline-flex;
  align-items: center;
  gap:         4px;
  margin-left: auto;
  font-size:   var(--bcc-t-xs);
  color:       var(--bcc-ink-3);
}

/* ================================================================
   7. LIGHT-MODE SAFETY
   views.css re-colours .ev-item-date / .ev-cal-cell for light themes with a
   higher-specificity selector; restore the vivid date tile and keep blank
   calendar cells invisible when a light theme is active.
=============================================================== */
body.theme-light .bcc-app .evx-date,
.bcc-app.bcc-light .evx-date {
  background: linear-gradient(160deg, var(--bcc-primary) 0%, var(--bcc-primary-hover) 100%);
}
body.theme-light .bcc-app .evx-cal-grid .ev-cal-cell.ev-cal-blank,
.bcc-app.bcc-light .evx-cal-grid .ev-cal-cell.ev-cal-blank { background: transparent; }
body.theme-light .bcc-app .evx-cal-grid .ev-cal-cell.ev-cal-has-events,
.bcc-app.bcc-light .evx-cal-grid .ev-cal-cell.ev-cal-has-events { background: var(--bcc-surface-2); }
body.theme-light .bcc-app .evx-cal-grid .ev-cal-cell.ev-cal-has-events:hover,
.bcc-app.bcc-light .evx-cal-grid .ev-cal-cell.ev-cal-has-events:hover { background: var(--bcc-surface-3); }

/* ================================================================
   8. RESPONSIVE
=============================================================== */

/* ── Tablet 768-1024 ─────────────────────────────────────────── */
@media (max-width: 1024px) {
  .evx-hero { padding: var(--bcc-s8) var(--bcc-s6); }
  .evx-cal-grid .ev-cal-cell { min-height: 72px; }
}

/* ── Mobile 481-767 ──────────────────────────────────────────── */
@media (max-width: 767px) {
  .evx-hero { padding: var(--bcc-s6) var(--bcc-s5); align-items: flex-start; }
  .evx-seg  { width: 100%; }
  .evx-seg .ev-toggle-btn { flex: 1 1 0; height: 44px; }
  .ev-rsvp-btn { height: 44px; }
  .evx-card { flex-wrap: wrap; align-items: flex-start; }
  .evx-item-media { display: none; }
  .ev-item-actions { width: 100%; margin-left: 0; padding-left: calc(64px + var(--bcc-s4)); }
  .evx-cal-grid { gap: var(--bcc-s1); }
  .evx-cal-grid .ev-cal-cell { min-height: 60px; }
  .evx-rsvp-seg { grid-template-columns: 1fr; }
}

/* ── Small phone <= 480 ──────────────────────────────────────── */
@media (max-width: 480px) {
  .evx-hero-title { font-size: var(--bcc-t-2xl); }
  .evx-seg .ev-toggle-btn { height: 44px; }
  .evx-cal-navbtn { width: 44px; height: 44px; }
  .evx-cal-grid .ev-cal-cell { min-height: 52px; padding: var(--bcc-s1); }
  .evx-cal-grid .ev-cal-dot { width: 6px; height: 6px; }
  .ev-item-actions { padding-left: 0; }
  .evx-date { min-width: 56px; }
}

/* ── Large desktop >= 1025 ───────────────────────────────────── */
@media (min-width: 1025px) {
  .evx-item-media { width: 120px; height: 76px; }
  .evx-card:hover { transform: translateY(-3px); }
}

/* ================================================================
   9. REDUCED MOTION
=============================================================== */
@media (prefers-reduced-motion: reduce) {
  .evx-page *,
  .evx-page *::before,
  .evx-page *::after,
  .evx-rsvp-seg *,
  .evx-day-list *,
  .evx-detail-cover-wrap * {
    transition-duration: .001ms !important;
    animation-duration:  .001ms !important;
  }
  .evx-card:hover,
  .evx-card:focus-within,
  .evx-cal-grid .ev-cal-cell.ev-cal-has-events:hover { transform: none; }
}
