/* gmailtheme — attachment preview cards (js/thumbs.js): preview area on top (PDF first page / image / mime icon),
   small type icon + name + size + Mail's ⋯ menu below. */
/* Mail sticks the block to the pane bottom and caps it at 60vh with its own scrollbar — cards just flow with the mail */
#mail-message .mail-message-attachments { position: static; padding-inline-start: 0; }
#mail-message .mail-message-attachments--wrapper { max-height: none; overflow: visible; }
#mail-message .mail-message-attachments .attachments {
	gap: 12px;
	margin: 10px 0;
}
#mail-message .mail-message-attachments .attachment {
	width: 200px !important;
	flex: 0 0 200px;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	grid-template-rows: 132px auto;
	align-items: center;
	border: 1px solid var(--gm-line, rgba(0, 0, 0, .12));
	border-radius: 12px;
	overflow: hidden;
	background: var(--gm-surface, #fff);
	transition: box-shadow .15s, border-color .15s;
}
#mail-message .mail-message-attachments .attachment:hover {
	background: var(--gm-surface, #fff);
	border-radius: 12px;
	border-color: transparent;
	box-shadow: 0 1px 3px rgba(60, 64, 67, .3), 0 4px 8px 3px rgba(60, 64, 67, .15);
}
#mail-message .mail-message-attachments .attachment span:hover { background: transparent; }

/* preview area */
#mail-message .mail-message-attachments .mail-attachment-img--wrapper {
	grid-column: 1 / -1;
	width: 100%;
	height: 132px;
	border-radius: 0;
	align-items: center;
	justify-content: center;
	background: #f1f3f4;
	border-bottom: 1px solid var(--gm-line, rgba(0, 0, 0, .12));
	cursor: pointer;
}
#mail-message .mail-message-attachments .mail-attachment-img--wrapper img.attachment-icon {
	width: 52px;
	height: 52px;
	margin: 0;
	opacity: .9;
}
#mail-message .mail-message-attachments .mail-attachment-img--wrapper img.mail-attached-image {
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	border-radius: 0;
}
#mail-message .mail-message-attachments .mail-attachment-img--wrapper img.gm-att-thumb {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: top center;
	opacity: 0;
	transition: opacity .2s;
}
#mail-message .mail-message-attachments .attachment[data-gm-thumb="ok"] img.gm-att-thumb { opacity: 1; }
#mail-message .mail-message-attachments .attachment[data-gm-thumb="ok"] img.attachment-icon { visibility: hidden; }
#mail-message .mail-message-attachments .attachment[data-gm-thumb="loading"] .mail-attachment-img--wrapper {
	background: linear-gradient(100deg, #f1f3f4 30%, #e8eaed 50%, #f1f3f4 70%) 0 0 / 300% 100%;
	animation: gm-thumb-shimmer 1.2s linear infinite;
}
@keyframes gm-thumb-shimmer { to { background-position: -150% 0; } }
#mail-message .mail-message-attachments .mail-attachment-img--wrapper:hover img { opacity: 1; }

/* name row */
#mail-message .mail-message-attachments .mail-attached--content {
	width: auto;
	min-width: 0;
	position: relative;
	padding: 8px 0 8px 36px;
	cursor: pointer;
}
#mail-message .mail-message-attachments .mail-attached--content::before {
	content: '';
	position: absolute;
	left: 10px;
	top: 50%;
	width: 18px;
	height: 18px;
	transform: translateY(-50%);
	background: var(--gm-mime) center / contain no-repeat;
}
#mail-message .mail-message-attachments .attachment-name {
	font-size: 13px;
	font-weight: 500;
	line-height: 18px;
	color: var(--gm-text, inherit);
}
#mail-message .mail-message-attachments .attachment-size {
	font-size: 12px;
	line-height: 16px;
}
#mail-message .mail-message-attachments .attachment .action-item { margin-inline-end: 2px; }

@media (max-width: 600px) {
	#mail-message .mail-message-attachments .attachment {
		width: calc(50% - 6px) !important;
		flex-basis: calc(50% - 6px);
	}
}
