/*
	Upcoming Events
	---------------------------------------------------------------------------
	Page-specific styles, loaded after main.css by upcoming-events-new.html only.

	Every selector is scoped under #events, so linking this file from another
	page cannot disturb that page's layout.

	The card is a fixed-height flex column: the picture, title, details and
	button all have a set size, and the description is the one part that flexes.
	Whatever room is left over is what the description gets, and anything past
	that is clipped - which is what keeps every card identical no matter how
	much text is typed in. events.js measures the clipping and adds a More
	toggle to the cards that actually need one.
*/

/* Page band */

	#events {
		background: #f0f4f4;
		padding: 4.5em 0 6em 0;
	}

		#events > .container {
			padding-left: 2em;
			padding-right: 2em;
		}

/* Intro */

	#events .events-intro {
		max-width: 38em;
		margin: 0 auto 3em auto;
		text-align: center;
	}

		#events .events-intro .events-season {
			display: block;
			margin-bottom: 0.5em;
			color: #b03257;
			font-size: 0.8em;
			font-weight: 600;
			letter-spacing: 0.18em;
			text-transform: uppercase;
		}

		#events .events-intro h2 {
			margin: 0 0 0.35em 0;
		}

		#events .events-intro p {
			margin: 0;
			color: #6d5f6e;
			text-align: center;
		}

/* Grid */

	#events .event-grid {
		display: grid;
		grid-template-columns: repeat(auto-fill, minmax(19em, 1fr));
		gap: 2em;
		/* start, not stretch: when one card is expanded its neighbours keep
		   their own height instead of being dragged taller with it. */
		align-items: start;
	}

/* Card */

	#events .event-card {
		display: flex;
		flex-direction: column;
		/* Sized so that, once the picture, title, details and button have
		   taken their fixed share, four lines of description are left. */
		height: 32em;
		margin: 0;
		background: #fff;
		border-radius: 0.65em;
		overflow: hidden;
		box-shadow: 0 1px 2px rgba(43, 37, 44, 0.06), 0 12px 28px -14px rgba(43, 37, 44, 0.35);
		-moz-transition: -moz-transform 0.35s ease, box-shadow 0.35s ease;
		-webkit-transition: -webkit-transform 0.35s ease, box-shadow 0.35s ease;
		-ms-transition: -ms-transform 0.35s ease, box-shadow 0.35s ease;
		transition: transform 0.35s ease, box-shadow 0.35s ease;
	}

		#events .event-card:hover {
			-moz-transform: translateY(-4px);
			-webkit-transform: translateY(-4px);
			-ms-transform: translateY(-4px);
			transform: translateY(-4px);
			box-shadow: 0 1px 2px rgba(43, 37, 44, 0.06), 0 20px 36px -16px rgba(43, 37, 44, 0.45);
		}

		/* Opened by the More toggle: the one card grows to fit its text. */
		#events .event-card.is-expanded {
			height: auto;
		}

/* Card - picture */

	#events .event-media {
		position: relative;
		flex: 0 0 auto;
		height: 11em;
		overflow: hidden;
		background: #e7e0e7;
	}

		#events .event-media img {
			display: block;
			width: 100%;
			height: 100%;
			object-fit: cover;
			-moz-transition: -moz-transform 0.5s ease;
			-webkit-transition: -webkit-transform 0.5s ease;
			-ms-transition: -ms-transform 0.5s ease;
			transition: transform 0.5s ease;
		}

		#events .event-card:hover .event-media img {
			-moz-transform: scale(1.045);
			-webkit-transform: scale(1.045);
			-ms-transform: scale(1.045);
			transform: scale(1.045);
		}

		#events .event-media a {
			display: block;
			height: 100%;
			border-bottom: 0;
		}

/* Card - date chip */

	#events .event-date-chip {
		position: absolute;
		top: 0.9em;
		left: 0.9em;
		display: block;
		min-width: 3.4em;
		padding: 0.45em 0.55em 0.55em 0.55em;
		background: #fff;
		border-radius: 0.45em;
		box-shadow: 0 2px 10px rgba(43, 37, 44, 0.3);
		text-align: center;
		line-height: 1;
	}

		#events .event-date-chip .month {
			display: block;
			color: #b03257;
			font-size: 0.7em;
			font-weight: 600;
			letter-spacing: 0.12em;
			text-transform: uppercase;
		}

		#events .event-date-chip .day {
			display: block;
			margin-top: 0.22em;
			color: #483949;
			font-size: 1.4em;
			line-height: 1;
		}

		/* For an event with no date set yet. */
		#events .event-date-chip.tba .day {
			margin-top: 0;
			padding: 0.2em 0;
			color: #6d5f6e;
			font-size: 0.8em;
			font-weight: 600;
			letter-spacing: 0.1em;
			text-transform: uppercase;
		}

/* Card - status tag */

	#events .event-tag {
		position: absolute;
		top: 1.1em;
		right: 0.9em;
		padding: 0.45em 0.9em;
		background: rgba(43, 37, 44, 0.85);
		border-radius: 2em;
		color: #fff;
		font-size: 0.7em;
		font-weight: 600;
		letter-spacing: 0.1em;
		line-height: 1.4;
		text-transform: uppercase;
	}

		#events .event-tag.sale {
			background: rgba(176, 50, 87, 0.9);
		}

/* Card - body */

	#events .event-body {
		display: flex;
		flex: 1 1 auto;
		flex-direction: column;
		min-height: 0;
		padding: 1.4em 1.5em 0 1.5em;
	}

	#events .event-title {
		flex: 0 0 auto;
		display: -webkit-box;
		-webkit-line-clamp: 2;
		line-clamp: 2;
		-webkit-box-orient: vertical;
		overflow: hidden;
		/* Two lines are reserved whether the title needs them or not, so the
		   details and buttons line up across the row. */
		min-height: 2.6em;
		margin: 0 0 0.5em 0;
		color: #483949;
		font-size: 1.15em;
		line-height: 1.3;
	}

		#events .event-title a {
			color: inherit;
			border-bottom: 0;
		}

			#events .event-title a:hover {
				color: #b03257;
			}

/* Card - date / time / location */

	#events .event-meta {
		flex: 0 0 auto;
		/* Three rows, held open even if an event only lists one or two. */
		min-height: 5.15em;
		margin: 0 0 0.85em 0;
		padding: 0;
		color: #6d5f6e;
		font-size: 0.85em;
		line-height: 1.55;
		list-style: none;
	}

		#events .event-meta li {
			position: relative;
			margin: 0 0 0.25em 0;
			padding: 0 0 0 1.75em;
		}

			#events .event-meta li:last-child {
				margin-bottom: 0;
			}

			#events .event-meta li:before {
				position: absolute;
				left: 0;
				top: 0.1em;
				width: 1.2em;
				color: #b03257;
				font-family: 'Font Awesome 5 Free';
				font-weight: 900;
				font-size: 0.85em;
				text-align: center;
				-moz-osx-font-smoothing: grayscale;
				-webkit-font-smoothing: antialiased;
			}

			#events .event-meta .when:before {
				content: '\f073';
			}

			#events .event-meta .time:before {
				content: '\f017';
			}

			#events .event-meta .where:before {
				content: '\f3c5';
			}

		#events .event-meta a {
			color: inherit;
			border-bottom: solid 1px rgba(109, 95, 110, 0.3);
		}

			#events .event-meta a:hover {
				color: #b03257;
				border-bottom-color: transparent;
			}

/* Card - description */

	#events .event-description {
		position: relative;
		/* The only part of the card that flexes. It takes the leftover room
		   and clips anything that does not fit. */
		flex: 1 1 auto;
		min-height: 0;
		overflow: hidden;
		font-size: 0.9em;
		line-height: 1.6;
	}

		#events .event-description p {
			margin: 0 0 0.75em 0;
			text-align: left;
		}

			#events .event-description p:last-child {
				margin-bottom: 0;
			}

		/* events.js adds .is-clamped to the cards whose text is actually being
		   cut off; the fade tells the reader there is more to see. */
		#events .event-card.is-clamped .event-description:after {
			content: '';
			position: absolute;
			left: 0;
			right: 0;
			bottom: 0;
			height: 2.75em;
			background: -moz-linear-gradient(top, rgba(255, 255, 255, 0), #ffffff 90%);
			background: -webkit-linear-gradient(top, rgba(255, 255, 255, 0), #ffffff 90%);
			background: -ms-linear-gradient(top, rgba(255, 255, 255, 0), #ffffff 90%);
			background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #ffffff 90%);
			pointer-events: none;
		}

		#events .event-card.is-expanded .event-description {
			overflow: visible;
		}

			#events .event-card.is-expanded .event-description:after {
				display: none;
			}

/* Card - actions */

	#events .event-actions {
		display: flex;
		flex: 0 0 auto;
		align-items: center;
		justify-content: space-between;
		gap: 1em;
		padding: 1.1em 1.5em 1.4em 1.5em;
	}

		/* Holds the call to action against the right edge whether or not the
		   More toggle is sitting to its left. Not :only-child - events.js
		   puts the toggle in the row on every card, even the ones where it
		   stays hidden, so the button would jump left once the page loaded. */
		#events .event-actions > .button,
		#events .event-actions > .button2,
		#events .event-actions > .event-note {
			margin-left: auto;
		}

		#events .event-actions .button,
		#events .event-actions .button2 {
			padding: 0.6em 1.7em 0.6em 1.7em;
			font-size: 0.9em;
			line-height: 1.5;
			white-space: nowrap;
		}

		/* For an event with no ticket link yet. */
		#events .event-actions .event-note {
			color: #6d5f6e;
			font-size: 0.8em;
			font-style: italic;
			line-height: 1.4;
			text-align: right;
		}

		/* Undoes the site's filled button styling - this is a disclosure
		   control, not a call to action, and should not compete with one.
		   Hidden until events.js finds the card is really overflowing. */
		#events .event-more {
			display: none;
			flex: 0 0 auto;
			position: static;
			padding: 0;
			background: none;
			border: 0;
			border-radius: 0;
			color: #b03257;
			font-size: 0.85em;
			font-weight: 400;
			line-height: 1.5;
			text-align: left;
			cursor: pointer;
		}

			#events .event-card.is-clamped .event-more {
				display: inline-block;
			}

			#events .event-more:hover {
				background: none;
				color: #ef8376;
			}

			/* The template zeroes the outline on every button, which leaves
			   keyboard users with nothing to follow. Put one back. */
			#events .event-more:focus-visible {
				outline: solid 2px #b03257;
				outline-offset: 3px;
			}

			#events .event-more:after {
				content: '\f078';
				display: inline-block;
				margin-left: 0.5em;
				font-family: 'Font Awesome 5 Free';
				font-weight: 900;
				font-size: 0.7em;
				-moz-transition: -moz-transform 0.3s ease;
				-webkit-transition: -webkit-transform 0.3s ease;
				-ms-transition: -ms-transform 0.3s ease;
				transition: transform 0.3s ease;
			}

			#events .event-card.is-expanded .event-more:after {
				-moz-transform: rotate(180deg);
				-webkit-transform: rotate(180deg);
				-ms-transform: rotate(180deg);
				transform: rotate(180deg);
			}

/* Wide */

	@media screen and (max-width: 1280px) {

		#events .event-grid {
			gap: 1.75em;
		}

	}

/* Narrow */

	@media screen and (max-width: 980px) {

		#events {
			padding: 3.5em 0 4.5em 0;
		}

		#events .event-grid {
			grid-template-columns: repeat(auto-fill, minmax(17em, 1fr));
		}

		#events .event-card {
			height: 31em;
		}

		#events .event-media {
			height: 10em;
		}

	}

/* Mobile */

	@media screen and (max-width: 736px) {

		#events {
			padding: 3em 0 4em 0;
		}

			#events > .container {
				padding-left: 1.25em;
				padding-right: 1.25em;
			}

		#events .events-intro {
			margin-bottom: 2.25em;
		}

		#events .event-grid {
			grid-template-columns: 1fr;
			gap: 1.5em;
		}

		#events .event-card {
			height: 32em;
		}

		#events .event-media {
			height: 10.5em;
		}

	}
