/* ==========================================================
   Woo Simple Gallery – Desktop Grid Style
   Loaded only when [woo_simple_gallery_grid] is used.
   Layout: first image full-width, the rest in a 2-column grid.
   ========================================================== */

.wsgg-gallery-wrapper {
	--wsgg-gap: 12px;
	--wsgg-radius: 10px;
	--wsgg-border: #E3E3E3;
	--wsgg-bg: #fff;

	max-width: 100%;
	margin-bottom: 30px;
	position: relative;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--wsgg-gap);
}

/* ── Cards (shared) ──────────────────────────────────────── */
.wsgg-card {
	margin: 0;
	position: relative;
	background: var(--wsgg-bg);
	border: 1px solid var(--wsgg-border);
	border-radius: var(--wsgg-radius);
	overflow: hidden;
	transition: opacity 0.3s ease, border-color 0.3s ease;
}

.wsgg-card img {
	display: block;
	width: 100%;
	transition: opacity 0.2s ease-in-out;
}

/* ── Hero (first image, spans both columns) ──────────────── */
.wsgg-hero {
	grid-column: 1 / -1;
	display: flex;
	align-items: center;
	justify-content: center;
	
}

.wsgg-hero img {
	height: auto;
	max-width: 100%;
}

/* ── Tiles (remaining images) ────────────────────────────── */
.wsgg-tile {
	aspect-ratio: 1 / 1;
	cursor: pointer;
}

.wsgg-tile img {
	height: 100%;
	object-fit: cover;
}

.wsgg-tile:hover,
.wsgg-tile:focus-visible {
	border-color: #333;
	outline: none;
}

/* Odd number of tiles: last one spans the full row instead of leaving a gap */
.wsgg-tile:last-child:nth-child(even) {
	grid-column: 1 / -1;
	aspect-ratio: 2 / 1;
}

/* ── Loading Spinner ─────────────────────────────────────── */
.wsgg-gallery-wrapper.wsgg-is-loading::after {
	content: '';
	position: absolute;
	top: 20%;
	left: 50%;
	width: 40px;
	height: 40px;
	margin: -20px 0 0 -20px;
	border: 4px solid #f3f3f3;
	border-top: 4px solid #3498db;
	border-radius: 50%;
	animation: wsgg-spin 1s linear infinite;
	z-index: 10;
}
.wsgg-gallery-wrapper.wsgg-is-loading .wsgg-card {
	opacity: 0.4;
	pointer-events: none;
}

@keyframes wsgg-spin {
	0%   { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}
