/*
 * DhishaAI - "Why Choose DhishaAI" ecosystem.
 *
 * SCOPE
 * -----
 * Every selector is nested under .dwce, which exists only inside the one filtered
 * widget on the About Us page, or under an element-ID class verified unique to
 * published page 1494. No bare .node / .card / .title / svg / h2 / ul anywhere.
 *
 * LAYOUT
 * ------
 * Mobile-first. The base state is the vertical connected flow. A container query
 * upgrades it to the orbit arrangement once the widget's own column is wide enough
 * - a container query rather than a viewport query, because this widget sits in a
 * flex column whose width does not track the viewport.
 *
 * In orbit mode the stage is `1fr | gutter | 1fr`. Cards auto-flow into the two
 * outer columns via :nth-child(odd/even) and hug the middle, while the hub is
 * centred over the empty gutter. For six points that produces
 *
 *        card  card
 *        card  HUB  card
 *        card  card
 *
 * and for four, seven or twelve it rebalances by itself. Nothing is derived from
 * the current item count: no per-item rule, no per-item class, no coordinates.
 *
 * Centring the hub is the only absolute positioning here, and it positions one
 * element - never an individual card.
 *
 * CONNECTIONS
 * -----------
 * Drawn by connectors.js into an SVG layer from the cards' real measured
 * positions. Purely decorative and pointer-events:none; if the script never runs
 * the section still reads correctly. In the stacked state CSS draws the short
 * vertical links instead and the SVG layer switches itself off, keyed off the
 * --dwce-mode custom property that this file sets.
 */

/* ---------------------------------------------------------------------------
 * The only rules that touch existing Elementor elements. Every selector here is
 * an element-ID class verified unique to published page 1494.
 * ------------------------------------------------------------------------- */

/* let the ecosystem use the section's full width */
.elementor-element-37da722 {
	flex-wrap: wrap;
}

.elementor-element-37da722 > .elementor-element-b74925c {
	flex: 1 1 100%;
	width: 100%;
}

/* hide the static Why-Choose-Us.png; file, attachment and widget all remain */
.elementor-element-37da722 > .elementor-element-0834d89 {
	display: none;
}

/* tighten only the vertical rhythm around this section's heading */
.elementor-element-c3fc6e7 {
	padding-block: clamp(8px, 1.2vw, 16px);
	gap: clamp(6px, 0.9vw, 12px);
}

.elementor-element-c3fc6e7 > .elementor-element-f6dc84c {
	gap: clamp(5px, 0.7vw, 10px);
}

/* ---------------------------------------------------------------------------
 * The ecosystem itself. No panel: no border, no border-radius, no background
 * rectangle. It sits directly on the section's existing dark navy ground, lit
 * only by a soft circular glow behind the hub.
 * ------------------------------------------------------------------------- */

.dwce {
	--dwce-blue: #2e7bd6;
	--dwce-blue-soft: #7fb3f0;
	--dwce-orange: #f07a22;
	--dwce-label: #eaf2ff;
	--dwce-card: rgba(255, 255, 255, 0.05);
	--dwce-card-hover: rgba(255, 255, 255, 0.09);
	--dwce-border: rgba(140, 185, 240, 0.24);
	--dwce-border-hover: rgba(140, 185, 240, 0.52);

	--dwce-gap: clamp(10px, 1.5cqi, 18px);
	--dwce-hub: clamp(84px, 10cqi, 116px);
	--dwce-card-w: clamp(190px, 26cqi, 300px);

	container-type: inline-size;
	container-name: dwce;

	position: relative;
	box-sizing: border-box;
	padding: clamp(6px, 1%, 14px) 0;
	background: none;
	border: 0;
}

.dwce *,
.dwce *::before,
.dwce *::after {
	box-sizing: border-box;
}

.dwce__stage {
	/* Read by connectors.js to decide whether to draw. It lives on the STAGE, not
	   on .dwce: a container query cannot style the element that defines the
	   container, so a flag set on .dwce inside @container would never apply. */
	--dwce-mode: stack;

	position: relative;
	z-index: 1;
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--dwce-gap);
	align-items: center;
	justify-items: center;
}

/* ambient glow behind the hub - a circle, deliberately not a rectangle */
.dwce__stage::before {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: min(58%, 520px);
	aspect-ratio: 1 / 1;
	transform: translate(-50%, -50%);
	border-radius: 50%;
	background: radial-gradient(
		circle,
		rgba(46, 123, 214, 0.20) 0%,
		rgba(46, 123, 214, 0.09) 42%,
		rgba(240, 122, 34, 0.05) 62%,
		rgba(46, 123, 214, 0) 74%
	);
	pointer-events: none;
	z-index: 0;
}

/* ---------------- SVG connector layer ---------------- */

.dwce__links {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: visible;
	pointer-events: none;
	z-index: 0;
}

.dwce__link {
	fill: none;
	stroke: rgba(127, 179, 240, 0.34);
	stroke-width: 1;
	stroke-linecap: round;
}

.dwce__link-dot {
	fill: rgba(127, 179, 240, 0.55);
}

/* ---------------- central hub ---------------- */

.dwce__hub {
	position: relative;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--dwce-hub);
	aspect-ratio: 1 / 1;
	border-radius: 50%;
	box-shadow: 0 8px 26px rgba(0, 0, 0, 0.34);
}

.dwce__hub-ring {
	position: absolute;
	inset: -9px;
	border: 1px solid rgba(127, 179, 240, 0.28);
	border-radius: 50%;
	pointer-events: none;
}

.dwce__hub-ring::before {
	content: "";
	position: absolute;
	inset: -8px;
	border: 1px dashed rgba(240, 122, 34, 0.18);
	border-radius: 50%;
}

/* The DhishaAI mark is navy and orange, so it sits on a light plate to stay
   legible against the navy ground. `contain` keeps its intrinsic proportions -
   never cropped, never stretched. */
.dwce__hub-logo {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	background-color: #ffffff;
	background-image: var(--dwce-hub-logo);
	background-repeat: no-repeat;
	background-position: center center;
	background-size: 78%;
	box-shadow: inset 0 0 0 1px rgba(140, 185, 240, 0.4);
}

/* fallback when only the 3.13:1 header wordmark is available */
.dwce__hub--wordmark {
	width: clamp(120px, 17cqi, 168px);
	aspect-ratio: 5 / 2;
	border-radius: 14px;
}

.dwce__hub--wordmark .dwce__hub-logo {
	border-radius: 12px;
	background-size: 84%;
}

.dwce__hub--wordmark .dwce__hub-ring {
	border-radius: 18px;
}

.dwce__hub--wordmark .dwce__hub-ring::before {
	border-radius: 22px;
}

/* ---------------- value nodes ---------------- */

.dwce__nodes {
	display: grid;
	gap: var(--dwce-gap);
	justify-items: center;
	margin: 0;
	padding: 0;
	list-style: none;
}

.dwce__node {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: var(--dwce-card-w);
	min-width: 0;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* height:100% keeps cards in the same row equal regardless of label length */
.dwce__node-inner {
	display: flex;
	align-items: center;
	gap: 10px;
	height: 100%;
	padding: 10px 14px;
	border: 1px solid var(--dwce-border);
	border-radius: 12px;
	background: var(--dwce-card);
	backdrop-filter: blur(2px);
	box-shadow: 0 3px 14px rgba(0, 0, 0, 0.18);
}

.dwce__dot {
	flex: 0 0 auto;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--dwce-blue-soft);
	box-shadow: 0 0 0 3px rgba(46, 123, 214, 0.15);
}

/* accent alternates by position, never by a per-item class */
.dwce__node:nth-child(even) .dwce__dot {
	background: var(--dwce-orange);
	box-shadow: 0 0 0 3px rgba(240, 122, 34, 0.15);
}

.dwce__label {
	min-width: 0;
	font-weight: 600;
	font-size: clamp(13px, 1.45cqi, 15px);
	line-height: 1.35;
	color: var(--dwce-label);
	overflow-wrap: anywhere;
}

/* ---------------- stacked state (base / narrow) ---------------- */

/* short vertical link joining each card to the hub or the card above */
.dwce__node::before {
	content: "";
	position: absolute;
	bottom: 100%;
	left: 50%;
	width: 1px;
	height: var(--dwce-gap);
	transform: translateX(-50%);
	background: linear-gradient(to bottom, rgba(127, 179, 240, 0), rgba(127, 179, 240, 0.34));
	pointer-events: none;
}

/* ---------------- orbit state (wide container) ---------------- */

@container dwce (min-width: 620px) {
	/* the middle track is an empty gutter that the hub is centred over, so the
	   hub is no longer a full-height divider between two columns */
	.dwce__stage {
		--dwce-mode: orbit;
		grid-template-columns: 1fr calc(var(--dwce-hub) + var(--dwce-gap) * 3) 1fr;
		column-gap: 0;
		row-gap: var(--dwce-gap);
		align-items: stretch;
	}

	/* let the <li> participate directly in the stage grid; role="list" and
	   role="listitem" in the markup keep the semantics intact */
	.dwce__nodes {
		display: contents;
	}

	.dwce__hub {
		position: absolute;
		left: 50%;
		top: 50%;
		transform: translate(-50%, -50%);
		margin: 0;
	}

	/* cards alternate outward and hug the gutter, so they cluster around the hub
	   instead of stretching to the far edges - this is what stops the section
	   reading as two independent columns */
	.dwce__node:nth-child(odd) {
		grid-column: 1;
		justify-self: end;
		text-align: right;
	}

	.dwce__node:nth-child(even) {
		grid-column: 3;
		justify-self: start;
	}

	.dwce__node:nth-child(odd) .dwce__node-inner {
		flex-direction: row-reverse;
	}

	/* the vertical links belong to the stacked state only */
	.dwce__node::before {
		content: none;
	}
}

/* Engines without container queries fall back to a viewport breakpoint. */
@supports not (container-type: inline-size) {
	@media (min-width: 1000px) {
		.dwce__stage {
			--dwce-mode: orbit;
			grid-template-columns: 1fr calc(var(--dwce-hub) + var(--dwce-gap) * 3) 1fr;
			column-gap: 0;
			row-gap: var(--dwce-gap);
			align-items: stretch;
		}
		.dwce__nodes { display: contents; }
		.dwce__hub { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); margin: 0; }
		.dwce__node:nth-child(odd) { grid-column: 1; justify-self: end; text-align: right; }
		.dwce__node:nth-child(odd) .dwce__node-inner { flex-direction: row-reverse; }
		.dwce__node:nth-child(even) { grid-column: 3; justify-self: start; }
		.dwce__node::before { content: none; }
	}
}

/* ---------------- interaction ---------------- */

.dwce__node-inner:hover,
.dwce__node:focus-within .dwce__node-inner {
	border-color: var(--dwce-border-hover);
	background: var(--dwce-card-hover);
}

.dwce__node :focus-visible {
	outline: 2px solid var(--dwce-orange);
	outline-offset: 3px;
	border-radius: 4px;
}

.dwce__label a {
	color: var(--dwce-blue-soft);
	text-underline-offset: 3px;
}

/* Motion is opt-in: the default state is completely static, so anyone who prefers
   reduced motion simply never receives these rules. */
@media (prefers-reduced-motion: no-preference) {
	.dwce__node-inner {
		transition: transform 220ms ease, background-color 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
	}

	.dwce__node-inner:hover,
	.dwce__node:focus-within .dwce__node-inner {
		transform: translateY(-2px);
		box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
	}

	.dwce__hub-ring {
		animation: dwce-pulse 6s ease-in-out infinite;
	}

	@keyframes dwce-pulse {
		0%, 100% { opacity: 0.5; transform: scale(1); }
		50%      { opacity: 0.95; transform: scale(1.03); }
	}
}
