/* KFV Landsberg - JEvents. Append after existing template CSS. */
/* JEvents root or root marked by the companion script. */
:is(#jevents_body, .kfv-jevents) {
  --kfv-j-course: #2563eb;
  --kfv-j-event: #b91c1c;
  --kfv-j-bg: #ffffff;
  --kfv-j-head: #f1f5f9;
  --kfv-j-muted-bg: #f8fafc;
  --kfv-j-ink: #263238;
  --kfv-j-muted: #596575;
  --kfv-j-line: #e1e5ea;
  --kfv-j-today: #eff6ff;
  --kfv-j-focus: #2563eb;
  --kfv-j-course-tint: #eaf1ff;
  --kfv-j-event-tint: #fcecec;
  --kfv-j-course-ink: #1746a2;
  --kfv-j-event-ink: #982020;
  color: var(--kfv-j-ink);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :is(#jevents_body, .kfv-jevents):not(:is([data-bs-theme="light"], [data-theme="light"], [data-color-scheme="light"], .light-mode, .light, [data-bs-theme="light"] *, [data-theme="light"] *, [data-color-scheme="light"] *, .light-mode *, .light *)) {
    --kfv-j-bg: #20242b;
    --kfv-j-head: #292f38;
    --kfv-j-muted-bg: #171b21;
    --kfv-j-ink: #e5e7eb;
    --kfv-j-muted: #aab4c3;
    --kfv-j-line: #3b414a;
    --kfv-j-today: #202f44;
    --kfv-j-focus: #93c5fd;
    --kfv-j-course-tint: #243855;
    --kfv-j-event-tint: #44292e;
    --kfv-j-course-ink: #dbeafe;
    --kfv-j-event-ink: #fee2e2;
    color-scheme: dark;
  }
}
:is([data-bs-theme="dark"], [data-theme="dark"], [data-color-scheme="dark"], .dark-mode, .dark) :is(#jevents_body, .kfv-jevents),
:is(#jevents_body, .kfv-jevents):is([data-bs-theme="dark"], [data-theme="dark"], [data-color-scheme="dark"], .dark-mode, .dark) {
  --kfv-j-bg: #20242b;
  --kfv-j-head: #292f38;
  --kfv-j-muted-bg: #171b21;
  --kfv-j-ink: #e5e7eb;
  --kfv-j-muted: #aab4c3;
  --kfv-j-line: #3b414a;
  --kfv-j-today: #202f44;
  --kfv-j-focus: #93c5fd;
  --kfv-j-course-tint: #243855;
  --kfv-j-event-tint: #44292e;
  --kfv-j-course-ink: #dbeafe;
  --kfv-j-event-ink: #fee2e2;
  color-scheme: dark;
}
/* Calendar cells: common JEvents table and Flat layout selectors. */
:is(#jevents_body, .kfv-jevents) :is(.jevcalendar, .jev_calendar, .cal_table, .jev_calendar_table, .jev_daysnames, .jev_days, .jev_monthview) {
  background-color: var(--kfv-j-bg);
  color: var(--kfv-j-ink);
  border-color: var(--kfv-j-line);
}
:is(#jevents_body, .kfv-jevents) :is(.cal_daysnames, .cal_td_daysnames, .jev_daysnames, .jev_dayname, .jev_daynames, .jevcalendar th, .jev_calendar th, .cal_table th) {
  background: var(--kfv-j-head) !important;
  color: var(--kfv-j-ink) !important;
  border-color: var(--kfv-j-line) !important;
  font-weight: 650;
}
:is(#jevents_body, .kfv-jevents) :is(.cal_td_daysnoevents, .cal_td_dayshasevents, .jev_day, .jev_daycell, .jevcalendar td, .jev_calendar td, .cal_table td) {
  background-color: var(--kfv-j-bg);
  color: var(--kfv-j-ink);
  border-color: var(--kfv-j-line) !important;
  vertical-align: top;
}
:is(#jevents_body, .kfv-jevents) :is(.cal_td_daysoutofmonth, .jev_dayout, .jev_othermonth) {
  background: var(--kfv-j-muted-bg) !important;
  color: var(--kfv-j-muted) !important;
}
:is(#jevents_body, .kfv-jevents) :is(.cal_today, .cal_td_today, .jev_today) {
  background: var(--kfv-j-today) !important;
  color: var(--kfv-j-ink) !important;
}
:is(#jevents_body, .kfv-jevents) :is(.month_date, .cal_daylink, .jev_daynum, .jev_daynumber) {
  color: var(--kfv-j-ink) !important;
  font-weight: 650;
}
:is(#jevents_body, .kfv-jevents) :is(select, input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"])) {
  background-color: var(--kfv-j-bg);
  border-color: var(--kfv-j-line);
  color: var(--kfv-j-ink);
  border-radius: 6px;
}
/* Category-specific layouts and event links marked by JS. */
:is(#jevents_body, .kfv-jevents) :is(.kfv-jev-course, .kfv-jev-event) {
  --kfv-j-accent: var(--kfv-j-event);
  --kfv-j-tint: var(--kfv-j-event-tint);
  --kfv-j-event-text: var(--kfv-j-event-ink);
}
:is(#jevents_body, .kfv-jevents) .kfv-jev-course {
  --kfv-j-accent: var(--kfv-j-course);
  --kfv-j-tint: var(--kfv-j-course-tint);
  --kfv-j-event-text: var(--kfv-j-course-ink);
}
:is(#jevents_body, .kfv-jevents) :is(.kfv-jev-course, .kfv-jev-event) {
  display: block;
  box-sizing: border-box;
  margin: 3px 0;
  padding: 5px 7px;
  border: 0;
  border-inline-start: 3px solid var(--kfv-j-accent);
  border-radius: 4px;
  background: var(--kfv-j-tint) !important;
  color: var(--kfv-j-event-text) !important;
  font-size: .82rem;
  line-height: 1.35;
  font-weight: 600;
  text-decoration: none;
  white-space: normal;
  overflow-wrap: anywhere;
}
:is(#jevents_body, .kfv-jevents) :is(.kfv-jev-course, .kfv-jev-event) a {
  color: inherit !important;
  text-decoration: none;
}
:is(#jevents_body, .kfv-jevents) :is(a.kfv-jev-course, a.kfv-jev-event):hover,
:is(#jevents_body, .kfv-jevents) :is(.kfv-jev-course, .kfv-jev-event) a:hover {
  text-decoration: underline;
}
:is(#jevents_body, .kfv-jevents) a:focus-visible {
  outline: 2px solid var(--kfv-j-focus);
  outline-offset: 2px;
}
.kfv-jev-time { display: block; font-size: .75rem; font-weight: 400; }
@media (max-width: 640px) {
  :is(#jevents_body, .kfv-jevents) :is(.kfv-jev-course, .kfv-jev-event) {
    font-size: .78rem;
    padding: 4px 5px;
  }
}
