/* =====================================================
   Serenity Header Share Widget
   Circular trigger → horizontal row of social icons
   expands inline (left or right direction)
   ===================================================== */

/* ─────────────────────────────────────────
   WRAPPER
───────────────────────────────────────── */
.hsw-wrapper {
	display: inline-flex;
	align-items: center;
	gap: 0;
	position: relative;
	overflow: visible;
}

/* ─────────────────────────────────────────
   TRIGGER — circular bordered button
───────────────────────────────────────── */
.hsw-trigger {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	flex-shrink: 0;
	background: transparent;
	border: 1.5px solid rgba(255,255,255,0.7);
	border-radius: 50%;
	cursor: pointer;
	padding: 0;
	color: #fff;
	transition: border-color 250ms ease, background 250ms ease, transform 180ms ease;
	-webkit-tap-highlight-color: transparent;
	position: relative;
	z-index: 2;
}

.hsw-trigger:hover {
	border-color: #fff;
	background: rgba(255,255,255,0.08);
	transform: scale(1.05);
}

.hsw-trigger svg {
	display: block;
	width: 16px;
	height: 16px;
	pointer-events: none;
}

/* ─────────────────────────────────────────
   ICONS ROW — collapsed
───────────────────────────────────────── */
.hsw-icons-row {
	display: flex;
	align-items: center;
	gap: 8px;
	overflow: hidden;
	max-width: 0;
	opacity: 0;
	pointer-events: none;
	transition: max-width 380ms cubic-bezier(.4,0,.2,1),
				opacity   280ms ease,
				gap       380ms ease;
	/* Enough max-width when open (6 icons × 50px + 5 gaps × 12px) */
}

.hsw-icons-row.hsw-open {
	max-width: 400px;
	opacity: 1;
	pointer-events: auto;
}

/* Row flows to the LEFT of trigger: row first, then trigger in DOM,
   so flex-direction row keeps left-to-right order as: [icons] [trigger] */
.hsw-icons-left {
	/* already default: row to the left of trigger */
}

/* Row flows to the RIGHT of trigger */
.hsw-icons-right {
	order: 2; /* trigger stays first at order:0 default */
}

/* ─────────────────────────────────────────
   SOCIAL ICON BUTTONS
───────────────────────────────────────── */
.hsw-social-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	flex-shrink: 0;
	background: transparent;
	border: 1.5px solid rgba(255,255,255,0.5);
	border-radius: 50%;
	color: #fff;
	cursor: pointer;
	text-decoration: none;
	transition: background 200ms ease, border-color 200ms ease, transform 180ms ease;
	-webkit-tap-highlight-color: transparent;
	/* Stagger fade-in when row opens */
	transform: scale(0.7);
	transition: background 200ms ease,
				border-color 200ms ease,
				transform 260ms cubic-bezier(.34,1.56,.64,1),
				opacity 200ms ease;
	opacity: 0;
}

.hsw-icons-row.hsw-open .hsw-social-btn {
	transform: scale(1);
	opacity: 1;
}

/* Stagger delays */
.hsw-icons-row.hsw-open .hsw-social-btn:nth-child(1) { transition-delay:  40ms; }
.hsw-icons-row.hsw-open .hsw-social-btn:nth-child(2) { transition-delay:  80ms; }
.hsw-icons-row.hsw-open .hsw-social-btn:nth-child(3) { transition-delay: 120ms; }
.hsw-icons-row.hsw-open .hsw-social-btn:nth-child(4) { transition-delay: 160ms; }
.hsw-icons-row.hsw-open .hsw-social-btn:nth-child(5) { transition-delay: 200ms; }
.hsw-icons-row.hsw-open .hsw-social-btn:nth-child(6) { transition-delay: 240ms; }

.hsw-social-btn:hover {
	background: rgba(255,255,255,0.12);
	border-color: rgba(255,255,255,0.85);
	transform: scale(1.08) !important;
}

.hsw-social-btn svg {
	display: block;
	width: 15px;
	height: 15px;
	fill: currentColor;
	pointer-events: none;
}

/* ─────────────────────────────────────────
   REDUCED MOTION
───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
	.hsw-trigger,
	.hsw-icons-row,
	.hsw-social-btn {
		transition: none !important;
	}
}

/* ─────────────────────────────────────────
   NO TAP HIGHLIGHT
───────────────────────────────────────── */
.hsw-wrapper *, .hsw-icons-row * {
	-webkit-tap-highlight-color: transparent !important;
}

/* ─────────────────────────────────────────
   VERTICAL DIRECTIONS — bottom / above
───────────────────────────────────────── */
.hsw-wrapper[data-dir="bottom"],
.hsw-wrapper[data-dir="above"] {
	flex-direction: column;
	align-items: center;
}

.hsw-wrapper[data-dir="bottom"] .hsw-trigger {
	order: 1;
}

.hsw-wrapper[data-dir="above"] .hsw-trigger {
	order: 2;
}

.hsw-icons-bottom,
.hsw-icons-above {
	max-width: 400px;
	max-height: 0;
}

.hsw-icons-bottom {
	order: 2;
}

.hsw-icons-above {
	order: 1;
}

.hsw-icons-bottom.hsw-open,
.hsw-icons-above.hsw-open {
	max-height: 120px;
}


/* ─────────────────────────────────────────
   TOP / BOTTOM VERTICAL ICON LAYOUT
───────────────────────────────────────── */
.hsw-wrapper[data-dir="bottom"] .hsw-icons-row,
.hsw-wrapper[data-dir="above"] .hsw-icons-row {
	overflow: hidden;
}

.hsw-wrapper[data-dir="bottom"] .hsw-icons-row.hsw-layout-horizontal,
.hsw-wrapper[data-dir="above"] .hsw-icons-row.hsw-layout-horizontal {
	flex-direction: row;
}

.hsw-wrapper[data-dir="bottom"] .hsw-icons-row.hsw-layout-vertical,
.hsw-wrapper[data-dir="above"] .hsw-icons-row.hsw-layout-vertical {
	flex-direction: column;
	max-width: 120px;
	max-height: 0;
}

.hsw-wrapper[data-dir="bottom"] .hsw-icons-row.hsw-layout-vertical.hsw-stack-bottom,
.hsw-wrapper[data-dir="above"] .hsw-icons-row.hsw-layout-vertical.hsw-stack-bottom {
	flex-direction: column-reverse;
}

.hsw-wrapper[data-dir="bottom"] .hsw-icons-row.hsw-layout-vertical.hsw-open,
.hsw-wrapper[data-dir="above"] .hsw-icons-row.hsw-layout-vertical.hsw-open {
	max-height: 480px;
}

/* =====================================================
   v1.0.10 FIX: Header Share as floating tooltip
   Icons must not increase Elementor header/column height.
   ===================================================== */
.elementor-widget-serenity-header-share,
.elementor-widget-serenity-header-share .elementor-widget-container,
.elementor-widget-serenity-header-share .elementor-widget-wrap {
	overflow: visible !important;
}

.hsw-wrapper {
	position: relative !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 0 !important;
	overflow: visible !important;
	width: auto !important;
	height: auto !important;
	min-width: 0 !important;
	min-height: 0 !important;
}

.hsw-trigger {
	position: relative !important;
	z-index: 1000001 !important;
}

.hsw-icons-row {
	position: absolute !important;
	z-index: 1000000 !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 8px !important;
	width: max-content !important;
	height: auto !important;
	max-width: none !important;
	max-height: none !important;
	overflow: visible !important;
	opacity: 0 !important;
	visibility: hidden !important;
	pointer-events: none !important;
	transition: opacity 220ms ease, transform 260ms cubic-bezier(.34,1.56,.64,1), visibility 0s linear 220ms !important;
}

.hsw-icons-row.hsw-open {
	max-width: none !important;
	max-height: none !important;
	opacity: 1 !important;
	visibility: visible !important;
	pointer-events: auto !important;
	transition-delay: 0s !important;
}

/* Left / Right: floating beside the button */
.hsw-wrapper[data-dir="left"] .hsw-icons-row {
	top: 50% !important;
	right: calc(100% + 10px) !important;
	bottom: auto !important;
	left: auto !important;
	flex-direction: row !important;
	transform: translateY(-50%) scale(.92) !important;
	transform-origin: right center !important;
}

.hsw-wrapper[data-dir="right"] .hsw-icons-row {
	top: 50% !important;
	left: calc(100% + 10px) !important;
	right: auto !important;
	bottom: auto !important;
	flex-direction: row !important;
	transform: translateY(-50%) scale(.92) !important;
	transform-origin: left center !important;
}

.hsw-wrapper[data-dir="left"] .hsw-icons-row.hsw-open,
.hsw-wrapper[data-dir="right"] .hsw-icons-row.hsw-open {
	transform: translateY(-50%) scale(1) !important;
}

/* Bottom / Above: floating like a tooltip, not in layout flow */
.hsw-wrapper[data-dir="bottom"] .hsw-icons-row {
	top: calc(100% + 10px) !important;
	left: 50% !important;
	right: auto !important;
	bottom: auto !important;
	transform: translateX(-50%) scale(.92) !important;
	transform-origin: top center !important;
}

.hsw-wrapper[data-dir="above"] .hsw-icons-row {
	bottom: calc(100% + 10px) !important;
	left: 50% !important;
	top: auto !important;
	right: auto !important;
	transform: translateX(-50%) scale(.92) !important;
	transform-origin: bottom center !important;
}

.hsw-wrapper[data-dir="bottom"] .hsw-icons-row.hsw-open,
.hsw-wrapper[data-dir="above"] .hsw-icons-row.hsw-open {
	transform: translateX(-50%) scale(1) !important;
}

/* Respect horizontal / vertical icon layout for above and bottom */
.hsw-icons-row.hsw-layout-horizontal {
	flex-direction: row !important;
}

.hsw-icons-row.hsw-layout-vertical {
	flex-direction: column !important;
}

.hsw-icons-row.hsw-layout-vertical.hsw-stack-bottom {
	flex-direction: column-reverse !important;
}

/* Avoid tiny mobile overflow when icons open near viewport edge */
@media (max-width: 767px) {
	.hsw-icons-row {
		gap: 7px !important;
	}

	.hsw-social-btn {
		width: 38px !important;
		height: 38px !important;
	}

	.hsw-wrapper[data-dir="right"] .hsw-icons-row {
		left: auto !important;
		right: calc(100% + 8px) !important;
		transform-origin: right center !important;
	}

	.hsw-wrapper[data-dir="right"] .hsw-icons-row,
	.hsw-wrapper[data-dir="left"] .hsw-icons-row {
		transform: translateY(-50%) scale(.92) !important;
	}

	.hsw-wrapper[data-dir="right"] .hsw-icons-row.hsw-open,
	.hsw-wrapper[data-dir="left"] .hsw-icons-row.hsw-open {
		transform: translateY(-50%) scale(1) !important;
	}
}
