/*
 * Hellpdesk: the card grid (inc/cards.php). Loaded only on pages that show it, after hellpdesk.css,
 * so it uses the same tokens.
 *
 * 3 cards per row on computers, 2 on tablets, and on phones 1 big card or 2 small ones
 * (Settings → Hellpdesk → Home page).
 */

.hd-cards {
	margin-top: 32px;
}

/* Kadence indents lists inside page content; this one is a grid. */
.hd-cards ul.hd-cards__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 32px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.hd-cards--phone-two ul.hd-cards__grid {
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
}

@media (min-width: 768px) {
	.hd-cards ul.hd-cards__grid,
	.hd-cards--phone-two ul.hd-cards__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 32px;
	}
}

@media (min-width: 1025px) {
	.hd-cards ul.hd-cards__grid,
	.hd-cards--phone-two ul.hd-cards__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.hd-cards__item {
	margin: 0;
}

/* One card: the picture, then a slim ticket footer. The whole card is the link. */
.hd-card-tile {
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
	border-radius: var(--hd-radius-card);
	background: var(--hd-paper);
	box-shadow: var(--hd-shadow-ticket);
	color: var(--hd-ash);
	text-decoration: none;
	transition: transform .2s ease, box-shadow .2s ease;
}

.hd-card-tile:hover {
	transform: translateY(-2px);
	box-shadow: 0 24px 48px rgba(28, 22, 22, .18);
	color: var(--hd-ash);
	text-decoration: none;
}

.hd-card-tile:focus-visible {
	outline: 2px solid var(--hd-ember-deep);
	outline-offset: 3px;
}

.hd-card-tile__image {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	/* Wide cards (letters, editorials: 1200x630) show whole, on a bone band, instead of being cropped. */
	object-fit: contain;
	background: var(--hd-bone-2);
}

.hd-card-tile__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 4px 12px;
	margin-top: auto;
	padding: 14px 20px 16px;
	border-top: 2px solid var(--hd-charcoal);
	font-size: var(--hd-small);
	line-height: 1.3;
}

.hd-card-tile__dept {
	font: 600 var(--hd-label)/1.2 var(--hd-font);
	letter-spacing: .14em;
	text-transform: uppercase;
}

/* Two small cards per row on phones: smaller corners and footer, date only. */
@media (max-width: 767px) {
	.hd-cards--phone-two .hd-card-tile {
		border-radius: 12px;
	}

	.hd-cards--phone-two .hd-card-tile__meta {
		padding: 8px 12px 10px;
		font-size: 13px;
	}

	.hd-cards--phone-two .hd-card-tile__dept {
		display: none;
	}
}

/* "Load more", centred under the grid. Starts as a link, becomes a button (assets/js/cards.js). */
.hd-cards__more {
	display: flex;
	justify-content: center;
	margin-top: 40px;
}

.hd-cards__more .hd-cards__button {
	cursor: pointer;
	font-family: var(--hd-font);
}

.hd-cards__more .hd-cards__button[disabled] {
	cursor: progress;
	opacity: .6;
}

.hd-cards__done {
	margin: 40px 0 0;
	text-align: center;
	color: var(--hd-ash);
}

@media (prefers-reduced-motion: reduce) {
	.hd-card-tile {
		transition: none;
	}

	.hd-card-tile:hover {
		transform: none;
	}
}
