/* =====================================================================
   The Nest Events — grid on desktop, carousel on mobile
   Palette: Copper #946F49 / Charcoal #20201E / Dark Brown #774D35
   Fonts:   Bebas Neue (headings, badge, button) + Montserrat (body)
   All colours/sizes come through custom properties so the Elementor
   style controls can override them per widget.
   ================================================================== */

.tne-events {
	--tne-cols: 3;
	--tne-gap: 40px;
	--tne-ratio: 1.5;
	--tne-radius: 0px;
	--tne-slide-w: 86%;

	--tne-badge-w: 68px;
	--tne-badge-offset: 0px;
	--tne-badge-month-bg: #946f49;
	--tne-badge-month-color: #ffffff;
	--tne-badge-day-bg: #ffffff;
	--tne-badge-day-color: #20201e;

	--tne-ribbon-bg: #20201e;
	--tne-ribbon-color: #ffffff;
	--tne-dot: #946f49;

	--tne-head-font: 'Bebas Neue', 'Oswald', 'Arial Narrow', sans-serif;
	--tne-body-font: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;

	position: relative;
}

/* ------------------------------- Grid ------------------------------ */

.tne-events__track {
	display: grid;
	grid-template-columns: repeat(var(--tne-cols), minmax(0, 1fr));
	gap: var(--tne-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

/* ------------------------------- Card ------------------------------ */

.tne-event {
	display: flex;
	flex-direction: column;
	min-width: 0;
	border-radius: var(--tne-radius);
	margin: 0;
}

.tne-event__media {
	position: relative;
	overflow: hidden;
	border-radius: var(--tne-radius) var(--tne-radius) 0 0;
	background: #ece9e3;
}

.tne-event__media-link {
	display: block;
	line-height: 0;
}

.tne-event__media img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: var(--tne-ratio);
	object-fit: cover;
	object-position: center;
	transition: transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.tne-events--zoom .tne-event:hover .tne-event__media img,
.tne-events--zoom .tne-event:focus-within .tne-event__media img {
	transform: scale(1.06);
}

/* --------------------------- Date badge ---------------------------- */

.tne-event__badge {
	position: absolute;
	z-index: 2;
	display: flex;
	flex-direction: column;
	width: var(--tne-badge-w);
	overflow: hidden;
	text-align: center;
	box-shadow: 0 2px 12px rgba(32, 32, 30, 0.22);
	pointer-events: none;
}

.tne-events--badge-bottom-left .tne-event__badge {
	left: var(--tne-badge-offset);
	bottom: var(--tne-badge-offset);
}

.tne-events--badge-bottom-right .tne-event__badge {
	right: var(--tne-badge-offset);
	bottom: var(--tne-badge-offset);
}

.tne-events--badge-top-left .tne-event__badge {
	left: var(--tne-badge-offset);
	top: var(--tne-badge-offset);
}

.tne-events--badge-top-right .tne-event__badge {
	right: var(--tne-badge-offset);
	top: var(--tne-badge-offset);
}

.tne-event__badge-month {
	display: block;
	padding: 7px 4px 5px;
	background: var(--tne-badge-month-bg);
	color: var(--tne-badge-month-color);
	font-family: var(--tne-head-font);
	font-size: 15px;
	line-height: 1;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.tne-event__badge-day {
	display: block;
	padding: 9px 4px 8px;
	background: var(--tne-badge-day-bg);
	color: var(--tne-badge-day-color);
	font-family: var(--tne-head-font);
	font-size: 30px;
	line-height: 1;
	letter-spacing: 0.02em;
}

/* ----------------------------- Ribbon ------------------------------ */

.tne-event__ribbon {
	position: absolute;
	z-index: 2;
	top: 14px;
	right: 0;
	padding: 7px 16px 6px;
	background: var(--tne-ribbon-bg);
	color: var(--tne-ribbon-color);
	font-family: var(--tne-head-font);
	font-size: 14px;
	line-height: 1;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	pointer-events: none;
}

/* ------------------------------ Body ------------------------------- */

.tne-event__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	padding-top: 18px;
}

.tne-events .tne-event__title {
	margin: 0 0 8px;
	font-family: var(--tne-head-font);
	font-size: 27px;
	font-weight: 400;
	line-height: 1.15;
	letter-spacing: 0.02em;
	color: #20201e;
}

/* Themes commonly set `a, a:link, a:visited { color: … }`, which outranks a
   single class. These rules are deliberately one step more specific so the
   plugin looks right before Elementor's generated CSS is layered on top. */
.tne-events .tne-event__title a,
.tne-events .tne-event__title a:link,
.tne-events .tne-event__title a:visited {
	color: inherit;
	text-decoration: none;
	transition: color 0.25s ease;
}

.tne-events .tne-event__title a:hover,
.tne-events .tne-event__title a:focus {
	color: #946f49;
	text-decoration: none;
}

.tne-event__when {
	margin: 0 0 10px;
	font-family: var(--tne-body-font);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.5;
	color: #20201e;
}

.tne-event__time::before {
	content: ' · ';
}

.tne-event__desc {
	font-family: var(--tne-body-font);
	font-size: 15px;
	line-height: 1.7;
	color: #4a4a46;
}

.tne-event__desc p {
	margin: 0 0 10px;
}

.tne-event__desc p:last-child {
	margin-bottom: 0;
}

.tne-event__cat {
	margin: 12px 0 0;
	font-family: var(--tne-body-font);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: #946f49;
}

/* ------------------------------ Button ----------------------------- */

/* Pushed to the bottom so buttons line up across a row of uneven cards.
   A block wrapper (rather than align-self) lets the Alignment control's
   text-align position the button too. */
.tne-event__actions {
	margin-top: auto;
	padding-top: 18px;
}

.tne-events a.tne-event__btn,
.tne-events a.tne-event__btn:link,
.tne-events a.tne-event__btn:visited {
	display: inline-block;
	padding: 12px 26px 11px;
	border: 1px solid #946f49;
	background: #946f49;
	color: #fff;
	font-family: var(--tne-head-font);
	font-size: 17px;
	line-height: 1;
	letter-spacing: 3px;
	text-transform: uppercase;
	text-decoration: none;
	transition: background-color 0.28s ease, color 0.28s ease, border-color 0.28s ease;
}

.tne-events a.tne-event__btn:hover,
.tne-events a.tne-event__btn:focus {
	background: #774d35;
	border-color: #774d35;
	color: #fff;
	text-decoration: none;
}

.tne-event__btn-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* ------------------------------ Empty ------------------------------ */

.tne-events__empty {
	margin: 0;
	font-family: var(--tne-body-font);
	font-size: 15px;
	color: #4a4a46;
}

/* ---------------------- Carousel navigation ------------------------ */

/* Hidden until the carousel breakpoint kicks in. */
.tne-events__nav {
	display: none;
	align-items: center;
	justify-content: center;
	gap: 14px;
	margin-top: 18px;
}

.tne-events__dots {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
}

.tne-events__dot {
	width: 9px;
	height: 9px;
	padding: 0;
	border: 1px solid var(--tne-dot);
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
	transition: background-color 0.25s ease, transform 0.25s ease;
	-webkit-appearance: none;
	appearance: none;
}

.tne-events__dot.is-active {
	background: var(--tne-dot);
	transform: scale(1.25);
}

.tne-events__arrow {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 1px solid var(--tne-dot);
	border-radius: 50%;
	background: transparent;
	color: var(--tne-dot);
	cursor: pointer;
	transition: background-color 0.25s ease, color 0.25s ease;
	-webkit-appearance: none;
	appearance: none;
}

.tne-events__arrow:hover:not(:disabled) {
	background: var(--tne-dot);
	color: #fff;
}

.tne-events__arrow:disabled {
	opacity: 0.35;
	cursor: default;
}

.tne-events__arrow svg {
	width: 14px;
	height: 14px;
	fill: currentColor;
}

/* =====================================================================
   Carousel mode
   The rules are duplicated per breakpoint on purpose: the breakpoint is
   a per-widget setting, so it is selected with a data attribute rather
   than by generating a media query per instance.
   ================================================================== */

@media (max-width: 767px) {

	.tne-events[data-carousel='yes'][data-bp='767'] .tne-events__track {
		display: flex;
		flex-wrap: nowrap;
		gap: min(var(--tne-gap), 20px);
		padding-inline: calc((100% - var(--tne-slide-w)) / 2);
		overflow-x: auto;
		overscroll-behavior-x: contain;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		-ms-overflow-style: none;
	}

	.tne-events[data-carousel='yes'][data-bp='767'] .tne-events__track::-webkit-scrollbar {
		display: none;
	}

	.tne-events[data-carousel='yes'][data-bp='767'] .tne-events__track > .tne-event {
		/* The track's side padding already shrinks the content box to
		   --tne-slide-w, so the card takes 100% of what is left. Using the
		   variable here as well would apply the percentage twice. */
		flex: 0 0 100%;
		width: 100%;
		max-width: 100%;
		scroll-snap-align: center;
		scroll-snap-stop: always;
	}

	.tne-events[data-carousel='yes'][data-bp='767'] .tne-events__nav.is-ready {
		display: flex;
	}
}

@media (max-width: 1024px) {

	.tne-events[data-carousel='yes'][data-bp='1024'] .tne-events__track {
		display: flex;
		flex-wrap: nowrap;
		gap: min(var(--tne-gap), 20px);
		padding-inline: calc((100% - var(--tne-slide-w)) / 2);
		overflow-x: auto;
		overscroll-behavior-x: contain;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		-ms-overflow-style: none;
	}

	.tne-events[data-carousel='yes'][data-bp='1024'] .tne-events__track::-webkit-scrollbar {
		display: none;
	}

	.tne-events[data-carousel='yes'][data-bp='1024'] .tne-events__track > .tne-event {
		/* The track's side padding already shrinks the content box to
		   --tne-slide-w, so the card takes 100% of what is left. Using the
		   variable here as well would apply the percentage twice. */
		flex: 0 0 100%;
		width: 100%;
		max-width: 100%;
		scroll-snap-align: center;
		scroll-snap-stop: always;
	}

	.tne-events[data-carousel='yes'][data-bp='1024'] .tne-events__nav.is-ready {
		display: flex;
	}
}

/* Type scales down a touch on phones. */
@media (max-width: 767px) {

	.tne-events .tne-event__title {
		font-size: 24px;
	}

	.tne-event__badge-day {
		font-size: 27px;
	}
}

@media (prefers-reduced-motion: reduce) {

	.tne-event__media img,
	.tne-event__btn,
	.tne-events__dot,
	.tne-events__arrow {
		transition: none;
	}

	.tne-events--zoom .tne-event:hover .tne-event__media img {
		transform: none;
	}
}
