/*
 * CraneMag Events, in the CraneMag house style.
 *
 * Colours follow the Flatsome theme settings (primary, secondary and base colour), so a
 * change in the theme options carries over. The hex values are the fallback for other themes.
 * Fonts are inherited from the theme (Poppins on cranemag.com).
 */

.cmev-wrap,
.cmev-shortcode {
	--cmev-accent: var(--fs-color-primary, #ffa100);
	--cmev-dark: var(--fs-color-secondary, #413b3d);
	--cmev-text: var(--fs-color-base, #0a0a0a);
	--cmev-muted: #6b6567;
	--cmev-line: #eceae6;
	--cmev-hover: #faf9f7;
	--cmev-card: #fff;
	--cmev-radius: 6px;
	--cmev-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.05);
	color: var(--cmev-text);
}

.cmev-wrap {
	box-sizing: border-box;
	max-width: 1510px;
	margin: 0 auto;
	padding: 30px 30px 60px;
}

/* The calendar uses the same column width as the article archives. */
.cmev-archive {
	max-width: 1230px;
}

.cmev-wrap *,
.cmev-shortcode * {
	box-sizing: border-box;
}

/* ---------- Calendar header ---------- */

.cmev-archive .cmev-header {
	margin: 0 0 24px;
	text-align: center;
}

.cmev-archive .cmev-title {
	margin: 0;
	font-size: 1.7em;
	font-weight: 700;
	letter-spacing: 0.05em;
	line-height: 1.3;
	text-transform: none;
}

.cmev-intro {
	max-width: 760px;
	margin: 12px auto 0;
	color: var(--cmev-muted);
}

.cmev-filters {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin: 0 0 16px;
}

.cmev-wrap .cmev-filters a {
	padding: 7px 14px;
	border-radius: var(--cmev-radius);
	background: var(--cmev-card);
	box-shadow: var(--cmev-shadow);
	color: var(--cmev-text);
	font-size: 0.85em;
	font-weight: 600;
	line-height: 1.4;
	text-decoration: none;
	transition: color 0.15s, background-color 0.15s;
}

.cmev-wrap .cmev-filters a:hover {
	color: var(--cmev-accent);
}

.cmev-wrap .cmev-filters a.is-current {
	background: var(--cmev-dark);
	color: #fff;
}

.cmev-when {
	display: flex;
	justify-content: center;
	gap: 20px;
	margin: 0 0 8px;
	font-size: 0.8em;
	font-weight: 600;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

.cmev-when .is-current {
	padding-bottom: 2px;
	border-bottom: 2px solid var(--cmev-accent);
}

.cmev-wrap .cmev-when a {
	color: var(--cmev-muted);
	text-decoration: none;
}

.cmev-wrap .cmev-when a:hover {
	color: var(--cmev-accent);
}

/* ---------- Event lists ---------- */

.cmev-wrap .cmev-month,
.cmev-shortcode .cmev-month {
	margin: 34px 0 12px;
	padding: 0;
	border: 0;
	font-size: 1.15em;
	font-weight: 700;
	line-height: 1.3;
}

.cmev-wrap ul.cmev-list,
.cmev-shortcode ul.cmev-list {
	margin: 0;
	padding: 0;
	overflow: hidden;
	border-radius: var(--cmev-radius);
	background: var(--cmev-card);
	box-shadow: var(--cmev-shadow);
	list-style: none;
}

.cmev-shortcode--plain ul.cmev-list {
	border-radius: 0;
	background: none;
	box-shadow: none;
}

.cmev-wrap .cmev-list > .cmev-row,
.cmev-shortcode .cmev-list > .cmev-row {
	position: relative;
	display: grid;
	grid-template-columns: 150px minmax(0, 1fr) auto;
	align-items: center;
	gap: 6px 20px;
	margin: 0;
	padding: 16px 20px;
	border-top: 1px solid var(--cmev-line);
	list-style: none;
	transition: background-color 0.15s;
}

.cmev-wrap .cmev-list > .cmev-row:first-child,
.cmev-shortcode .cmev-list > .cmev-row:first-child {
	border-top: 0;
}

.cmev-list > .cmev-row:hover {
	background: var(--cmev-hover);
}

.cmev-shortcode--plain .cmev-list > .cmev-row {
	padding-left: 0;
	padding-right: 0;
}

/* Lists from a shortcode show the year in the date, which needs a wider first column. */
.cmev-shortcode .cmev-list > .cmev-row {
	grid-template-columns: 165px minmax(0, 1fr) auto;
}

/* Same look as the date badge on the article cards. */
.cmev-date {
	display: inline-block;
	justify-self: start;
	padding: 4px 10px;
	border-radius: 4px;
	background: var(--cmev-accent);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.05em;
	line-height: 1.4;
	text-transform: uppercase;
	white-space: nowrap;
}

.cmev-date--tba {
	background: #dedad5;
	color: var(--cmev-dark);
}

.cmev-row__main {
	min-width: 0;
}

.cmev-wrap .cmev-row__title,
.cmev-shortcode .cmev-row__title {
	color: var(--cmev-text);
	font-weight: 700;
	line-height: 1.35;
	text-decoration: none;
}

/* The whole row is clickable. */
.cmev-row__title::after {
	content: "";
	position: absolute;
	inset: 0;
}

.cmev-wrap .cmev-row:hover .cmev-row__title,
.cmev-shortcode .cmev-row:hover .cmev-row__title {
	color: var(--cmev-accent);
}

.cmev-row__meta {
	margin-top: 2px;
	color: var(--cmev-muted);
	font-size: 0.85em;
	line-height: 1.4;
}

/* Same look as .cat-label on the site. */
.cmev-row__cat {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 3px;
	background: var(--cmev-dark);
	color: #fff;
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.08em;
	line-height: 1.4;
	text-transform: uppercase;
	white-space: nowrap;
}

.cmev-archive--category .cmev-row__cat {
	display: none;
}

.cmev-row--cancelled .cmev-row__title {
	text-decoration: line-through;
}

.cmev-row--cancelled .cmev-date {
	background: #dedad5;
	color: var(--cmev-dark);
	text-decoration: line-through;
}

.cmev-badge {
	display: inline-block;
	margin-left: 8px;
	padding: 2px 8px;
	border-radius: 3px;
	background: #fff1d6;
	color: #6b4a00;
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.06em;
	line-height: 1.5;
	text-transform: uppercase;
	vertical-align: middle;
	white-space: nowrap;
}

.cmev-badge--cancelled {
	background: var(--fs-color-alert, #b20000);
	color: #fff;
}

.cmev-empty {
	margin: 30px 0;
	text-align: center;
	color: var(--cmev-muted);
}

.cmev-wrap .cmev-more,
.cmev-shortcode .cmev-more {
	margin: 14px 0 0;
	font-size: 0.9em;
	font-weight: 600;
}

.cmev-archive .navigation,
.cmev-archive .nav-pagination {
	margin-top: 30px;
	text-align: center;
}

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

.cmev-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	grid-template-rows: auto 1fr;
	column-gap: 60px;
}

.cmev-single .cmev-header {
	grid-column: 1;
	grid-row: 1;
	margin: 0 0 20px;
}

.cmev-body {
	grid-column: 1;
	grid-row: 2;
	min-width: 0;
}

.cmev-side {
	grid-column: 2;
	grid-row: 1 / span 2;
}

/* Orange uppercase line above the title, like the category above an article. */
.cmev-kicker {
	margin: 0 0 4px;
	font-size: 0.7em;
	font-weight: 700;
	letter-spacing: 0.05em;
	line-height: 1.6;
	text-transform: uppercase;
}

.cmev-wrap .cmev-kicker a {
	color: var(--cmev-accent);
	text-decoration: none;
}

.cmev-kicker span {
	margin: 0 4px;
	color: var(--cmev-muted);
}

.cmev-single .cmev-title {
	margin: 0 0 8px;
	font-size: 1.7em;
	font-weight: 700;
	line-height: 1.3;
}

.cmev-meta {
	margin: 0;
	color: var(--cmev-text);
	font-size: 0.7em;
	letter-spacing: 0.05em;
	line-height: 1.8;
	text-transform: uppercase;
}

.cmev-meta strong {
	color: var(--cmev-accent);
	font-weight: 600;
}

.cmev-meta .cmev-badge {
	margin-left: 6px;
}

.cmev-notice {
	margin: 0 0 20px;
	padding: 14px 18px;
	border-left: 4px solid var(--cmev-accent);
	border-radius: var(--cmev-radius);
	background: var(--cmev-card);
	box-shadow: var(--cmev-shadow);
	font-size: 0.95em;
}

.cmev-wrap .cmev-image {
	display: block;
	width: 100%;
	height: auto;
	margin: 0 0 24px;
	border-radius: var(--cmev-radius);
}

.cmev-wrap .cmev-content {
	padding: 0;
}

/* Some themes centre the text of .entry-content in a narrow column; here it follows the layout. */
.cmev-wrap .cmev-content > :where(p, ul, ol, h2, h3, h4, blockquote) {
	max-width: none;
	margin-left: 0;
	margin-right: 0;
}

.cmev-wrap .cmev-content > :first-child {
	margin-top: 0;
}

/* Dark card, like the newsletter block in the article sidebar. */
.cmev-details {
	padding: 22px 20px 24px;
	border-radius: var(--cmev-radius);
	background: var(--cmev-dark);
	box-shadow: var(--cmev-shadow);
	color: #fff;
}

.cmev-wrap .cmev-details__title {
	margin: 0 0 16px;
	color: #fff;
	font-size: 1.15em;
	font-weight: 700;
	line-height: 1.3;
}

/* Flatsome sets definition lists inline and in capitals; the card needs label above value. */
.cmev-wrap .cmev-details dl {
	margin: 0;
	font-size: inherit;
	letter-spacing: normal;
	opacity: 1;
	text-transform: none;
}

.cmev-details__row {
	margin: 0 0 14px;
}

.cmev-wrap .cmev-details dt {
	display: block;
	margin: 0;
	color: var(--cmev-accent);
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.08em;
	line-height: 1.6;
	text-transform: uppercase;
}

.cmev-wrap .cmev-details dd {
	display: block;
	margin: 0;
	padding: 0;
	letter-spacing: normal;
	text-transform: none;
	color: #fff;
	font-size: 0.95em;
	font-weight: 600;
	line-height: 1.45;
}

.cmev-wrap .cmev-details dd a {
	color: #fff;
	text-decoration: underline;
}

.cmev-wrap .cmev-details .cmev-button,
.cmev-banner .cmev-banner__intro .cmev-button {
	display: block;
	margin: 20px 0 0;
	padding: 0.65em 1em;
	border: 0;
	border-radius: var(--cmev-radius);
	background-color: var(--cmev-accent);
	color: #fff;
	font-weight: 700;
	line-height: 1.6;
	text-align: center;
	text-decoration: none;
	text-transform: none;
}

.cmev-wrap .cmev-details .cmev-button:hover,
.cmev-banner .cmev-banner__intro .cmev-button:hover {
	filter: brightness(0.94);
}

/* ---------- Banner: pointer to the calendar with the next events ---------- */

.cmev-banner {
	display: grid;
	grid-template-columns: minmax(280px, 1fr) minmax(0, 2fr);
	max-width: 1170px;
	margin: 0 auto 30px;
	overflow: hidden;
	border-radius: var(--cmev-radius);
	background: var(--cmev-card);
	box-shadow: var(--cmev-shadow);
	font-size: 1rem;
	text-align: left;
}

/* In the header of a Flatsome article category the block gets the exact width of the
   article grid below it (10 of 12 columns), at every screen width. */
@media (min-width: 850px) {
	.archive-page-header .cmev-banner {
		width: calc(83.333% - 5px);
		max-width: none;
		margin-top: 10px;
	}
}

.cmev-banner--intro-only {
	grid-template-columns: minmax(0, 1fr);
}

.cmev-banner__intro {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	padding: 28px 30px 30px;
	background: var(--cmev-dark);
	color: #fff;
}

.cmev-banner .cmev-banner__kicker {
	margin: 0 0 6px;
	color: var(--cmev-accent);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	line-height: 1.6;
	text-transform: uppercase;
}

.cmev-banner .cmev-banner__title {
	margin: 0 0 10px;
	color: #fff;
	font-size: 1.4em;
	font-weight: 700;
	line-height: 1.25;
	text-transform: none;
}

.cmev-banner .cmev-banner__text {
	margin: 0;
	color: rgba(255, 255, 255, 0.85);
	font-size: 0.92em;
	line-height: 1.6;
}

.cmev-banner .cmev-banner__intro .cmev-button {
	display: inline-block;
	padding: 0.65em 1.4em;
}

.cmev-banner__events {
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-width: 0;
}

.cmev-banner .cmev-list > .cmev-row {
	padding: 18px 26px;
}

.cmev-banner .cmev-row__cat {
	display: none;
}

/* Below roughly tablet width the intro and the events are stacked. */
@media (max-width: 999px) {
	.cmev-banner {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* ---------- Related articles ---------- */

.cmev-related {
	margin-top: 44px;
}

.cmev-wrap .cmev-related__title {
	margin: 0 0 18px;
	font-size: 1.25em;
	font-weight: 700;
	line-height: 1.3;
}

/* The Flatsome card row sits in the wrapper's own padding, so its column gutter is pulled back. */
.cmev-related > .row {
	width: auto;
	max-width: none;
	margin-left: -15px;
	margin-right: -15px;
}

/* Fallback list for themes without the Flatsome article cards. */
.cmev-wrap ul.cmev-related__list {
	margin: 0;
	padding: 0;
	overflow: hidden;
	border-radius: var(--cmev-radius);
	background: var(--cmev-card);
	box-shadow: var(--cmev-shadow);
	list-style: none;
}

.cmev-wrap .cmev-related__list li {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	margin: 0;
	padding: 14px 20px;
	border-top: 1px solid var(--cmev-line);
}

.cmev-wrap .cmev-related__list li:first-child {
	border-top: 0;
}

.cmev-wrap .cmev-related__list a {
	color: var(--cmev-text);
	font-weight: 600;
	text-decoration: none;
}

.cmev-wrap .cmev-related__list a:hover {
	color: var(--cmev-accent);
}

.cmev-related__list time {
	flex: 0 0 auto;
	color: var(--cmev-muted);
	font-size: 0.85em;
	white-space: nowrap;
}

/* ---------- Smaller screens ---------- */

@media (min-width: 850px) {
	.cmev-details {
		position: sticky;
		top: 100px;
	}
}

@media (max-width: 849px) {
	.cmev-wrap {
		padding: 24px 15px 44px;
	}

	.cmev-layout {
		display: block;
	}

	.cmev-side {
		margin: 0 0 24px;
	}

	.cmev-banner {
		grid-template-columns: minmax(0, 1fr);
	}

	.cmev-banner__intro {
		padding: 24px 20px 26px;
	}

	.cmev-banner .cmev-list > .cmev-row {
		padding: 16px 20px;
	}
}

@media (max-width: 599px) {
	.cmev-filters {
		justify-content: flex-start;
	}

	.cmev-wrap .cmev-list > .cmev-row,
	.cmev-shortcode .cmev-list > .cmev-row,
	.cmev-banner .cmev-list > .cmev-row {
		grid-template-columns: minmax(0, 1fr) auto;
		padding: 14px 16px;
	}

	.cmev-row__main {
		grid-column: 1 / -1;
		grid-row: 2;
	}

	.cmev-row__cat {
		justify-self: end;
	}

	.cmev-row .cmev-badge {
		display: table;
		margin: 4px 0 0;
	}

	.cmev-wrap .cmev-related__list li {
		flex-direction: column;
		gap: 2px;
	}
}
