/* Post 58 upcoming events: all selectors are isolated to this feature. */
.p58-events, .p58-event-dialog {
  --p58-navy: #0d2b4b;
  --p58-gold: #f3c66d;
  --p58-offwhite: #fdfaf3;
  box-sizing: border-box;
}
.p58-events *, .p58-event-dialog * { box-sizing: border-box; }
.p58-events[hidden] { display: none !important; }
.p58-events {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-height: 66px;
  background: var(--p58-navy);
  border-top: 2px solid var(--p58-gold);
  border-bottom: 2px solid var(--p58-gold);
  color: #fff;
  overflow: hidden;
  font-family: inherit;
}
.p58-events-heading {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  justify-content: center;
  padding: 12px 20px;
  background: #08213a;
  box-shadow: 5px 0 15px rgba(0,0,0,.17);
  position: relative;
  z-index: 1;
}
.p58-events-heading strong {
  color: var(--p58-gold);
  font-size: .95rem;
  line-height: 1.25;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.p58-events-heading small {
  color: #e8edf3;
  font-size: .75rem;
  line-height: 1.45;
}
.p58-events-viewport {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.p58-events-track {
  display: flex;
  align-items: center;
  width: max-content;
  animation: p58-event-scroll 24s linear infinite;
  will-change: transform;
}
/* Pause on hover to make moving events easier to select, but not on focus:
   a clicked event keeps focus after its popup closes. */
.p58-events-viewport:hover .p58-events-track {
  animation-play-state: paused;
}
/* The ticker continues moving underneath the open event dialog, even if
   the pointer remains over the event bar behind the popup. */
body.p58-dialog-open .p58-events-viewport:hover .p58-events-track {
  animation-play-state: running;
}
.p58-events-group {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-around;
  gap: 25px;
  padding: 8px 30px 8px 20px;
}
.p58-event-item {
  display: inline-flex;
  gap: 11px;
  align-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 999px;
  background: rgba(255,255,255,.09);
  color: #fff;
  font: inherit;
  font-size: .91rem;
  line-height: 1.3;
  text-align: left;
  padding: 8px 14px 8px 8px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.p58-event-item:hover, .p58-event-item:focus-visible {
  background: rgba(255,255,255,.19);
  border-color: var(--p58-gold);
}
.p58-event-item:focus-visible { outline: 3px solid var(--p58-gold); outline-offset: 2px; }
.p58-event-date {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--p58-gold);
  color: #08213a;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .01em;
}
.p58-event-title { font-weight: 650; white-space: nowrap; }
.p58-event-action { color: var(--p58-gold); font-size: 1.05rem; }
@keyframes p58-event-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Native <dialog> makes a real accessible, Esc-dismissible popup. */
.p58-event-dialog {
  position: fixed;
  width: min(92vw, 690px);
  max-width: 690px;
  max-height: min(90dvh, 920px);
  overflow-y: auto;
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: var(--p58-offwhite);
  color: #18314a;
  box-shadow: 0 24px 75px rgba(0,0,0,.44);
  font-family: inherit;
}
.p58-event-dialog::backdrop { background: rgba(4,16,32,.78); }
.p58-dialog-content { padding: 24px; }
.p58-dialog-close {
  position: sticky;
  top: 10px;
  float: right;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 2px solid #d7e0e9;
  border-radius: 50%;
  background: #fff;
  color: #08213a;
  font: inherit;
  font-size: 1.5rem;
  cursor: pointer;
}
.p58-dialog-close:hover, .p58-dialog-close:focus-visible { background: #eaf0f7; outline-color: #cd9d36; }
.p58-dialog-title { margin: 5px 48px 7px 0; font-size: clamp(1.4rem, 4vw, 1.9rem); line-height: 1.2; color: #0d2b4b; }
.p58-dialog-date { margin: 0 0 14px; color: #43566c; font-weight: 700; }
.p58-dialog-flyer {
  display: block;
  width: 100%;
  max-width: 520px;
  height: auto;
  margin: 12px auto 18px;
  border: 1px solid #dce0e5;
  border-radius: 6px;
}
.p58-dialog-details { padding: 14px 16px; background: #e9eef3; border-radius: 8px; margin: 15px 0; }
.p58-dialog-details p { margin: 5px 0; line-height: 1.55; }
.p58-dialog-register {
  display: inline-block;
  padding: 12px 17px;
  border-radius: 6px;
  background: #0d2b4b;
  color: #fff !important;
  font-weight: 750;
  text-decoration: none;
}
.p58-dialog-register:hover, .p58-dialog-register:focus-visible { background: #17466f; text-decoration: underline; }
.p58-veterans-poster {
  margin: 16px 0;
  padding: 30px 22px;
  text-align: center;
  color: white;
  background: linear-gradient(145deg,#091d36,#204c75);
  border: 5px double #e7c176;
  border-radius: 8px;
}
.p58-veterans-poster .poster-kicker { margin: 0 0 9px; color: #f3cf89; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; }
.p58-veterans-poster .poster-title { margin: 0 0 14px; font-size: clamp(1.5rem, 6vw, 2.4rem); line-height: 1.14; color: #fff; }
.p58-veterans-poster p { margin: 7px 0; color: white; }
.p58-veterans-poster .poster-date { font-size: 1.17rem; font-weight: 750; color: #f3cf89; }
@media (max-width: 680px) {
  .p58-events { flex-direction: column; }
  .p58-events-heading { flex-direction: row; align-items: baseline; justify-content: space-between; gap: 10px; padding: 8px 14px; }
  .p58-events-heading strong { font-size: .83rem; }
  .p58-events-heading small { font-size: .73rem; }
  .p58-events-viewport { min-height: 57px; }
  .p58-dialog-content { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .p58-events-track { animation: none; }
  .p58-events-group[aria-hidden="true"] { display: none; }
  .p58-events-viewport { overflow-x: auto; }
  .p58-event-item { transition: none; }
}
