/**
 * Mobile and tablet radius for the global newsletter panel.
 * Desktop keeps the existing 100px radius from style.css.
 */
@media screen and (max-width: 1024px) {
	body .site-above-footer-wrap[data-section="section-above-footer-builder"] .ast-builder-grid-row-container-inner {
		border-radius: clamp(30px, 4.8828125vw, 50px);
	}
}

/* Keep the footer sections inside the shared global page gutter. */
.site-above-footer-wrap,
.site-primary-footer-wrap {
	padding-inline: var(--cie-section-padding-inline);
}

.site-above-footer-wrap .ast-builder-grid-row-container-inner {
	width: 100%;
}

/* Stack the footer navigation beneath its brand block on tablet. */
@media only screen and (min-width: 768px) and (max-width: 1084px) {
	.site-primary-footer-wrap[data-section="section-primary-footer-builder"] .ast-builder-grid-row {
		grid-template-columns: minmax(0, 1fr) minmax(0, 0.7fr) minmax(0, 1.35fr) minmax(0, 1.4fr);
		column-gap: clamp(12px, 1.5625vw, 20px);
		row-gap: clamp(32px, 4.167vw, 45px);
	}

	.site-primary-footer-wrap[data-section="section-primary-footer-builder"] .site-footer-primary-section-1 {
		grid-column: 1 / -1;
	}
}

/* Let the footer navigation keep its natural width on tighter desktop screens. */
@media only screen and (min-width: 1085px) and (max-width: 1199px) {
	.site-primary-footer-wrap[data-section="section-primary-footer-builder"] .ast-builder-grid-row {
		grid-template-columns:
			clamp(240px, 22.17vw, 266px)
			minmax(0, 1fr)
			minmax(0, 0.75fr)
			minmax(0, 1.6fr)
			minmax(0, 1.5fr);
		column-gap: clamp(12px, 1.25vw, 15px);
	}
}

/* Continue the phone stack through the gap in Astra's 545–767px grid rules. */
@media only screen and (max-width: 767px) {
	.site-primary-footer-wrap[data-section="section-primary-footer-builder"] .ast-builder-grid-row {
		grid-template-columns: minmax(0, 1fr);
		gap: clamp(24px, 4.167vw, 32px);
	}
}

/* Shared accreditation strip: one fluid gutter and proportional logo spacing. */
body .site-below-footer-wrap[data-section="section-below-footer-builder"] {
	padding-block: clamp(20px, 2.083334vw, 40px);
	padding-inline: var(--cie-section-padding-inline);
}

body .site-below-footer-wrap[data-section="section-below-footer-builder"] #block-12 > p {
	margin: 0 !important;
}

body .site-below-footer-wrap[data-section="section-below-footer-builder"] .site-footer-below-section-1 {
	margin-bottom: 0 !important;
	min-width: 0;
}

body .site-below-footer-wrap #block-8 {
	margin-bottom: clamp(12px, 1.25vw, 24px);
}

body #colophon .site-below-footer-wrap .accrehead {
	font-size: clamp(22px, 2.083334vw, 30px) !important;
	line-height: clamp(30px, 2.777778vw, 40px) !important;
}

body .site-below-footer-wrap :is(.footer_logo_slider, .cie-footer-accreditations-static) {
	gap: clamp(12px, 3.125vw, 60px);
	min-width: 0;
}

body .site-below-footer-wrap :is(.footer_logo_slider, .cie-footer-accreditations-static) .elementor-widget-image {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 0;
}

body .site-below-footer-wrap :is(.footer_logo_slider, .cie-footer-accreditations-static) .elementor-widget-image img {
	width: auto !important;
	height: clamp(32px, 3.125vw, 60px) !important;
	max-width: min(100%, clamp(68px, 6.25vw, 120px)) !important;
	object-fit: contain;
}

/* Keep every accreditation visible when the desktop row no longer fits. */
@media (max-width: 1000px) {
	body .site-below-footer-wrap .cie-footer-accreditations-static {
		display: grid;
		grid-template-columns: repeat(4, minmax(0, 1fr));
		width: 100%;
	}

	body .site-below-footer-wrap .cie-footer-accreditations-static > .elementor-widget-image {
		width: 100%;
		margin: 0;
	}
}

/* Reduce mobile logos proportionally, meeting the existing size at tablet. */
@media (max-width: 767px) {
	body .site-below-footer-wrap :is(.footer_logo_slider, .cie-footer-accreditations-static) .elementor-widget-image img {
		height: clamp(24px, calc(18.285714px + 1.785714vw), 32px) !important;
		max-width: min(100%, clamp(51px, calc(38.857143px + 3.794643vw), 68px)) !important;
	}
}

/* Increase the break before Solutions while the footer is truly stacked. */
@media only screen and (max-width: 544px) {
	#colophon .site-primary-footer-wrap[data-section="section-primary-footer-builder"] .site-footer-primary-section-1 {
		margin-bottom: clamp(24px, 6.154vw, 32px);
	}
}

/* Centre the Contact actions in the primary footer on phone layouts only. */
@media only screen and (max-width: 767px) {
	#colophon .site-primary-footer-wrap[data-section="section-primary-footer-builder"] .site-footer-primary-section-5 .footcontact > div {
		justify-content: center;
	}

	#colophon .site-primary-footer-wrap[data-section="section-primary-footer-builder"] .site-footer-primary-section-5 .cie-footer-back-to-top {
		margin-left: auto;
		margin-right: auto;
	}

	#colophon .site-primary-footer-wrap[data-section="section-primary-footer-builder"] :is(.site-footer-primary-section-2, .site-footer-primary-section-3, .site-footer-primary-section-4, .site-footer-primary-section-5) a {
		color: #cad1d6 !important;
	}

	#colophon .site-primary-footer-wrap[data-section="section-primary-footer-builder"] .site-footer-primary-section-5 .footaddress > div {
		color: #cad1d6 !important;
	}
}

body .footbottom .footlast {
	justify-content: center;
	column-gap: clamp(24px, calc(33.506944vw - 233.333333px), 410px);
}

@media (min-width: 768px) {
	body .footbottom {
		--cie-footer-artwork-width: clamp(180px, 22.239583vw, 427px);
		background-size: var(--cie-footer-artwork-width) auto;
		background-position: left bottom;
	}
}

/* Match the bar height to the artwork's native 427:119 aspect ratio. */
@media (min-width: 1025px) {
	body .footbottom {
		height: calc(var(--cie-footer-artwork-width) * 119 / 427);
		padding-block: 0;
		display: flex;
		align-items: center;
	}

	body .footbottom > .ast-container {
		width: 100%;
	}
}

/* Remove the copyright-bar artwork from phone layouts. */
@media only screen and (max-width: 767px) {
	body .footbottom {
		background-image: none;
	}

	body .footbottom .footlast {
		column-gap: clamp(12px, 3.125vw, 24px);
		font-size: clamp(10px, 3.076923vw, 12px) !important;
		line-height: clamp(15px, 4.358974vw, 17px) !important;
		white-space: normal;
	}

	body .footbottom .footlast > a {
		flex: 0 0 auto;
		white-space: nowrap;
	}
}
