/* Event cards in list_common.tpl's card view (Steve, 2026-11-18).
   Photo on top, then category + date, title, time and place. Colours come from colors.css tokens, so the cards follow
   the light, dark and high-contrast themes; a promoter's own colours (list_common.tpl sets --ts-card-* inline) win.
   New class names (ts-card-*), so the old .event-card / .card-* rules and their dark-theme overrides don't apply. */

/* 3 / 2 / 1 columns, every card in a row the same height (Bootstrap 3 columns inside a flex row). */
.ts-card-grid {
	display: flex;
	flex-wrap: wrap;
}
.ts-card-grid::before,
.ts-card-grid::after {
	display: none; /* Bootstrap 3's clearfix would become flex items */
}
.ts-card-grid > .event-card-container {
	display: flex;
	margin-bottom: 24px;
}

.ts-card {
	--ts-card-bg: var(--white);
	--ts-card-text: var(--black);
	--ts-card-muted: var(--grey-dark);
	--ts-card-accent: var(--green-secondary);
	--ts-card-line: var(--grey-tertiary);
	--ts-card-title: var(--green-primary);
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	overflow: hidden;
	border: 1px solid var(--ts-card-line);
	border-radius: 14px;
	background-color: var(--ts-card-bg);
	color: var(--ts-card-text);
	transition: transform .2s ease, box-shadow .2s ease;
}
.ts-card:hover,
.ts-card:focus-within {
	transform: translateY(-3px);
	box-shadow: 0 10px 24px var(--black-10, rgba(0, 0, 0, .1));
}
@media (prefers-reduced-motion: reduce) {
	.ts-card, .ts-card:hover, .ts-card:focus-within { transition: none; transform: none; }
}

/* Photo: same 2:1 shape for every card, cropped from the top so faces stay in. */
.ts-card-photo {
	aspect-ratio: 2 / 1;
	overflow: hidden;
	background-color: var(--grey-tetradic);
}
.ts-card-photo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center top;
}

/* DRAFT / SOLD OUT etc. over the photo */
.ts-card-status {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 2;
}

.ts-card-body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 10px;
	padding: 16px 18px 18px;
}

.ts-card-meta {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	font-size: 13px;
	line-height: 1.3;
	text-transform: uppercase;
	letter-spacing: .02em;
}
.ts-card-category {
	min-width: 0;
	overflow: hidden;
	color: var(--ts-card-accent);
	font-weight: 600;
	white-space: nowrap;
	text-overflow: ellipsis;
}
.ts-card-date {
	margin-left: auto;
	color: var(--ts-card-muted);
	font-weight: 600;
	white-space: nowrap;
}

/* The title's link covers the whole card (one clear link name for screen readers). */
.ts-card h2.ts-card-title {
	display: -webkit-box;
	margin: 0;
	overflow: hidden;
	color: var(--ts-card-title) !important; /* primary green; the dark theme forces h2 colours */
	font-size: 18px !important; /* custom.css forces every h2 to 22px !important */
	font-weight: 700;
	line-height: 1.3;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
}
.ts-card-title a,
.ts-card-title a:hover,
.ts-card-title a:focus {
	color: inherit !important;
	font-weight: inherit; /* custom.css gives every link 400 */
	text-decoration: none;
}
.ts-card-title a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	border-radius: 14px;
}
.ts-card-title a:focus-visible {
	outline: none;
}
.ts-card-title a:focus-visible::after {
	outline: 3px solid var(--ts-card-accent);
	outline-offset: -3px;
}

.ts-card-facts {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 15px;
	line-height: 1.35;
}
.ts-card-facts li {
	display: flex;
	gap: 10px;
	min-width: 0;
}
.ts-card-facts li > i {
	flex: 0 0 18px;
	margin-top: 2px;
	color: var(--ts-card-muted);
	text-align: center;
}
.ts-card-facts li > span {
	min-width: 0;
}
.ts-card-venue,
.ts-card-town {
	display: block;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}
.ts-card-town {
	color: var(--ts-card-muted);
	font-size: 13px;
}
/* Headliners: one line, cut with … when long (the full list is on the event page) */
.ts-card-headliners > span {
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	font-weight: 600;
}

/* Phones: Get Tickets (or Manage / View for the promoter) under the card, above the title link */
.ts-card-actions {
	position: relative;
	z-index: 2;
	display: flex;
	margin-top: auto;
	border-top: 1px solid var(--ts-card-line);
}
.ts-card-actions a {
	flex: 1 1 0;
	padding: 12px;
	background-color: var(--ts-card-button, var(--green-primary));
	color: var(--white) !important;
	font-weight: 600;
	text-align: center;
	text-decoration: none !important;
}
.ts-card-actions a + a {
	border-left: 1px solid var(--ts-card-line);
}
/* Dark theme (admin only today): --green-primary is a near-black there, so titles use the bright green */
[data-theme="dark"] .ts-card {
	--ts-card-title: var(--green-tertiary);
}
/* Dark theme: the bright green with dark text (--white is the dark tone there) */
[data-theme="dark"] .ts-card-actions a {
	background-color: var(--ts-card-button, var(--green-secondary));
}
/* Tablets and up: like the old cards, the buttons slide up over the bottom of the card on hover, or when a
   keyboard user tabs into the card. Phones keep them showing under the card. */
@media (min-width: 768px) {
	/* Room for the buttons, so they never cover the venue or town */
	.ts-card-body {
		padding-bottom: 60px;
	}
	.ts-card-actions {
		position: absolute;
		right: 0;
		bottom: 0;
		left: 0;
		transform: translateY(100%);
		transition: transform .25s ease;
	}
	.ts-card:hover .ts-card-actions,
	.ts-card:focus-within .ts-card-actions {
		transform: translateY(0);
	}
}
@media (min-width: 768px) and (prefers-reduced-motion: reduce) {
	.ts-card-actions { transition: none; }
}
