/**
 * WarTable tournament cards: [wk_event_calendar]
 * Upcoming cards, divider, past cards with pagination.
 * Card: image | title, place and date, text | price, highlights, button, sponsor.
 * Fonts come from the theme. Colours can be changed with the variables below.
 */

.wk-tournaments,
.wk-cards {
	--wk-border: #e2e2e2;
	--wk-muted: #666;
	--wk-strong: #111;
	--wk-button-bg: #333;
	--wk-button-hover: #27514b;
	--wk-closed-bg: #c7c7c7;
	--wk-divider: #27514b;
}

.wk-cards {
	display: flex;
	flex-direction: column;
}

.wk-card {
	display: grid;
	grid-template-columns: 180px minmax(0, 1fr) minmax(170px, 250px);
	gap: 1.5rem 2rem;
	align-items: start;
	padding: 1.75rem 0;
	border-bottom: 1px solid var(--wk-border);
}

.wk-card:last-child {
	border-bottom: 0;
}

/* No image at all: text and side column only */
.wk-card.wk-card--no-image {
	grid-template-columns: minmax(0, 1fr) minmax(170px, 250px);
}

/* Image */
.wk-card__image img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 4px;
}

/* Title, place and date, text (resets Divi's default heading and paragraph spacing) */
.wk-card .wk-card__title {
	margin: 0 0 0.4rem;
	padding: 0;
	font-size: 30px;
	line-height: 1.2;
}

.wk-card .wk-card__title a {
	color: inherit;
	text-decoration: none;
}

.wk-card .wk-card__meta {
	margin: 0 0 1rem;
	padding: 0;
	font-weight: 600;
	color: #444;
}

.wk-card .wk-card__organiser {
	margin: -0.6rem 0 1rem;
	padding: 0;
	color: var(--wk-muted);
	font-size: 13px;
}

/* External ticket link: small arrow */
.buy-ticket.wk-external::after {
	content: "\2197";
	margin-left: 0.35em;
}

.wk-card .wk-card__text p {
	margin: 0 0 1em;
	padding: 0;
}

.wk-card .wk-card__text p:last-child {
	margin-bottom: 0;
}

/* Price, highlights, button, sponsor */
.wk-card__side {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 0.9rem;
	text-align: right;
}

.wk-card .wk-card__price {
	margin: 0;
	padding: 0;
	color: var(--wk-muted);
}

.wk-card .wk-card__price del {
	margin-right: 0.35em;
	opacity: 0.7;
}

.wk-card ul.wk-card__highlights {
	display: flex;
	flex-direction: column;
	gap: 0.9rem;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
	font-weight: 700;
	color: var(--wk-strong);
}

.wk-card ul.wk-card__highlights li {
	margin: 0;
	padding: 0;
}

.wk-card .buy-ticket {
	display: inline-block;
	margin: 0;
	padding: 0.7em 1.4em;
	border: 0;
	border-radius: 999px;
	background: var(--wk-button-bg);
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	transition: background 0.2s ease;
}

.wk-card a.buy-ticket:hover,
.wk-card a.buy-ticket:focus {
	background: var(--wk-button-hover);
	color: #fff;
}

.wk-card .buy-ticket.wk-sales-closed,
.wk-card .buy-ticket.wk-sales-closed:hover {
	background: var(--wk-closed-bg);
	color: #333;
	cursor: default;
}

.wk-card__sponsor img {
	display: block;
	max-width: 240px;
	width: 100%;
	height: auto;
}

/* Tablet: image + text, side column below */
@media (max-width: 980px) {
	.wk-card {
		grid-template-columns: 140px minmax(0, 1fr);
	}

	.wk-card__side {
		grid-column: 1 / -1;
		align-items: flex-start;
		text-align: left;
	}

	.wk-card.wk-card--no-image {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* Phone: everything stacked */
@media (max-width: 600px) {
	.wk-card {
		grid-template-columns: minmax(0, 1fr);
	}

	.wk-card__image {
		max-width: 260px;
	}

	.wk-card .wk-card__title {
		font-size: 24px;
	}
}

.wk-cards-empty {
	text-align: center;
	color: var(--wk-muted, #666);
}

/* ---------- Divider between upcoming and past tournaments ---------- */

.wk-divider {
	display: flex;
	align-items: center;
	gap: 1.25rem;
	margin: 3.5rem 0 0.75rem;
}

.wk-divider::before,
.wk-divider::after {
	content: "";
	flex: 1;
	border-top: 2px solid var(--wk-divider);
}

.wk-divider .wk-divider__title {
	margin: 0;
	padding: 0;
	font-size: 32px;
	line-height: 1.2;
	text-align: center;
}

/* ---------- Past tournaments ---------- */

.wk-card--past .wk-card__played {
	margin: 0;
	padding: 0.3em 1em;
	border: 1px solid var(--wk-border);
	border-radius: 999px;
	color: var(--wk-muted);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.4;
}

/* ---------- Pagination ---------- */

.wk-pagination {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.4rem;
	margin: 1.75rem 0 0;
}

.wk-pagination .page-numbers {
	display: inline-block;
	min-width: 2.4em;
	padding: 0.4em 0.9em;
	border: 1px solid var(--wk-border);
	border-radius: 999px;
	color: #333;
	line-height: 1.4;
	text-align: center;
	text-decoration: none;
}

.wk-pagination a.page-numbers:hover,
.wk-pagination a.page-numbers:focus {
	border-color: var(--wk-button-bg);
}

.wk-pagination .page-numbers.current {
	border-color: var(--wk-button-bg);
	background: var(--wk-button-bg);
	color: #fff;
}

.wk-pagination .page-numbers.dots {
	border: 0;
}

@media (max-width: 600px) {
	.wk-divider .wk-divider__title {
		font-size: 24px;
	}
}
