.diq-gallery {
	width: 100%;
	box-sizing: border-box;
}

.diq-gallery * {
	box-sizing: border-box;
}

.diq-item {
	position: relative;
	overflow: hidden;
	margin: 0;
}

.diq-item-img {
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
}

.diq-item-img.diq-crop {
	object-fit: cover;
}

.diq-item-img.diq-contain {
	object-fit: contain;
}

/* Higher specificity (two classes) than .diq-item-img above, so this still wins even though
   both are !important — masonry relies on each image's natural aspect ratio for its row flow,
   the opposite of every other type's fill-the-cell behavior. */
.diq-type-masonry .diq-item-img {
	height: auto !important;
}

.diq-item-caption {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 8px 10px;
	background: rgba( 0, 0, 0, 0.55 );
	color: #fff;
	font-size: 13px;
	margin: 0;
}

.diq-hidden {
	display: none !important;
}

.diq-pagination-controls {
	display: block;
}

/* Loading skeleton — placeholder tiles shown the instant a fetch starts (Load More click or
   an infinite-scroll sentinel), so there's always a visible "it's working" state instead of
   a pause that looks unresponsive. Numbered pages don't use this at all — dimming the
   existing batch (see .diq-grid-transitioning below) is the loading state there.
   A faint grid-line texture plus a hairline border keep adjacent tiles reading as separate
   cells even when a gallery's gutter is 0 — without it, several same-color tiles packed
   edge-to-edge just look like one oversized gray slab instead of a grid of incoming photos. */
.diq-skeleton {
	background-color: #ececed;
	background-image:
		linear-gradient(to right, rgba(0, 0, 0, 0.05) 1px, transparent 1px),
		linear-gradient(to bottom, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
	background-size: 16px 16px;
	border: 1px solid rgba(0, 0, 0, 0.06);
	animation: diq-skeleton-pulse 1.4s ease-in-out infinite;
}

@keyframes diq-skeleton-pulse {
	0%, 100% { opacity: 0.4; }
	50% { opacity: 0.65; }
}

/* Masonry has no img to derive a height from (that's what real items rely on) — give
   skeleton tiles a fixed height so they actually show up as boxes. Custom Grid doesn't need
   this: as a grid item it stretches to fill the row span set inline by buildSkeletonItem(). */
.diq-type-masonry .diq-skeleton {
	height: 160px;
}

/* Numbered pages: the outgoing batch stays in the DOM (never wiped up front) and is just
   dimmed in place while the next page loads, so a slow/failed request always has real
   content to fall back to instead of an empty grid — no skeleton tiles involved here. */
.diq-grid-transitioning .diq-item {
	opacity: 0.35;
	pointer-events: none;
}

.diq-load-more {
	display: block;
	margin: 16px auto 0;
	padding: 10px 24px;
	background: #1d2327;
	color: #fff;
	border: none;
	cursor: pointer;
	font-size: 14px;
}

.diq-load-more:hover {
	background: #2c3338;
}

.diq-load-more.is-loading {
	opacity: 0.7;
	cursor: default;
}

.diq-infinite-loading {
	text-align: center;
	padding: 12px 0;
	font-size: 13px;
	color: #646970;
	visibility: hidden;
}

.diq-infinite-loading.is-visible {
	visibility: visible;
}

/* Invisible trigger element for infinite-scroll style — IntersectionObserver watches this,
   nothing to actually show. A little height keeps it reliably observable even in an empty grid. */
.diq-scroll-sentinel {
	height: 1px;
}

.diq-pagination-nav {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 16px;
}

.diq-page-btn {
	min-width: 36px;
	padding: 8px 10px;
	background: #fff;
	border: 1px solid #dcdcde;
	color: #1d2327;
	cursor: pointer;
	font-size: 14px;
}

.diq-page-btn:hover {
	background: #f0f0f1;
}

.diq-page-btn.is-active {
	background: #1d2327;
	border-color: #1d2327;
	color: #fff;
}

.diq-powered-by {
	text-align: center;
	margin-top: 10px;
	font-size: 12px;
}

.diq-powered-by a {
	color: inherit;
	opacity: 0.6;
	text-decoration: none;
}

.diq-gallery-message {
	padding: 16px;
	background: #f0f0f1;
	border: 1px dashed #c3c4c7;
	text-align: center;
}