/*
 * Group layouts theme.json can't express: the plum hero's decorative circles,
 * card grids that mix query results with a CTA card, the contact map and the
 * gallery collage.
 */

/* Plum hero: a deep circle top right and a saffron one at the bottom. */
.wp-block-group.is-style-hero-plum {
	position: relative;
	overflow: hidden;
	isolation: isolate;
}

.wp-block-group.is-style-hero-plum::before,
.wp-block-group.is-style-hero-plum::after {
	content: "";
	position: absolute;
	z-index: -1;
	border-radius: 50%;
	pointer-events: none;
}

.wp-block-group.is-style-hero-plum::before {
	top: -80px;
	right: -60px;
	width: 320px;
	height: 320px;
	background-color: #5b2a70;
}

.wp-block-group.is-style-hero-plum::after {
	right: 260px;
	bottom: -110px;
	width: 200px;
	height: 200px;
	background-color: var(--wp--preset--color--saffron);
	opacity: 0.9;
}

@media (width <= 1100px) {

	.wp-block-group.is-style-hero-plum::after {
		display: none;
	}
}

/* Listing grids: posts and the CTA card are items of the same grid. */
.ts-card-grid > .wp-block-post-template.ts-contents {
	display: contents;
}

.ts-post-card {
	transition: border-color var(--wp--custom--motion--duration);
}

.ts-post-card:hover,
.ts-post-card:focus-within {
	border-color: var(--wp--preset--color--saffron);
}

/* Gallery hero collage: three tilted photos with white frames. */
.ts-collage {
	position: relative;
	min-height: 300px;
}

.ts-collage .wp-block-image {
	position: absolute;
	width: 58%;
	margin: 0;
}

.ts-collage .wp-block-image img {
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border: 6px solid var(--wp--preset--color--white);
	border-radius: 18px;
	box-shadow: 0 18px 40px rgba(42, 21, 51, 0.35);
}

.ts-collage .wp-block-image:nth-child(1) {
	top: 0;
	left: 0;
	transform: rotate(-6deg);
}

.ts-collage .wp-block-image:nth-child(2) {
	top: 24px;
	right: 0;
	transform: rotate(5deg);
}

.ts-collage .wp-block-image:nth-child(3) {
	bottom: 0;
	left: 22%;
	transform: rotate(-2deg);
}

/* Gallery hero chips: the photo and video totals; an empty one hides. */
.ts-media-chip {
	padding: 8px 14px;
	border-radius: var(--wp--preset--border-radius--pill);
	background-color: var(--wp--custom--alpha--white-12);
	color: var(--wp--preset--color--white);
	font-size: var(--wp--preset--font-size--eyebrow);
	font-weight: 700;
}

.ts-media-chip:not(:has(p:not(:empty))) {
	display: none;
}

/* Legal hero chips. */
.ts-legal-chip {
	padding: 6px 14px;
	border-radius: var(--wp--preset--border-radius--pill);
	background-color: var(--wp--custom--alpha--white-12);
	color: var(--wp--preset--color--white);
}

.ts-legal-chip:first-child {
	background-color: var(--wp--preset--color--saffron);
	color: var(--wp--preset--color--ink);
}

.ts-card-grid > .ts-contents > li {
	margin: 0;
}

/*
 * The band that closes a legal page: its text gives way, down to 280px,
 * before the button drops under it.
 */
.ts-legal-band > .wp-block-group {
	flex: 1 1 280px;
}

/* A card that ends with its content instead of stretching to its grid row. */
.ts-fit {
	align-self: start;
}

/*
 * Legal pages: "On this page" and the questions card stay in view beside the
 * article; on tablet and mobile they sit above it and scroll away.
 */
@media (width > 1100px) {

	.ts-legal-aside {
		position: sticky;
		top: calc(var(--wp-admin--admin-bar--height, 0px) + 104px);
		align-self: start;
	}
}

/*
 * Event fields (bound to the plugin's ACF fields). A row whose field is empty,
 * such as an older event without a time or venue, is left out.
 */
.ts-event-row:not(:has(.ts-event-value:not(:empty))) {
	display: none;
}

.ts-details .ts-event-label {
	color: var(--wp--preset--color--lilac-deep);
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.ts-details .ts-event-value {
	color: var(--wp--preset--color--white);
	font-size: var(--wp--preset--font-size--body);
	font-weight: 600;
	overflow-wrap: anywhere;
}

.ts-details__note {
	padding-top: 16px;
	border-top: 1px solid var(--wp--custom--alpha--white-12);
	color: var(--wp--preset--color--lilac-deep);
}

.ts-details__note a {
	color: var(--wp--preset--color--white);
	font-weight: 700;
}

/*
 * The event poster's frame (.ts-poster): a white card around the picture, with
 * "Event poster" and "View full size" in a row under it. The plugin puts a
 * link to the full-size file around the picture; both open it in the viewer.
 * The link's touch target is taller than the row, so its margin takes that
 * height back. Phones get the design's tighter frame.
 */
.ts-poster .wp-block-post-featured-image {
	margin: 0;
}

.ts-poster .wp-block-post-featured-image a {
	display: block;
	border-radius: inherit;
}

.ts-poster .wp-block-post-featured-image img {
	display: block;
	width: 100%;
}

.ts-poster__caption {
	padding: 0 8px 6px;
}

.ts-poster__caption p {
	font-size: 0.875rem;
}

.ts-poster__caption .wp-block-button {
	margin-block: -12px;
}

@media (width <= 640px) {

	.wp-block-group.ts-poster > * + * {
		margin-block-start: 8px;
	}

	.ts-poster__caption {
		padding: 0 6px 2px;
	}

	.ts-poster__caption p {
		font-size: 0.8125rem;
	}

	.ts-poster__caption .wp-block-button {
		--ts-button-icon-size: 16px;
	}
}

/*
 * A photo with a button over its bottom corner (.ts-photo-pill): the Case
 * Study's "See video". The button takes no room of its own, so the card
 * around the photo keeps its height.
 */
.ts-photo-pill {
	position: relative;
}

.ts-photo-pill > .wp-block-image {
	margin: 0;
}

.ts-photo-pill > .wp-block-image img {
	display: block;
	width: 100%;
}

.ts-photo-pill > .wp-block-buttons {
	position: absolute;
	bottom: 12px;
	left: 12px;
	margin: 0;
}

.ts-photo-pill > .wp-block-buttons .wp-block-button__link {
	min-height: var(--wp--custom--touch-target);
	padding: 0 18px 0 14px;
	font-size: 0.875rem;
}

/*
 * Single job (fields bound to the plugin's job field source). The hero has
 * the plum circle and a large "work" watermark instead of the saffron circle;
 * a chip whose field is empty, such as a job without a type, is left out.
 */
.wp-block-group.ts-hero--job::after {
	display: none;
}

.ts-hero--job .ts-hero-watermark {
	position: absolute;
	right: 40px;
	bottom: -40px;
	z-index: -1;
	width: 220px;
	color: var(--wp--custom--alpha--white-10);
	pointer-events: none;
}

.ts-job-title {
	max-width: 900px;
	text-wrap: balance;
}

.ts-job-chip {
	padding: 7px 13px;
	border-radius: var(--wp--preset--border-radius--pill);
	background-color: var(--wp--custom--alpha--white-12);
	color: var(--wp--preset--color--white);
	font-size: var(--wp--preset--font-size--caption);
	font-weight: 700;
}

.ts-job-chip--type {
	background-color: var(--wp--preset--color--saffron);
	color: var(--wp--preset--color--ink);
}

.ts-job-chip:not(:has(.ts-job-value:not(:empty))),
.ts-job-card__meta .ts-job-type-chip:empty {
	display: none;
}

/* More jobs cards: the whole card highlights with its title link. */
.ts-job-card {
	height: 100%;
	transition: border-color var(--wp--custom--motion--duration);
}

.ts-job-card:hover,
.ts-job-card:focus-within {
	border-color: var(--wp--preset--color--saffron);
}

.ts-job-card .wp-block-post-title a {
	color: var(--wp--preset--color--plum);
	text-decoration: none;
}

.ts-job-card .ts-job-type-chip {
	padding: 3px 9px;
	border-radius: var(--wp--preset--border-radius--pill);
	background-color: var(--wp--preset--color--lilac);
	color: var(--wp--preset--color--plum);
	font-size: 0.75rem;
	font-weight: 800;
}

/*
 * Happening now on the Events page: the ongoing event in a white card, with
 * its details, how long it has run, and a link. Three columns on desktop,
 * started from the top (the owner's alignment rule); one column below 1100px.
 */
.ts-now .wp-block-post-template {
	margin: 0;
	padding: 0;
	list-style: none;
}

.ts-now__card {
	display: grid;
	grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) auto;
	gap: 40px;
	align-items: start;
}

.wp-block-group.ts-now__card > * {
	min-width: 0;
	margin-block: 0;
}

.ts-now .wp-block-post-title {
	color: var(--wp--preset--color--plum);
	font-size: 1.875rem;
	letter-spacing: -0.02em;
}

.ts-now__icon {
	color: var(--wp--preset--color--plum);
	fill: currentcolor;
}

.ts-now__ends {
	color: var(--wp--preset--color--muted);
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.ts-now__ends > * {
	margin: 0;
}

.ts-now__now {
	color: var(--wp--preset--color--plum);
}

.ts-now__bar {
	position: relative;
	height: 10px;
	margin-right: 8px;
	border-radius: var(--wp--preset--border-radius--pill);
	background-color: var(--wp--preset--color--plum);
}

.ts-now__bar::after {
	content: "";
	position: absolute;
	top: 50%;
	right: -8px;
	box-sizing: content-box;
	width: 12px;
	height: 12px;
	margin-top: -9px;
	border: 3px solid var(--wp--preset--color--white);
	border-radius: 50%;
	background-color: var(--wp--preset--color--coral);
}

.ts-now__running {
	color: var(--wp--preset--color--body);
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.5;
}

@media (width <= 1100px) {

	.ts-now__card {
		grid-template-columns: minmax(0, 1fr);
		gap: 20px;
	}

	.ts-now .wp-block-post-title {
		font-size: 1.625rem;
	}

	.ts-now__ends {
		font-size: 0.75rem;
	}
}

@media (width <= 640px) {

	.ts-now__card {
		gap: 18px;
	}

	.ts-now .wp-block-post-title {
		font-size: 1.375rem;
	}

	.ts-now__ends {
		font-size: 0.6875rem;
	}

	.ts-now__running {
		font-size: 0.875rem;
	}

	.ts-now__action,
	.ts-now__action .wp-block-button {
		width: 100%;
	}
}

/*
 * The Events filter row: the type chips on the left, the search field and the
 * order switch on the right. The plugin's Event Search block takes a row of
 * its own above the chips below 1100px.
 */
.ts-event-filters > .ts-nav-chips {
	margin-inline-end: auto;
}
