/*
 * Saggi finishing-touches stylesheet.
 * Applied only on pages generated by the Saggi Elementor Builder
 * (see Plugin::boot -> wp_enqueue_scripts hook).
 *
 * Every rule here is scoped either to a CSS class Section_Builder
 * writes onto its containers, or to widget-injected wrapper divs
 * (saggi-trustbar, saggi-chips, saggi-note, saggi-list). Editing a
 * generated page in Elementor still works — these rules never fight
 * user-added widgets, they only style Saggi utility markup.
 *
 * SECTION-BACKGROUND FALLBACKS
 * ---------------------------------------------------------------
 * Section_Builder sets background_color / background_background on
 * every top-level container. Some Elementor versions + Container
 * Flexbox configurations drop those settings during render (e.g.
 * when the "Flexbox Container" experiment is off, or when the
 * document was saved before an Elementor upgrade). The rules below
 * re-assert the design system's palette using the CSS classes we
 * attach to every section, so the visual identity survives even in
 * those edge cases.
 */

/* Every Saggi section: sane defaults so text is always legible */
.saggi-hero, .saggi-final-cta, .saggi-dark-split, .saggi-key-issues,
.saggi-intro, .saggi-image-split, .saggi-two-col-bullets,
.saggi-service-cards, .saggi-process, .saggi-why-choose,
.saggi-chip-list, .saggi-faq {
	font-family: "Georgia", "Times New Roman", serif;
	color: #41505f;
	line-height: 1.75;
}

/* Light sections */
.saggi-intro, .saggi-why-choose, .saggi-faq, .saggi-image-split:not(.saggi-on-dark) {
	background-color: #ffffff;
}
.saggi-two-col-bullets, .saggi-service-cards, .saggi-process, .saggi-chip-list {
	background-color: #f6f7f9;
}

/* Dark sections */
.saggi-dark-split, .saggi-key-issues {
	background: linear-gradient(150deg, #0d1b2a 0%, #132639 100%) !important;
	color: #c8d3de;
}
.saggi-dark-split h1, .saggi-dark-split h2, .saggi-dark-split h3,
.saggi-key-issues h1, .saggi-key-issues h2, .saggi-key-issues h3 {
	color: #ffffff !important;
}
.saggi-dark-split p, .saggi-key-issues p { color: #c8d3de !important; }

/* Body typography */
.saggi-hero, .saggi-final-cta,
.saggi-intro, .saggi-image-split, .saggi-two-col-bullets,
.saggi-service-cards, .saggi-process, .saggi-why-choose,
.saggi-chip-list, .saggi-faq,
.saggi-dark-split, .saggi-key-issues {
	padding-top: 74px;
	padding-bottom: 74px;
}
@media (max-width: 900px) {
	.saggi-hero, .saggi-final-cta,
	.saggi-intro, .saggi-image-split, .saggi-two-col-bullets,
	.saggi-service-cards, .saggi-process, .saggi-why-choose,
	.saggi-chip-list, .saggi-faq,
	.saggi-dark-split, .saggi-key-issues {
		padding-top: 56px;
		padding-bottom: 56px;
	}
}

/* Section content stays centered and max-width'd even if Elementor's
 * boxed-content is unavailable. Uses :where() so specificity stays low
 * and users can override in the editor. */
:where(.saggi-hero, .saggi-final-cta, .saggi-intro, .saggi-image-split,
	.saggi-dark-split, .saggi-key-issues, .saggi-two-col-bullets,
	.saggi-service-cards, .saggi-process, .saggi-why-choose,
	.saggi-chip-list, .saggi-faq) > .e-con-inner {
	max-width: 1180px;
	margin-left: auto;
	margin-right: auto;
}

/* trust bar in hero + final CTA */
.saggi-trustbar {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 30px;
	font-family: "Helvetica Neue", Arial, sans-serif;
	font-size: 0.8rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #d8bd85;
	line-height: 1.5;
}
.saggi-trustbar .saggi-trust-item {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}
.saggi-trustbar .saggi-trust-item::before {
	content: "";
	width: 6px;
	height: 6px;
	background: #b0894a;
	transform: rotate(45deg);
	display: inline-block;
}

/* bullet grid (why representation matters) */
.saggi-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 12px;
	grid-template-columns: 1fr 1fr;
}
.saggi-list li {
	background: #fff;
	border: 1px solid #e3e7ec;
	border-left: 3px solid #b0894a;
	padding: 14px 18px;
	font-size: 1rem;
	color: #1b2733;
	line-height: 1.55;
}
@media (max-width: 900px) {
	.saggi-list {
		grid-template-columns: 1fr;
	}
}

/* note callout */
.saggi-note {
	font-style: italic;
	line-height: 1.65;
}

/* chip list (related services) */
.saggi-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}
.saggi-chip {
	background: #fff;
	border: 1px solid #e3e7ec;
	padding: 11px 18px;
	font-size: 0.94rem;
	color: #1b2733;
	font-family: "Georgia", "Times New Roman", serif;
}

/* final CTA contact line */
.saggi-contact-line {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 14px 40px;
	font-family: "Helvetica Neue", Arial, sans-serif;
	font-size: 0.95rem;
}
.saggi-contact-line a {
	color: inherit;
	text-decoration: none;
}
.saggi-contact-line a:hover {
	color: #fff;
	text-decoration: underline;
}

/* process step decoration */
.saggi-step .elementor-widget-heading h3 {
	font-family: "Georgia", "Times New Roman", serif;
}

/* Hard-stack 2-col rows below the Loveable 900px breakpoint even when
 * Elementor's default tablet cascade would keep them side-by-side.
 * Every 2-col Section_Builder row uses an inner container with
 * flex_direction=row + flex_wrap=wrap; setting cell widths to 100%
 * at 900px produces the desired stacked layout, matching the Loveable
 * reference exactly. */
@media (max-width: 900px) {
	.saggi-intro .e-con-inner > .e-con,
	.saggi-image-split .e-con-inner > .e-con,
	.saggi-two-col-bullets .e-con-inner > .e-con,
	.saggi-dark-split .e-con-inner > .e-con {
		width: 100% !important;
		max-width: 100% !important;
	}
	.saggi-reverse .e-con-inner {
		flex-direction: column-reverse;
	}
}

/* Full-width buttons on very narrow screens (matches Loveable .sg-btn) */
@media (max-width: 480px) {
	.saggi-hero .elementor-widget-button .elementor-button,
	.saggi-final-cta .elementor-widget-button .elementor-button {
		width: 100%;
	}
}

/*
 * Elementor's container border control is single-color across all four
 * sides. The Saggi design uses a gold top rule + light-gray other sides
 * on service cards, trust cards, and key-issue cards. Recreate that here.
 */
.saggi-trust-card,
.saggi-service-card,
.saggi-key-card {
	border-top: 3px solid #b0894a !important;
	border-right: 1px solid #e3e7ec !important;
	border-bottom: 1px solid #e3e7ec !important;
	border-left: 1px solid #e3e7ec !important;
	box-shadow: 0 2px 10px rgba(13, 27, 42, 0.05);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.saggi-key-card {
	border-right-color: rgba(255, 255, 255, 0.14) !important;
	border-bottom-color: rgba(255, 255, 255, 0.14) !important;
	border-left-color: rgba(255, 255, 255, 0.14) !important;
}

/* CTA strip: 4-side border with gold left rule */
.saggi-strip {
	border-top: 1px solid #e3e7ec !important;
	border-right: 1px solid #e3e7ec !important;
	border-bottom: 1px solid #e3e7ec !important;
	border-left: 4px solid #b0894a !important;
}

/* Note callout: navy left rule on light bg */
.saggi-note {
	display: block;
	background: #fff;
	border: 1px solid #e3e7ec;
	border-left: 4px solid #0d1b2a;
	padding: 22px 24px;
	color: #1b2733;
}
/* Gold left rule + darker frame when the note lives inside a dark section */
.saggi-dark-split .saggi-note,
.saggi-key-issues .saggi-note {
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.16);
	border-left: 4px solid #b0894a;
	color: #e3eaf1;
}

/* Trustbar: pull separator + border-top from CSS (widget border settings
 * apply to the OUTER widget wrapper — we style the inner .saggi-trustbar
 * div ourselves so the effect works regardless of Elementor version). */
.saggi-hero .elementor-widget-text-editor .saggi-trustbar,
.saggi-final-cta .elementor-widget-text-editor .saggi-contact-line {
	padding-top: 24px;
	border-top: 1px solid rgba(255, 255, 255, 0.14);
	margin-top: 24px;
}

/* Hero radial-glow overlay — Elementor's built-in gradient only supports
 * a single linear gradient; layer the radial highlight from the Loveable
 * reference on top via CSS so the hero and final CTA get their
 * characteristic warm glow. */
.saggi-hero {
	background-image:
		radial-gradient(1100px 480px at 12% 0%, rgba(176, 137, 74, 0.16), transparent 62%),
		linear-gradient(160deg, #0d1b2a 0%, #122942 58%, #0b1622 100%) !important;
}
.saggi-final-cta {
	background-image:
		radial-gradient(900px 400px at 85% 10%, rgba(176, 137, 74, 0.18), transparent 60%),
		linear-gradient(150deg, #0b1622, #12293f) !important;
}

/* Figure L-shaped gold accent (bottom-left of image_split figures) */
.saggi-image-split .saggi-figure,
.saggi-image-split .elementor-widget-image {
	position: relative;
}
.saggi-image-split .elementor-widget-image::after {
	content: "";
	position: absolute;
	left: -14px;
	bottom: -14px;
	width: 120px;
	height: 120px;
	border-left: 3px solid #b0894a;
	border-bottom: 3px solid #b0894a;
	z-index: -1;
	pointer-events: none;
}
@media (max-width: 900px) {
	.saggi-image-split .elementor-widget-image::after {
		display: none;
	}
}

/* Hero split-layout image (right column) */
.saggi-hero-split .saggi-hero-figure img {
	max-height: 480px;
	object-fit: cover;
	border-radius: 4px;
	box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35);
}

/* Card / bullet / cards grid fallback: if Elementor container widths
 * fail to render (older Elementor without Flexbox Containers, or the
 * experiment is off), these rules keep the cards in a readable grid.
 * The trailing `> *:not(...)` guard avoids swallowing utility divs
 * that shouldn't participate in the grid. */
.saggi-service-cards .e-con-inner > .e-con,
.saggi-why-choose .e-con-inner > .e-con,
.saggi-key-issues .e-con-inner > .e-con {
	background-color: inherit;
}
.saggi-service-cards .e-con-inner,
.saggi-why-choose .e-con-inner,
.saggi-key-issues .e-con-inner {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
}
.saggi-service-cards .saggi-service-card,
.saggi-why-choose .saggi-service-card,
.saggi-why-choose .saggi-highlight,
.saggi-key-issues .saggi-key-card,
.saggi-intro .saggi-trust-card {
	flex: 1 1 calc(33.333% - 20px);
	min-width: 250px;
	padding: 26px 24px;
	background: #fff;
	border-radius: 2px;
}
.saggi-intro .saggi-trust-card {
	flex-basis: calc(50% - 20px);
}
.saggi-key-issues .saggi-key-card {
	flex-basis: calc(50% - 20px);
	background: rgba(255, 255, 255, 0.05);
	color: #c8d3de;
}
.saggi-key-issues .saggi-key-card h3 { color: #ffffff; }
.saggi-key-issues .saggi-key-card p { color: #c8d3de; }
@media (max-width: 900px) {
	.saggi-service-cards .saggi-service-card,
	.saggi-why-choose .saggi-service-card,
	.saggi-why-choose .saggi-highlight,
	.saggi-key-issues .saggi-key-card,
	.saggi-intro .saggi-trust-card {
		flex-basis: 100%;
	}
}

/*
 * TWO-COLUMN GRID FALLBACK (nuclear)
 * ---------------------------------------------------------------
 * Every two-column layout Section_Builder emits (hero-with-image,
 * image_split, intro_two_col, dark_split, light_two_col_bullets)
 * carries the .saggi-row-2 class on the SECTION itself. The rules
 * below force a 2-column CSS Grid layout regardless of what
 * Elementor's container renderer chose to output.
 *
 * We use CSS Grid rather than flex because a Grid rule with an
 * explicit `grid-template-columns: 1fr 1fr` is impossible for
 * Elementor's own styles to accidentally collapse to a single
 * column — flex-direction can be reset by cascade, but Grid
 * template columns are absolute.
 *
 * Both the .e-con root and the .e-con-inner wrapper (present when
 * the container's content_width is 'boxed') are targeted so the
 * two columns end up in the grid regardless of Elementor version.
 *
 * `body` prefix bumps specificity above Elementor's own defaults;
 * `!important` closes the last gap. Users can still edit widget
 * internals in Elementor — only the two-column geometry is
 * pinned.
 */
body .saggi-row-2,
body .saggi-row-2 > .e-con-inner {
	display: grid !important;
	grid-template-columns: 1fr 1fr !important;
	gap: 52px !important;
	align-items: flex-start !important;
	width: 100%;
}
/* Hero grid: 55 / 42 with vertical centering */
body .saggi-hero-split,
body .saggi-hero-split > .e-con-inner {
	grid-template-columns: 55fr 42fr !important;
	gap: 48px !important;
	align-items: center !important;
}
/* Text-heavy variant: 42 / 55 (office, team, about) */
body .saggi-variant-text-heavy,
body .saggi-variant-text-heavy > .e-con-inner {
	grid-template-columns: 42fr 55fr !important;
}
body .saggi-variant-text-heavy.saggi-image-right,
body .saggi-variant-text-heavy.saggi-image-right > .e-con-inner {
	grid-template-columns: 55fr 42fr !important;
}
/* Image-heavy: 55 / 42 (visual-lead) */
body .saggi-variant-image-heavy,
body .saggi-variant-image-heavy > .e-con-inner {
	grid-template-columns: 55fr 42fr !important;
}
body .saggi-variant-image-heavy.saggi-image-right,
body .saggi-variant-image-heavy.saggi-image-right > .e-con-inner {
	grid-template-columns: 42fr 55fr !important;
}
/* Every column child inside a 2-col row lays out as a stack */
body .saggi-row-2 > .saggi-col,
body .saggi-row-2 > .e-con-inner > .saggi-col,
body .saggi-row-2 > .saggi-col-left,
body .saggi-row-2 > .e-con-inner > .saggi-col-left,
body .saggi-row-2 > .saggi-col-right,
body .saggi-row-2 > .e-con-inner > .saggi-col-right,
body .saggi-row-2 > .saggi-col-text,
body .saggi-row-2 > .e-con-inner > .saggi-col-text,
body .saggi-row-2 > .saggi-col-image,
body .saggi-row-2 > .e-con-inner > .saggi-col-image,
body .saggi-row-2 > .saggi-hero-text-col,
body .saggi-row-2 > .e-con-inner > .saggi-hero-text-col,
body .saggi-row-2 > .saggi-hero-image-col,
body .saggi-row-2 > .e-con-inner > .saggi-hero-image-col {
	display: flex !important;
	flex-direction: column !important;
	min-width: 0;
	width: auto !important;
	max-width: 100% !important;
}
@media (max-width: 900px) {
	body .saggi-row-2,
	body .saggi-row-2 > .e-con-inner,
	body .saggi-hero-split,
	body .saggi-hero-split > .e-con-inner,
	body .saggi-variant-text-heavy,
	body .saggi-variant-text-heavy > .e-con-inner,
	body .saggi-variant-image-heavy,
	body .saggi-variant-image-heavy > .e-con-inner,
	body .saggi-variant-text-heavy.saggi-image-right,
	body .saggi-variant-text-heavy.saggi-image-right > .e-con-inner,
	body .saggi-variant-image-heavy.saggi-image-right,
	body .saggi-variant-image-heavy.saggi-image-right > .e-con-inner {
		grid-template-columns: 1fr !important;
		gap: 30px !important;
	}
}

/* Image-split figure: fill its column, cap height, keep aspect */
.saggi-image-split .saggi-figure img,
.saggi-image-split .saggi-col-right img,
.saggi-image-split .saggi-col-left img {
	width: 100%;
	max-height: 520px;
	object-fit: cover;
	border-radius: 2px;
	box-shadow: 0 18px 44px rgba(13, 27, 42, 0.18);
}

/*
 * IMAGE_SPLIT VARIANTS
 * ---------------------------------------------------------------
 * The section builder tags each row with a variant class so we can
 * asymmetrically size the columns for different narrative shapes:
 *
 *   .saggi-variant-balanced    — 48 / 48  (generic split)
 *   .saggi-variant-text-heavy  — 42 / 55  (office / team / about,
 *                                          long prose reads better
 *                                          in the wider column)
 *   .saggi-variant-image-heavy — 55 / 42  (visual-lead sections)
 *
 * The `.saggi-image-left` / `.saggi-image-right` class on the row
 * tells us which column is the image so the width targets stay
 * correct regardless of source order.
 */
.saggi-row-2.saggi-variant-text-heavy.saggi-image-left  > .saggi-col-left  { flex: 0 1 42% !important; }
.saggi-row-2.saggi-variant-text-heavy.saggi-image-left  > .saggi-col-right { flex: 1 1 55% !important; }
.saggi-row-2.saggi-variant-text-heavy.saggi-image-right > .saggi-col-left  { flex: 1 1 55% !important; }
.saggi-row-2.saggi-variant-text-heavy.saggi-image-right > .saggi-col-right { flex: 0 1 42% !important; }

.saggi-row-2.saggi-variant-image-heavy.saggi-image-left  > .saggi-col-left  { flex: 0 1 55% !important; }
.saggi-row-2.saggi-variant-image-heavy.saggi-image-left  > .saggi-col-right { flex: 1 1 42% !important; }
.saggi-row-2.saggi-variant-image-heavy.saggi-image-right > .saggi-col-left  { flex: 1 1 42% !important; }
.saggi-row-2.saggi-variant-image-heavy.saggi-image-right > .saggi-col-right { flex: 0 1 55% !important; }

@media (max-width: 900px) {
	.saggi-row-2.saggi-variant-text-heavy > .saggi-col-left,
	.saggi-row-2.saggi-variant-text-heavy > .saggi-col-right,
	.saggi-row-2.saggi-variant-image-heavy > .saggi-col-left,
	.saggi-row-2.saggi-variant-image-heavy > .saggi-col-right {
		flex: 1 1 100% !important;
	}
	/* On mobile, always show image first in text-heavy sections */
	.saggi-variant-text-heavy.saggi-image-right {
		flex-direction: column-reverse !important;
	}
}

/*
 * LEAD PARAGRAPH
 * ---------------------------------------------------------------
 * paragraphs_html() marks the first paragraph in a run of 4+
 * paragraphs as .saggi-lead. Give it distinctive weight so long
 * office / team / about copy has a clear opening beat instead of
 * reading as an undifferentiated text wall.
 */
.saggi-lead {
	font-size: 1.12em;
	line-height: 1.6;
	color: #1b2733;
	margin-bottom: 20px !important;
	font-weight: 500;
}
.saggi-dark-split .saggi-lead,
.saggi-key-issues .saggi-lead,
.saggi-final-cta .saggi-lead,
.saggi-hero .saggi-lead {
	color: #ffffff !important;
}

/* Give body paragraphs breathing room so 6-15 paragraphs don't feel
 * cramped when they end up in a single text-editor widget. */
.saggi-image-split .elementor-widget-text-editor .elementor-widget-container p,
.saggi-two-col-bullets .elementor-widget-text-editor .elementor-widget-container p,
.saggi-dark-split .elementor-widget-text-editor .elementor-widget-container p,
.saggi-intro .elementor-widget-text-editor .elementor-widget-container p {
	margin-bottom: 16px;
}

/* Framed figure treatment for editorial variants (subtle depth) */
.saggi-variant-text-heavy .saggi-figure img,
.saggi-variant-image-heavy .saggi-figure img {
	box-shadow: 0 24px 60px rgba(13, 27, 42, 0.24);
}

/* Hero split-layout column sizing: 55% text / 42% image, vertically centered.
 * Overrides the generic 50/50 .saggi-row-2 rule for the hero grid.
 * Matches the "55/45" editorial hero requested by the design brief. */
.saggi-hero-split .saggi-row-2 {
	align-items: center;
	gap: 48px !important;
}
.saggi-hero-split .saggi-hero-text-col  { flex: 1 1 55% !important; min-width: 0; }
.saggi-hero-split .saggi-hero-image-col { flex: 0 1 42% !important; min-width: 0; }
.saggi-hero-split .saggi-hero-figure img {
	max-height: 520px;
	width: 100%;
	object-fit: cover;
	border-radius: 6px;
	box-shadow: 0 40px 80px rgba(0, 0, 0, 0.45);
}
@media (max-width: 900px) {
	.saggi-hero-split .saggi-hero-text-col,
	.saggi-hero-split .saggi-hero-image-col {
		flex: 1 1 100% !important;
	}
	.saggi-hero-split .saggi-row-2 { gap: 30px !important; }
	.saggi-hero-split .saggi-hero-figure img { max-height: 360px; }
}
