/* Resources page — eBook library grid. */

.hl-resources__intro {
	margin-top: 24px;
	max-width: 780px;
}

.hl-resources__grid {
	display: grid;
	/* Four across on a wide screen, down to one on a phone, without a
	   breakpoint per step — the cards carry a book cover so they must not get
	   narrower than roughly a cover's width. */
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 32px 28px;
	margin-top: 48px;
}

.hl-resource {
	display: flex;
	flex-direction: column;
	background: var(--hl-white);
	border: 1px solid var(--hl-line);
	border-radius: var(--hl-radius);
	overflow: hidden;
	text-decoration: none;
	color: inherit;
	transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.hl-resource:hover,
.hl-resource:focus-visible {
	transform: translateY(-4px);
	border-color: transparent;
	box-shadow: var(--hl-shadow);
}

.hl-resource__cover {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 32px 24px 24px;
	background: var(--hl-mist);
	/* A fixed box keeps the grid rows aligned even though the covers are not
	   all the same aspect ratio. */
	min-height: 260px;
}

.hl-resource__cover img {
	max-width: 100%;
	max-height: 220px;
	width: auto;
	height: auto;
	border-radius: 2px;
	box-shadow: 0 14px 30px -12px rgba(11, 34, 51, 0.45);
	transition: transform 0.25s ease;
}

.hl-resource:hover .hl-resource__cover img {
	transform: scale(1.03);
}

.hl-resource__body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	gap: 10px;
	padding: 24px;
}

.hl-resource__title {
	font-weight: 600;
	font-size: 17px;
	line-height: 1.35;
	color: var(--hl-navy);
}

.hl-resource__desc {
	font-size: 15px;
	line-height: 1.55;
	color: var(--hl-body);
}

.hl-resource__more {
	/* Pushed to the bottom so the link label lines up across cards whose
	   titles run to different lengths. */
	margin-top: auto;
	padding-top: 14px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--hl-blue);
}

.hl-resource__more::after {
	content: " →";
	transition: margin-left 0.2s ease;
}

.hl-resource:hover .hl-resource__more::after {
	margin-left: 4px;
}

@media (max-width: 600px) {
	.hl-resources__grid {
		grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
		gap: 24px 20px;
	}

	.hl-resource__cover {
		min-height: 200px;
		padding: 24px 20px 20px;
	}

	.hl-resource__cover img {
		max-height: 170px;
	}

	.hl-resource__body {
		padding: 20px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hl-resource,
	.hl-resource__cover img,
	.hl-resource__more::after {
		transition: none;
	}

	.hl-resource:hover {
		transform: none;
	}

	.hl-resource:hover .hl-resource__cover img {
		transform: none;
	}
}
