/* KBS Calendar — override any --kbs-* variable in your theme to restyle. */
.kbs-cal,
.kbs-event,
.kbs-btn {
	--kbs-primary: #2a5da3;
	--kbs-primary-dark: #1d4480;
	--kbs-text: #1d2327;
	--kbs-muted: #646970;
	--kbs-border: #dcdfe4;
	--kbs-bg: #fff;
	--kbs-other-bg: #f7f8fa;
	--kbs-today-bg: #fff8e1;
	--kbs-radius: 6px;
	--kbs-lane-h: 1.6rem;
	--kbs-font-size: 0.8125rem;
	color: var(--kbs-text);
}

.kbs-cal {
	position: relative;
	margin: 0 0 2rem;
}
.kbs-cal *,
.kbs-event * {
	box-sizing: border-box;
}

/* ---------- toolbar ---------- */
.kbs-cal__toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 0.75rem;
	flex-wrap: wrap;
}
.kbs-cal__title {
	margin: 0 !important;
	font-size: 1.5rem;
	line-height: 1.2;
}
.kbs-cal__nav {
	display: flex;
	gap: 0.375rem;
}
.kbs-cal__btn {
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 2.5rem;
	min-width: 2.5rem;
	padding: 0 0.9rem;
	border: 1px solid var(--kbs-primary);
	border-radius: var(--kbs-radius);
	background: var(--kbs-primary);
	color: #fff;
	font: inherit;
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.15s;
}
.kbs-cal__btn--icon {
	padding: 0;
}
.kbs-cal__btn:hover:not(:disabled),
.kbs-cal__btn:focus-visible {
	background: var(--kbs-primary-dark);
	border-color: var(--kbs-primary-dark);
}
.kbs-cal__btn:disabled {
	opacity: 0.45;
	cursor: default;
}
.kbs-cal__btn:focus-visible,
.kbs-ev:focus-visible,
.kbs-more:focus-visible,
.kbs-list__item:focus-visible {
	outline: 2px solid var(--kbs-primary);
	outline-offset: 2px;
}

/* Screen-reader-only text (event dates/times spoken after the title). */
.kbs-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* A focused event shows its full title instead of the truncated one (keyboard users get no tooltip). */
.kbs-grid .kbs-ev:focus-visible {
	position: relative;
	z-index: 5;
	align-self: start;
	height: auto;
	min-height: calc(var(--kbs-lane-h) - 2px);
	padding-top: 0.3rem;
	padding-bottom: 0.3rem;
	line-height: 1.25;
	white-space: normal;
	overflow: visible;
	align-items: flex-start;
	text-align: left;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.kbs-grid .kbs-ev:focus-visible .kbs-ev__title {
	overflow: visible;
	text-overflow: clip;
	white-space: normal;
}

.kbs-cal__legend {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 1.1rem;
	list-style: none;
	margin: 0 0 0.75rem !important;
	padding: 0 !important;
	font-size: 0.875rem;
	color: var(--kbs-muted);
}
.kbs-cal__legend li {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	margin: 0;
}
.kbs-cal__legend-dot {
	width: 0.7rem;
	height: 0.7rem;
	border-radius: 50%;
}

.kbs-cal__body {
	transition: opacity 0.15s;
}
.kbs-cal.is-loading .kbs-cal__body {
	opacity: 0.45;
	pointer-events: none;
}
.kbs-cal__status:empty {
	display: none;
}
.kbs-cal__status {
	margin: 0.75rem 0 0;
	color: var(--kbs-muted);
	font-size: 0.9375rem;
}

/* ---------- month grid ---------- */
.kbs-grid {
	border: 1px solid var(--kbs-border);
	border-radius: var(--kbs-radius);
	overflow: hidden;
	background: var(--kbs-bg);
	font-size: var(--kbs-font-size);
}
.kbs-grid__head {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	border-bottom: 1px solid var(--kbs-border);
	background: var(--kbs-other-bg);
}
.kbs-grid__dow {
	padding: 0.5rem 0.25rem;
	text-align: center;
	font-weight: 700;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--kbs-muted);
}
.kbs-week {
	position: relative;
	min-height: 7.25rem;
	border-bottom: 1px solid var(--kbs-border);
}
.kbs-week:last-child {
	border-bottom: 0;
}
.kbs-week__bg {
	position: absolute;
	inset: 0;
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
}
.kbs-day + .kbs-day {
	border-left: 1px solid var(--kbs-border);
}
.kbs-day.is-other {
	background: var(--kbs-other-bg);
}
.kbs-day.is-today {
	background: var(--kbs-today-bg);
}
.kbs-week__fg {
	position: relative;
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	row-gap: 2px;
	padding-bottom: 0.4rem;
}
.kbs-day__num {
	padding: 0.35rem 0.45rem 0.2rem;
	text-align: right;
	font-size: 0.8125rem;
	font-weight: 600;
}
.kbs-day__num span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.6rem;
	height: 1.6rem;
	padding: 0 0.3rem;
	border-radius: 999px;
}
.kbs-day__num span.is-today {
	background: var(--kbs-primary);
	color: #fff;
}
.kbs-week .kbs-day.is-other ~ * {
	/* noop: other-month styling handled below */
}

/* events */
.kbs-ev {
	display: flex;
	align-items: center;
	gap: 0.3rem;
	min-width: 0;
	margin: 0 0.25rem;
	padding: 0 0.4rem;
	height: calc(var(--kbs-lane-h) - 2px);
	border-radius: 4px;
	line-height: 1;
	text-decoration: none !important;
	white-space: nowrap;
	overflow: hidden;
	color: var(--kbs-text);
}
.kbs-ev__title {
	overflow: hidden;
	text-overflow: ellipsis;
	font-weight: 600;
}
.kbs-ev__time {
	flex: none;
	font-weight: 400;
	opacity: 0.85;
}
.kbs-ev--block {
	background: var(--kbs-c, var(--kbs-primary));
}
.kbs-ev--block:hover {
	filter: brightness(0.92);
}
.kbs-ev--block.is-cont-before {
	margin-left: 0;
	border-top-left-radius: 0;
	border-bottom-left-radius: 0;
}
.kbs-ev--block.is-cont-after {
	margin-right: 0;
	border-top-right-radius: 0;
	border-bottom-right-radius: 0;
}
.kbs-ev--dot:hover {
	background: rgba(0, 0, 0, 0.06);
}
.kbs-ev__dot {
	flex: none;
	width: 0.55rem;
	height: 0.55rem;
	border-radius: 50%;
	background: var(--kbs-c, var(--kbs-primary));
}
.kbs-more {
	appearance: none;
	justify-self: start;
	margin: 0 0.25rem;
	padding: 0 0.4rem;
	height: calc(var(--kbs-lane-h) - 2px);
	border: 0;
	border-radius: 4px;
	background: none;
	color: var(--kbs-primary);
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}
.kbs-more:hover {
	background: rgba(0, 0, 0, 0.06);
}

/* "+N more" popover */
.kbs-pop {
	position: absolute;
	z-index: 50;
	background: var(--kbs-bg);
	border: 1px solid var(--kbs-border);
	border-radius: var(--kbs-radius);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
	font-size: var(--kbs-font-size);
}
.kbs-pop__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.5rem 0.5rem 0.5rem 0.75rem;
	border-bottom: 1px solid var(--kbs-border);
	background: var(--kbs-other-bg);
	font-weight: 700;
}
.kbs-pop__close {
	appearance: none;
	border: 0;
	background: none;
	font-size: 1.4rem;
	line-height: 1;
	width: 2rem;
	height: 2rem;
	cursor: pointer;
	color: var(--kbs-muted);
	border-radius: 4px;
}
.kbs-pop__close:hover {
	background: rgba(0, 0, 0, 0.06);
}
.kbs-pop__list {
	display: grid;
	gap: 3px;
	padding: 0.5rem 0.25rem;
	max-height: 18rem;
	overflow: auto;
}

/* ---------- list view (mobile) ---------- */
.kbs-list__day {
	margin: 0 0 1rem;
	border: 1px solid var(--kbs-border);
	border-radius: var(--kbs-radius);
	overflow: hidden;
	background: var(--kbs-bg);
}
.kbs-list__date {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin: 0 !important;
	padding: 0.6rem 0.9rem;
	background: var(--kbs-other-bg);
	border-bottom: 1px solid var(--kbs-border);
	font-size: 1rem !important;
	line-height: 1.2;
}
.kbs-list__num {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 50%;
	background: var(--kbs-primary);
	color: #fff;
	font-weight: 400 !important;
	font-size: 1rem;
}
.kbs-list__label {
	display: flex;
	flex-direction: column;
}
.kbs-list__label strong {
	font-weight: 400 !important;
	letter-spacing: 0.06em;
}
.kbs-list__label span {
	font-weight: 400;
	font-size: 0.875rem;
	color: var(--kbs-muted);
}
.kbs-list__today {
	margin-left: auto;
	padding: 0.2rem 0.55rem;
	border-radius: 999px;
	background: var(--kbs-today-bg);
	color: var(--kbs-text);
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}
.kbs-list__items {
	list-style: none;
	margin: 0 !important;
	padding: 0 !important;
}
.kbs-list__items li {
	margin: 0;
}
.kbs-list__items li + li {
	border-top: 1px solid var(--kbs-border);
}
.kbs-list__item {
	display: flex;
	gap: 0.9rem;
	padding: 0.8rem 0.9rem;
	color: var(--kbs-text);
	text-decoration: none !important;
}
.kbs-list__item:hover {
	background: var(--kbs-other-bg);
}
.kbs-list__time {
	flex: 0 0 6.5rem;
	font-size: 0.875rem;
	color: var(--kbs-muted);
	padding-top: 0.1rem;
}
.kbs-list__main {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	min-width: 0;
}
.kbs-list__title {
	font-weight: 700;
	color: var(--kbs-primary);
}
.kbs-list__loc {
	font-size: 0.875rem;
	color: var(--kbs-muted);
}
.kbs-list__empty {
	padding: 1.5rem;
	text-align: center;
	color: var(--kbs-muted);
	border: 1px dashed var(--kbs-border);
	border-radius: var(--kbs-radius);
}

@media (max-width: 420px) {
	.kbs-cal__title {
		font-size: 1.25rem;
	}
	.kbs-list__item {
		flex-direction: column;
		gap: 0.25rem;
	}
	.kbs-list__time {
		flex: none;
	}
}

/* ================================================================== */
/* Single event page                                                   */
/* ================================================================== */
.kbs-event__meta {
	display: grid;
	gap: 0.55rem;
	margin: 0 0 1.5rem;
	padding: 1rem 1.25rem;
	border-left: 4px solid var(--kbs-primary);
	background: var(--kbs-other-bg);
	border-radius: 0 var(--kbs-radius) var(--kbs-radius) 0;
}
.kbs-event__row {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	font-size: 1.0625rem;
}
.kbs-event__row .kbs-icon {
	flex: none;
	color: var(--kbs-primary);
}
.kbs-event__dot {
	width: 0.75rem;
	height: 0.75rem;
	margin: 0 0.25rem;
	border-radius: 50%;
}
.kbs-event__subhead {
	font-size: 1.125rem !important;
	margin: 0 0 0.5rem !important;
}
.kbs-event__dates {
	margin: 0 0 1.5rem;
}
.kbs-event__dates ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	list-style: none;
	margin: 0 !important;
	padding: 0 !important;
}
.kbs-event__dates li {
	margin: 0;
}
.kbs-event__dates a {
	display: inline-block;
	padding: 0.35rem 0.7rem;
	border: 1px solid var(--kbs-border);
	border-radius: 999px;
	font-size: 0.875rem;
	text-decoration: none;
}
.kbs-event__dates li.is-current a {
	background: var(--kbs-primary);
	border-color: var(--kbs-primary);
	color: #fff;
}
.kbs-event__repeats {
	margin: -0.25rem 0 0.6rem !important;
	font-size: 0.9375rem;
	color: var(--kbs-muted);
}
.kbs-event__more {
	font-size: 0.875rem;
	color: var(--kbs-muted);
}
.kbs-event__gdesc,
.kbs-event__content {
	margin: 0 0 1.5rem;
}

/* Parent section */
.kbs-parent {
	margin: 2rem 0;
	border: 2px solid var(--kbs-primary);
	border-radius: calc(var(--kbs-radius) + 2px);
	background: var(--kbs-bg);
	overflow: hidden;
}
.kbs-parent__head {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.75rem 1.25rem;
	background: var(--kbs-primary);
	color: #fff;
}
.kbs-parent__head h2 {
	margin: 0 !important;
	color: inherit !important;
	font-size: 1.2rem !important;
}
.kbs-parent__badge {
	margin-left: auto;
	padding: 0.2rem 0.6rem;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.18);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}
.kbs-parent__content {
	padding: 1.25rem 1.25rem 0.25rem;
}
.kbs-parent__files {
	list-style: none;
	margin: 0 !important;
	padding: 0.5rem 1.25rem 1.25rem !important;
	display: grid;
	gap: 0.5rem;
}
.kbs-parent__files li {
	margin: 0;
}
.kbs-parent__files a {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.7rem 0.9rem;
	border: 1px solid var(--kbs-border);
	border-radius: var(--kbs-radius);
	text-decoration: none;
	color: var(--kbs-text);
}
.kbs-parent__files a:hover {
	border-color: var(--kbs-primary);
	background: var(--kbs-other-bg);
}
.kbs-parent__files .kbs-icon {
	color: var(--kbs-primary);
	flex: none;
}
.kbs-parent__fname {
	font-weight: 600;
	overflow-wrap: anywhere;
}
.kbs-parent__fmeta {
	margin-left: auto;
	flex: none;
	font-size: 0.8125rem;
	color: var(--kbs-muted);
}
.kbs-parent__foot {
	padding: 0.65rem 1.25rem;
	border-top: 1px solid var(--kbs-border);
	background: var(--kbs-other-bg);
	font-size: 0.875rem;
	color: var(--kbs-muted);
}

.kbs-parent--locked {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 1.1rem 1.25rem;
	border-style: dashed;
	background: var(--kbs-other-bg);
}
.kbs-parent__lockicon {
	flex: none;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	border-radius: 50%;
	background: var(--kbs-primary);
	color: #fff;
}
.kbs-parent__lockbody {
	flex: 1;
	min-width: 0;
}
.kbs-parent--locked .kbs-parent__lockbody p {
	margin: 0 !important;
	font-size: 0.9375rem !important;
	line-height: 1.5 !important;
}
.kbs-parent--locked .kbs-parent__lockbody p.kbs-parent__title {
	font-weight: 700;
	font-size: 1.0625rem !important;
	margin-bottom: 0.15rem !important;
}
/* Button: fully self-styled so theme / Elementor button & link rules can't leak in. */
a.kbs-btn,
a.kbs-btn:link,
a.kbs-btn:visited {
	flex: none;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center;
	gap: 0.5rem;
	box-sizing: border-box;
	width: auto;
	min-height: 2.75rem;
	margin: 0 !important;
	padding: 0.65rem 1.2rem !important;
	border: 0 !important;
	border-radius: var(--kbs-radius) !important;
	background: var(--kbs-primary) !important;
	background-image: none !important;
	box-shadow: none !important;
	color: #fff !important;
	font-family: inherit;
	font-size: 0.9375rem !important;
	font-weight: 600 !important;
	font-style: normal !important;
	line-height: 1.2 !important;
	letter-spacing: 0.01em !important;
	text-transform: none !important;
	text-decoration: none !important;
	text-shadow: none !important;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color 0.15s;
}
a.kbs-btn:hover,
a.kbs-btn:focus,
a.kbs-btn:focus-visible,
a.kbs-btn:active {
	background: var(--kbs-primary-dark) !important;
	color: #fff !important;
	text-decoration: none !important;
	transform: none !important;
}
a.kbs-btn:focus-visible {
	outline: 2px solid var(--kbs-primary) !important;
	outline-offset: 2px !important;
}
a.kbs-btn .kbs-icon {
	flex: none;
	width: 18px;
	height: 18px;
	color: currentColor;
}
a.kbs-btn span {
	color: inherit !important;
	font: inherit !important;
}
.kbs-event__back {
	margin-top: 2rem;
}

@media (max-width: 560px) {
	.kbs-parent--locked {
		flex-wrap: wrap;
	}
	.kbs-parent--locked a.kbs-btn {
		width: 100%;
		justify-content: center;
	}
}

/* Standalone pieces from [kbs_event field="…"] */
.kbs-parent__files--bare {
	padding: 0 !important;
}