/* Only activated command targets use these rules; ordinary widgets remain unchanged. */
.spg-instance { width: 100%; min-width: 0; max-width: 100%; }
.spg-instance:where([data-spg-mode="grid"]) {
	--spg-layout-mode: grid;
	--spg-grid-display: block;
	--spg-ribbon-display: none;
}
.spg-instance:where([data-spg-mode="ribbon"]) {
	--spg-layout-mode: ribbon;
	--spg-grid-display: none;
	--spg-ribbon-display: block;
}
.spg-source-layout--grid { display: var(--spg-grid-display, block); }
.spg-source-layout--ribbon { display: var(--spg-ribbon-display, none); }
.spg-instance > .spg-source[hidden] { display: none !important; }
.spg-instance .spg-managed { width: 100%; min-width: 0; }
.spg-instance .spg-managed[hidden] { display: none !important; }
/* Vertical lists crop to the measured Posts Visible at a Time height. */
.spg-instance .spg-vertical-viewport {
	width: 100%;
	min-width: 0;
	min-height: 0;
	overflow-x: hidden;
	overflow-y: auto;
	touch-action: pan-y;
	cursor: grab;
	scrollbar-width: none;
	-ms-overflow-style: none;
}
.spg-instance .spg-vertical-viewport::-webkit-scrollbar { display: none; width: 0; height: 0; }
.spg-instance .spg-vertical-viewport.is-dragging { cursor: grabbing; user-select: none; }
.spg-vertical-viewport > .hamish-post-list { align-content: start; }
.spg-instance[data-spg-active] .spg-managed .spg-card { display: grid !important; }
.spg-instance .spg-grid {
	display: grid !important;
	grid-template-columns: repeat(var(--spg-columns, 1), minmax(0, 1fr)) !important;
	column-gap: var(--spg-command-gap-x, var(--spg-command-gap, var(--hamish-post-gap, 20px)));
	row-gap: var(--spg-command-gap-y, var(--spg-command-gap, var(--hamish-vertical-post-gap, var(--hamish-post-gap, 20px))));
	width: 100%;
	transform: none !important;
}
.spg-instance .spg-grid .spg-card { width: 100%; min-width: 0; max-width: 100%; margin: 0; }
[data-spg-grid-control], [data-spg-reveal-count][hidden], [data-spg-reveal-count][data-spg-exhausted] { display: none !important; }
.spg-status:empty { display: none; }
.spg-status { margin-block: 12px; }
[data-spg-reveal-count][aria-busy="true"] { cursor: progress; opacity: .6; }


/* Full-width layouts distribute spare horizontal space between cards. */
.spg-instance[data-spg-full-width] .spg-managed .spg-grid,
.spg-instance[data-spg-full-width] .spg-managed .hpl-scroller__track {
	justify-content: space-between;
}


/* Beat Elementor kit button rules while keeping per-widget controls stronger.
 * State defaults add no specificity, so widget colors also win on hover/press.
 * The adapter clones each widget's styled template; event inputs own counts.
 */
.spg-load-more-button,
.spg-adapter-load-more,
.elementor-widget-hamish-post-list button:is(.spg-load-more-button, .spg-adapter-load-more) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 24px;
	border: 0 solid transparent;
	border-radius: 4px;
	background-color: #222;
	background-image: none;
	box-shadow: none;
	color: #fff;
	font: inherit;
	text-decoration: none;
	cursor: pointer;
	transition: color .2s ease, background-color .2s ease, border-color .2s ease;
}
:is(.spg-load-more-button, .spg-adapter-load-more):where(:hover:not(:disabled)),
.elementor-widget-hamish-post-list button:is(.spg-load-more-button, .spg-adapter-load-more):where(:hover:not(:disabled)) { background-color: #444; }
:is(.spg-load-more-button, .spg-adapter-load-more):where(:active:not(:disabled)),
.elementor-widget-hamish-post-list button:is(.spg-load-more-button, .spg-adapter-load-more):where(:active:not(:disabled)) { background-color: #111; }
:is(.spg-load-more-button, .spg-adapter-load-more):focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.spg-load-more-icon { display: inline-flex; flex: none; align-items: center; line-height: 1; }
.spg-load-more-icon svg { display: block; width: 1em; height: 1em; fill: currentColor; }
.spg-load-more-icon svg [fill]:not([fill="none"]) { fill: currentColor; }
.spg-load-more-icon svg [stroke]:not([stroke="none"]) { stroke: currentColor; }
.spg-load-more-button--icon-after .spg-load-more-icon { order: 1; }
.spg-adapter-load-more { display: flex; width: max-content; max-width: 100%; margin: 20px auto; }
:is(.spg-load-more-button, .spg-adapter-load-more)[hidden] { display: none !important; }

/* Pagination displays the complete current page without a scrolling viewport. */
.spg-instance[data-spg-pagination="1"] {
	--spg-layout-mode: grid !important;
	--spg-grid-display: block !important;
	--spg-ribbon-display: none !important;
}
.spg-instance[data-spg-pagination="1"] .hamish-post-list {
	column-gap: var(--spg-command-gap-x, var(--spg-command-gap, var(--hamish-post-gap, 20px)));
	row-gap: var(--spg-command-gap-y, var(--spg-command-gap, var(--hamish-vertical-post-gap, var(--hamish-post-gap, 20px))));
}
/* Neutralize wrappers left by a previous editor render or older runtime. */
.spg-instance:is([data-spg-pagination="1"], :has(.hamish-post-list__pagination)) .spg-vertical-viewport {
	max-height: none !important;
	height: auto !important;
	overflow: visible !important;
	cursor: auto !important;
}
/* SPG opens the existing boxed Elementor modal; keep its background separate
 * from the dynamic-height scroller when mobile browser chrome changes size. */
.spg-modal-open.e-con-boxed {
	position: fixed;
	inset: 0;
	width: 100%;
	box-sizing: border-box;
	height: 100vh;
	height: 100lvh;
	overflow: hidden;
}
.spg-modal-open.e-con-boxed > .e-con-inner {
	/* A bounded column must scroll vertically, not wrap into columns. */
	flex-wrap: nowrap;
	min-height: 0;
	max-height: 100vh;
	max-height: 100dvh;
	overflow-y: auto;
	overscroll-behavior-y: contain;
}
/* Preserve the authored video/metadata height instead of compressing it. */
.spg-modal-open.e-con-boxed > .e-con-inner > * {
	flex-shrink: 0;
}
