/*
 * Activity archive — grid styles
 * Enqueued by archive-activity.php
 */

.cjdng-aca {
	--cjdng-aca-accent: var(--e-global-color-primary, #2563eb);
	--cjdng-aca-accent-soft: color-mix(in srgb, var(--cjdng-aca-accent) 9%, transparent);
	--cjdng-aca-text: var(--e-global-color-text, #1f2937);
	--cjdng-aca-muted: color-mix(in srgb, var(--cjdng-aca-text) 60%, transparent);
	--cjdng-aca-border: #e5e7eb;
	--cjdng-aca-bg: #fafbfd;

	font-family: var(--e-global-typography-text-font-family, inherit);
	color: var(--cjdng-aca-text);

	/* Break out of Astra's narrow content column to use the full viewport. */
	position: relative;
	left: 50%;
	right: 50%;
	margin-left: -50vw;
	margin-right: -50vw;
	width: 100vw;
	max-width: 100vw;
	box-sizing: border-box;
	padding: 2rem max(1.25rem, calc(50vw - 600px)) 3rem;
}

.cjdng-aca-header {
	margin-bottom: 1.75rem;
	text-align: center;
}

.cjdng-aca-title {
	font-family: var(--e-global-typography-primary-font-family, inherit);
	font-weight: var(--e-global-typography-primary-font-weight, 600);
	font-size: clamp(1.6rem, 2.4vw, 2.1rem);
	color: var(--cjdng-aca-text);
	margin: 0 0 0.5rem;
}

.cjdng-aca-intro {
	color: var(--cjdng-aca-muted);
	font-size: 1rem;
	margin: 0 auto;
	max-width: 640px;
}

.cjdng-aca-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4rem 0.45rem;
	margin: 0 0 1.5rem;
	padding: 0.85rem 1rem;
	background: #fff;
	border: 1px solid var(--cjdng-aca-border);
	border-radius: 12px;
}

.cjdng-aca-filter-label {
	font-size: 0.78rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--cjdng-aca-muted);
	font-weight: 600;
	margin: 0 0.2rem 0 0.35rem;
}

.cjdng-aca-filter-sep {
	color: var(--cjdng-aca-border);
	margin: 0 0.25rem;
	user-select: none;
}

.cjdng-aca-chip {
	display: inline-flex;
	align-items: center;
	padding: 0.32rem 0.7rem;
	border-radius: 999px;
	background: var(--cjdng-aca-bg);
	border: 1px solid var(--cjdng-aca-border);
	color: var(--cjdng-aca-text);
	text-decoration: none;
	font-size: 0.85rem;
	font-weight: 500;
	line-height: 1.2;
	transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.cjdng-aca-chip:hover,
.cjdng-aca-chip:focus {
	border-color: var(--cjdng-aca-accent);
	color: var(--cjdng-aca-accent);
}

.cjdng-aca-chip.is-active {
	background: var(--cjdng-aca-accent);
	color: #fff;
	border-color: var(--cjdng-aca-accent);
}

.cjdng-aca-chip-all {
	font-weight: 600;
}

.cjdng-aca-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 1.5rem;
}

.cjdng-aca-card {
	background: #fff;
	border: 1px solid var(--cjdng-aca-border);
	border-radius: 12px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.cjdng-aca-card:hover,
.cjdng-aca-card:focus-within {
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.cjdng-aca-thumb {
	position: relative;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: var(--cjdng-aca-bg);
	display: block;
}

.cjdng-aca-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.cjdng-aca-thumb-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	width: 100%;
	height: 100%;
	color: var(--cjdng-aca-muted);
	font-size: 0.85rem;
	background:
		linear-gradient(135deg, var(--cjdng-aca-accent-soft) 0%, transparent 70%),
		var(--cjdng-aca-bg);
}

.cjdng-aca-thumb-placeholder::before {
	content: "";
	width: 36px;
	height: 36px;
	background: var(--cjdng-aca-accent);
	opacity: 0.35;
	-webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.6'><rect x='3' y='5' width='18' height='14' rx='2'/><circle cx='9' cy='10' r='1.7'/><path d='M21 17l-5-6-4 5-2-2-7 6'/></svg>") center/contain no-repeat;
	        mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.6'><rect x='3' y='5' width='18' height='14' rx='2'/><circle cx='9' cy='10' r='1.7'/><path d='M21 17l-5-6-4 5-2-2-7 6'/></svg>") center/contain no-repeat;
}

.cjdng-aca-body {
	padding: 1rem 1.1rem 1.15rem;
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
	flex: 1;
}

.cjdng-aca-name {
	font-family: var(--e-global-typography-primary-font-family, inherit);
	font-weight: 600;
	font-size: 1.15rem;
	margin: 0;
	line-height: 1.25;
}

.cjdng-aca-name a {
	color: var(--cjdng-aca-text);
	text-decoration: none;
}

.cjdng-aca-name a:hover,
.cjdng-aca-name a:focus {
	color: var(--cjdng-aca-accent);
}

.cjdng-aca-centre {
	font-size: 0.88rem;
	color: var(--cjdng-aca-muted);
}

.cjdng-aca-centre a {
	color: inherit;
	text-decoration: none;
	border-bottom: 1px dotted currentColor;
}

.cjdng-aca-centre a:hover,
.cjdng-aca-centre a:focus {
	color: var(--cjdng-aca-accent);
}

.cjdng-aca-schedule {
	font-size: 0.92rem;
	color: var(--cjdng-aca-text);
	line-height: 1.35;
}

/* Activity type rendered inline next to the title, separated by " · ".
   Lighter weight than the title so the title remains the visual focus. */
.cjdng-aca-type-inline {
	font-weight: 400;
	color: var(--cjdng-aca-muted);
	font-size: 0.85em;
}

/* Audience pills — neutral outline style (not pink) so they stay quiet.
   Multiple terms render side-by-side, capped at 2 by the helper. */
.cjdng-aca-audience {
	display: flex;
	flex-wrap: wrap;
	gap: 0.3rem;
	margin-top: 0.15rem;
}

.cjdng-aca-audience-pill {
	font-size: 0.75rem;
	padding: 0.16rem 0.55rem;
	border-radius: 999px;
	background: #fff;
	color: var(--cjdng-aca-muted);
	border: 1px solid var(--cjdng-aca-border);
	white-space: nowrap;
}

.cjdng-aca-price-free .cjdng-aca-price-amount {
	color: #16a34a;
}

.cjdng-aca-price-hint {
	font-size: 0.75rem;
	color: var(--cjdng-aca-muted);
	display: block;
	margin-top: 0.15rem;
}

.cjdng-aca-card.is-ended {
	opacity: 0.65;
}

.cjdng-aca-footer {
	margin-top: auto;
	padding-top: 0.75rem;
	border-top: 1px solid var(--cjdng-aca-border);
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 0.75rem;
	flex-wrap: wrap;
}

.cjdng-aca-price {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
}

.cjdng-aca-price-label {
	font-size: 0.72rem;
	color: var(--cjdng-aca-muted);
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.cjdng-aca-price-amount {
	font-family: var(--e-global-typography-primary-font-family, inherit);
	font-weight: 700;
	font-size: 1.05rem;
	color: var(--cjdng-aca-text);
}

.cjdng-aca-price-unit {
	font-size: 0.85rem;
	color: var(--cjdng-aca-muted);
	font-weight: 500;
	margin-left: 0.15rem;
}

.cjdng-aca-cta {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.55rem 0.9rem;
	background: var(--cjdng-aca-accent);
	color: #fff;
	border-radius: 8px;
	font-weight: 600;
	font-size: 0.9rem;
	text-decoration: none;
	transition: opacity 0.15s ease;
}

.cjdng-aca-cta:hover,
.cjdng-aca-cta:focus {
	opacity: 0.88;
	color: #fff;
}

.cjdng-aca-empty {
	text-align: center;
	padding: 3rem 1rem;
	color: var(--cjdng-aca-muted);
}

/*
 * Row layout (M1.35)
 * Desktop (≥601px): vertical list of horizontal rows
 *   .grid is a flex column, each .card is row flex with image left + body grid right
 *   .body uses CSS Grid to keep content stacked left while pinning .footer to col 2
 * Mobile (≤600px): inherit the default vertical-card styles above (no override block)
 */
@media (min-width: 601px) {
	.cjdng-aca-grid {
		display: flex;
		flex-direction: column;
		gap: 1rem;
	}

	.cjdng-aca-card {
		flex-direction: row;
		align-items: stretch;
	}

	.cjdng-aca-thumb {
		flex: 0 0 220px;
		max-width: 220px;
		/* aspect-ratio: 4/3 inherited — height auto-derives to ~165px */
	}

	.cjdng-aca-body {
		display: grid;
		grid-template-columns: 1fr auto;
		grid-template-rows: auto auto auto auto;
		gap: 0.45rem 1.5rem;
		padding: 0.95rem 1.25rem;
		align-content: center;
	}

	.cjdng-aca-name,
	.cjdng-aca-centre,
	.cjdng-aca-schedule,
	.cjdng-aca-audience {
		grid-column: 1;
		margin: 0;
	}

	.cjdng-aca-footer {
		grid-column: 2;
		grid-row: 1 / -1;
		margin-top: 0;
		padding-top: 0;
		border-top: 0;
		border-left: 1px solid var(--cjdng-aca-border);
		padding-left: 1.25rem;
		flex-direction: column;
		align-items: flex-end;
		justify-content: center;
		gap: 0.7rem;
		min-width: 150px;
	}

	.cjdng-aca-price {
		align-items: flex-end;
		text-align: right;
	}
}

/* Activities Program PDF link (shared look on hub + activities archive) */
.cjdng-program-pdf {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	margin: 0.25rem 0 1.5rem;
	padding: 0.5rem 0.95rem;
	border: 1px solid var(--e-global-color-primary, #2563eb);
	border-radius: 8px;
	font-weight: 600;
	font-size: 0.9rem;
	text-decoration: none;
	color: var(--e-global-color-primary, #2563eb);
	background: #fff;
	transition: background 0.15s ease, color 0.15s ease;
}
.cjdng-program-pdf:hover,
.cjdng-program-pdf:focus {
	background: var(--e-global-color-primary, #2563eb);
	color: #fff;
}
.cjdng-program-archive {
	margin: 0.5rem 0 1.5rem;
	font-size: 0.9rem;
}
.cjdng-program-archive-label {
	display: block;
	font-weight: 600;
	color: color-mix(in srgb, var(--e-global-color-text, #1f2937) 65%, transparent);
	margin-bottom: 0.3rem;
}
.cjdng-program-archive ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.3rem 1rem;
}
.cjdng-program-archive a {
	color: var(--e-global-color-primary, #2563eb);
	text-decoration: underline;
}

/* Link between the current listing and its Archives (past activities) view */
.cjdng-aca-archives-link {
	margin: -0.5rem 0 1.25rem;
	font-size: 0.9rem;
}
.cjdng-aca-archives-link a {
	color: var(--cjdng-aca-muted);
	text-decoration: underline;
}
.cjdng-aca-archives-link a:hover {
	color: var(--cjdng-aca-accent);
}
