/*
 * DOC-2: download cards with covers.
 * Each file shown by its cover, the way a brochure stands on a shelf: the
 * cover, the name, the file type and size, and the link that downloads it.
 * Two by two on a phone, a row from a tablet up.
 */

.wprk-section.wprk-doc-2 .wprk-doc-2__list {
	gap: var(--wp--preset--spacing--50) var(--wp--preset--spacing--40);
}

.wprk-doc-2 .wprk-doc-2__doc {
	display: flex;
	flex-direction: column;
}

.wprk-doc-2 .wprk-doc-2__doc > * {
	margin: 0;
	min-width: 0;
}

/* A cover is a sheet of paper: a hairline, a soft shadow, and no rounding beyond the theme's smallest. */
.wprk-doc-2 .wprk-doc-2__cover {
	margin-block-end: var(--wp--preset--spacing--30);
}

.wprk-doc-2 .wprk-doc-2__cover img {
	aspect-ratio: 3 / 4;
	background-color: var(--wprk-card-bg);
	border: 1px solid var(--wprk-border);
	border-radius: var(--wp--custom--radius--sm);
	box-shadow: var(--wp--custom--shadow--md);
	display: block;
	object-fit: cover;
	width: 100%;
}

.wprk-doc-2 .wprk-doc-2__doc :where(h3) {
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.3;
	overflow-wrap: break-word;
}

.wprk-doc-2 .wprk-doc-2__meta {
	color: var(--wprk-muted);
	font-size: var(--wp--preset--font-size--small);
	font-variant-numeric: lining-nums tabular-nums;
	line-height: 1.4;
	margin-block-start: 0.2rem;
}

.wprk-doc-2 .wprk-doc-2__doc > .wp-block-buttons {
	margin-block-start: var(--wp--preset--spacing--20);
}

/* On a phone the covers stand two by two. */
@media (max-width: 599px) {
	.wprk-section.wprk-doc-2 .wprk-doc-2__list:not(.is-stacked) {
		gap: var(--wp--preset--spacing--40) var(--wp--preset--spacing--30);
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
	.wprk-doc-2 .wprk-doc-2__cover img {
		transition: transform 0.25s ease;
	}

	.wprk-doc-2 .wprk-doc-2__doc:hover .wprk-doc-2__cover img {
		transform: translateY(-4px);
	}
}
