/* Listings, fields and filter buttons drawn by the theme (inc/render/), in the layout JetEngine gave them. */

/* ---- grid: N columns per device, gaps from the block's settings ---- */
.jet-listing-grid--blocks {
	--df-gap-x: 20px;
	--df-gap-y: 20px;
}

.jet-listing-grid__items {
	--columns: 3;
	display: flex;
	flex-wrap: wrap;
	margin: 0 calc(var(--df-gap-x) / -2);
	width: calc(100% + var(--df-gap-x));
}

.jet-listing-grid__item {
	box-sizing: border-box;
	padding: calc(var(--df-gap-y) / 2) calc(var(--df-gap-x) / 2);
	flex: 0 0 calc(100% / var(--columns));
	max-width: calc(100% / var(--columns));
}

.grid-col-desk-1 { --columns: 1; }
.grid-col-desk-2 { --columns: 2; }
.grid-col-desk-3 { --columns: 3; }
.grid-col-desk-4 { --columns: 4; }
.grid-col-desk-5 { --columns: 5; }
.grid-col-desk-6 { --columns: 6; }

@media (max-width: 1024px) {
	.grid-col-tablet-1 { --columns: 1; }
	.grid-col-tablet-2 { --columns: 2; }
	.grid-col-tablet-3 { --columns: 3; }
	.grid-col-tablet-4 { --columns: 4; }
	.grid-col-tablet-6 { --columns: 6; }
}

@media (max-width: 767px) {
	.grid-col-mobile-1 { --columns: 1; }
	.grid-col-mobile-2 { --columns: 2; }
	.grid-col-mobile-3 { --columns: 3; }
}

.jet-equal-columns > * {
	height: 100%;
}

.jet-listing-not-found {
	display: block;
	margin: 0;
	width: auto;
}

/* ---- fields and images ---- */
.jet-listing-dynamic-field__content {
	display: block;
	max-width: 100%;
}

.jet-listing-dynamic-image {
	display: flex;
	align-items: flex-start;
}

.jet-listing-dynamic-image > * {
	max-width: 100%;
	flex: 0 0 auto;
}

.jet-listing-dynamic-image img {
	display: block;
}

/* ---- sideways-scrolling row (sponsor logos on phones) ---- */
.jet-listing-grid__scroll-slider {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.jet-listing-grid__scroll-slider > .jet-listing-grid__items {
	flex-wrap: nowrap;
}

/* ---- carousel (sponsor logos): a row that scrolls a set of logos at a time, with dots ---- */
.df-carousel .jet-listing-grid__items {
	flex-wrap: nowrap;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
}

.df-carousel .jet-listing-grid__items::-webkit-scrollbar {
	display: none;
}

.df-carousel .jet-listing-grid__item {
	scroll-snap-align: start;
}

.df-carousel__dots {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 12px;
}

.df-carousel__dots:empty {
	display: none;
}

.df-carousel__dots button {
	width: 10px;
	height: 10px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--df-dot, #ccc);
	cursor: pointer;
}

.df-carousel__dots button:hover {
	background: var(--df-dot-hover, #999);
}

.df-carousel__dots button[aria-current="true"] {
	background: var(--df-dot-active, #333);
}

@media (prefers-reduced-motion: reduce) {
	.df-carousel .jet-listing-grid__items {
		scroll-behavior: auto;
	}
}

/* ---- filter buttons (stage, year) ---- */
.df-filter {
	scroll-margin-top: 120px; /* clear the sticky header when a filter link jumps back here */
}

.df-filter .jet-radio-list-wrapper {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.df-filter .jet-radio-list__row {
	flex: 1 1 0;
	margin: 0;
}

/* Phones: two buttons a row rather than squashed names. */
@media (max-width: 767px) {
	.df-filter .jet-radio-list__row {
		flex-basis: calc(50% - 5px);
	}
}

.df-filter .jet-radio-list__button {
	display: block;
	padding: 4px 20px;
	border: 1px solid var(--wp--preset--color--borderline, #e0e0e0);
	border-radius: 8px;
	background: #fff;
	color: var(--wp--preset--color--contrast, inherit);
	font-size: 14px;
	font-weight: 700;
	text-align: center;
	text-decoration: none;
	line-height: 1.5;
}

.df-filter .jet-radio-list__button:hover {
	border-color: #28A7DC;
}

.df-filter .jet-radio-list__button.is-active {
	color: #fff;
	background: #28A7DC;
	border-color: #28A7DC;
}

/* While a filter fetches its results (assets/js/filters.js). */
[data-df-listing][aria-busy="true"] {
	opacity: .5;
	transition: opacity .15s .1s; /* only noticeable if it's slow */
}

.df-filter__status {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}
