/**
 * Agency Builder — shared frontend styles.
 *
 * Kept intentionally minimal: card design itself lives entirely inside
 * each Loop Template (designed visually in Elementor), so this file only
 * covers structural layout that every loop/filter/quick-view instance
 * needs regardless of its visual theme.
 */

.agency-builder-loop-grid {
	display: grid;
	width: 100%;
}

.agency-builder-loop-item {
	min-width: 0;
}

.agency-builder-no-results {
	grid-column: 1 / -1;
	text-align: center;
	opacity: 0.7;
	padding: 2em 0;
}

.agency-builder-editor-notice {
	padding: 2em;
	text-align: center;
	border: 2px dashed rgba(0, 0, 0, 0.15);
	border-radius: 8px;
	opacity: 0.75;
}

/* Pagination */
.agency-builder-pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
}

.agency-builder-pagination__page,
.agency-builder-pagination__prev-next {
	padding: 0.5em 1em;
	border-radius: 6px;
	cursor: pointer;
	border: 1px solid rgba(0, 0, 0, 0.15);
	background: transparent;
}

.agency-builder-pagination__page.is-active {
	font-weight: 600;
}

.agency-builder-pagination__prev-next[disabled] {
	opacity: 0.4;
	cursor: default;
}

/* Pagination "Shape" presets — applied to the widget's own wrapper via
   Elementor's prefix_class, so these rules only ever take effect when a
   shape other than "Default" is actually chosen. Each one only sets
   what it needs to (square/rounded set border-radius; circle also
   forces equal width/height via a min-width and centers the number
   inside it), so the widget's own Border Radius / Padding / Border
   controls still work normally alongside whichever shape is picked. */
.agency-builder-pagination-shape-square .agency-builder-pagination__page {
	border-radius: 0;
}

.agency-builder-pagination-shape-rounded .agency-builder-pagination__page {
	border-radius: 8px;
}

.agency-builder-pagination-shape-circle .agency-builder-pagination__page {
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1;
	min-width: 2.4em;
	min-height: 2.4em;
	padding: 0;
}

.agency-builder-pagination__ellipsis {
	padding: 0.5em 0.25em;
	opacity: 0.6;
}

.agency-builder-load-more-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	padding: 0.75em 2em;
	border-radius: 999px;
	border: 1px solid currentColor;
	background: transparent;
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.agency-builder-load-more-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.agency-builder-load-more-btn[disabled] {
	opacity: 0.5;
	cursor: default;
	transform: none;
	box-shadow: none;
}

.agency-builder-load-more-btn.is-loading::after,
.agency-builder-infinite-scroll-sentinel .agency-builder-spinner {
	content: "";
	display: inline-block;
	width: 1em;
	height: 1em;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: agency-builder-spin 0.6s linear infinite;
}

.agency-builder-infinite-scroll-sentinel {
	width: 100%;
	display: flex;
	justify-content: center;
	padding: 1em 0;
	min-height: 1px;
}

.agency-builder-infinite-scroll-sentinel .agency-builder-spinner {
	opacity: 0;
}

.agency-builder-infinite-scroll-sentinel.is-loading .agency-builder-spinner {
	opacity: 1;
}

@keyframes agency-builder-spin {
	to {
		transform: rotate(360deg);
	}
}

.agency-builder-no-more-posts {
	width: 100%;
	text-align: center;
	opacity: 0.6;
}

/* AJAX Filter widget */
.agency-builder-filters {
	display: flex;
	flex-wrap: wrap;
}

/* The actual row of filter items — its own flex container, separate
   from the outer wrapper, since the outer wrapper also has to hold the
   hamburger toggle and <select> as siblings of this. "Spacing Between"
   (the gap control) and "Layout" (horizontal/vertical) both target this
   element specifically. */
.agency-builder-filters__items {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
	flex: 1 1 auto;
}

.agency-builder-filters--vertical .agency-builder-filters__items {
	flex-direction: column;
}

.agency-builder-filter-item {
	cursor: pointer;
	padding: 0.5em 1.25em;
	background: transparent;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* Pills — fully rounded, bordered chip (the original default look). */
.agency-builder-filters--pills .agency-builder-filter-item {
	border-radius: 999px;
	border: 1px solid rgba(0, 0, 0, 0.15);
}

.agency-builder-filters--pills .agency-builder-filter-item.is-active {
	background-color: currentColor;
}

/* Buttons — rectangular with a slight radius, solid border, filled background even when inactive. */
.agency-builder-filters--buttons .agency-builder-filter-item {
	border-radius: 6px;
	border: 1px solid rgba(0, 0, 0, 0.15);
	background-color: rgba(0, 0, 0, 0.04);
}

.agency-builder-filters--buttons .agency-builder-filter-item.is-active {
	background-color: currentColor;
	border-color: currentColor;
}

/* Tabs — flat, no background or border, an underline indicates the active one. */
.agency-builder-filters--tabs {
	gap: 1.5em;
	border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.agency-builder-filters--tabs .agency-builder-filter-item {
	padding: 0.5em 0.1em;
	border: none;
	border-bottom: 2px solid transparent;
	background: transparent;
	border-radius: 0;
}

.agency-builder-filters--tabs .agency-builder-filter-item.is-active {
	border-bottom-color: currentColor;
	background: transparent;
	font-weight: 600;
}

.agency-builder-filter-item.is-active {
	color: #fff;
}

.agency-builder-filters--tabs .agency-builder-filter-item.is-active {
	color: inherit;
}

.agency-builder-filter-item .agency-builder-filter-count {
	opacity: 0.6;
	margin-left: 0.35em;
}

/* Dropdown style — and Mobile Style forcing "Dropdown" or "Hamburger" —
   swap to a real <select>, or a collapsible toggle, instead of the row
   of pill/button/tab elements. Both markups are always rendered; CSS
   here decides which one is visible for a given combination of the
   widget's Style/Mobile Style settings and viewport width. */
.agency-builder-filters__select {
	display: none;
	width: 100%;
	padding: 0.6em 1em;
	border-radius: 6px;
	border: 1px solid rgba(0, 0, 0, 0.15);
	background: #fff;
}

.agency-builder-filters--dropdown .agency-builder-filters__items {
	display: none;
}

.agency-builder-filters--dropdown .agency-builder-filters__select {
	display: block;
}

.agency-builder-filters__hamburger-toggle {
	display: none;
	align-items: center;
	gap: 0.5em;
	width: 100%;
	padding: 0.6em 1em;
	border-radius: 6px;
	border: 1px solid rgba(0, 0, 0, 0.15);
	background: #fff;
	cursor: pointer;
	text-align: left;
}

.agency-builder-filters__hamburger-icon {
	display: inline-flex;
	flex-direction: column;
	gap: 3px;
	flex-shrink: 0;
}

.agency-builder-filters__hamburger-icon span {
	display: block;
	width: 18px;
	height: 2px;
	background: currentColor;
}

.agency-builder-filters--hamburger .agency-builder-filters__hamburger-toggle {
	display: flex;
}

.agency-builder-filters--hamburger .agency-builder-filters__items {
	display: none;
	flex-direction: column;
	width: 100%;
	margin-top: 0.5em;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 6px;
	padding: 0.5em;
}

.agency-builder-filters--hamburger.is-open .agency-builder-filters__items {
	display: flex;
}

/* Mobile Style override: forces Dropdown or Hamburger behaviour below
   767px regardless of what the desktop Style is set to, by swapping
   which pre-rendered markup is visible — data-mobile-style is set by
   the widget's own "Mobile Style" setting. */
@media (max-width: 767px) {
	.agency-builder-filters[data-mobile-style="dropdown"] .agency-builder-filters__items,
	.agency-builder-filters[data-mobile-style="hamburger"] .agency-builder-filters__items {
		display: none;
	}

	.agency-builder-filters[data-mobile-style="dropdown"] .agency-builder-filters__select {
		display: block;
	}

	.agency-builder-filters[data-mobile-style="hamburger"] .agency-builder-filters__hamburger-toggle {
		display: flex;
	}

	.agency-builder-filters[data-mobile-style="hamburger"].is-open .agency-builder-filters__items {
		display: flex;
		flex-direction: column;
		margin-top: 0.5em;
		border: 1px solid rgba(0, 0, 0, 0.12);
		border-radius: 6px;
		padding: 0.5em;
	}
}

/* AJAX Search */
.agency-builder-search-form {
	position: relative;
}

.agency-builder-search-form input {
	width: 100%;
	box-sizing: border-box;
}

.agency-builder-search-form--with-icon input {
	padding-left: 2.5em;
}

.agency-builder-search-icon {
	position: absolute;
	left: 0.75em;
	top: 50%;
	transform: translateY(-50%);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
	line-height: 1;
}

.agency-builder-search-icon svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

.agency-builder-search-results {
	position: absolute;
	inset-inline: 0;
	top: 100%;
	z-index: 20;
	background: #fff;
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
	border-radius: 8px;
	max-height: 360px;
	overflow-y: auto;
}

.agency-builder-search-results mark {
	background: rgba(255, 214, 0, 0.5);
	padding: 0 0.1em;
}

/* Quick View */
.agency-builder-quick-view-trigger {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	cursor: pointer;
	border: none;
	background: transparent;
	transition-property: background-color, color, transform, box-shadow;
	transition-timing-function: ease;
}

.agency-builder-quick-view-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.6);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 100000;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease;
}

.agency-builder-quick-view-overlay.is-open {
	opacity: 1;
	visibility: visible;
}

.agency-builder-quick-view-popup {
	background: #fff;
	max-width: 900px;
	width: 92vw;
	max-height: 88vh;
	overflow-y: auto;
	border-radius: 12px;
	position: relative;
	transform: translateY(16px);
	transition: transform 0.25s ease;
}

.agency-builder-quick-view-overlay.is-open .agency-builder-quick-view-popup {
	transform: translateY(0);
}

.agency-builder-quick-view-close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: none;
	background: rgba(0, 0, 0, 0.06);
	cursor: pointer;
	font-size: 18px;
	line-height: 1;
}

/* Dynamic Image — hover auto scroll */
.agency-builder-image-scroll__frame {
	position: relative;
	overflow: hidden;
	width: 100%;
}

.agency-builder-image-scroll__img {
	display: block;
	width: 100%;
	height: auto;
	max-width: none;
	transform: translateY(0);
}

.agency-builder-image-scroll__img--bg {
	height: 150%;
	background-size: cover;
	background-repeat: no-repeat;
	background-position: top center;
}

@media (max-width: 767px) {
	.agency-builder-loop-grid {
		grid-template-columns: 1fr !important;
	}
}

/* Terms Pills widget */
.agency-builder-terms-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.agency-builder-terms-pill {
	display: inline-block;
	line-height: 1.4;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

/* ACF Link Button widget */
.agency-builder-acf-link-button {
	display: inline-block;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.agency-builder-btn-align-left .elementor-widget-container {
	text-align: left;
}

.agency-builder-btn-align-center .elementor-widget-container {
	text-align: center;
}

.agency-builder-btn-align-right .elementor-widget-container {
	text-align: right;
}

.agency-builder-btn-align-justify .agency-builder-acf-link-button {
	display: block;
	width: 100%;
	text-align: center;
}

/* Theme Builder canvas wrappers */
.agency-builder-tb-header,
.agency-builder-tb-content,
.agency-builder-tb-footer {
	/* Never clip a full-bleed section inside these — the active theme's
	   own preserved header/footer markup (see templates/canvas.php) may
	   still wrap these in its own width-constraining containers, but at
	   least these wrappers themselves never add a SECOND layer of
	   clipping on top of that. */
	overflow: visible;
	width: 100%;
}

/*
 * Full-bleed helper: add the class "agency-builder-full-bleed" (Advanced
 * tab → CSS Classes, in Elementor) to any Container/Section that should
 * stretch edge-to-edge across the browser, ignoring the active theme's
 * own content-width container — a static CTA band is the most common
 * use for this. This is the built-in, permanent version of what would
 * otherwise need custom CSS pasted into the theme's Customizer by hand.
 *
 * Elementor's own Container/Section "Content Width: Full Width" option
 * already does something similar for widgets living in the THEME's own
 * normal templates — this exists specifically because a Theme Builder
 * template's content sits inside the active theme's preserved header
 * markup (see templates/canvas.php's header/footer capture-and-splice),
 * which can interfere with that native option working as expected in
 * this specific context.
 */
.agency-builder-full-bleed {
	width: 100vw !important;
	max-width: 100vw !important;
	margin-left: calc(50% - 50vw) !important;
	margin-right: calc(50% - 50vw) !important;
	box-sizing: border-box;
}

/* Astra (and themes with similarly-named wrappers) sometimes set
   overflow: hidden on these specific containers for unrelated layout
   reasons — which would silently clip the negative-margin bleed above
   even though the rule itself is correctly applied. overflow: visible
   is safe here; it's not something these particular wrapper elements
   rely on for their own normal appearance. */
.ast-container,
.site-content,
#content {
	overflow: visible;
}

