/* ==========================================================================
   JA Canada Events Widget — frontend
   Scoped under .jace-widget. Brand: Montserrat, navy #1B3C4F, teal #2A7C7B.
   v1.0.1 — fixes: oval arrows, image prominence, location leading-space, alignment
   ========================================================================== */

.jace-widget {
	--jace-navy: #1B3C4F;
	--jace-teal: #2A7C7B;
	--jace-light-teal: #5EC4C6;
	--jace-text: #1B3C4F;
	--jace-muted: #6b7280;
	--jace-border: #e5e7eb;

	font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	color: var(--jace-text);
	background: transparent;
	max-width: 1200px;
	margin: 0 auto;
}

.jace-widget *,
.jace-widget *::before,
.jace-widget *::after {
	box-sizing: border-box;
}

/* -------- Toolbar -------- */
.jace-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 0;
	border-bottom: 1px solid var(--jace-border);
	margin-bottom: 32px;
	gap: 16px;
	flex-wrap: wrap;
}

.jace-toolbar-left,
.jace-toolbar-right {
	display: flex;
	align-items: center;
	gap: 12px;
}

/* -------- Arrow buttons --------
   Aggressive resets so Elementor / theme button defaults can't squish or
   stretch the circle. width / height / aspect-ratio / min / max all locked.
*/
.jace-widget button.jace-arrow {
	flex: 0 0 36px !important;
	width: 36px !important;
	height: 36px !important;
	min-width: 36px !important;
	min-height: 36px !important;
	max-width: 36px !important;
	max-height: 36px !important;
	padding: 0 !important;
	margin: 0 !important;
	border: none !important;
	border-radius: 50% !important;
	aspect-ratio: 1 / 1 !important;
	box-shadow: none !important;
	line-height: 1 !important;
	box-sizing: border-box !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	background: var(--jace-light-teal) !important;
	color: var(--jace-navy) !important;
	cursor: pointer;
	transition: background .2s ease, color .2s ease, transform .15s ease;
	font-size: 0;
	text-transform: none;
	letter-spacing: 0;
}

.jace-widget button.jace-arrow svg {
	width: 14px !important;
	height: 14px !important;
	flex-shrink: 0;
	display: block;
	fill: currentColor;
	pointer-events: none;
}

.jace-widget button.jace-arrow:hover:not(:disabled) {
	background: var(--jace-teal) !important;
	color: #fff !important;
	transform: translateY(-1px);
}

.jace-widget button.jace-arrow:disabled {
	opacity: .35;
	cursor: not-allowed;
}

/* -------- Today / dropdowns -------- */
.jace-widget .jace-today-btn {
	padding: 7px 16px;
	border: 1px solid var(--jace-navy);
	border-radius: 4px;
	background: transparent;
	font-weight: 700;
	font-size: 12px;
	letter-spacing: 0.06em;
	cursor: pointer;
	color: var(--jace-navy);
	text-transform: uppercase;
	font-family: inherit;
	line-height: 1.4;
	transition: background .2s ease, color .2s ease;
}

.jace-widget .jace-today-btn:hover {
	background: var(--jace-navy);
	color: #fff;
}

.jace-widget .jace-month-select,
.jace-widget .jace-province-select {
	border: none;
	background-color: transparent;
	font-weight: 700;
	text-transform: uppercase;
	font-size: 12px;
	letter-spacing: 0.06em;
	color: var(--jace-navy);
	padding: 6px 22px 6px 4px;
	cursor: pointer;
	font-family: inherit;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'><path d='M6 8L0 0h12z' fill='%231B3C4F'/></svg>");
	background-repeat: no-repeat;
	background-position: right 4px center;
	background-size: 9px;
}

.jace-widget .jace-month-select:focus,
.jace-widget .jace-province-select:focus,
.jace-widget .jace-today-btn:focus,
.jace-widget button.jace-arrow:focus {
	outline: 2px solid var(--jace-light-teal);
	outline-offset: 2px;
}

/* -------- Events list -------- */
.jace-events-list {
	display: flex;
	flex-direction: column;
	gap: 40px;
}

/* Grid columns:
   col 1 (60px)            = date (DAY / DD)
   col 2 (28px)            = teal divider centered
   col 3 (1.1fr)           = text content
   col 4 (1fr, min 380px)  = image — large for prominence; aspect-ratio enforced
   align-items: start prevents the divider/image stretching from causing visual overlap
*/
.jace-event {
	display: grid;
	grid-template-columns: 60px 28px minmax(0, 1.1fr) minmax(380px, 1fr);
	gap: 0 24px;
	align-items: start;
}

.jace-event-date-col {
	padding-top: 4px;
	text-align: center;
}

.jace-event-day {
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--jace-navy);
}

.jace-event-num {
	font-size: 32px;
	font-weight: 800;
	color: var(--jace-navy);
	line-height: 1;
	margin-top: 6px;
}

/* Divider sits in its own grid column, centered, stretches with the row. */
.jace-event-divider {
	width: 3px;
	background: var(--jace-light-teal);
	border-radius: 2px;
	align-self: stretch;
	justify-self: center;
	margin: 4px 0;
}

.jace-event-content {
	min-width: 0;
	padding-top: 4px;
}

.jace-event-meta-row {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	min-height: 24px;
}

.jace-event-featured-tag {
	display: inline-block;
	background: var(--jace-teal);
	color: #fff;
	padding: 5px 14px;
	border-radius: 4px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	line-height: 1;
}

.jace-event-meta {
	font-size: 13px;
	color: var(--jace-navy);
	font-weight: 600;
}

.jace-event-title {
	font-size: 22px;
	font-weight: 800;
	text-transform: uppercase;
	margin: 12px 0 8px;
	color: var(--jace-navy);
	line-height: 1.2;
	letter-spacing: 0.01em;
}

.jace-event-title a {
	color: inherit;
	text-decoration: none;
	transition: color .2s ease;
}

.jace-event-title a:hover {
	color: var(--jace-teal);
}

/* Location: only add the gap between name and address when both exist —
   adjacent-sibling selector prevents a leading space when venue name is empty. */
.jace-event-location {
	font-size: 14px;
	margin: 0 0 14px;
	line-height: 1.4;
}

.jace-event-location-name {
	font-weight: 700;
	color: var(--jace-navy);
}

.jace-event-location-address {
	color: var(--jace-navy);
}

.jace-event-location-name + .jace-event-location-address {
	margin-left: 6px;
}

.jace-event-description {
	font-size: 14px;
	color: var(--jace-navy);
	line-height: 1.55;
	margin: 0;
}

/* -------- Image: large, uniform, object-fit: cover --------
   aspect-ratio + grid column width together guarantee every image
   in the list renders at the exact same dimensions.
*/
.jace-event-image {
	display: block;
	overflow: hidden;
	border-radius: 4px;
	aspect-ratio: 16 / 11;
	background: #0a0a0a;
	width: 100%;
	align-self: start;
}

.jace-event-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	display: block;
	margin: 0;
	transition: transform .4s ease;
}

.jace-event-image:hover img {
	transform: scale(1.03);
}

/* If a card has no image, let content span across the image column. */
.jace-event--no-image .jace-event-content {
	grid-column: 3 / span 2;
}

/* -------- States -------- */
.jace-loading,
.jace-empty {
	text-align: center;
	padding: 60px 20px;
	color: var(--jace-muted);
	font-size: 14px;
}

.jace-events-list.is-loading {
	opacity: .5;
	pointer-events: none;
	transition: opacity .2s ease;
}

/* -------- See all button -------- */
.jace-see-all {
	text-align: center;
	margin-top: 48px;
}

.jace-see-all-btn {
	display: inline-block;
	background: var(--jace-navy);
	color: #fff;
	padding: 13px 38px;
	border-radius: 999px;
	text-decoration: none;
	font-weight: 600;
	font-size: 14px;
	transition: background .2s ease, transform .15s ease;
}

.jace-see-all-btn:hover,
.jace-see-all-btn:focus {
	background: var(--jace-teal);
	color: #fff;
	transform: translateY(-1px);
}

/* -------- Tablet -------- */
@media (max-width: 1024px) {
	.jace-event {
		grid-template-columns: 60px 24px minmax(0, 1fr) minmax(320px, .9fr);
		gap: 0 18px;
	}
}

/* -------- Mobile: stack image below text -------- */
@media (max-width: 760px) {
	.jace-event {
		grid-template-columns: 56px 20px minmax(0, 1fr);
		gap: 0 14px;
	}

	.jace-event-image {
		grid-column: 1 / -1;
		margin-top: 18px;
		aspect-ratio: 16 / 9;
	}

	.jace-event--no-image .jace-event-content {
		grid-column: 3 / span 1;
	}

	.jace-event-title {
		font-size: 18px;
	}

	.jace-event-num {
		font-size: 26px;
	}
}

@media (max-width: 600px) {
	.jace-toolbar {
		flex-direction: column;
		align-items: flex-start;
	}

	.jace-toolbar-right {
		width: 100%;
		justify-content: flex-end;
	}
}
