/**
 * The Events Calendar — remap TEC v2 tokens onto Music for the Many.
 * TEC loads after the theme stylesheet; this file is enqueued after TEC.
 */

body.tribe-events-page-template,
body.events-archive,
body.single-tribe_events,
.tribe-events,
.tribe-common {
	--tec-color-background: var(--wp--preset--color--paper, #fffbed);
	--tec-color-background-events: var(--wp--preset--color--paper, #fffbed);
	--tec-color-background-secondary: var(--wp--preset--color--paper, #fffbed);
	--tec-color-background-messages: var(--wp--preset--color--yellow, #edc032);
	--tec-color-background-events-bar: var(--wp--preset--color--paper, #fffbed);
	--tec-color-background-view-selector: var(--wp--preset--color--paper, #fffbed);
	--tec-color-background-view-selector-tabs: var(--wp--preset--color--paper, #fffbed);
	--tec-color-icon-events-bar: var(--wp--preset--color--ink, #130e0f);
	--tec-color-icon-events-bar-active: var(--wp--preset--color--red, #a53032);
	--tec-color-icon-events-bar-hover: var(--wp--preset--color--red, #a53032);
	--tec-color-text-primary: var(--wp--preset--color--ink, #130e0f);
	--tec-color-text-primary-light: var(--wp--preset--color--ink-muted, #5c3a3c);
	--tec-color-text-secondary: var(--wp--preset--color--ink-muted, #5c3a3c);
	--tec-color-accent-primary: var(--wp--preset--color--red, #a53032);
	--tec-color-accent-primary-hover: var(--wp--preset--color--red-deep, #7f2224);
	--tec-color-accent-primary-active: var(--wp--preset--color--red-deep, #7f2224);
	--tec-color-accent-primary-background: rgb(165 48 50 / 0.08);
	--tec-color-accent-secondary: var(--wp--preset--color--ink, #130e0f);
	--tec-color-link-primary: var(--wp--preset--color--red, #a53032);
	--tec-color-link-accent: var(--wp--preset--color--red, #a53032);
	--tec-color-link-accent-hover: var(--wp--preset--color--red-deep, #7f2224);
	--tec-color-button-primary: var(--wp--preset--color--ink, #130e0f);
	--tec-color-button-primary-hover: var(--wp--preset--color--red, #a53032);
	--tec-color-button-primary-active: var(--wp--preset--color--red-deep, #7f2224);
	--tec-color-background-events-bar-submit-button: var(--wp--preset--color--ink, #130e0f);
	--tec-color-background-events-bar-submit-button-hover: var(--wp--preset--color--red, #a53032);
	--tec-color-day-marker-current-month: var(--wp--preset--color--red, #a53032);
	--tec-color-icon-primary: var(--wp--preset--color--ink, #130e0f);
	--tec-color-icon-active: var(--wp--preset--color--red, #a53032);
	--tec-color-icon-focus: var(--wp--preset--color--red, #a53032);
	--tec-color-event-icon: var(--wp--preset--color--ink, #130e0f);
	--tec-color-event-icon-hover: var(--wp--preset--color--red, #a53032);
	--tec-color-border-default: var(--wp--preset--color--ink, #130e0f);
	--tec-color-border-secondary: var(--wp--preset--color--ink, #130e0f);
	--tec-color-border-hover: var(--wp--preset--color--red, #a53032);
	--tec-color-border-active: var(--wp--preset--color--red, #a53032);
	--tec-border-radius-default: 0;
	--tec-font-family-sans-serif: var(--wp--preset--font-family--body, "Nunito", system-ui, sans-serif);
	--tec-font-weight-bold: 600;
	--tec-grid-width-default: var(--m4tm-wide, 72rem);
	--tec-box-shadow-default: none;
	--tec-box-shadow-card: none;
}

/* One gutter everywhere: the same wide width and side padding as the
   header’s alignwide group, so the calendar lines up with the logo. */
.tribe-events .tribe-events-l-container,
.tribe-events .tribe-common-l-container,
#tribe-events-pg-template,
.tribe-events-pg-template {
	box-sizing: border-box;
	width: 100%;
	max-width: var(--m4tm-wide, 72rem) !important;
	margin-inline: auto !important;
	padding-inline: var(--wp--preset--spacing--50, 2rem) !important;
	overflow: visible;
	background: transparent;
}

.tribe-events .tribe-events-l-container {
	padding-block: 0 !important;
}

/* The title strip and intro are printed inside that container, which
   already carries the gutter, so they add none of their own. */
.tribe-common .m4tm-page-title__inner,
.tribe-common .m4tm-whats-on-lead > .wp-block-group {
	max-width: none !important;
	margin-inline: 0 !important;
	padding-inline: 0 !important;
}

/* The closing CTA band is printed inside it too: break out to full bleed. */
.tribe-common .m4tm-band.alignfull {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw) !important;
	margin-right: calc(50% - 50vw) !important;
}

.tribe-common .m4tm-band.alignfull > .alignwide {
	max-width: var(--m4tm-wide, 72rem) !important;
	margin-inline: auto !important;
	padding-inline: var(--wp--preset--spacing--50, 2rem) !important;
}

/* Day view: featured images cropped like the list cards */
.tribe-events .tribe-events-calendar-day__event-featured-image-wrapper {
	margin: 0 0 var(--tec-spacer-3, 1rem);
	overflow: hidden;
	background: var(--wp--preset--color--ink, #130e0f);
}

.tribe-events .tribe-events-calendar-day__event-featured-image {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border: 0;
	border-radius: 0;
}

.tribe-events-single {
	max-width: var(--m4tm-wide, 72rem);
	margin-inline: auto;
	padding-inline: var(--m4tm-gutter, 2rem);
	background: transparent;
}

/* TEC’s own Events h1 — we inject the theme title strip instead */
.tribe-events-header__title,
.tribe-events-page-title,
#tribe-events-header .tribe-events-page-title {
	display: none;
}

.tribe-common .tribe-common-c-btn,
.tribe-common button.tribe-common-c-btn,
.tribe-events .tribe-events-c-search__button,
.tribe-events .tribe-events-c-top-bar__nav-link,
.tribe-events .tribe-events-c-top-bar__today-button,
.tribe-events .tribe-events-c-top-bar__datepicker-button {
	border-radius: 0 !important;
	border: 0 !important;
	background: transparent !important;
	color: var(--wp--preset--color--ink, #130e0f) !important;
	box-shadow: none !important;
	font-family: var(--wp--preset--font-family--ui, "Plus Jakarta Sans", system-ui, sans-serif) !important;
	font-weight: 600 !important;
	text-transform: lowercase;
	letter-spacing: 0;
}

.tribe-events .tribe-events-c-search__button,
.tribe-common .tribe-common-c-btn--search,
.tribe-events .tribe-events-c-events-bar .tribe-events-c-search__button {
	background: var(--wp--preset--color--red, #a53032) !important;
	color: var(--wp--preset--color--paper, #fffbed) !important;
	padding: 0.65rem 1.1rem !important;
}

.tribe-common .tribe-common-c-btn:hover,
.tribe-events .tribe-events-c-search__button:hover,
.tribe-events .tribe-events-c-top-bar__nav-link:hover,
.tribe-events .tribe-events-c-top-bar__today-button:hover {
	transform: none;
	box-shadow: none !important;
	background: var(--wp--preset--color--red-deep, #7f2224) !important;
	color: var(--wp--preset--color--paper, #fffbed) !important;
}

.tribe-events .tribe-events-c-top-bar__nav-link:hover,
.tribe-events .tribe-events-c-top-bar__today-button:hover {
	background: transparent !important;
	color: var(--wp--preset--color--red, #a53032) !important;
	text-decoration: underline;
}

.tribe-events .tribe-events-c-search__input,
.tribe-common input[type="text"],
.tribe-common input[type="search"] {
	border-radius: 0 !important;
	border: 1px solid var(--wp--preset--color--ink-muted, #5c3a3c) !important;
	background: var(--wp--preset--color--paper, #fffbed) !important;
	color: var(--wp--preset--color--ink, #130e0f);
	box-shadow: none !important;
	font-family: var(--wp--preset--font-family--body, "Nunito", system-ui, sans-serif);
}

.tribe-events .tribe-events-c-events-bar {
	border: 0 !important;
	background: var(--wp--preset--color--paper, #fffbed) !important;
	padding-inline: 0;
}

.tribe-events-c-view-selector__list-item-link,
.tribe-events-c-view-selector__button {
	font-family: var(--wp--preset--font-family--ui, "Plus Jakarta Sans", system-ui, sans-serif) !important;
	font-weight: 600;
	color: var(--wp--preset--color--ink, #130e0f) !important;
	border-radius: 0 !important;
	border-bottom: 3px solid transparent;
}

.tribe-events-c-view-selector__list-item--active .tribe-events-c-view-selector__list-item-link,
.tribe-events-c-view-selector__list-item-link:hover {
	color: var(--wp--preset--color--red, #a53032) !important;
	border-bottom-color: var(--wp--preset--color--red, #a53032);
}

.tribe-events-header__messages,
.tribe-events-c-messages__message,
.tribe-events-notices {
	border-radius: 0 !important;
	border: 0 !important;
	background: var(--wp--preset--color--yellow, #edc032) !important;
	color: var(--wp--preset--color--ink, #130e0f) !important;
	box-shadow: none !important;
	font-family: var(--wp--preset--font-family--ui, "Plus Jakarta Sans", system-ui, sans-serif);
}

.tribe-events-calendar-list__month-separator-text,
.tribe-events-calendar-list__event-date-tag-datetime,
.tribe-events-calendar-list__event-date-tag-month,
.tribe-events-calendar-list__event-date-tag-daynum,
.tribe-events-calendar-list__event-date-tag-year {
	color: var(--wp--preset--color--red, #a53032) !important;
	font-family: var(--wp--preset--font-family--ui, "Plus Jakarta Sans", system-ui, sans-serif) !important;
	font-weight: 600 !important;
	text-transform: lowercase;
}

.tribe-events-calendar-list__event-date-tag,
.tribe-events-calendar-latest-past__event-date-tag,
.tribe-events .tribe-events-calendar-list__event-date-tag.tribe-common-g-col,
.tribe-events .tribe-events-calendar-latest-past__event-date-tag.tribe-common-g-col,
.tribe-common--breakpoint-medium.tribe-events .tribe-events-calendar-list__event-date-tag,
.tribe-common--breakpoint-medium.tribe-events .tribe-events-calendar-latest-past__event-date-tag {
	flex: 0 0 4.75rem !important;
	flex-grow: 0 !important;
	flex-shrink: 0 !important;
	flex-basis: 4.75rem !important;
	width: 4.75rem !important;
	min-width: 4.75rem !important;
	max-width: 4.75rem !important;
	height: 4.75rem !important;
	align-self: flex-start;
	box-sizing: border-box;
	background: var(--wp--preset--color--paper, #fffbed) !important;
	border: 3px solid var(--wp--preset--color--ink, #130e0f) !important;
	border-radius: 0;
	box-shadow: 4px 4px 0 var(--wp--preset--color--red, #a53032);
	padding: 0 !important;
}

.tribe-events-calendar-list__event-date-tag-datetime,
.tribe-events-calendar-latest-past__event-date-tag-datetime {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	flex: none !important;
	background: transparent !important;
	border: 0 !important;
	box-shadow: none;
	padding: 0.3rem 0.2rem;
	box-sizing: border-box;
}

.tribe-events-calendar-list__event-row,
.tribe-events-calendar-latest-past__event-row {
	align-items: flex-start;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	background: var(--wp--preset--color--paper, #fffbed);
	padding: 1.15rem 1.25rem;
	margin-block: 0 1.25rem;
}

.tribe-events-calendar-list__event-row:hover,
.tribe-events-calendar-latest-past__event-row:hover {
	transform: none;
	box-shadow: none;
}

.tribe-events-calendar-list__event-title,
.tribe-events-calendar-latest-past__event-title,
.tribe-events-single-event-title,
.tribe-events-calendar-list__event-title-link,
.tribe-events-calendar-latest-past__event-title-link {
	color: var(--wp--preset--color--red, #a53032) !important;
	font-family: var(--wp--preset--font-family--ui, "Plus Jakarta Sans", system-ui, sans-serif) !important;
	font-weight: 600 !important;
	letter-spacing: -0.02em;
	text-decoration: none !important;
	text-wrap: balance;
}

.tribe-events .tribe-events-header,
.tribe-events .tribe-events-c-events-bar,
.tribe-events .tribe-events-c-search,
.tribe-events .tribe-events-c-top-bar,
.tribe-events .tribe-events-c-top-bar__nav,
.tribe-events .tribe-events-c-view-selector,
.tribe-events .tribe-events-c-view-selector__button,
.tribe-events .tribe-events-c-view-selector__content,
.tribe-events-c-view-selector--tabs .tribe-events-c-view-selector__content,
.tribe-events-c-search__input-control,
.tribe-events-c-events-bar__search-container,
.tribe-events-c-events-bar__views,
.tribe-common-form-control-text,
.tribe-common-form-control-text__input {
	border: 0 !important;
	box-shadow: none !important;
	background: var(--wp--preset--color--paper, #fffbed) !important;
}

.tribe-events-c-view-selector__button-icon-svg path,
.tribe-events-c-view-selector__list-item-icon-svg path,
.tribe-events-c-view-selector .tribe-common-c-svgicon__svg-fill {
	fill: var(--wp--preset--color--ink, #130e0f) !important;
}

.tribe-events,
.tribe-events-view,
.tribe-events-view-wrapper,
.tribe-events-l-container {
	overflow: visible !important;
}

.tribe-events-calendar-list__event-featured-image-wrapper img,
.tribe-events-calendar-latest-past__event-featured-image-wrapper img,
.tribe-events-event-image img,
.tribe-events-single .tribe-events-event-image img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border: 0;
	border-radius: 0;
}

.tribe-events-calendar-month__day,
.tribe-events-calendar-month__header-column {
	border-color: var(--wp--preset--color--ink, #130e0f) !important;
	border-radius: 0;
}

.tribe-events-calendar-month__day--current .tribe-events-calendar-month__day-date {
	background: var(--wp--preset--color--yellow, #edc032);
	color: var(--wp--preset--color--ink, #130e0f);
	border-radius: 0;
}

.tribe-events-calendar-month__calendar-event-title-link {
	color: var(--wp--preset--color--red, #a53032) !important;
	font-family: var(--wp--preset--font-family--ui, "Plus Jakarta Sans", system-ui, sans-serif);
}

.tribe-events-single .tribe-events-schedule,
.tribe-events-event-meta {
	border: 0;
	border-radius: 0;
	box-shadow: none;
	background: var(--wp--preset--color--paper, #fffbed);
	padding: 1rem 0;
}

.tribe-events-single-event-title {
	font-size: clamp(2rem, 5vw, 3.25rem) !important;
	line-height: 0.95 !important;
	text-transform: lowercase;
}

@media (prefers-reduced-motion: reduce) {
	.tribe-events-calendar-list__event-row,
	.tribe-events-calendar-latest-past__event-row,
	.tribe-common .tribe-common-c-btn,
	.tribe-events .tribe-events-c-search__button {
		transition: none;
	}
}

/* ===== Featured event card above the calendar =====
   TEC's reset (.tribe-common article/p/h3 { border:0; margin:0; padding:0 })
   outranks style.css here, so the card box is restated. */

.tribe-common .m4tm-event-card {
	display: grid;
	border: 3px solid var(--wp--preset--color--ink, #130e0f);
	box-shadow: 6px 6px 0 var(--wp--preset--color--red, #a53032);
	margin: var(--wp--preset--spacing--50, 2rem) 0 var(--wp--preset--spacing--60, 3rem);
}

.tribe-common .m4tm-event-card__body {
	padding: 1.5rem 1.75rem 1.75rem;
}

.tribe-common .m4tm-event-card__eyebrow {
	margin: 0 0 0.85rem;
	padding: 0.3rem 0.6rem;
	border: 3px solid var(--wp--preset--color--ink, #130e0f);
}

.tribe-common .m4tm-event-card__title {
	margin: 0.25rem 0 0.5rem;
}

.tribe-common .m4tm-event-card__venue {
	margin: 0 0 0.75rem;
}

.tribe-common .m4tm-event-card__excerpt {
	margin: 0 0 1.25rem;
}

.tribe-common .m4tm-whats-on-intro p {
	margin: 0 0 1em;
}

/* TEC hangs list/day rows 24px out past the container at the medium breakpoint.
   Keep the date box on the same gutter as everything else. */
.tribe-common--breakpoint-medium.tribe-events .tribe-events-calendar-list__event-row,
.tribe-common--breakpoint-medium.tribe-events .tribe-events-calendar-latest-past__event-row,
.tribe-common--breakpoint-medium.tribe-events .tribe-events-calendar-day__event {
	margin-left: 0 !important;
	margin-right: 0 !important;
}
