/* Events page — compact layout (2026-11-21). Loaded after styles.css. */

/* ---------- Next Up panel ---------- */
.nu-panel {
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
  color: #fff; border-radius: var(--radius-lg); padding: 22px 28px 28px; margin-bottom: 26px;
  box-shadow: var(--shadow-md); position: relative; overflow: hidden;
}
.nu-panel:empty { display: none; }
.nu-strip { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: nowrap; overflow-x: auto; }
.nu-day {
  display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 66px;
  padding: 8px 6px 7px; border-radius: var(--radius-md); background: none; border: 1px solid transparent;
  color: rgba(255,255,255,0.75); cursor: pointer; font-family: var(--font-body);
}
.nu-day:disabled { cursor: default; opacity: 0.5; }
.nu-day:not(:disabled):hover { background: rgba(255,255,255,0.08); }
.nu-day.is-today { background: rgba(255,255,255,0.12); color: #fff; }
.nu-day.is-selected { border-color: var(--color-highlight); }
.nu-dow { font-family: var(--font-display); font-size: 0.78rem; letter-spacing: 0.08em; font-weight: 700; }
.nu-num {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: 0.95rem; color: #fff;
}
.nu-day.has-race .nu-num { background: var(--color-accent); }
.nu-day--zrl.has-race .nu-num { background: #5b2dbf; }
.nu-day--irl.has-race .nu-num { background: var(--color-success); }
.nu-day--usac.has-race .nu-num { background: #b31942; }
.nu-lbl { font-size: 0.68rem; font-weight: 600; min-height: 1em; white-space: nowrap; }
.nu-body { display: grid; grid-template-columns: 1fr 300px; gap: 28px; align-items: end; }
.nu-body--solo { grid-template-columns: 1fr; }
.nu-eyebrow {
  display: flex; align-items: center; gap: 8px; margin: 0 0 4px;
  font-family: var(--font-display); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--color-highlight);
}
.nu-eyebrow .cal-swatch { box-shadow: 0 0 0 2px rgba(255,255,255,0.6); }
.nu-big {
  font-family: var(--font-display); font-weight: 700; text-transform: uppercase;
  font-size: clamp(2.6rem, 7vw, 4.6rem); line-height: 0.95; margin: 0 0 8px; color: #fff; letter-spacing: 0.01em;
}
.nu-title { color: #fff; font-family: var(--font-body); font-size: 1.3rem; font-weight: 700; margin: 0 0 2px; text-transform: none; }
.nu-title a { color: inherit; text-decoration: none; }
.nu-title a:hover { text-decoration: underline; }
.nu-sub { color: rgba(255,255,255,0.8); margin: 0 0 14px; font-size: 0.92rem; }
.nu-stats { display: flex; flex-wrap: wrap; gap: 10px 32px; margin-bottom: 18px; }
.nu-stats span, .er-stat span {
  display: block; font-family: var(--font-display); font-weight: 700; font-size: 0.72rem;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.nu-stats span { color: rgba(255,255,255,0.7); }
.nu-stats b { font-size: 1.7rem; font-weight: 700; color: #fff; line-height: 1.1; }
.nu-stats small, .er-stat small { font-size: 0.6em; font-weight: 600; margin-left: 2px; opacity: 0.85; }
.nu-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.nu-addcal { font-size: 0.85rem; color: rgba(255,255,255,0.8); display: inline-flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.nu-addcal a, .nu-addcal button {
  color: #fff; font-weight: 600; background: none; border: 0; padding: 0; font: inherit; font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.nu-side {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-md); padding: 16px 18px;
}
.nu-side-when { font-weight: 700; color: #fff; margin-bottom: 2px; }
.nu-side-title { font-weight: 700; font-size: 1.05rem; margin-bottom: 2px; }
.nu-side-title a { color: #fff; text-decoration: none; }
.nu-side-sub { font-size: 0.84rem; color: rgba(255,255,255,0.75); margin-bottom: 12px; }
.nu-side .btn-outline { color: #fff; border-color: rgba(255,255,255,0.5); }
.nu-side .btn-outline:hover { background: rgba(255,255,255,0.12); }

/* ---------- compact rows ---------- */
.er-month { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 10px; }
.er-month h3 { margin: 0; font-size: 1.5rem; }
.er-month span { font-size: 0.85rem; color: var(--color-text-muted); font-weight: 600; }
.er-earlier {
  display: block; width: 100%; margin: 0 0 10px; padding: 9px 12px; border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm); background: none; color: var(--color-primary); font-weight: 600; font-size: 0.86rem; cursor: pointer;
}
.er-earlier:hover { background: rgba(39, 83, 100, 0.05); }
.er-earlier span { color: var(--color-text-muted); font-weight: 500; }
.er-list { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); overflow: hidden; }
.er-day + .er-day .er-row.is-first { border-top: 1px solid var(--color-border); }
.er-row {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) 150px 120px 150px; gap: 16px; align-items: center;
  padding: 10px 16px 10px 12px; border-top: 1px solid rgba(0,0,0,0.04); position: relative;
}
.er-day .er-row:first-child { border-top: 0; }
.er-row:hover { background: rgba(39, 83, 100, 0.035); }
.er-row::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--color-border); }
.er-row--ecro::before { background: var(--color-accent); }
.er-row--zrl::before  { background: #5b2dbf; }
.er-row--club::before { background: var(--color-primary); opacity: 0.55; }
.er-row--irl::before  { background: var(--color-success); }
.er-row--usac::before { background: #b31942; }
.er-row.is-placeholder .er-title { color: var(--color-text-muted); }

.er-tile {
  width: 56px; height: 56px; border-radius: var(--radius-sm); background: var(--color-primary); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; position: relative;
}
.er-tile b { font-family: var(--font-display); font-size: 1.55rem; font-weight: 700; }
.er-tile span { font-family: var(--font-display); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; margin-top: 2px; }
.er-tile em {
  position: absolute; bottom: -7px; font-style: normal; font-size: 0.58rem; font-weight: 700; text-transform: uppercase;
  background: #fff; color: var(--color-accent); border: 1px solid var(--color-accent); border-radius: 999px; padding: 1px 5px; letter-spacing: 0.04em;
}
.er-tile.is-today { background: var(--color-accent); }
.er-tile.is-past { background: #eceae6; color: var(--color-text-muted); }
.er-tile.is-blank { background: none; height: 1px; }

.er-eyebrow {
  display: flex; align-items: center; gap: 6px; font-family: var(--font-display); font-weight: 700; font-size: 0.74rem;
  letter-spacing: 0.07em; text-transform: uppercase; color: var(--color-text-muted); margin-bottom: 1px;
  white-space: nowrap; min-width: 0;
}
.er-eb-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.er-eyebrow .er-badge, .er-eyebrow .cal-swatch { flex-shrink: 0; }
.er-eyebrow .cal-swatch { width: 8px; height: 8px; }
.er-title { font-weight: 700; font-size: 1rem; line-height: 1.25; color: var(--color-text); }
.er-title a { color: inherit; text-decoration: none; }
.er-title a:hover { color: var(--color-accent); }
.er-sub { font-size: 0.84rem; color: var(--color-text-muted); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.er-stats { display: flex; gap: 16px; }
.er-stat span { color: var(--color-text-muted); font-size: 0.66rem; }
.er-stat b { font-size: 1.02rem; font-weight: 700; color: var(--color-text); white-space: nowrap; }

.er-time { display: flex; flex-direction: column; font-size: 0.9rem; }
.er-time b { font-weight: 700; white-space: nowrap; }
.er-time b.is-tbd { color: var(--color-text-muted); font-weight: 600; }
.er-time-lbl { font-weight: 500; font-size: 0.76rem; color: var(--color-text-muted); }
.er-tz { font-size: 0.7rem; color: var(--color-text-muted); }
.er-more summary { font-size: 0.75rem; color: var(--color-primary); cursor: pointer; font-weight: 600; list-style: none; }
.er-more summary::-webkit-details-marker { display: none; }
.er-more[open] summary { margin-bottom: 2px; }
.er-more div { font-size: 0.76rem; color: var(--color-text); line-height: 1.4; }

.er-status { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: nowrap; text-align: right; }
.er-eyebrow .er-badge { margin-left: 6px; font-family: var(--font-body); }
.er-badge { font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; border-radius: 999px; padding: 3px 8px; white-space: nowrap; }
.er-badge--next { background: var(--color-accent); color: #fff; }
.er-badge--live { background: var(--color-success); color: #fff; }
.er-cta { font-size: 0.82rem; font-weight: 600; color: var(--color-primary); text-decoration: none; white-space: nowrap; }
.er-cta:hover { color: var(--color-accent); }
.er-results { font-weight: 700; font-size: 0.85rem; color: var(--color-text); text-decoration: none; }
.er-results:hover { color: var(--color-accent); }
.er-done { font-size: 0.8rem; color: var(--color-text-muted); }
.er-ics {
  width: 30px; height: 30px; display: grid; place-items: center; border-radius: var(--radius-sm);
  border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text-muted); cursor: pointer; padding: 0;
}
.er-ics svg { width: 16px; height: 16px; }
.er-ics:hover { color: var(--color-primary); border-color: var(--color-primary); }

.er-row.is-past .er-title, .er-row.is-past .er-stat b, .er-row.is-past .er-time b { color: var(--color-text-muted); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .er-row { grid-template-columns: 56px minmax(0, 1fr) 130px 120px; }
  .er-row .er-status { grid-column: 2 / -1; justify-content: flex-start; }
}
@media (max-width: 900px) {
  .nu-body { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nu-panel { padding: 16px 16px 20px; border-radius: var(--radius-md); }
  .er-row { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 4px 10px; padding: 10px 12px 10px 10px; align-items: start; }
  .er-tile { width: 48px; height: 48px; grid-row: span 3; }
  .er-tile.is-blank { grid-row: span 1; }
  .er-tile b { font-size: 1.3rem; }
  .er-row .er-main, .er-row .er-stats { grid-column: 2 / 4; }
  .er-row .er-time { grid-column: 2; align-self: center; }
  .er-row .er-status { grid-column: 3; justify-content: flex-end; align-self: center; }
  .nu-strip { gap: 2px; overflow: visible; }
  .nu-day { flex: 1 1 0; min-width: 0; padding: 6px 0; }
  .nu-num { width: 28px; height: 28px; font-size: 0.85rem; }
  .nu-lbl { font-size: 0.6rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .er-row .er-stats.is-empty { display: none; }
  .er-time { flex-direction: row; flex-wrap: wrap; gap: 0 8px; align-items: baseline; }
  .er-sub { white-space: normal; }
}

/* ---------- day switcher + course profile (2026-11-21b) ---------- */
.nu-switch { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -4px 0 16px; }
.nu-arrow {
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.35); background: rgba(255,255,255,0.06);
  color: #fff; font-size: 1.25rem; line-height: 1; display: grid; place-items: center; cursor: pointer; padding: 0 0 2px;
}
.nu-arrow:hover { background: rgba(255,255,255,0.16); }
.nu-count { font-size: 0.8rem; color: rgba(255,255,255,0.75); font-weight: 600; min-width: 9em; }
.nu-chips { display: flex; gap: 6px; flex: 1 1 100%; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.nu-chip {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; max-width: 260px;
  padding: 5px 11px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.22); background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.85); font: inherit; font-size: 0.78rem; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nu-chip b { color: #fff; font-weight: 700; }
.nu-chip:hover { background: rgba(255,255,255,0.12); }
.nu-chip.is-active { background: #fff; color: var(--color-primary-dark); border-color: #fff; }
.nu-chip.is-active b { color: var(--color-primary-dark); }
.nu-chip.is-past { opacity: 0.55; }
.nu-chip .cal-swatch { width: 8px; height: 8px; flex-shrink: 0; }

.nu-profile { margin: 22px -28px -28px; padding: 12px 28px 10px; background: rgba(0,0,0,0.18); border-top: 1px solid rgba(255,255,255,0.08); }
.nu-profile.is-empty { display: none; }
.nu-prof-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-family: var(--font-display); font-weight: 700;
  font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255,255,255,0.7); margin-bottom: 4px; }
.nu-prof-plot { position: relative; padding-top: 4px; }
.nu-prof-plot svg { display: block; width: 100%; height: 110px; }
.nu-prof-axis { position: relative; height: 18px; border-top: 1px solid rgba(255,255,255,0.2); }
.nu-prof-axis span { position: absolute; top: 3px; transform: translateX(-50%); font-family: var(--font-display); font-weight: 700;
  font-size: 0.7rem; letter-spacing: 0.06em; color: rgba(255,255,255,0.65); white-space: nowrap; }
.nu-prof-none { margin: 0; font-size: 0.8rem; color: rgba(255,255,255,0.6); }
.nu-prof-loading { height: 140px; }
@media (max-width: 640px) {
  .nu-profile { margin: 18px -16px -20px; padding: 10px 16px 8px; }
  .nu-prof-plot svg { height: 80px; }
  .nu-chip { max-width: 200px; }
}

.nu-prof-tabs { display: inline-flex; gap: 4px; }
.nu-prof-tabs button { font: inherit; font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer;
  background: none; color: rgba(255,255,255,0.7); border: 1px solid rgba(255,255,255,0.3); border-radius: 999px; padding: 2px 9px; }
.nu-prof-tabs button.is-active { background: #fff; color: var(--color-primary-dark); border-color: #fff; }
.nu-chips { scrollbar-color: rgba(255,255,255,0.35) transparent; }
.nu-chips::-webkit-scrollbar { height: 6px; }
.nu-chips::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 3px; }
.nu-chips::-webkit-scrollbar-track { background: transparent; }

.er-stat b i { display: block; font-style: normal; font-size: 0.68rem; font-weight: 600; color: var(--color-text-muted); }
.er-time b { display: flex; gap: 5px; align-items: baseline; }

/* segments on the course profile (2026-11-21c) */
.nu-seg-lbls { position: relative; margin-bottom: 4px; }
.nu-seg-lbl {
  position: absolute; white-space: nowrap; font-family: var(--font-display); font-weight: 700; font-size: 0.7rem;
  letter-spacing: 0.04em; text-transform: uppercase; line-height: 15px; padding: 0 5px; border-radius: 3px;
  color: #fff; border-left: 3px solid currentColor;
}
.nu-seg-lbl.seg-sprint { color: #5fe3a8; }
.nu-seg-lbl.seg-climb { color: #ff8a80; }
.nu-seg-lbl.seg-segment { color: #9fd3f0; }
.nu-seg-lbl.is-points { background: #ffd166; color: #3a2a00; border-left-color: #3a2a00; }
.nu-seg-bands rect { opacity: 0.22; }
.nu-seg-bands rect.seg-sprint { fill: #5fe3a8; }
.nu-seg-bands rect.seg-climb { fill: #ff8a80; }
.nu-seg-bands rect.seg-segment { fill: #9fd3f0; }
.nu-seg-bands rect.is-points { fill: #ffd166; opacity: 0.45; }
.nu-seg-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: 0.72rem; color: rgba(255,255,255,0.7); }
.nu-seg-legend span { display: inline-flex; align-items: center; gap: 5px; }
.nu-seg-legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.nu-seg-legend i.seg-sprint { background: #5fe3a8; }
.nu-seg-legend i.seg-climb { background: #ff8a80; }
.nu-seg-legend i.seg-segment { background: #9fd3f0; }
.nu-seg-legend i.is-points { background: #ffd166; }
.nu-points { margin-top: 8px; font-size: 0.8rem; color: rgba(255,255,255,0.88); line-height: 1.45; }
.nu-points b { color: #ffd166; }
.nu-points-note { display: block; font-size: 0.74rem; color: rgba(255,255,255,0.6); margin-top: 2px; }

/* Event list scrolls inside its own pane beside the month calendar (2026-11-21d) */
.er-list {
  position: relative; max-height: min(760px, calc(100vh - var(--header-h) - 150px)); overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: rgba(39,83,100,0.35) transparent;
  /* scroll shadows: show there's more above/below */
  background:
    linear-gradient(var(--color-surface) 30%, rgba(255,255,255,0)) center top,
    linear-gradient(rgba(255,255,255,0), var(--color-surface) 70%) center bottom,
    radial-gradient(farthest-side at 50% 0, rgba(0,0,0,0.12), rgba(0,0,0,0)) center top,
    radial-gradient(farthest-side at 50% 100%, rgba(0,0,0,0.12), rgba(0,0,0,0)) center bottom;
  background-repeat: no-repeat; background-size: 100% 40px, 100% 40px, 100% 12px, 100% 12px;
  background-attachment: local, local, scroll, scroll;
  background-color: var(--color-surface);
}
.er-list::-webkit-scrollbar { width: 8px; }
.er-list::-webkit-scrollbar-thumb { background: rgba(39,83,100,0.3); border-radius: 4px; }
.er-row { background: transparent; }
.er-list-hint { font-size: 0.75rem; color: var(--color-text-muted); margin: 6px 2px 0; text-align: right; }
@media (max-width: 860px) {
  .er-list { max-height: 70vh; }
}
