/**
 * Homepage ad section layout fixes — scoped narrowly.
 */

/* Recent Ads only — hide extra View All links/buttons outside the header row. */
.adt-recent-mini-ads-section:not([data-t4s-ad-list="featured"]):not(.text4stuff-featured-ads-gallery) a[href]:has(> .adt-button-1):not(.adt-ads-top-box a),
.adt-recent-mini-ads-section:not([data-t4s-ad-list="featured"]):not(.text4stuff-featured-ads-gallery) .adt-mini-ads-grid ~ a[href],
.adt-recent-mini-ads-section:not([data-t4s-ad-list="featured"]):not(.text4stuff-featured-ads-gallery) .adt-mini-ads-grid ~ div:not(.adt-horizontal-ad-box) a[href]:has(> .adt-button-1),
.adt-recent-mini-ads-section:not([data-t4s-ad-list="featured"]):not(.text4stuff-featured-ads-gallery) .col-lg-12 > a[href]:has(> .adt-button-1) {
	display: none !important;
}

.adt-recent-mini-ads-section:not([data-t4s-ad-list="featured"]):not(.text4stuff-featured-ads-gallery) .adt-ads-top-box {
	display: flex !important;
	flex-wrap: nowrap !important;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	margin-bottom: 30px;
}

.adt-recent-mini-ads-section:not([data-t4s-ad-list="featured"]):not(.text4stuff-featured-ads-gallery) .adt-ads-top-box > a[href] {
	display: inline-block !important;
	flex: 0 0 auto;
	margin-left: auto;
}

.adt-recent-mini-ads-section:not([data-t4s-ad-list="featured"]):not(.text4stuff-featured-ads-gallery) .adt-ads-top-box h2 {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
}

@media (max-width: 991.98px) {
	.adt-recent-mini-ads-section:not([data-t4s-ad-list="featured"]):not(.text4stuff-featured-ads-gallery) .adt-ads-top-box h2 {
		font-size: clamp(18px, 4vw, 24px);
		line-height: 1.2;
	}

	/* Featured Ads carousel — header row + arrows not overlapping View All. */
	.adt-property-ads-section .adt-ads-top-box {
		flex-wrap: nowrap;
		align-items: center;
		gap: 12px;
		margin-bottom: 20px;
	}

	.adt-property-ads-section .adt-ads-top-box .ad-content-box {
		flex: 1 1 auto;
		min-width: 0;
	}

	.adt-property-ads-section .adt-ads-top-box .ad-content-box h2 {
		margin: 0;
		font-size: clamp(18px, 4vw, 24px);
		line-height: 1.2;
	}

	.adt-property-ads-section .adt-ads-top-box > a {
		flex: 0 0 auto;
		margin-left: auto;
	}

	.adt-property-ads-section .adt-ads-top-box .adt-button-1 {
		white-space: nowrap;
		padding: 5px 16px;
		line-height: 32px;
	}

	.adt-property-ads-section .adt-property-ads-carousel-widgets {
		display: flex;
		flex-direction: column;
	}

	.adt-property-ads-section .adt-property-ads-carousel-widgets > .owl-nav {
		order: -1;
		position: static !important;
		top: auto !important;
		right: auto !important;
		left: auto !important;
		display: flex !important;
		justify-content: flex-end;
		align-items: center;
		gap: 10px;
		width: 100%;
		margin: 0 0 12px;
	}

	.adt-property-ads-section .adt-property-ads-carousel-widgets > .owl-stage-outer {
		order: 0;
		width: 100%;
	}

	.adt-property-ads-section .adt-property-ads-carousel-widgets > .owl-nav .owl-prev,
	.adt-property-ads-section .adt-property-ads-carousel-widgets > .owl-nav .owl-next {
		margin: 0;
	}
}

@media (max-width: 575.98px) {
	.adt-property-ads-section .adt-ads-top-box .adt-button-1,
	.adt-recent-mini-ads-section:not([data-t4s-ad-list="featured"]):not(.text4stuff-featured-ads-gallery) .adt-ads-top-box .adt-button-1 {
		padding: 5px 12px;
		font-size: 13px;
	}
}
