﻿.af-docs {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: flex-start;
}

/* Existing card layout */
.af-doc {
	position: relative;
	display: block;
	width: 290px;
	max-width: 100%;
	aspect-ratio: 4 / 4;
	border-radius: 5px;
	overflow: hidden;
	background-size: cover;
	background-position: center;
	text-decoration: none;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
}

	.af-doc::before {
		content: "";
		position: absolute;
		inset: 0;
		opacity: .9;
	}

.af-doc-badge {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 2;
	font-size: .75rem;
	font-weight: 400;
	padding: 6px 10px;
	background: #222;
	color: #fff;
}

.af-doc-overlay {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 2;
	background: rgba(0, 55, 125, .9);
	color: #fff;
	height: 35px;
	padding: 3px 14px 14px 14px;
	box-sizing: border-box;
	overflow: hidden;
	transition: height 220ms ease;
}

.af-doc:hover .af-doc-overlay,
.af-doc:focus .af-doc-overlay {
	height: 100%;
}

.af-doc-title {
	font-size: 1.1em;
	font-weight: 500;
	line-height: 1.5;
	margin: 0;
	text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}

.af-doc-sub {
	margin-top: 6px;
	font-size: .85rem;
	opacity: .9;
}

/* Compact SVG icon and title layout */
.af-docs--icons {
	gap: 24px 32px;
}

.af-document-icon {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	width: 145px;
	max-width: 100%;
	padding: 8px;
	box-sizing: border-box;
	color: inherit;
	text-align: center;
	text-decoration: none;
	border-radius: 5px;
	transition: transform 160ms ease, background-color 160ms ease;
}

	.af-document-icon:hover,
	.af-document-icon:focus {
		background-color: rgba(0, 55, 125, .06);
		transform: translateY(-2px);
		text-decoration: none;
	}

	.af-document-icon:focus-visible {
		outline: 2px solid #145cab;
		outline-offset: 3px;
	}

.af-document-icon-image {
	display: block;
	width: 72px;
	height: 84px;
	margin: 0 auto 10px;
}

	.af-document-icon-image img {
		display: block;
		width: 100%;
		height: 100%;
		object-fit: contain;
	}

.af-document-icon-title {
	display: block;
	font-size: 1rem;
	font-weight: 400;
	line-height: 1.25;
	overflow-wrap: anywhere;
}

/* Responsive */
@media (max-width: 640px) {
	.af-docs--cards .af-doc {
		width: 100%;
	}

	.af-docs--icons {
		gap: 18px;
	}

	.af-document-icon {
		width: calc(50% - 9px);
	}
}

@media (max-width: 380px) {
	.af-document-icon {
		width: 100%;
	}
}
