/**
 * ACNJ Events feed.
 *
 * Palette is keyed on acnj_event_type term slugs. The --default rule catches
 * any type added later, so a new event type looks neutral rather than broken.
 *
 * Custom properties are declared on both .acnj-events (for feed layout) and
 * .acnj-event-single (for single event pages) because post_class() puts the
 * type modifier on the article element, which sits outside .acnj-events.
 *
 * The type modifier also lands on each individual pill, so an event with more
 * than one type gets one correctly-coloured pill per term while the card's
 * border and date keep the first term's colour.
 *
 * --acnj-event-text is separate from --acnj-event-color because a background
 * colour that carries dark ink well does not necessarily pass contrast as text
 * on white; community-conversation amber is the case in point.
 */

.acnj-events,
.acnj-event-single {
	--acnj-event-color: #5a5d6c;
	--acnj-event-ink: #ffffff;
	--acnj-event-text: #5a5d6c;
}

.acnj-events {
	box-sizing: content-box;
	margin: 2rem auto;
	max-width: 1150px !important;
	padding-inline: 2rem;
}

/* Ratios: pill ink on pill background, then --acnj-event-text on white. */
.acnj-event--in-person              { --acnj-event-color: #1f6b45; --acnj-event-ink: #ffffff; --acnj-event-text: #1f6b45; } /* 6.5:1, 6.5:1 */
.acnj-event--virtual                { --acnj-event-color: #3673b8; --acnj-event-ink: #ffffff; --acnj-event-text: #3673b8; } /* 4.9:1, 4.9:1 */
.acnj-event--conference             { --acnj-event-color: #31407d; --acnj-event-ink: #ffffff; --acnj-event-text: #31407d; } /* 9.7:1, 9.7:1 */
.acnj-event--training               { --acnj-event-color: #765077; --acnj-event-ink: #ffffff; --acnj-event-text: #765077; } /* 6.6:1, 6.6:1 */
.acnj-event--workshop               { --acnj-event-color: #9c4f96; --acnj-event-ink: #ffffff; --acnj-event-text: #9c4f96; } /* 5.3:1, 5.3:1 */
.acnj-event--meeting                { --acnj-event-color: #3d6b6b; --acnj-event-ink: #ffffff; --acnj-event-text: #3d6b6b; } /* 6.0:1, 6.0:1 */
.acnj-event--community-conversation { --acnj-event-color: #fcb040; --acnj-event-ink: #00335d; --acnj-event-text: #8a5a00; } /* 7.0:1, 5.9:1 */
.acnj-event--recording              { --acnj-event-color: #a13d3d; --acnj-event-ink: #ffffff; --acnj-event-text: #a13d3d; } /* 6.5:1, 6.5:1 */
.acnj-event--default                { --acnj-event-color: #5a5d6c; --acnj-event-ink: #ffffff; --acnj-event-text: #5a5d6c; } /* 6.6:1, 6.6:1 */

.acnj-events__heading {
	margin: 0 0 1rem;
}

/* Filter chips ---------------------------------------------------------- */

.acnj-events__filters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0 0 1.5rem;
}

.acnj-events__filters[hidden] {
	display: none;
}

.acnj-events__filter {
	background: #ffffff;
	border: 2px solid var(--acnj-event-color, #5a5d6c);
	border-radius: 2rem;
	color: #00335d;
	cursor: pointer;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.2;
	padding: 0.4rem 0.9rem;
}

.acnj-events__filter.is-active {
	background: var(--acnj-event-color, #5a5d6c);
	color: var(--acnj-event-ink, #ffffff);
}

.acnj-events__filter:focus-visible {
	outline: 3px solid #00335d;
	outline-offset: 2px;
}

/* List ------------------------------------------------------------------ */

.acnj-events__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.acnj-events__empty {
	color: #575757;
	margin: 0;
}

.acnj-event {
	border-left: 6px solid var(--acnj-event-color);
	display: flex;
	gap: 1.25rem;
	margin: 0 0 1.25rem;
	padding: 1.25rem;
	background: #ffffff;
	box-shadow: 0 1px 3px rgba( 0, 0, 0, 0.12 );
}

.acnj-event[hidden] {
	display: none;
}

.acnj-events .acnj-button-wrapper {
	margin-bottom: 64px;
	margin-top: 32px;
}

.acnj-events .acnj-button,
.acnj-event-single .acnj-button {
	margin-bottom: 0;
}

/* Date block ------------------------------------------------------------ */

.acnj-event__date {
	flex: 0 0 4.5rem;
	text-align: center;
	line-height: 1.1;
	color: var(--acnj-event-text);
}

.acnj-event__day {
	display: block;
	font-size: 2.25rem;
	font-weight: 700;
}

.acnj-event__month {
	display: block;
	font-size: 0.95rem;
	font-weight: 700;
	text-transform: uppercase;
}

.acnj-event__year {
	display: block;
	font-size: 0.8rem;
	opacity: 0.75;
}

/* Media ----------------------------------------------------------------- */

.acnj-event__media {
	flex: 0 0 11rem;
}

.acnj-event__media figure {
	aspect-ratio: 16 / 9;
}

.acnj-event__media figure img {
	display: block;
	height: 100%;
	width: 100%;
	object-fit: cover;
}

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

.acnj-event__body {
	flex: 1 1 auto;
	min-width: 0;
}

/* Wrapper owns the spacing so multiple pills wrap as a row rather than each
   pill carrying its own margin. */
.acnj-event__types {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	margin: 0 0 0.5rem;
}

.acnj-event__type {
	background: var(--acnj-event-color);
	border-radius: 2rem;
	color: var(--acnj-event-ink);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.03em;
	padding: 0.2rem 0.7rem;
	text-transform: uppercase;
}

.acnj-event__title {
	font-size: 1.25rem;
	margin: 0 0 0.35rem;
}

.acnj-event__meta {
	color: #575757;
	font-size: 0.9rem;
	margin: 0 0 0.5rem;
}

.acnj-event__excerpt {
	margin: 0 0 0.75rem;
}

.acnj-event__excerpt p:last-child {
	margin-bottom: 0;
}

.acnj-event__register {
	display: inline-block;
}

/* Mobile ---------------------------------------------------------------- */

@media ( max-width: 600px ) {

	.acnj-event {
		flex-wrap: wrap;
		gap: 0.75rem;
		padding: 1rem;
	}

	.acnj-event__date {
		flex: 0 0 3.5rem;
		text-align: left;
	}

	.acnj-event__day {
		font-size: 1.75rem;
	}

	.acnj-event__media {
		flex: 0 0 100%;
		order: 3;
	}

	.acnj-event__body {
		flex: 1 1 60%;
	}
}

/* Single event ---------------------------------------------------------- */

.acnj-event-single .acnj-event-single__meta-wrapper,
.acnj-event-single .content-area__wrapper {
	margin-inline: auto;
	max-width: 1150px;
	padding-inline: 64px;
}

.acnj-event-single__date {
	color: var(--acnj-event-text);
	font-size: 1.35rem;
	font-weight: 700;
}

.acnj-event-single__meta {
	color: #575757;
	margin: 0 0 1.5rem;
}

.acnj-event-single .post__thumbnail {
	margin-bottom: 32px;
}

.acnj-event-single .post__thumbnail:after,
.acnj-event-single .post__thumbnail img {
	height: 100%;
	object-fit: cover;
}

.acnj-event-single__meta-wrapper {
	align-items: center;
	display: flex;
	gap: 32px;
	margin: 32px auto;
	max-width: 1270px;
	padding-inline: 64px;
}

.acnj-event-single .acnj-event__types {
	margin-bottom: 0;
}

.wp-singular.page .acnj-events {
	margin-block: 64px;
}