/**
 * Shared horizontal alignment for Tivity page modules (not header mega menu widgets).
 *
 * Horizontal inset stacks with Elementor .e-flexbox-base { padding: 10px } (10px per side).
 * Target 30px from viewport edge → 10px (Elementor) + 20px (theme) = 40px gutter total.
 * Fluid: breakout to viewport width; use .tivity-block-inset on inner content when needed.
 */

:root {
	/* Matches Elementor .e-flexbox-base horizontal padding on page templates. */
	--tivity-elementor-flex-inset: 10px;
	--tivity-block-gutter-total: 40px;
	--tivity-block-max-full: 1800px;
	--tivity-block-max-large: 1600px;
	--tivity-block-max-medium: 1379px;
	--tivity-block-width-full: min(var(--tivity-block-max-full), calc(100% - var(--tivity-block-gutter-total)));
	--tivity-block-width-large: min(var(--tivity-block-max-large), calc(100% - var(--tivity-block-gutter-total)));
	--tivity-block-width-medium: min(var(--tivity-block-max-medium), calc(100% - var(--tivity-block-gutter-total)));
	--tivity-block-width-inset: calc(100% - var(--tivity-block-gutter-total));
}

html:has(.tivity-widget-width--fluid),
html:has(.tivity-content-image--teal),
html:has(.tivity-content-image--teal-solid),
html:has(.tivity-content-image--purple),
html:has(.tivity-content-image--navy),
html:has(.tivity-content-image--grey),
html:has(.tivity-faqs--light-teal),
html:has(.tivity-faqs--grey),
html:has(.tivity-hero-basic--cream),
html:has(.tivity-hero-basic--grey),
html:has(.tivity-hero-basic--navy-gradient),
html:has(.tivity-review-slider--navy-gradient),
html:has(.tivity-review-slider--teal),
html:has(.tivity-review-slider--grey),
html:has(.tivity-leadership--navy-solid),
html:has(.tivity-leadership--navy-gradient),
html:has(.tivity-leadership--grey),
html:has(.tivity-cta--fluid),
html:has(.tivity-cta--footer),
html:has(.tivity-quote-hero--width-fluid) {
	overflow-x: clip;
}

/* Default: Full width preset (most page modules). */
.elementor-element[class*="elementor-widget-tivity-"]:not([class*="elementor-widget-tivity-menu-"]):not(.elementor-widget-tivity-offset-message):not(.elementor-widget-tivity-review-slider):not(.elementor-widget-tivity-leadership):not(.elementor-widget-tivity-quote-hero) {
	box-sizing: border-box;
	width: var(--tivity-block-width-full);
	max-width: var(--tivity-block-max-full);
	margin-inline: auto;
}

.elementor-element.tivity-widget-width--large {
	width: var(--tivity-block-width-large);
	max-width: var(--tivity-block-max-large);
}

.elementor-element.tivity-widget-width--medium {
	width: var(--tivity-block-width-medium);
	max-width: var(--tivity-block-max-medium);
}

.elementor-element.tivity-widget-width--fluid:not(.elementor-widget-tivity-quote-hero) {
	width: 100vw;
	max-width: 100vw;
	margin-inline: 0;
	margin-left: calc(50% - 50vw);
}

/* Editor preview: width classes on the section root (numbered list, stat bar, icon cards). */
.tivity-numbered-list--width-full,
.tivity-stat-bar--width-full,
.tivity-icon-cards--width-full,
.tivity-overlap-card--width-full,
.tivity-fcard--width-full,
.tivity-core-values--width-full,
.tivity-quote-hero--width-full {
	width: var(--tivity-block-width-full);
	max-width: var(--tivity-block-max-full);
	margin-inline: auto;
}

.tivity-numbered-list--width-large,
.tivity-stat-bar--width-large,
.tivity-icon-cards--width-large,
.tivity-overlap-card--width-large,
.tivity-fcard--width-large,
.tivity-core-values--width-large {
	width: var(--tivity-block-width-large);
	max-width: var(--tivity-block-max-large);
	margin-inline: auto;
}

.tivity-numbered-list--width-medium,
.tivity-stat-bar--width-medium,
.tivity-icon-cards--width-medium,
.tivity-overlap-card--width-medium,
.tivity-fcard--width-medium,
.tivity-core-values--width-medium {
	width: var(--tivity-block-width-medium);
	max-width: var(--tivity-block-max-medium);
	margin-inline: auto;
}

.tivity-numbered-list--width-fluid,
.tivity-stat-bar--width-fluid,
.tivity-icon-cards--width-fluid,
.tivity-overlap-card--width-fluid,
.tivity-fcard--width-fluid,
.tivity-core-values--width-fluid,
.tivity-review-slider--width-fluid {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
}

/* Review Slider / Leadership: section breaks out in widget CSS; keep the widget shell from double-insetting. */
.elementor-element.elementor-widget.elementor-widget-tivity-review-slider,
.elementor-element.elementor-widget.elementor-widget-tivity-leadership,
.elementor-element.elementor-widget.elementor-widget-tivity-overlap-card,
.elementor-element.elementor-widget.elementor-widget-tivity-quote-hero {
	box-sizing: border-box;
	width: 100%;
	max-width: none;
	margin-inline: 0;
}

/* Fluid: shared block width on the widget shell (background band is full-bleed in widget CSS). */
.elementor-element.elementor-widget.elementor-widget-tivity-quote-hero.tivity-widget-width--fluid {
	width: var(--tivity-block-width-full);
	max-width: var(--tivity-block-max-full);
	margin-inline: auto;
}

.tivity-leadership--width-fluid {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
}

/* Inner content width when the outer shell is full-bleed (fluid / colored bands). */
.tivity-block-inset,
.elementor-element.tivity-widget-width--fluid:not([class*="elementor-widget-tivity-menu-"]) .tivity-stat-bar {
	box-sizing: border-box;
	width: var(--tivity-block-width-full);
	max-width: var(--tivity-block-max-full);
	margin-inline: auto;
}

.tivity-block-inset--large {
	width: var(--tivity-block-width-large);
	max-width: var(--tivity-block-max-large);
}

.tivity-block-inset--medium {
	width: var(--tivity-block-width-medium);
	max-width: var(--tivity-block-max-medium);
}
