/* Upcoming Events strip (homepage) — compact */
.ue { --ue-red: #C04036; --ue-dark: #262626; --ue-line: #ecdcd6; padding: 26px 0 24px; background: #fbf6f3; border-bottom: 1px solid var(--ue-line); }
.ue *, .ue *::before, .ue *::after { box-sizing: border-box; }
.ue :where(h2, h3, p, ul) { margin: 0; padding: 0; }
.ue ul { list-style: none; }

.ue-bar { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 14px; }
.ue-bar h2 { font-size: clamp(20px, 2.4vw, 26px); font-weight: 800; line-height: 1.2; color: var(--ue-dark); }
.ue-bar h2 em { color: var(--ue-red); font-style: normal; }
.ue .ue-all { font-size: 14px; font-weight: 700; color: var(--ue-red); text-decoration: none; white-space: nowrap; }
.ue .ue-all:hover { text-decoration: underline; }

.ue-grid { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ue-n-1 { grid-template-columns: minmax(0, 1fr); max-width: 560px; }
.ue-n-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.ue-card { min-width: 0; display: flex; gap: 14px; align-items: stretch; padding: 12px; background: #fff; border: 1px solid var(--ue-line); border-radius: 16px; box-shadow: 0 4px 14px rgba(38, 38, 38, .05); transition: box-shadow .2s, transform .2s; }
.ue-card:hover { box-shadow: 0 8px 22px rgba(192, 64, 54, .14); transform: translateY(-2px); }

/* thumbnail: poster if there is one, otherwise a date tile */
.ue-media { flex: 0 0 104px; width: 104px; min-height: 104px; border-radius: 12px; overflow: hidden; display: block; position: relative; background: #f1e7e3; }
.ue-poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }
.ue-panel { display: grid; place-items: center; color: #fff; background: radial-gradient(circle at 85% 12%, rgba(255, 255, 255, .22), transparent 55%), linear-gradient(135deg, var(--ue-accent, #8b1409), #3a0a05); }
.ue-date { text-align: center; line-height: 1; }
.ue-date b { display: block; font-size: 25px; font-weight: 800; }
.ue-date span { display: block; margin-top: 6px; font-size: 12px; font-weight: 700; letter-spacing: .24em; padding-left: .24em; }

.ue-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ue-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.ue-badge { padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--ue-dark); color: #fff; white-space: nowrap; }
.is-urgent .ue-badge { background: var(--ue-red); }
.ue-kicker { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #8a7b76; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ue-body h3 { font-size: 16px; font-weight: 800; line-height: 1.3; color: var(--ue-dark); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ue-meta { display: flex; flex-wrap: wrap; gap: 2px 12px; margin: 5px 0 9px; font-size: 12.5px; color: #666; }
.ue-meta span { display: inline-flex; align-items: center; gap: 5px; }
.ue-meta svg { color: var(--ue-red); flex: none; }
.ue-actions { margin-top: auto; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.ue .ue-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px; border-radius: 999px; background: var(--ue-red); color: #fff; font-weight: 700; font-size: 13px; line-height: 1.2; text-decoration: none; transition: background .2s; }
.ue .ue-btn:hover { background: #a3342b; }
.ue .ue-btn.is-closed { background: #e6e1de; color: #7a7470; cursor: not-allowed; }
.ue .ue-more { font-size: 13px; font-weight: 600; color: var(--ue-dark); text-decoration: underline; text-underline-offset: 3px; }
.ue .ue-more:hover { color: var(--ue-red); }

.ue-none { padding: 12px 16px; background: #fff; border: 1px dashed var(--ue-line); border-radius: 12px; font-size: 14px; color: #666; }

/* events that have finished drop in here by themselves */
.ue-past { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--ue-line); }
.ue-past > span { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #8a7b76; }
.ue-past ul { display: flex; flex-wrap: wrap; gap: 8px; }
.ue .ue-past a { display: inline-flex; align-items: baseline; gap: 7px; padding: 4px 12px; border-radius: 999px; background: #efe9e6; color: #555; font-size: 12.5px; font-weight: 600; text-decoration: none; }
.ue .ue-past a:hover { background: #e5dcd8; color: var(--ue-dark); }
.ue-past small { font-size: 11px; font-weight: 500; color: #8a7b76; letter-spacing: 0; text-transform: none; }
.ue :focus-visible { outline: 3px solid #f1a89f; outline-offset: 2px; }

@media (max-width: 1000px) { .ue-grid, .ue-n-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ue-n-1 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 680px) {
  .ue { padding: 20px 0 18px; }
  .ue-grid, .ue-n-1, .ue-n-2, .ue-n-3 { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  /* homepage strip on phones: swipe sideways, one card at a time with the next one peeking in */
  #upcoming-events .ue-grid.ue-n-2, #upcoming-events .ue-grid.ue-n-3 { display: flex; grid-template-columns: none; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; padding: 2px 2px 10px; margin: 0 -2px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  #upcoming-events .ue-grid::-webkit-scrollbar { display: none; }
  #upcoming-events .ue-grid.ue-n-2 .ue-card, #upcoming-events .ue-grid.ue-n-3 .ue-card { flex: 0 0 86%; scroll-snap-align: start; }
  .ue-media { flex-basis: 88px; width: 88px; min-height: 88px; }
  .ue-card { padding: 10px; gap: 12px; }
  .ue-body h3 { font-size: 15px; }
}
/* ── slider (shown when there are more than 3 events) ── */
.ue-slider { position: relative; }
.ue-track { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; padding: 2px 2px 10px; margin: 0 -2px; scrollbar-width: none; outline-offset: 4px; }
.ue-track::-webkit-scrollbar { display: none; }
.ue-track .ue-card { flex: 0 0 calc((100% - 28px) / 3); scroll-snap-align: start; }
.ue-nav { position: absolute; top: 50%; z-index: 3; width: 38px; height: 38px; margin-top: -24px; border: 0; border-radius: 50%; background: #fff; color: var(--ue-red); font-size: 26px; line-height: 1; cursor: pointer; box-shadow: 0 4px 14px rgba(38, 38, 38, .22); display: grid; place-items: center; padding: 0 0 3px; transition: opacity .2s, transform .2s; }
.ue-nav:hover:not(:disabled) { transform: scale(1.08); }
.ue-nav:disabled { opacity: 0; pointer-events: none; }
.ue-prev { left: -14px; } .ue-next { right: -14px; }
.ue-slider.is-static .ue-nav { display: none; }
@media (max-width: 1000px) { .ue-track .ue-card { flex-basis: calc((100% - 14px) / 2); } }
@media (max-width: 680px) { .ue-track .ue-card { flex-basis: 86%; } .ue-prev { left: -6px; } .ue-next { right: -6px; } .ue-nav { width: 34px; height: 34px; } }

/* position dots under the phone slider (added by upcoming-events.js) */
.ue-dots { display: none; }
@media (max-width: 680px) {
  .ue-dots { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 4px; }
  .ue-dots button { position: relative; width: 8px; height: 8px; padding: 0; border: 0; border-radius: 99px; background: #d9cfca; cursor: pointer; transition: width .2s, background .2s; }
  .ue-dots button::after { content: ''; position: absolute; inset: -10px -4px; }
  .ue-dots button.on { width: 22px; background: var(--ue-red); }
}

/* ── full list on /campus-life/events ── */
.ue-dir { background: #fff; padding: 40px 0 34px; border-bottom: 0; }
.ue-dir .ue-bar h2 { font-size: clamp(26px, 3.4vw, 34px); }
.ue-sub { display: flex; align-items: center; gap: 10px; margin: 20px 0 12px; font-size: 12.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #8a7b76; }
.ue-sub span { background: #efe9e6; color: #555; border-radius: 999px; padding: 2px 10px; letter-spacing: 0; font-size: 12px; }
.ue-rows { display: grid; gap: 8px; }
.ue-row { display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: #fbf6f3; border: 1px solid var(--ue-line); border-radius: 14px; }
.ue-rdate { flex: 0 0 78px; text-align: center; line-height: 1.15; color: #555; }
.ue-rdate b { display: block; font-size: 18px; font-weight: 800; color: var(--ue-dark); }
.ue-rdate i { display: block; font-style: normal; font-size: 10.5px; font-weight: 700; letter-spacing: .1em; color: #8a7b76; }
.ue-rmain { flex: 1; min-width: 0; display: grid; gap: 1px; }
.ue-rmain strong { font-size: 15px; font-weight: 700; color: var(--ue-dark); line-height: 1.3; }
.ue-rmain small { font-size: 12.5px; color: #7a706b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ue-done { padding: 3px 11px; border-radius: 999px; background: #e6e1de; color: #6b6561; font-size: 11px; font-weight: 700; white-space: nowrap; }
.ue .ue-view { font-size: 13.5px; font-weight: 600; color: var(--ue-red); text-decoration: none; white-space: nowrap; }
.ue .ue-view:hover { text-decoration: underline; }
@media (max-width: 680px) {
  .ue-dir { padding: 28px 0 24px; }
  .ue-row { flex-wrap: wrap; gap: 6px 12px; padding: 10px 12px; }
  .ue-rmain { flex: 1 1 calc(100% - 94px); }
  .ue-rdate { flex-basis: 70px; }
  .ue-view { margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) { .ue-card { transition: none !important; } }
@media print { .ue { display: none; } }
