.thm-events,
.thm-event-single {
	--thm-gold: #b2936d;
	--thm-ink: #262626;
	--thm-white: #fff;
	color: var(--thm-text, var(--thm-ink));
	overflow-wrap: anywhere;
}

.thm-events {
	display: grid;
	gap: var(--thm-gap, 1.25rem);
	container-type: inline-size;
}

.thm-events-grid {
	grid-template-columns: repeat(var(--thm-columns, 2), minmax(0, 1fr));
}

@media (max-width: 767px) {
	.thm-events-grid {
		grid-template-columns: repeat(var(--thm-columns, 1), minmax(0, 1fr));
	}
}

.thm-events .thm-event-card {
	display: grid;
	align-content: start;
	grid-template-rows: auto 1fr;
	position: relative;
	min-width: 0;
	background: var(--thm-card, var(--thm-white));
	border: 1px solid var(--thm-border, var(--thm-gold));
	border-radius: 0;
}

.thm-events .thm-event-card:is(:hover, :focus-within) {
	border-color: var(--thm-hover-border, var(--thm-ink));
}

.thm-events .thm-event-card:not(.thm-event-has-image) {
	grid-template-rows: 1fr;
}

.thm-events .thm-event-media {
	overflow: hidden;
	background: var(--thm-image-bg, var(--thm-ink));
}

.thm-events .thm-event-media .thm-event-image {
	display: block;
	width: 100%;
	height: var(--thm-image-height, clamp(9rem, 26vw, 14rem));
	object-fit: var(--thm-fit, cover);
	border-radius: 0;
}

@container (min-width: 38rem) {
	.thm-events-list .thm-event-has-image {
		grid-template-columns: minmax(10rem, 24%) minmax(0, 1fr);
		grid-template-rows: auto;
	}

	.thm-events-list .thm-event-media {
		position: relative;
		min-height: var(--thm-image-height, 12rem);
	}

	.thm-events-list .thm-event-media .thm-event-image {
		position: absolute;
		height: 100%;
	}
}

@media (prefers-reduced-motion: no-preference) {
	.thm-events .thm-event-image {
		transition: transform .2s ease;
	}

	.thm-events .thm-event-card:hover .thm-event-image {
		transform: scale(var(--thm-zoom, 1));
	}
}

.thm-events .thm-event-main {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: .8rem;
	padding: clamp(.9rem, 2vw, 1.5rem);
}

.thm-events .thm-event-date {
	position: absolute;
	z-index: 1;
	inset-block-start: .65rem;
	inset-inline-end: .65rem;
	max-inline-size: calc(100% - 1.3rem);
	padding: .42rem .6rem;
	border: 1px solid var(--thm-gold);
	background: var(--thm-date-bg, #795c38);
	color: var(--thm-badge-text, var(--thm-white));
	font-size: .875rem;
	font-weight: 700;
	line-height: 1.25;
	text-align: center;
}

.thm-events-grid .thm-event-card:not(.thm-event-has-image) .thm-event-date {
	position: static;
	justify-self: end;
	margin: .65rem .65rem 0;
}

.thm-events-grid .thm-event-card:not(.thm-event-has-image) {
	grid-template-rows: auto 1fr;
}

.thm-events .thm-event-title {
	margin: 0;
	color: var(--thm-title, var(--thm-ink));
	font-size: clamp(1.2rem, 2.5vw, 1.7rem);
	font-weight: 650;
	line-height: 1.2;
}

.thm-events :is(.thm-event-meta, .thm-event-copy),
.thm-event-single .thm-event-type {
	margin: 0;
	line-height: 1.55;
}

.thm-events .thm-event-meta {
	display: flex;
	flex-wrap: wrap;
	gap: .25em 1.15em;
	font-size: .94em;
}

.thm-events .thm-event-type,
.thm-event-single .thm-event-type {
	margin: 0 0 .25rem;
	font-weight: 600;
	font-size: .8em;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.thm-events .thm-event-status,
.thm-event-single .thm-event-status {
	display: inline-block;
	margin: 0;
	padding: .25rem .55rem;
	background: var(--thm-status, var(--thm-ink));
	color: var(--thm-status-text, var(--thm-white));
	font-weight: 600;
	font-size: .875em;
}

.thm-events .thm-event-button,
.thm-event-single .thm-event-button {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: .5rem .85rem;
	margin-top: auto;
	background: var(--thm-button, var(--thm-gold));
	color: var(--thm-button-text, var(--thm-ink));
	border: 1px solid transparent;
	border-radius: 0;
	font: inherit;
	font-weight: 600;
	text-decoration: none;
}

.thm-events .thm-event-button:is(:hover, :focus-visible),
.thm-event-single .thm-event-button:is(:hover, :focus-visible) {
	background: var(--thm-button-hover, var(--thm-ink));
	color: var(--thm-button-hover-text, var(--thm-white));
}

.thm-events a:focus-visible,
.thm-event-single :is(a, input, textarea, button):focus-visible {
	outline: 2px solid var(--thm-ink);
	outline-offset: 3px;
}

.thm-event-single {
	box-sizing: border-box;
	width: min(100%, 76rem);
	margin-inline: auto;
	padding: clamp(2rem, 6vw, 4rem) 1rem;
}

.thm-event-single h1 {
	max-width: 24ch;
	margin: 0 0 clamp(1.4rem, 4vw, 2.5rem);
	color: var(--thm-ink);
	font-size: clamp(2rem, 5vw, 3.45rem);
	line-height: 1.12;
}

.thm-event-single .thm-event-detail-layout {
	display: grid;
	align-items: start;
	grid-template-columns: minmax(0, 1fr) minmax(15rem, 29%);
	grid-template-areas: "article sidebar";
	gap: clamp(1rem, 4vw, 3rem);
}

.thm-event-single .thm-event-detail-main { grid-area: article; min-width: 0; }
.thm-event-single .thm-event-description { line-height: 1.7; }
.thm-event-single .thm-event-sidebar {
	grid-area: sidebar;
	border-top: 4px solid var(--thm-gold);
	background: var(--thm-ink);
	color: var(--thm-white);
}

.thm-event-single .thm-event-sidebar section { padding: clamp(1rem, 3vw, 1.65rem); }
.thm-event-single .thm-event-sidebar section + section { border-top: 1px solid rgb(255 255 255 / 24%); }
.thm-event-single .thm-event-sidebar h2 { margin: 0 0 .85rem; color: inherit; font-size: 1.35rem; }
.thm-event-single .thm-event-sidebar dl { margin: 0; }
.thm-event-single .thm-event-sidebar dt { margin-top: .85rem; color: var(--thm-gold); font-weight: 700; }
.thm-event-single .thm-event-sidebar dd { margin: 0; }
.thm-event-single .thm-event-sidebar p { margin: 0 0 .7rem; }
.thm-event-single .thm-event-sidebar a:not(.thm-event-button) { color: var(--thm-gold); text-decoration: underline; }
.thm-event-single .thm-event-sidebar a:focus-visible { outline-color: var(--thm-white); }
.thm-event-single .thm-event-sidebar .thm-event-button { margin-top: 1rem; }

@media (max-width: 767px) {
	.thm-event-single .thm-event-detail-layout {
		grid-template-columns: minmax(0, 1fr);
		grid-template-areas: "sidebar" "article";
	}
}

.thm-event-single .thm-event-single-image {
	display: block;
	max-height: min(32rem, 70vh);
	max-width: 100%;
	width: auto;
	object-fit: contain;
	margin: 0 0 1.5rem;
	border-radius: 0;
}

.thm-event-single .thm-event-signup {
	margin-top: 2rem;
	padding: clamp(1rem, 4vw, 2rem);
	border: 1px solid var(--thm-gold);
	background: var(--thm-white);
	scroll-margin-top: 6rem;
}

.thm-event-single .thm-event-fields {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1rem;
}

.thm-event-single .thm-event-fields label { font-weight: 600; }
.thm-event-single .thm-event-note { grid-column: 1 / -1; }

.thm-event-single .thm-event-fields :is(input, textarea) {
	display: block;
	width: 100%;
	min-height: 44px;
	margin-top: .3rem;
	border: 1px solid var(--thm-gold);
	border-radius: 0;
	font-size: max(1rem, 16px);
}

@media (max-width: 38rem) {
	.thm-event-single .thm-event-fields { grid-template-columns: 1fr; }
}
