/**
 * Global gold dividers — thin 1px hairline (tapered edges), never wavy/thick.
 * Desktop: only keep the divider under the page hero and the one above the footer.
 */

@media (min-width: 1024px) {
	body.cbr-theme {
		--cbr-edge-divider-size: var(--cbr-divider-size-desktop, 1px);
	}

	body.cbr-theme :is(
		.cbr-gold-ornament,
		.cbr-gold-ornament--emblem,
		.cbr-site-footer__ornament.cbr-gold-ornament,
		.cbr-site-footer__accent-line
	) {
		height: var(--cbr-edge-divider-size);
		max-height: var(--cbr-edge-divider-size);
		min-height: var(--cbr-edge-divider-size);
		background: var(--cbr-gold-gradient-divider);
		border: 0;
		-webkit-mask-image: var(--cbr-divider-taper-mask);
		mask-image: var(--cbr-divider-taper-mask);
		-webkit-mask-repeat: no-repeat;
		mask-repeat: no-repeat;
		-webkit-mask-size: 100% 100%;
		mask-size: 100% 100%;
	}

	/* Hide all inter-section dividers on desktop */
	body.cbr-theme :is(.cbr-page, .cbr-home, .cbr-nol, .cbr-per, .cbr-evt, .cbr-chi, .cbr-con) > section + section::before {
		content: none !important;
		display: none !important;
		height: 0 !important;
		max-height: 0 !important;
		min-height: 0 !important;
		margin: 0 !important;
	}

	body.cbr-theme :is(.cbr-page, .cbr-home, .cbr-nol, .cbr-per, .cbr-evt, .cbr-chi, .cbr-con) > :is(.cbr-section-divider, .cbr-home-section-divider) {
		display: none !important;
	}

	/*
	 * Under-hero hairline — same on every page (home used ::after because
	 * the next section overflow:hidden clipped sibling ::before).
	 */
	body.cbr-theme :is(.cbr-page, .cbr-home, .cbr-nol, .cbr-per, .cbr-evt, .cbr-chi, .cbr-con) > :is(
		.cbr-hero,
		.cbr-home-hero,
		.cbr-nol-hero,
		.cbr-per-hero,
		.cbr-evt-hero,
		.cbr-chi-hero,
		.cbr-con-hero,
		.cbr-nol-catalog-hero
	) {
		position: relative;
		overflow: visible !important;
	}

	body.cbr-theme :is(.cbr-page, .cbr-home, .cbr-nol, .cbr-per, .cbr-evt, .cbr-chi, .cbr-con) > :is(
		.cbr-hero,
		.cbr-home-hero,
		.cbr-nol-hero,
		.cbr-per-hero,
		.cbr-evt-hero,
		.cbr-chi-hero,
		.cbr-con-hero,
		.cbr-nol-catalog-hero
	) + section::before {
		content: none !important;
		display: none !important;
		height: 0 !important;
		margin: 0 !important;
	}

	body.cbr-theme :is(.cbr-page, .cbr-home, .cbr-nol, .cbr-per, .cbr-evt, .cbr-chi, .cbr-con) > :is(
		.cbr-hero,
		.cbr-home-hero,
		.cbr-nol-hero,
		.cbr-per-hero,
		.cbr-evt-hero,
		.cbr-chi-hero,
		.cbr-con-hero,
		.cbr-nol-catalog-hero
	)::after {
		content: "" !important;
		display: block !important;
		position: absolute;
		left: 0;
		right: 0;
		bottom: calc(var(--cbr-home-section-gap, var(--cbr-section-gap, 40px)) / -2);
		z-index: 4;
		width: 100%;
		height: var(--cbr-edge-divider-size) !important;
		max-height: var(--cbr-edge-divider-size) !important;
		min-height: var(--cbr-edge-divider-size) !important;
		margin: 0;
		padding: 0;
		border: 0;
		background: var(--cbr-gold-gradient-divider);
		-webkit-mask-image: var(--cbr-divider-taper-mask);
		mask-image: var(--cbr-divider-taper-mask);
		-webkit-mask-repeat: no-repeat;
		mask-repeat: no-repeat;
		-webkit-mask-size: 100% 100%;
		mask-size: 100% 100%;
		pointer-events: none;
		box-sizing: border-box;
	}

	/* Footer top divider — same thickness / taper as under-hero */
	body.cbr-theme .cbr-site-footer__ornament.cbr-gold-ornament {
		height: var(--cbr-edge-divider-size) !important;
		max-height: var(--cbr-edge-divider-size) !important;
		min-height: var(--cbr-edge-divider-size) !important;
		width: 100vw;
		max-width: 100vw;
		margin-left: calc(50% - 50vw);
		margin-right: 0;
		background: var(--cbr-gold-gradient-divider);
		-webkit-mask-image: var(--cbr-divider-taper-mask);
		mask-image: var(--cbr-divider-taper-mask);
		-webkit-mask-repeat: no-repeat;
		mask-repeat: no-repeat;
		-webkit-mask-size: 100% 100%;
		mask-size: 100% 100%;
	}

	body.cbr-theme .cbr-site-footer__ornament-wrap {
		padding-left: 0;
		padding-right: 0;
		overflow-x: clip;
	}

	body.cbr-theme .cbr-page--home > .cbr-home-hero::after,
	body.cbr-theme .cbr-page--home > *:has(+ .cbr-home-service--coverage)::after,
	body.cbr-theme .cbr-page--home > .cbr-home-service--coverage::before {
		content: none !important;
		display: none !important;
		height: 0 !important;
	}
}

/* Mobile — hide gold dividers except the one above the footer */
@media (max-width: 1023px) {
	body.cbr-theme :is(.cbr-page, .cbr-home, .cbr-nol, .cbr-per, .cbr-evt, .cbr-chi, .cbr-con) > section + section::before {
		content: none !important;
		display: none !important;
		height: 0 !important;
		max-height: 0 !important;
		min-height: 0 !important;
		margin: 0 !important;
	}

	body.cbr-theme :is(.cbr-page, .cbr-home, .cbr-nol, .cbr-per, .cbr-evt, .cbr-chi, .cbr-con) > :is(.cbr-section-divider, .cbr-home-section-divider) {
		display: none !important;
		height: 0 !important;
		margin: 0 !important;
		padding: 0 !important;
	}

	body.cbr-theme :is(
		.cbr-gold-ornament,
		.cbr-gold-ornament--emblem,
		.cbr-hero__divider,
		.cbr-hero__divider--copy,
		.cbr-hero__divider--media,
		.cbr-section-ornament,
		.cbr-site-footer__accent-line,
		.cbr-site-footer__divider
	):not(.cbr-site-footer__ornament) {
		display: none !important;
		content: none !important;
		height: 0 !important;
		min-height: 0 !important;
		max-height: 0 !important;
		margin: 0 !important;
		padding: 0 !important;
		border: 0 !important;
		background: none !important;
	}

	/* Same under-hero hairline on every page (mobile) */
	body.cbr-theme :is(.cbr-page, .cbr-home, .cbr-nol, .cbr-per, .cbr-evt, .cbr-chi, .cbr-con) > :is(
		.cbr-hero,
		.cbr-home-hero,
		.cbr-nol-hero,
		.cbr-per-hero,
		.cbr-evt-hero,
		.cbr-chi-hero,
		.cbr-con-hero,
		.cbr-nol-catalog-hero
	) {
		position: relative;
		overflow: visible !important;
	}

	body.cbr-theme :is(.cbr-page, .cbr-home, .cbr-nol, .cbr-per, .cbr-evt, .cbr-chi, .cbr-con) > :is(
		.cbr-hero,
		.cbr-home-hero,
		.cbr-nol-hero,
		.cbr-per-hero,
		.cbr-evt-hero,
		.cbr-chi-hero,
		.cbr-con-hero,
		.cbr-nol-catalog-hero
	) + section::before {
		content: none !important;
		display: none !important;
		height: 0 !important;
		margin: 0 !important;
	}

	body.cbr-theme :is(.cbr-page, .cbr-home, .cbr-nol, .cbr-per, .cbr-evt, .cbr-chi, .cbr-con) > :is(
		.cbr-hero,
		.cbr-home-hero,
		.cbr-nol-hero,
		.cbr-per-hero,
		.cbr-evt-hero,
		.cbr-chi-hero,
		.cbr-con-hero,
		.cbr-nol-catalog-hero
	)::after {
		content: "" !important;
		display: block !important;
		position: absolute;
		left: 0;
		right: 0;
		bottom: calc(var(--cbr-home-section-gap, var(--cbr-section-gap, 40px)) / -2);
		z-index: 4;
		width: 100%;
		height: var(--cbr-divider-size, 1px) !important;
		max-height: var(--cbr-divider-size, 1px) !important;
		min-height: var(--cbr-divider-size, 1px) !important;
		margin: 0;
		padding: 0;
		border: 0;
		background: var(--cbr-gold-gradient-divider) !important;
		-webkit-mask-image: var(--cbr-divider-taper-mask);
		mask-image: var(--cbr-divider-taper-mask);
		-webkit-mask-repeat: no-repeat;
		mask-repeat: no-repeat;
		-webkit-mask-size: 100% 100%;
		mask-size: 100% 100%;
		pointer-events: none;
		box-sizing: border-box;
	}

	/* Only divider on mobile: gold line above footer */
	body.cbr-theme .cbr-site-footer__ornament-wrap {
		display: block !important;
		padding: 1.5rem 0 1.75rem !important;
		height: auto !important;
		margin: 0 !important;
		overflow-x: clip;
	}

	body.cbr-theme .cbr-site-footer__ornament.cbr-gold-ornament {
		display: block !important;
		content: "" !important;
		height: var(--cbr-divider-size, 1px) !important;
		min-height: var(--cbr-divider-size, 1px) !important;
		max-height: var(--cbr-divider-size, 1px) !important;
		width: 100% !important;
		max-width: 100% !important;
		margin: 0 auto !important;
		padding: 0 !important;
		border: 0 !important;
		background: var(--cbr-gold-gradient-divider) !important;
	}
}
