/* ============================================================
   Ion Addons – Widget CSS  (v1.0.5 — clean rewrite)
   ============================================================ */

/* ── Reset ────────────────────────────────────────────────── */
.etw-timeline-wrapper {
	position: relative;
	width: 100%;
	box-sizing: border-box;
}
.etw-timeline-wrapper *,
.etw-timeline-wrapper *::before,
.etw-timeline-wrapper *::after {
	box-sizing: border-box;
}

/* ── Items container ──────────────────────────────────────── */
.etw-items {
	position: relative;
	z-index: 2;
}

/* ── Single item ──────────────────────────────────────────── */
.etw-item {
	display: flex;
	align-items: flex-start;
	margin-bottom: 48px;   /* default gap — overridden per-item via Elementor */
	position: relative;    /* MUST be here for ::before positioning */
}

/* ╔══════════════════════════════════════════════════════════╗
   ║  CONNECTOR LINE                                          ║
   ║  Drawn as ::before on every .etw-item except the last.   ║
   ║  The item uses padding-bottom instead of margin-bottom   ║
   ║  so the pseudo-element height can span the gap.          ║
   ╚══════════════════════════════════════════════════════════╝ */

/* Switch gap from margin → padding so ::before bottom:0 works */
.etw-has-line .etw-item {
	margin-bottom: 0 !important;
	padding-bottom: 48px;   /* default; overridden by Elementor slider */
}
.etw-has-line .etw-item:last-child {
	padding-bottom: 0 !important;
}

/* The line segment itself */
.etw-has-line .etw-item::before {
	content: '';
	position: absolute;
	top: 24px;      /* half of 48px default marker — starts at circle centre */
	bottom: 0;      /* reaches to bottom of padding-box = top of next item */
	width: 3px;
	background-color: #e5e7eb;
	z-index: 0;
	pointer-events: none;
}

/* No line after the last marker */
.etw-has-line .etw-item:last-child::before {
	display: none !important;
}

/* ── Horizontal position of line per layout ──────────────── */
/* Left layout: marker-col is 64px wide, marker is 48px       */
/* So marker center = 48/2 = 24px from left of marker-col,    */
/* BUT marker-col itself starts at 0. Center of the 48px      */
/* circle = 24px from item left edge.                         */
.etw-has-line.etw-layout-left .etw-item::before {
	left: 24px;    /* = half of 48px marker, aligns with circle centre */
	transform: translateX(-50%);
}

/* Right layout: mirrored */
.etw-has-line.etw-layout-right .etw-item::before {
	right: 24px;
	left: auto;
	transform: translateX(50%);
}

/* Center layouts: line runs down the middle */
.etw-has-line.etw-layout-center .etw-item::before,
.etw-has-line.etw-layout-center-all .etw-item::before {
	left: 50%;
	transform: translateX(-50%);
}

/* ── Line style variants ──────────────────────────────────── */
.etw-line-dashed .etw-item::before {
	background: repeating-linear-gradient(
		to bottom,
		#e5e7eb 0px, #e5e7eb 8px,
		transparent 8px, transparent 16px
	) !important;
}
.etw-line-dotted .etw-item::before {
	background: repeating-linear-gradient(
		to bottom,
		#e5e7eb 0px, #e5e7eb 3px,
		transparent 3px, transparent 8px
	) !important;
}

/* ── Marker column ────────────────────────────────────────── */
.etw-marker-col {
	flex-shrink: 0;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	z-index: 3;
}

/* ── Marker circle ────────────────────────────────────────── */
.etw-marker {
	width: 48px;
	height: 48px;
	background-color: #2563EB;
	color: #fff;
	border: 3px solid #fff;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 16px;
	flex-shrink: 0;
	position: relative;
	z-index: 4;
	box-shadow: 0 0 0 4px rgba(37,99,235,0.18);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.etw-item:hover .etw-marker {
	transform: scale(1.12);
	box-shadow: 0 0 0 6px rgba(37,99,235,0.22);
}

/* ── Marker style variants ────────────────────────────────── */
.etw-marker-style-diamond .etw-marker {
	border-radius: 0;
	transform: rotate(45deg);
}
.etw-marker-style-diamond .etw-marker > * { transform: rotate(-45deg); }
.etw-marker-style-diamond .etw-item:hover .etw-marker { transform: rotate(45deg) scale(1.12); }

.etw-marker-style-square .etw-marker { border-radius: 4px; }

.etw-marker-style-dot .etw-marker {
	border-radius: 50%;
	width: 20px;
	height: 20px;
	font-size: 0;
	border-width: 0;
	box-shadow: 0 0 0 4px rgba(37,99,235,0.22);
}

/* ── Content column ───────────────────────────────────────── */
.etw-content-col {
	flex: 1;
	min-width: 0;
}

.etw-content-box {
	background: #fff;
	border-radius: 12px;
	padding: 24px 28px;
	box-shadow: 0 8px 32px rgba(0,0,0,0.10);
	max-width: 600px;
	position: relative;
	transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.etw-item:hover .etw-content-box {
	box-shadow: 0 12px 48px rgba(37,99,235,0.13);
	transform: translateY(-2px);
}

/* ── Image in content ─────────────────────────────────────── */
.etw-item-image { margin-bottom: 16px; }
.etw-item-image img {
	width: 100%;
	height: auto;
	display: block;
	border-radius: 8px;
}
.etw-img-left,
.etw-img-right {
	display: flex;
	align-items: flex-start;
	gap: 16px;
}
.etw-img-left .etw-item-image  { order: 1; flex-shrink: 0; width: 40%; margin-bottom: 0; }
.etw-img-left .etw-item-content { order: 2; flex: 1; }
.etw-img-right .etw-item-image  { order: 2; flex-shrink: 0; width: 40%; margin-bottom: 0; }
.etw-img-right .etw-item-content { order: 1; flex: 1; }

/* ── Typography ───────────────────────────────────────────── */
.etw-item-date {
	display: inline-block;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #2563EB;
	margin-bottom: 6px;
}
.etw-item-title {
	margin: 0 0 12px;
	font-size: 20px;
	font-weight: 700;
	color: #111827;
	line-height: 1.3;
}
.etw-item-content {
	color: #374151;
	font-size: 15px;
	line-height: 1.7;
}
.etw-item-content p { margin: 0 0 10px; }
.etw-item-content p:last-child { margin-bottom: 0; }
.etw-item-content ul,
.etw-item-content ol { padding-left: 20px; margin: 0 0 10px; }
.etw-item-content li { margin-bottom: 4px; }
.etw-no-template { color: #9ca3af; font-style: italic; font-size: 14px; }

/* ╔══════════════════════════════════════════════════════════╗
   ║  LAYOUT: LEFT  (line left, content right — default)      ║
   ╚══════════════════════════════════════════════════════════╝ */
.etw-layout-left .etw-item { flex-direction: row; }
.etw-layout-left .etw-marker-col { width: 64px; padding-right: 16px; }
.etw-layout-left .etw-content-col { padding-left: 8px; }

/* ╔══════════════════════════════════════════════════════════╗
   ║  LAYOUT: RIGHT  (line right, content left)               ║
   ╚══════════════════════════════════════════════════════════╝ */
.etw-layout-right .etw-item { flex-direction: row-reverse; }
.etw-layout-right .etw-marker-col { width: 64px; padding-left: 16px; }
.etw-layout-right .etw-content-col { padding-right: 8px; display: flex; flex-direction: column; align-items: flex-end; }
.etw-layout-right .etw-content-box { text-align: right; }

/* ╔══════════════════════════════════════════════════════════╗
   ║  LAYOUT: CENTER  (alternating)                           ║
   ╚══════════════════════════════════════════════════════════╝ */
.etw-layout-center .etw-items,
.etw-layout-center-all .etw-items { max-width: 900px; margin: 0 auto; }

.etw-layout-center .etw-item.etw-side-left {
	flex-direction: row-reverse;
	justify-content: flex-end;
}
.etw-layout-center .etw-item.etw-side-left .etw-marker-col { width: 80px; justify-content: center; flex-shrink: 0; }
.etw-layout-center .etw-item.etw-side-left .etw-content-col { width: calc(50% - 40px); padding-right: 24px; flex: 0 0 auto; text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
.etw-layout-center .etw-item.etw-side-left .etw-content-box { text-align: left; width: 100%; }

.etw-layout-center .etw-item.etw-side-right { flex-direction: row; justify-content: flex-end; }
.etw-layout-center .etw-item.etw-side-right .etw-marker-col { width: 80px; justify-content: center; flex-shrink: 0; }
.etw-layout-center .etw-item.etw-side-right .etw-content-col { width: calc(50% - 40px); padding-left: 24px; flex: 0 0 auto; }

/* ╔══════════════════════════════════════════════════════════╗
   ║  LAYOUT: CENTER-ALL  (all right)                         ║
   ╚══════════════════════════════════════════════════════════╝ */
.etw-layout-center-all .etw-item { flex-direction: row; padding-left: calc(50% - 40px); }
.etw-layout-center-all .etw-marker-col { width: 80px; justify-content: center; flex-shrink: 0; }
.etw-layout-center-all .etw-content-col { padding-left: 16px; flex: 1; }

/* ── Hidden line-track (kept in DOM only for animate_line JS) */
.etw-line-track { display: none; visibility: hidden; width: 0; height: 0; overflow: hidden; }
.etw-line        { display: none; }
.etw-line-progress { display: none; }

/* ╔══════════════════════════════════════════════════════════╗
   ║  SCROLL ANIMATIONS                                       ║
   ╚══════════════════════════════════════════════════════════╝ */
.etw-anim-pending.etw-anim-fade-up    { opacity: 0; transform: translateY(40px); }
.etw-anim-pending.etw-anim-fade-left  { opacity: 0; transform: translateX(-50px); }
.etw-anim-pending.etw-anim-fade-right { opacity: 0; transform: translateX(50px); }
.etw-anim-pending.etw-anim-fade-in    { opacity: 0; }
.etw-anim-pending.etw-anim-zoom-in    { opacity: 0; transform: scale(0.88); }
.etw-anim-pending.etw-anim-flip       { opacity: 0; transform: rotateY(-60deg); perspective: 800px; }

.etw-anim-fade-up,
.etw-anim-fade-left,
.etw-anim-fade-right,
.etw-anim-fade-in,
.etw-anim-zoom-in,
.etw-anim-flip {
	transition-property: opacity, transform;
	transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Show all items immediately inside Elementor editor */
.elementor-editor-active .etw-anim-pending {
	opacity: 1 !important;
	transform: none !important;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 767px) {
	.etw-layout-center .etw-item.etw-side-left,
	.etw-layout-center .etw-item.etw-side-right {
		flex-direction: row;
		justify-content: flex-start;
	}
	.etw-layout-center .etw-item.etw-side-left .etw-content-col,
	.etw-layout-center .etw-item.etw-side-right .etw-content-col {
		width: auto;
		padding-right: 0;
		padding-left: 12px;
		align-items: flex-start;
		text-align: left;
		flex: 1;
	}
	.etw-layout-center .etw-item.etw-side-left .etw-marker-col,
	.etw-layout-center .etw-item.etw-side-right .etw-marker-col { width: 56px; }
	.etw-layout-center-all .etw-item { padding-left: 0; }
	.etw-layout-right .etw-content-box { text-align: left; }
	.etw-layout-right .etw-content-col { align-items: flex-start; }
	.etw-img-left, .etw-img-right { flex-direction: column; }
	.etw-img-left .etw-item-image,
	.etw-img-right .etw-item-image { width: 100%; margin: 0 0 16px 0; order: 1; }
	.etw-img-left .etw-item-content,
	.etw-img-right .etw-item-content { order: 2; }

	/* Mobile: left-layout line stays on left */
	.etw-has-line.etw-layout-center .etw-item::before {
		left: 24px;
		transform: translateX(-50%);
	}
}

/* ── ION badge in Elementor panel ────────────────────────── */
.elementor-panel-schemes-item[data-widget="ion_timeline"]::after,
.elementor-panel [data-element_type="ion_timeline"]::after {
	content: 'ION';
	position: absolute;
	top: 4px;
	right: 4px;
	background: linear-gradient(135deg, #6C63FF 0%, #3ECFCF 100%);
	color: #fff;
	font-size: 8px;
	font-weight: 800;
	padding: 2px 5px;
	border-radius: 4px;
	line-height: 1.3;
	pointer-events: none;
	z-index: 10;
}


/* ============================================================
   Ion Widgets – US States Map Widget
   ============================================================ */

.ion-map-widget {
	position: relative;
	width: 100%;
	font-family: inherit;
	-webkit-user-select: none;
	user-select: none;
}

/* ── Map wrapper ────────────────────────────────────────── */
.ion-map-wrap {
	position: relative;
	width: 100%;
	/* Don't force a min-height — the SVG determines the height */
	overflow: visible;
}

.ion-map-svg {
	display: block;
	width: 100%;
	height: auto;
}

/* ── State paths ────────────────────────────────────────── */
.ion-state-path {
	fill: #1a3557;
	stroke: #ffffff;
	stroke-width: 0.8;
	stroke-linejoin: round;
	transition: fill 0.18s ease, filter 0.18s ease;
	cursor: pointer;
	outline: none;
}
.ion-state-path:hover,
.ion-state-path.is-hovered {
	fill: #2563eb;
	filter: brightness(1.15);
}
.ion-state-path:focus { outline: none; }

/* ── Tooltip ─────────────────────────────────────────────── */
.ion-map-tooltip {
	position: fixed;
	background: #0f2a45;
	color: #fff;
	padding: 5px 11px;
	border-radius: 6px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.02em;
	pointer-events: none;
	z-index: 99999;
	white-space: nowrap;
	opacity: 0;
	transform: translate(-50%, -110%);
	transition: opacity 0.12s ease;
	box-shadow: 0 3px 12px rgba(0,0,0,0.3);
}
.ion-map-tooltip.is-visible { opacity: 1; }
.ion-map-tooltip::after {
	content: '';
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	border: 5px solid transparent;
	border-top-color: #0f2a45;
}

/* ── Region boxes (overlay mode) ────────────────────────── */
.ion-map-boxes {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.ion-region-box {
	position: absolute;
	/* Frosted glass — matches the screenshot */
	background: rgba(235,240,250,0.55);
	border: 1.5px solid rgba(255,255,255,0.80);
	border-radius: 16px;
	padding: 14px 18px;
	pointer-events: all;
	/* Strong blur creates the frosted-glass effect over the map */
	backdrop-filter: blur(22px) saturate(1.4);
	-webkit-backdrop-filter: blur(22px) saturate(1.4);
	box-shadow:
		0 8px 32px rgba(0,0,0,0.12),
		inset 0 1px 0 rgba(255,255,255,0.70);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
	min-width: 190px;
}
.ion-region-box:hover {
	box-shadow: 0 8px 32px rgba(0,0,0,0.18);
	transform: translateY(-2px);
	z-index: 10;
}

/* ── Overlay positions ───────────────────────────────────── */
.ion-region-west      { top: 1%;  left: 0%; }
.ion-region-northeast { top: 1%;  right: 1%; }
.ion-region-midwest   { top: 42%; left: 20%; }
.ion-region-southeast { top: 48%; right: 1%; }
.ion-region-southwest { bottom: 1%; left: 30%; }

/* ── Stacked mode ────────────────────────────────────────── */
.ion-layout-stacked .ion-region-box {
	position: static !important;
	display: inline-block;
	margin: 0;
}
.ion-stacked-boxes {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 16px;
	padding: 20px 0 0;
}

/* ── Box inner content ───────────────────────────────────── */
.ion-region-title {
	font-size: 14px;
	font-weight: 800;
	color: #0f2a45;
	text-transform: uppercase;
	letter-spacing: 0.07em;
	margin-bottom: 5px;
	line-height: 1.2;
}

.ion-region-desc {
	font-size: 11.5px;
	color: #3a4a5c;
	line-height: 1.5;
	margin-bottom: 8px;
}

/* ── State list ──────────────────────────────────────────── */
.ion-region-list {
	list-style: none;
	padding: 0;
	margin: 0;
}
.ion-cols-1 { columns: 1; }
.ion-cols-2 { columns: 2; column-gap: 10px; }
.ion-cols-3 { columns: 3; column-gap: 8px; }

.ion-region-list li {
	font-size: 12.5px;
	font-weight: 500;
	color: #1e7e34;
	line-height: 1.85;
	break-inside: avoid;
	display: flex;
	align-items: center;
	gap: 5px;
	white-space: nowrap;
}
.ion-region-list li::before {
	content: '';
	display: inline-block;
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: #1e7e34;
	flex-shrink: 0;
}
.ion-region-list li a {
	color: inherit;
	text-decoration: none;
	transition: color 0.15s, opacity 0.15s;
}
.ion-region-list li a:hover {
	text-decoration: underline;
	opacity: 0.8;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
	.ion-layout-overlay .ion-map-wrap { min-height: 0 !important; }
	.ion-layout-overlay .ion-map-boxes { position: static; }
	.ion-layout-overlay .ion-map-boxes { display: flex; flex-direction: column; gap: 12px; padding-top: 16px; }
	.ion-region-box { position: static !important; min-width: 0; }
	.ion-cols-3 { columns: 2; }
}

/* ── Region box click highlight ─────────────────────────── */
.ion-region-box.is-highlighted {
	box-shadow: 0 0 0 3px #2563eb, 0 8px 32px rgba(37,99,235,0.25) !important;
	transform: translateY(-3px) !important;
	transition: box-shadow 0.25s ease, transform 0.25s ease;
}

/* ── D3 map container ────────────────────────────────────── */
.ion-map-d3-container {
	position: relative;
	width: 100%;
	line-height: 0;
	/* Must be a block that the SVG can expand into */
	display: block;
}
.ion-map-d3-container svg {
	display: block;
	width: 100%;
	height: auto;
	min-height: 400px;
}
.ion-map-loading {
	text-align: center;
	padding: 60px 20px;
	font-size: 13px;
	color: #8b91a7;
	font-style: italic;
}
.ion-map-tooltip {
	position: fixed;
	background: #0f2a45;
	color: #fff;
	padding: 4px 10px;
	border-radius: 6px;
	font-size: 12px;
	font-weight: 600;
	pointer-events: none;
	z-index: 99999;
	white-space: nowrap;
	opacity: 0;
	transform: translate(-50%, -130%);
	transition: opacity .1s;
	box-shadow: 0 3px 12px rgba(0,0,0,.25);
}
.ion-map-tooltip::after {
	content: '';
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	border: 4px solid transparent;
	border-top-color: #0f2a45;
}

/* ── Map wrap must be relative so overlay boxes sit on the SVG ── */
.ion-map-wrap {
	position: relative !important;
}
.ion-map-boxes {
	position: absolute;
	top: 0; left: 0; right: 0; bottom: 0;
	pointer-events: none;
	z-index: 10;
}
.ion-map-d3-container {
	position: relative;
	z-index: 1;
}

/* ── Map Legend ──────────────────────────────────────────── */
.ion-map-legend {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 6px 20px;
	margin-top: 16px;
	padding: 0 4px;
}
.ion-legend-item {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-size: 13px;
	font-weight: 500;
	color: #374151;
	cursor: pointer;
	padding: 4px 10px;
	border-radius: 20px;
	border: 1.5px solid transparent;
	transition: background 0.15s, border-color 0.15s;
	user-select: none;
}
.ion-legend-item:hover {
	background: rgba(0,0,0,0.05);
}
.ion-legend-item.is-active {
	border-color: rgba(0,0,0,0.15);
	background: rgba(0,0,0,0.04);
}
.ion-legend-dot {
	display: inline-block;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	flex-shrink: 0;
}
