/* Lazy Block: certificates. Vars from base style.css. */

.certs {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	grid-auto-flow: dense;
	gap: 16px;
}

.cert {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 10px;
	border: 1px solid var(--hair);
	border-radius: 10px;
	background: #fff;
	cursor: pointer;
	aspect-ratio: 3 / 4;
	overflow: hidden;
	transition: border-color .16s, box-shadow .16s;
}

/* Horizontal certificates take two columns and a landscape box */
.cert--wide {
	grid-column: span 2;
	aspect-ratio: 3 / 2;
}

/* contain = no cropping for any orientation */
.cert img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.cert:hover {
	border-color: var(--accent);
	box-shadow: 0 12px 30px rgba(20, 34, 58, .1);
}

@media (max-width: 560px) {
	.certs { grid-template-columns: repeat(2, 1fr); }
	.cert--wide { grid-column: span 2; }
}

/* Lightbox */
.certs-lightbox {
	position: fixed;
	inset: 0;
	z-index: 80;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 30px;
}

.certs-lightbox[hidden] { display: none; }

.certs-lightbox__overlay {
	position: absolute;
	inset: 0;
	background: rgba(8, 12, 20, .85);
}

.certs-lightbox__img {
	position: relative;
	max-width: min(90vw, 720px);
	max-height: 88vh;
	border-radius: 8px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}

.certs-lightbox__close {
	position: absolute;
	top: 18px;
	right: 24px;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .12);
	color: #fff;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
}

.certs-lightbox__close:hover { background: rgba(255, 255, 255, .22); }
