/**
 * IU Media Folder Gallery - shared styles (frontend + editor).
 */

.iu-gallery {
	display: grid;
	grid-template-columns: repeat( var( --iu-columns, 3 ), 1fr );
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;

	&.alignwide {
		max-width: var( --wp--style--global--wide-size, 1200px );
		margin-left: auto;
		margin-right: auto;
	}

	&.alignfull {
		width: 100%;
	}
}

.iu-gallery-item {
	margin: 0;
	overflow: hidden;
	border-radius: 2px;

	a.iu-gallery-link {
		display: block;
		line-height: 0;
		text-decoration: none;
	}
}

.iu-gallery-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	aspect-ratio: 1 / 1;
	transition: opacity 0.2s ease;

	.iu-gallery-link:hover & {
		opacity: 0.85;
	}
}

.iu-gallery-caption {
	font-size: 0.85em;
	color: #555;
	padding: 4px 2px;
	text-align: center;
}

.iu-gallery-empty {
	color: #666;
	font-style: italic;
}
