/**
 * Events calendar widget (intro + calendar + optional CTA)
 *
 * @package MBM_Theme
 * @since 1.0.0
 */

.ecw {
	position: relative;
	padding: clamp(3rem, 5vw, 4.5rem) 0;
	overflow: visible;
}

.ecw__head {
	margin-bottom: clamp(1.25rem, 2.5vw, 2rem);
	max-width: min(52rem, 100%);
}

.ecw__title {
	margin: 0 0 0.65rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	font-size: clamp(1.5rem, 2.2vw, 1.85rem);
	font-weight: 700;
	color: var(--la-blue-dark, #03033e);
}

.ecw__text {
	margin: 0;
	font-size: clamp(1rem, 1.2vw, 1.05rem);
	line-height: 1.55;
	color: var(--la-blue-80, #393974);
}

.ecw__footer {
	margin-top: clamp(2rem, 4vw, 2.75rem);
	display: flex;
	justify-content: flex-start;
}

.evcal.evcal--nested {
	padding: 0;
}

.evcal__inner {
	width: 100%;
}

.evcal__empty {
	margin: 0;
	color: var(--la-blue-60, #6b6b97);
	font-size: 1rem;
}

.evcal__empty--muted {
	font-size: 0.95rem;
	margin-bottom: 1.25rem;
}

.evcal__filters {
	margin-bottom: clamp(1.25rem, 2.5vw, 1.75rem);
}

/* List + "All" years: no month stepper; show full event list */
.evcal__filters--list-all-years .evcal__period {
	display: none;
}

.evcal__toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem 1.25rem;
}

.evcal__view-toggle {
	--evcal-toggle-pad: 0.2rem;
	--evcal-toggle-gap: 0.2rem;
	position: relative;
	display: inline-grid;
	grid-template-columns: 1fr 1fr;
	align-items: stretch;
	border-radius: 999px;
	padding: var(--evcal-toggle-pad);
	gap: var(--evcal-toggle-gap);
	isolation: isolate;
	background: rgba(8, 8, 81, 0.06);
	border: 1px solid rgba(8, 8, 81, 0.1);
}

.evcal__view-toggle::before {
	content: "";
	position: absolute;
	top: var(--evcal-toggle-pad);
	left: var(--evcal-toggle-pad);
	width: calc((100% - (var(--evcal-toggle-pad) * 2) - var(--evcal-toggle-gap)) / 2);
	height: calc(100% - (var(--evcal-toggle-pad) * 2));
	border-radius: 999px;
	background: var(--la-gold, #966c0f);
	transform: translateX(0);
	transition: transform 0.26s ease;
	z-index: 0;
}

.evcal__view-toggle.is-view-calendar::before {
	transform: translateX(calc(100% + var(--evcal-toggle-gap)));
}

.evcal__view-btn {
	position: relative;
	z-index: 1;
	appearance: none;
	border: 0;
	background: transparent;
	color: var(--la-blue, #080851);
	font-weight: 600;
	font-size: 0.875rem;
	min-width: 5.75rem;
	width: 100%;
	padding: 0.55rem 0.9rem;
	border-radius: 999px;
	cursor: pointer;
	text-align: center;
	white-space: nowrap;
	transition: color 0.22s ease;
}

.evcal__view-btn--active {
	color: var(--la-white, #fff);
}

.evcal__view-btn:not(.evcal__view-btn--active):hover {
	color: var(--la-blue-dark, #03033e);
}

.evcal__period {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
}

.evcal__month-current {
	min-width: 8.5rem;
	text-align: center;
	font-weight: 700;
	font-size: 1.05rem;
	color: var(--la-blue-dark, #03033e);
	text-transform: capitalize;
}

.evcal__icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 10px;
	border: 0;
	cursor: pointer;
	background: var(--la-gold, #966c0f);
	color: var(--la-white, #fff);
	transition: filter 0.2s ease, transform 0.15s ease;
}

.evcal__icon-btn:hover {
	filter: brightness(1.08);
}

.evcal__icon-btn:active {
	transform: scale(0.96);
}

.evcal__years {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}

.evcal__year-btn {
	appearance: none;
	border-radius: 10px;
	border: 1px solid rgba(8, 8, 81, 0.12);
	padding: 0.4rem 0.85rem;
	font-weight: 600;
	font-size: 0.85rem;
	cursor: pointer;
	background: var(--la-white, #fff);
	color: var(--la-blue, #080851);
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.evcal__year-btn--active {
	background: var(--la-gold, #966c0f);
	color: var(--la-white, #fff);
	border-color: transparent;
}

.evcal__year-btn:not(.evcal__year-btn--active):hover {
	border-color: rgba(150, 108, 15, 0.45);
}

.evcal__calendar-view--hidden {
	display: none !important;
}

.evcal__list-view--hidden {
	display: none !important;
}

.evcal {
	--evcal-cell-gap: 0.35rem;
}

.evcal__weekday-row {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: var(--evcal-cell-gap);
	margin-bottom: 0.5rem;
}

.evcal__weekday {
	text-align: center;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--la-blue-60, #6b6b97);
}

.evcal__calendar-grid {
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
}

.evcal-week {
	--evcal-lane-row: 30px;
	/* Space reserved for day number before event bars overlap the cell */
	--evcal-bars-top: 2.75rem;
	width: 100%;
	position: relative;
	padding-bottom: 0.35rem;
}

.evcal-week__days {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: var(--evcal-cell-gap);
	position: relative;
	z-index: 0;
}

.evcal-week__bars {
	list-style: none;
	margin: 0;
	padding: 0;
	position: absolute;
	left: 0;
	right: 0;
	top: var(--evcal-bars-top);
	z-index: 1;
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	grid-auto-rows: var(--evcal-lane-row);
	gap: var(--evcal-cell-gap);
	pointer-events: none;
	height: calc(
		var(--evcal-lanes) * var(--evcal-lane-row) + max(0, var(--evcal-lanes) - 1) * var(--evcal-cell-gap)
	);
}

.evcal-week__bar-slot {
	min-width: 0;
	display: flex;
	align-items: stretch;
	pointer-events: auto;
}

.evcal-day {
	position: relative;
	z-index: 0;
	min-height: max(
		clamp(6.75rem, 17vw, 8rem),
		calc(
			var(--evcal-bars-top) + var(--evcal-lanes) * var(--evcal-lane-row) +
				max(0, var(--evcal-lanes) - 1) * var(--evcal-cell-gap) + 0.5rem
		)
	);
	border-radius: 12px;
	border: 1px solid rgba(8, 8, 81, 0.08);
	background: rgba(255, 255, 255, 0.92);
	padding: 0.45rem 0.5rem 0.5rem;
}

.evcal-day--muted {
    border: 1px dashed #0000001c;
    background: rgb(255 255 255 / 0%);
    opacity: 1;
}

.evcal-day__num {
	position: relative;
	z-index: 2;
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--la-blue-dark, #03033e);
}

.evcal-day--muted .evcal-day__num {
	color: transparent;
}

.evcal-bar {
	flex: 1;
	display: flex;
	align-items: center;
	min-height: 28px;
	min-width: 0;
	padding: 0 1rem;
	margin: 0;
	border-radius: 50px;
	text-decoration: none;
	background: rgba(100, 80, 160, 0.14);
	color: var(--la-blue-dark, #03033e);
	font-size: 0.72rem;
	font-weight: 600;
	line-height: 1.25;
	overflow: hidden;
	transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.evcal-bar--flat-l {
	border-top-left-radius: 3px;
	border-bottom-left-radius: 3px;
}

.evcal-bar--flat-r {
	border-top-right-radius: 3px;
	border-bottom-right-radius: 3px;
}

.evcal-bar:hover,
.evcal-bar--hl {
	background: rgba(150, 108, 15, 0.28);
	color: var(--la-blue-dark, #03033e);
	box-shadow: 0 0 0 1px rgba(150, 108, 15, 0.35);
}

.evcal-bar__text {
	display: block;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.evcal__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
}

.evcal__list-link {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	padding: 1rem 1.1rem;
	border-radius: 14px;
	border: 1px solid rgba(8, 8, 81, 0.1);
	background: var(--la-white, #fff);
	text-decoration: none;
	color: inherit;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.evcal__list-link:hover {
	border-color: rgba(150, 108, 15, 0.45);
	box-shadow: 0 6px 22px rgba(8, 8, 81, 0.06);
}

.evcal__list-name {
	font-weight: 700;
	font-size: 1rem;
	color: var(--la-blue-dark, #03033e);
}

.evcal__list-dates {
	font-size: 0.9rem;
	color: var(--la-blue-80, #393974);
}

.evcal__list-location {
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--la-blue, #080851);
}

.evcal__tooltip {
	position: fixed;
	z-index: 10050;
	max-width: min(22rem, calc(100vw - 2rem));
	padding: 0.85rem 1rem;
	border-radius: 12px;
	background: var(--la-white, #fff);
	border: 1px solid rgba(8, 8, 81, 0.12);
	box-shadow: 0 12px 40px rgba(8, 8, 81, 0.12);
	pointer-events: none;
}

.evcal__tooltip[hidden] {
	display: none !important;
}

.evcal__tooltip-title {
	margin: 0 0 0.35rem;
	font-weight: 700;
	font-size: 0.95rem;
	color: var(--la-blue-dark, #03033e);
}

.evcal__tooltip-dates,
.evcal__tooltip-location,
.evcal__tooltip-summary {
	margin: 0 0 0.25rem;
	font-size: 0.82rem;
	color: var(--la-blue-80, #393974);
	line-height: 1.45;
}

.evcal__tooltip-summary:last-child {
	margin-bottom: 0;
}

@media (max-width: 767.98px) {
	.evcal__toolbar {
		flex-direction: column;
		align-items: stretch;
	}

	.evcal__view-toggle {
		display: grid;
		width: 100%;
		max-width: 22rem;
		margin: 0 auto;
	}

	.evcal__view-btn {
		min-width: 0;
		padding: 0.65rem 0.75rem;
	}

	.evcal__period {
		justify-content: center;
	}

	.evcal__years {
		justify-content: center;
	}
}
