/**
 * Jazz & Rib Fest block styles.
 *
 * Deliberately a plain stylesheet rather than a SCSS partial. The theme's
 * compiled bundle and its SCSS source have drifted apart, so anything added
 * to the SCSS today would be lost the next time the bundle is rebuilt.
 * Keeping these styles here means the festival blocks survive either way.
 * Follows the pattern already set by css/explore.css.
 *
 * The palette is declared locally rather than read from the theme's custom
 * properties, because those are defined in the SCSS source but never made it
 * into the deployed bundle.
 */

.jrf-grid__section,
.jrf-logos__section,
.jrf-schedule__section {
	--jrf-dark: #313056;
	--jrf-brand: #f16151;
	--jrf-ink: #232020;
	--jrf-white: #fff;
	--jrf-gap: 30px;
	--jrf-radius: 6px;
}

/* ---------------------------------------------------------------- headings */

.jrf-grid__heading {
	margin: 0 0 40px;
	text-align: center;
}

/* Sections that sit on the dark festival purple carry light text. */
.jrf-grid__section--sponsors .jrf-grid__heading,
.jrf-grid__section--vendors .jrf-grid__heading,
.jrf-grid__section--lineup .jrf-grid__heading {
	color: var(--jrf-white);
}

.jrf-grid__empty {
	text-align: center;
	opacity: 0.75;
}

.jrf-grid__section--sponsors .jrf-grid__empty,
.jrf-grid__section--vendors .jrf-grid__empty,
.jrf-grid__section--lineup .jrf-grid__empty {
	color: var(--jrf-white);
}

/* ------------------------------------------------------------------- grids */

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

@media screen and (min-width: 600px) {
	.jrf-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media screen and (min-width: 900px) {
	.jrf-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

.jrf-grid__item {
	display: flex;
	flex-direction: column;
	margin: 0;
}

.jrf-grid__item::before {
	content: none;
}

/* ------------------------------------------------------------------- cards */

.jrf-card {
	border-radius: var(--jrf-radius);
	overflow: hidden;
}

/*
 * Logo cards are a white tile with the logo centred and given breathing room,
 * so wordmarks and square marks of different proportions all sit consistently.
 * A fixed aspect ratio keeps every tile the same height regardless of the
 * logo inside it.
 */
.jrf-card--logo {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1 / 1;
	padding: 24px;
	background-color: var(--jrf-white);
}

.jrf-card--logo .jrf-card__image {
	width: auto;
	max-width: 100%;
	max-height: 100%;
	height: auto;
	object-fit: contain;
}

/* Vendor and artist cards are a photo filling the tile. */
.jrf-card--photo {
	aspect-ratio: 1 / 1;
	background-color: rgba(255, 255, 255, 0.08);
}

.jrf-card--photo .jrf-card__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.jrf-card__name {
	margin: 16px 0 0;
	font-weight: 700;
	line-height: 1.25;
	color: var(--jrf-white);
}

/* ---------------------------------------------------------- logo carousel */

.jrf-logos {
	position: relative;
	overflow: hidden;
}

.jrf-logos__track {
	display: flex;
	width: max-content;
	animation: jrf-logos-scroll linear infinite;
	animation-duration: 40s;
}

.jrf-logos--slow .jrf-logos__track {
	animation-duration: 60s;
}

.jrf-logos--fast .jrf-logos__track {
	animation-duration: 25s;
}

.jrf-logos:hover .jrf-logos__track,
.jrf-logos:focus-within .jrf-logos__track {
	animation-play-state: paused;
}

.jrf-logos__set {
	display: flex;
	align-items: center;
	gap: 60px;
	margin: 0;
	padding: 0 30px 0 0;
	list-style: none;
}

.jrf-logos__item {
	flex: 0 0 auto;
	margin: 0;
}

.jrf-logos__item::before {
	content: none;
}

.jrf-logos__image {
	display: block;
	width: auto;
	height: 70px;
	max-width: none;
	object-fit: contain;
}

.jrf-logos__link {
	display: block;
}

/*
 * The track holds two identical sets, so shifting it left by exactly half its
 * width lands the second set where the first began and the loop is seamless.
 */
@keyframes jrf-logos-scroll {
	from {
		transform: translateX(0);
	}
	to {
		transform: translateX(-50%);
	}
}

/*
 * Motion is decorative here, so anyone who has asked for reduced motion gets
 * a static, horizontally scrollable row instead.
 */
@media (prefers-reduced-motion: reduce) {
	.jrf-logos {
		overflow-x: auto;
	}

	.jrf-logos__track {
		animation: none;
	}

	.jrf-logos__set[aria-hidden="true"] {
		display: none;
	}
}

/* ------------------------------------------------------------------ lineup */

.jrf-lineup__controls {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 16px;
	margin: 0 0 30px;
}

.jrf-lineup__control select {
	min-width: 200px;
	padding: 10px 14px;
	border: 0;
	border-radius: 4px;
	background-color: var(--jrf-white);
	color: var(--jrf-ink);
	font: inherit;
	font-size: 1.5rem;
	line-height: 1.2;
}

.jrf-artist__stage {
	display: flex;
	align-items: flex-start;
	gap: 6px;
	margin: 6px 0 0;
	font-size: 1.4rem;
	line-height: 1.3;
	color: var(--jrf-white);
}

.jrf-artist__pin {
	flex: 0 0 auto;
	margin-top: 2px;
}

/* ---------------------------------------------------------------- schedule */

.jrf-schedule {
	/*
	 * One knob controls the whole timetable. Every block offset and height is
	 * this many pixels per minute, so tightening or loosening the day is a
	 * single value change.
	 */
	--jrf-min: 1.4px;
	--jrf-header-h: 84px;
	--jrf-rule: rgba(49, 48, 86, 0.15);
}

.jrf-schedule__tabs {
	display: flex;
	flex-wrap: wrap;
	border: 1px solid var(--jrf-rule);
	border-bottom: 0;
	border-radius: 6px 6px 0 0;
	overflow: hidden;
}

.jrf-schedule__tab {
	flex: 1 1 0;
	min-width: 140px;
	padding: 18px 12px;
	border: 0;
	border-right: 1px solid var(--jrf-rule);
	background: transparent;
	color: var(--jrf-ink);
	font: inherit;
	text-align: center;
	cursor: pointer;
}

.jrf-schedule__tab:last-child {
	border-right: 0;
}

.jrf-schedule__tab-date {
	display: block;
	font-size: 1.4rem;
	opacity: 0.8;
}

.jrf-schedule__tab-day {
	display: block;
	font-size: 2.4rem;
	font-weight: 700;
	line-height: 1.1;
	text-transform: uppercase;
}

.jrf-schedule__tab[aria-selected="true"] {
	background-color: var(--jrf-dark);
	color: var(--jrf-white);
}

.jrf-schedule__tab:focus-visible {
	outline: 3px solid var(--jrf-brand);
	outline-offset: -3px;
}

.jrf-schedule__panel {
	padding: 30px 0 0;
	border: 1px solid var(--jrf-rule);
	border-top: 0;
	border-radius: 0 0 6px 6px;
}

.jrf-schedule__grid {
	display: flex;
	gap: 20px;
	padding: 0 20px 30px;
}

.jrf-schedule__axis {
	position: relative;
	flex: 0 0 auto;
	width: 62px;
	/* Clears the stage heading row so the ticks line up with the tracks. */
	padding-top: var(--jrf-header-h);
	height: calc(var(--jrf-span) * var(--jrf-min) + var(--jrf-header-h));
}

.jrf-schedule__tick {
	position: absolute;
	right: 0;
	top: calc(var(--jrf-header-h) + var(--jrf-offset) * var(--jrf-min));
	transform: translateY(-50%);
	font-size: 1.3rem;
	font-weight: 700;
	color: var(--jrf-dark);
	white-space: nowrap;
}

.jrf-schedule__column {
	display: flex;
	flex: 1 1 0;
	flex-direction: column;
	min-width: 0;
}

.jrf-schedule__stage {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	/* Fixed rather than min so every column's track starts at the same y. */
	height: var(--jrf-header-h);
	text-align: center;
}

.jrf-schedule__stage-name {
	margin: 0;
	font-size: 1.6rem;
	font-weight: 700;
	line-height: 1.2;
	color: var(--jrf-ink);
}

.jrf-schedule__stage-presenter {
	margin: 4px 0 0;
	font-size: 1.2rem;
	line-height: 1.3;
	color: var(--jrf-ink);
}

.jrf-schedule__presented-by {
	display: block;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	opacity: 0.7;
}

.jrf-schedule__sponsor {
	display: block;
	font-weight: 700;
}

.jrf-schedule__track {
	position: relative;
	height: calc(var(--jrf-span) * var(--jrf-min));
	/* Hourly gridlines, drawn to match the axis ticks exactly. */
	background-image: linear-gradient(to bottom, var(--jrf-rule) 1px, transparent 1px);
	background-size: 100% calc(60 * var(--jrf-min));
}

.jrf-schedule__set {
	position: absolute;
	left: 0;
	right: 0;
	top: calc(var(--jrf-offset) * var(--jrf-min));
	height: calc(var(--jrf-duration) * var(--jrf-min));
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 10px;
	border-radius: 6px;
	background-color: #9d4459;
	color: var(--jrf-white);
	text-align: center;
	overflow: hidden;
}

.jrf-schedule__set-name {
	margin: 0;
	font-size: 1.4rem;
	font-weight: 700;
	line-height: 1.2;
}

.jrf-schedule__set-time {
	margin: 4px 0 0;
	font-size: 1.3rem;
	line-height: 1.2;
}

.jrf-schedule__notice {
	margin: 20px 0 0;
	padding: 12px 16px;
	border-left: 3px solid var(--jrf-brand);
	background-color: rgba(241, 97, 81, 0.08);
	font-size: 1.4rem;
}

/*
 * Below the grid breakpoint the timetable stops being a timetable. The axis
 * goes away and each stage becomes a chronological list, which is the same
 * DOM reflowed rather than a second copy of the markup.
 */
@media screen and (max-width: 899px) {
	.jrf-schedule__grid {
		flex-direction: column;
		gap: 30px;
	}

	.jrf-schedule__axis {
		display: none;
	}

	.jrf-schedule__stage {
		height: auto;
		align-items: flex-start;
		padding-bottom: 12px;
		border-bottom: 1px solid var(--jrf-rule);
		text-align: left;
	}

	.jrf-schedule__track {
		display: flex;
		flex-direction: column;
		gap: 10px;
		height: auto;
		padding-top: 12px;
		background-image: none;
	}

	.jrf-schedule__set {
		position: static;
		height: auto;
		flex-direction: row;
		align-items: baseline;
		justify-content: space-between;
		gap: 12px;
		text-align: left;
	}

	.jrf-schedule__set-time {
		margin: 0;
		flex: 0 0 auto;
	}
}
