/*
 * Events Design Kit — event list shortcode
 * ---------------------------------------------------------------------------
 * Styles "Events Shortcodes For The Events Calendar" ([events-calendar-templates]),
 * which renders .ect-* markup rather than The Events Calendar's own views.
 * Loaded only on pages that contain the shortcode.
 *
 * Turns the default horizontal rows into a three-column card grid: square
 * image on top, date badge overlaid on it, text beneath.
 *
 * SPECIFICITY
 * Two stylesheets have to be beaten, and both use an ID:
 *   theme   .tribe...  #ect-events-list-content h2.ect-list-title a.ect-event-url
 *   plugin  #ect-events-list-content .ect-list-post.style-2 .ect-rate-area
 * Everything below is therefore scoped to #ect-events-list-content with at
 * least as many classes, and forced with !important where those rules are.
 */

/* Grid --------------------------------------------------------------------- */

#ect-events-list-content #list-wrp.ect-list-wrapper {
	display: grid !important;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
	max-width: 1180px !important;
	margin: 0 auto !important;
	padding: 0 24px !important;
}

/* Card --------------------------------------------------------------------- */

#ect-events-list-content .ect-list-post,
#ect-events-list-content .ect-list-post.style-2 {
	position: relative;
	display: flex !important;
	flex-direction: column !important;
	width: 100% !important;
	height: 100%;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	gap: 0 !important;
	background: var(--edk-surface, #fff) !important;
	border: 1px solid var(--edk-line, #E8E4DC) !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	overflow: hidden;
	transition: border-color .3s ease, box-shadow .3s ease;
}

#ect-events-list-content .ect-list-post:hover {
	border-color: var(--edk-accent, #80764E) !important;
	box-shadow: 0 14px 34px rgba(0, 0, 0, .09) !important;
}

/* Square featured image ----------------------------------------------------- */

/* The plugin gives this z-index:9, which paints the photo over the date badge
   and leaves the date invisible until a hover changes the stacking. */
#ect-events-list-content .ect-list-post .ect-list-post-left {
	width: 100% !important;
	min-height: 0 !important;
	overflow: hidden;
	z-index: 1 !important;
}

#ect-events-list-content .ect-list-post .ect-list-post-left:hover {
	filter: none !important;
	-webkit-filter: none !important;
}

#ect-events-list-content .ect-list-post .ect-list-img,
#ect-events-list-content .ect-list-post.style-2 .ect-list-img {
	width: 100% !important;
	height: auto !important;
	min-height: 0 !important;
	aspect-ratio: 1 / 1;
	border-radius: 0 !important;
	padding: 0 !important;
	transition: transform .5s ease;
}

#ect-events-list-content .ect-list-post:hover .ect-list-img {
	transform: scale(1.04);
}

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

#ect-events-list-content .ect-list-post .ect-list-post-right {
	width: 100% !important;
	display: block !important;
	flex: 1 1 auto;
}

#ect-events-list-content .ect-list-post .ect-list-post-right-table {
	display: flex !important;
	flex-direction: column !important;
	width: 100% !important;
	height: 100% !important;
}

#ect-events-list-content .ect-list-post .ect-list-description,
#ect-events-list-content .ect-list-post-right .ect-list-description {
	width: 100% !important;
	height: auto !important;
	display: flex !important;
	flex-direction: column !important;
	align-items: flex-start !important;
	justify-content: flex-start !important;
	gap: 10px !important;
	padding: 24px 24px 26px !important;
	border: none !important;
	box-shadow: none !important;
	text-align: left !important;
}

/* Date badge, overlaid on the image ----------------------------------------
   The date markup is a sibling of the image deeper in the tree, so it is
   positioned against the card itself. Backgrounds are cleared on both outer
   wrappers so only one green shows. */

#ect-events-list-content .ect-list-post .modern-list-right-side {
	position: absolute;
	top: 0;
	left: 0;
	width: auto !important;
	height: auto !important;
	padding: 0 !important;
	margin: 0 !important;
	background: transparent !important;
	border: 0 !important;
	border-radius: 0 !important;
	z-index: 20;
}

#ect-events-list-content .ect-list-post .modern-list-right-side .ect-list-date {
	width: auto !important;
	height: auto !important;
	display: block !important;
	background: transparent !important;
	border: 0 !important;
	border-radius: 0 !important;
	padding: 0 !important;
	margin: 0 !important;
}

#ect-events-list-content .ect-list-post .ect-list-date .ect-date-area,
#ect-events-list-content .ect-list-post.style-2 .ect-list-date .ect-date-area {
	display: block !important;
	width: auto !important;
	min-width: 84px;
	background: var(--edk-primary, #04362F) !important;
	color: #ffffff !important;
	border: 0 !important;
	border-radius: 0 !important;
	padding: 14px 16px 12px !important;
	margin: 0 !important;
	text-align: center !important;
	font-size: 16px !important;
	line-height: 1 !important;
	letter-spacing: 0 !important;
}

#ect-events-list-content .ect-list-post.style-2 .ect-list-date .ect-date-area .ev-day {
	display: block !important;
	float: none !important;
	width: auto !important;
	margin: 0 0 5px !important;
	font-family: var(--edk-font-display, Georgia, serif) !important;
	font-size: 30px !important;
	font-weight: 400 !important;
	line-height: 1 !important;
	letter-spacing: 0 !important;
	color: #ffffff !important;
}

#ect-events-list-content .ect-list-post.style-2 .ect-list-date .ect-date-area .ev-mo,
#ect-events-list-content .ect-list-post.style-2 .ect-list-date .ect-date-area .ev-yr {
	display: inline-block !important;
	float: none !important;
	width: auto !important;
	margin: 0 !important;
	font-family: var(--edk-font-ui, Helvetica, Arial, sans-serif) !important;
	font-size: 10px !important;
	font-weight: 500 !important;
	line-height: 1.4 !important;
	letter-spacing: .12em !important;
	text-transform: uppercase !important;
	color: var(--edk-accent, #80764E) !important;
}

/* Title -------------------------------------------------------------------- */

#ect-events-list-content .ect-list-wrapper .ect-list-post h2.ect-list-title {
	margin: 0 !important;
	padding: 0 !important;
}

/* The plugin centres titles below 790px. That reads as inconsistent rather than
   centred, because the heading shrink-wraps its text inside a flex-start column:
   a short title fills one line and looks left aligned, while a title long enough
   to wrap fills the column and visibly centres. Pinned left at every width, and
   given a full-width box so the shrink-wrap can't reintroduce the difference.
   Deliberately outside a media query — the plugin's breakpoint is 790px and this
   file's is 767px, so a rule scoped to either would leave a gap between them. */
#ect-events-list-content .ect-list-wrapper .ect-list-post h2.ect-list-title,
#ect-events-list-content .ect-list-wrapper .ect-list-post h2.ect-list-title a,
#ect-events-list-content .ect-list-wrapper h2.ect-list-title a.ect-event-url {
	display: block !important;
	width: 100% !important;
	text-align: left !important;
}

#ect-events-list-content .ect-list-wrapper .ect-list-post h2.ect-list-title a,
#ect-events-list-content .ect-list-wrapper h2.ect-list-title a.ect-event-url {
	font-family: var(--edk-font-display, Georgia, serif) !important;
	font-size: 22px !important;
	font-weight: 400 !important;
	line-height: 1.25 !important;
	letter-spacing: 1px !important;
	text-transform: none !important;
	color: var(--edk-primary, #04362F) !important;
	border: 0 !important;
	text-decoration: none !important;
}

#ect-events-list-content .ect-list-wrapper h2.ect-list-title a.ect-event-url:hover {
	color: var(--edk-accent, #80764E) !important;
	filter: none !important;
	-webkit-filter: none !important;
}

/* Excerpt ------------------------------------------------------------------ */

#ect-events-list-content .ect-list-post .ect-list-description .ect-event-content,
#ect-events-list-content .ect-list-post .ect-list-description .ect-event-content p {
	display: block !important;
	width: 100% !important;
	font-family: var(--edk-font-body, Georgia, serif) !important;
	font-size: 13px !important;
	line-height: 1.65 !important;
	letter-spacing: 0 !important;
	color: var(--edk-body, #252525) !important;
	margin: 0 !important;
	padding: 0 !important;
	text-align: left !important;
}

/* Ticket price -------------------------------------------------------------
   The plugin lays this out as a full-width flex column, which stacks the
   ticket icon above the figure. Forced back to a shrink-wrapped row. */

#ect-events-list-content .ect-list-post .ect-rate-area,
#ect-events-list-content .ect-list-post.style-2 .ect-rate-area {
	display: inline-flex !important;
	flex-direction: row !important;
	align-items: center !important;
	align-self: flex-start !important;
	width: auto !important;
	gap: 7px;
	background: var(--edk-muted, #F7F6F3) !important;
	border: 1px solid var(--edk-line, #E8E4DC) !important;
	padding: 6px 12px !important;
	margin: 2px 0 0 !important;
	line-height: 1 !important;
}

#ect-events-list-content .ect-list-post .ect-rate-area .ect-icon,
#ect-events-list-content .ect-list-post .ect-rate-area .ect-icon i {
	width: auto !important;
	color: var(--edk-accent, #80764E) !important;
	font-size: 12px !important;
	line-height: 1 !important;
}

#ect-events-list-content .ect-list-post .ect-rate-area .ect-rate {
	font-family: var(--edk-font-ui, Helvetica, Arial, sans-serif) !important;
	font-size: 12px !important;
	font-weight: 500 !important;
	letter-spacing: .06em !important;
	line-height: 1 !important;
	color: var(--edk-primary, #04362F) !important;
}

/* Read more ---------------------------------------------------------------- */

#ect-events-list-content .ect-list-post a.ect-events-read-more,
#ect-events-list-content .ect-list-post.style-2 a.ect-events-read-more {
	display: inline-block !important;
	flex-direction: row !important;
	align-self: flex-start !important;
	width: auto !important;
	font-family: var(--edk-font-ui, Helvetica, Arial, sans-serif) !important;
	font-size: 11px !important;
	font-weight: 500 !important;
	line-height: 1 !important;
	letter-spacing: .16em !important;
	text-transform: uppercase !important;
	text-align: center !important;
	color: var(--edk-primary, #04362F) !important;
	background: transparent !important;
	border: 1px solid var(--edk-primary, #04362F) !important;
	border-radius: 0 !important;
	padding: 12px 20px !important;
	margin: 6px 0 0 !important;
	text-decoration: none !important;
	transition: .3s ease;
}

#ect-events-list-content .ect-list-post a.ect-events-read-more:hover {
	color: #ffffff !important;
	background: var(--edk-primary, #04362F) !important;
	border-color: var(--edk-primary, #04362F) !important;
}

/* Responsive --------------------------------------------------------------- */

@media (max-width: 1024px) {
	#ect-events-list-content #list-wrp.ect-list-wrapper {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 20px;
	}
}

@media (max-width: 767px) {
	#ect-events-list-content #list-wrp.ect-list-wrapper {
		grid-template-columns: minmax(0, 1fr);
		padding: 0 16px !important;
	}

	/* The plugin and theme both restack these at small widths; the card is
	   already a single column, so the overrides simply need repeating. */
	#ect-events-list-content .ect-list-post .ect-list-post-left,
	#ect-events-list-content .ect-list-post .ect-list-post-right,
	#ect-events-list-content .ect-list-post .ect-list-post-right-table {
		display: block !important;
		width: 100% !important;
		text-align: left !important;
	}

	#ect-events-list-content .ect-list-post .ect-list-post-right-table {
		display: flex !important;
		flex-direction: column !important;
	}

	#ect-events-list-content .ect-list-post .ect-list-description {
		align-items: flex-start !important;
		text-align: left !important;
		padding: 22px 20px 24px !important;
	}

	#ect-events-list-content .ect-list-post .modern-list-right-side .ect-list-date,
	#ect-events-list-content .ect-list-post .ect-list-date .ect-date-area {
		display: block !important;
		justify-content: flex-start !important;
		flex-wrap: nowrap !important;
	}

	#ect-events-list-content .ect-list-post.style-2 .ect-list-date .ect-date-area .ev-day {
		font-size: 26px !important;
	}

	/* Full width call to action on a single-column card. */
	#ect-events-list-content .ect-list-post a.ect-events-read-more,
	#ect-events-list-content .ect-list-post.style-2 a.ect-events-read-more {
		display: block !important;
		width: 100% !important;
		align-self: stretch !important;
		padding: 15px 20px !important;
		margin-top: 10px !important;
	}
}
