/* ShareToSocial — frontend styles */

/*
 * Visually-hidden but screen-reader-accessible text. Defined here
 * instead of relying on a theme's own .screen-reader-text class,
 * since this plugin has to work identically regardless of which
 * theme (if any) happens to provide that class.
 */
.sts-screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.sts-share {
	--sts-radius: 6px;
	--sts-gap: 8px;
	--sts-icon-size: 16px;
	--sts-btn-size: 40px;
	--sts-btn-padding: 7px 13px;
	--sts-font-size: 13px;
}

/* ---------- Size variants ---------- */

.sts-size-small {
	--sts-icon-size: 13px;
	--sts-btn-size: 32px;
	--sts-btn-padding: 8px 10px;
	--sts-font-size: 12px;
}

.sts-size-medium {
	--sts-icon-size: 16px;
	--sts-btn-size: 40px;
	--sts-btn-padding: 7px 13px;
	--sts-font-size: 13px;
}

.sts-size-large {
	--sts-icon-size: 19px;
	--sts-btn-size: 48px;
	--sts-btn-padding: 10px 16px;
	--sts-font-size: 14px;
}

.sts-size-xlarge {
	--sts-icon-size: 22px;
	--sts-btn-size: 56px;
	--sts-btn-padding: 10px 20px;
	--sts-font-size: 16px;
}

/* ---------- Accessibility: larger touch targets ---------- */

.sts-large-targets {
	--sts-btn-size: max(44px, var(--sts-btn-size));
}

.sts-large-targets.sts-share--inline .sts-share__link {
	min-height: 44px;
	min-width: 44px;
}

.sts-share * {
	box-sizing: border-box;
}

.sts-share a {
	text-decoration: none;
}

.sts-icon-svg {
	width: var(--sts-icon-size, 16px);
	height: var(--sts-icon-size, 16px);
	display: inline-block;
	vertical-align: middle;
	fill: currentColor;
}

/* ---------- Inline row ---------- */

.sts-share--inline {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px;
	margin: 28px 0;
	padding: 16px 0;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

/* ---------- Icon alignment ---------- */

.sts-align-left.sts-share--inline {
	justify-content: flex-start;
}

.sts-align-center.sts-share--inline {
	justify-content: center;
}

.sts-align-right.sts-share--inline {
	justify-content: flex-end;
}

.sts-share__title {
	font-size: 14px;
	font-weight: 600;
	color: #444;
	white-space: nowrap;
}

.sts-share__list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--sts-gap);
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

.sts-share__item {
	margin: 0 !important;
	list-style: none !important;

}

.sts-share--inline .sts-share__link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: var(--sts-btn-padding, 8px 14px);
	color: #fff;
	background: var(--sts-brand, #555);
	border-radius: var(--sts-radius);
	font-size: var(--sts-font-size, 13px);
	font-weight: 500;
	line-height: 1.4;
	transition: background-color 0.2s ease, transform 0.15s ease;
}

.sts-share--inline .sts-share__link:hover,
.sts-share--inline .sts-share__link:focus-visible {
	background: var(--sts-brand-hover, #333);
}

.sts-share__label {
	white-space: nowrap;
}

/* ---------- Style variants ---------- */

.sts-style-square .sts-share__link {
	--sts-radius: 0;
}

.sts-style-rounded .sts-share__link {
	--sts-radius: 6px;
}

.sts-style-pill .sts-share__link {
	--sts-radius: 999px;
}

/* Icons Only: no button chrome — bare icon in the brand color. */
.sts-style-icons.sts-share--inline .sts-share__link {
	background: transparent;
	color: var(--sts-brand, #555);
	padding: 4px;
}

.sts-style-icons.sts-share--inline .sts-share__link:hover,
.sts-style-icons.sts-share--inline .sts-share__link:focus-visible {
	background: transparent;
	color: var(--sts-brand-hover, #333);
}

/* Outline: transparent fill, brand-colored border — fills solid on hover. */
.sts-style-outline.sts-share--inline .sts-share__link {
	--sts-radius: 999px;
	background: transparent;
	color: var(--sts-brand, #555);
	box-shadow: inset 0 0 0 1.5px var(--sts-brand, #555);
	transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.sts-style-outline.sts-share--inline .sts-share__link:hover,
.sts-style-outline.sts-share--inline .sts-share__link:focus-visible {
	background: var(--sts-brand, #555);
	color: #fff;
	box-shadow: inset 0 0 0 1.5px var(--sts-brand-hover, #333);
}

/* Official Buttons: each network's own share-button wording, in a tight
   native-style radius rather than the rounded/pill/square choices above. */
.sts-style-official .sts-share__link {
	--sts-radius: 4px;
	font-weight: 600;
}

/* Round Text: white pill, brand-colored border/icon/text, fills solid on hover. */
.sts-style-text.sts-share--inline .sts-share__link {
	--sts-radius: 19px;
	background: #fff;
	color: var(--sts-brand, #555);
	box-shadow: inset 0 0 0 1px var(--sts-brand, #555);
	transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.sts-style-text.sts-share--inline .sts-share__link:hover,
.sts-style-text.sts-share--inline .sts-share__link:focus-visible {
	background: var(--sts-brand, #555);
	color: #fff;
	box-shadow: inset 0 0 0 1px var(--sts-brand-hover, #333);
}

/* Accent Border: white card, brand-colored bottom accent + soft shadow. */
.sts-style-accent-border.sts-share--inline .sts-share__link {
	--sts-radius: 10px;
	background: #fff;
	color: var(--sts-brand, #555);
	box-shadow: 0 2px 0 0 var(--sts-brand, #555), 0 1px 4px rgba(0, 0, 0, 0.15);
	transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.sts-style-accent-border.sts-share--inline .sts-share__link:hover,
.sts-style-accent-border.sts-share--inline .sts-share__link:focus-visible {
	background: var(--sts-brand, #555);
	color: #fff;
	box-shadow: 0 2px 0 0 var(--sts-brand-hover, #333), 0 1px 4px rgba(0, 0, 0, 0.15);
}

/* ---------- Floating bar ---------- */

.sts-share--floating {
	position: fixed;
	top: var(--sts-top-offset, 150px);
	z-index: 100;
	transition: opacity 0.3s ease, left 0.3s ease, right 0.3s ease;
}

.sts-share--floating.sts-position-left {
	left: 12px;
}

.sts-share--floating.sts-position-right {
	right: 12px;
}

.sts-share--floating.sts-position-bottom,
.sts-share--floating.sts-position-bottom-sticky {
	top: auto;
	bottom: 0;
	left: 0;
	right: 0;
	width: 100%;
	background: #fff;
	box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
	padding: 8px max(8px, env(safe-area-inset-left)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-right));
	transition: opacity 0.3s ease, transform 0.3s ease;
}

.sts-share--floating.sts-position-bottom .sts-share__float-inner,
.sts-share--floating.sts-position-bottom-sticky .sts-share__float-inner {
	flex-direction: row;
	justify-content: center;
}

.sts-share--floating.sts-position-bottom .sts-share__list,
.sts-share--floating.sts-position-bottom-sticky .sts-share__list {
	flex-direction: row;
	flex-wrap: wrap;
	justify-content: center;
	flex: 1;
}

.sts-share--floating.sts-position-bottom .sts-share__list.sts-collapsed,
.sts-share--floating.sts-position-bottom-sticky .sts-share__list.sts-collapsed {
	transform: translateY(140%);
}

.sts-share--floating.sts-position-bottom .sts-share__toggle,
.sts-share--floating.sts-position-bottom-sticky .sts-share__toggle {
	width: 32px;
	height: var(--sts-btn-size, 42px);
	margin: 0 0 0 6px;
}

.sts-share--floating.sts-position-bottom .sts-share__toggle .sts-icon-svg,
.sts-share--floating.sts-position-bottom-sticky .sts-share__toggle .sts-icon-svg {
	transform: rotate(90deg);
}

.sts-share--floating.sts-position-bottom .sts-share__toggle.sts-active .sts-icon-svg,
.sts-share--floating.sts-position-bottom-sticky .sts-share__toggle.sts-active .sts-icon-svg {
	transform: rotate(270deg);
}

/* Auto-hide-on-scroll is the "Bottom" position's default behavior
   (not "Bottom (sticky)"). The visible state is the CSS default;
   frontend.js adds .sts-scroll-hidden while scrolling down and
   removes it again on scroll up or near the top of the page. */
.sts-share--floating.sts-position-bottom.sts-scroll-hidden {
	transform: translateY(140%);
	opacity: 0;
	pointer-events: none;
}

.sts-share--floating.sts-is-narrow {
	display: none;
}

.sts-share__float-inner {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
}

/* Repeats var(--sts-gap) since this selector's specificity would
   otherwise override the base .sts-share__list rule above. */
.sts-share--floating .sts-share__list {
	flex-direction: column;
	gap: var(--sts-gap);
	transition: transform 0.3s ease, opacity 0.3s ease;
}

.sts-share--floating .sts-share__list.sts-collapsed {
	opacity: 0;
	pointer-events: none;
}

.sts-share--floating.sts-position-left .sts-share__list.sts-collapsed {
	transform: translateX(-140%);
}

.sts-share--floating.sts-position-right .sts-share__list.sts-collapsed {
	transform: translateX(140%);
}

.sts-share--floating .sts-share__link {
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--sts-btn-size, 42px);
	height: var(--sts-btn-size, 42px);
	color: #fff;
	background: var(--sts-brand, #555);
	border-radius: var(--sts-radius);
	font-size: var(--sts-font-size, 13px);
	transition: background-color 0.2s ease, transform 0.15s ease;
}

.sts-style-pill.sts-share--floating .sts-share__link {
	border-radius: 999px;
}

.sts-style-icons.sts-share--floating .sts-share__link {
	background: transparent;
	color: var(--sts-brand, #555);
}

.sts-style-icons.sts-share--floating .sts-share__link:hover,
.sts-style-icons.sts-share--floating .sts-share__link:focus-visible {
	background: transparent;
	color: var(--sts-brand-hover, #333);
}

.sts-style-outline.sts-share--floating .sts-share__link {
	border-radius: 999px;
	background: transparent;
	color: var(--sts-brand, #555);
	box-shadow: inset 0 0 0 1.5px var(--sts-brand, #555);
}

.sts-style-outline.sts-share--floating .sts-share__link:hover,
.sts-style-outline.sts-share--floating .sts-share__link:focus-visible {
	background: var(--sts-brand, #555);
	color: #fff;
	box-shadow: inset 0 0 0 1.5px var(--sts-brand-hover, #333);
}

.sts-style-text.sts-share--floating .sts-share__link {
	border-radius: 999px;
	background: #fff;
	color: var(--sts-brand, #555);
	box-shadow: inset 0 0 0 1px var(--sts-brand, #555);
}

.sts-style-text.sts-share--floating .sts-share__link:hover,
.sts-style-text.sts-share--floating .sts-share__link:focus-visible {
	background: var(--sts-brand, #555);
	color: #fff;
	box-shadow: inset 0 0 0 1px var(--sts-brand-hover, #333);
}

.sts-style-accent-border.sts-share--floating .sts-share__link {
	border-radius: 10px;
	background: #fff;
	color: var(--sts-brand, #555);
	box-shadow: 0 2px 0 0 var(--sts-brand, #555), 0 1px 4px rgba(0, 0, 0, 0.15);
}

.sts-style-accent-border.sts-share--floating .sts-share__link:hover,
.sts-style-accent-border.sts-share--floating .sts-share__link:focus-visible {
	background: var(--sts-brand, #555);
	color: #fff;
	box-shadow: 0 2px 0 0 var(--sts-brand-hover, #333), 0 1px 4px rgba(0, 0, 0, 0.15);
}

.sts-share--floating .sts-share__link:hover,
.sts-share--floating .sts-share__link:focus-visible {
	background: var(--sts-brand-hover, #333);
	transform: scale(1.08);
}

/* ---------- Floating bar network-name labels ---------- */

/* Shared min-width keeps every pill the same width regardless of
   label length ("WhatsApp" vs. "Copy Link"). */
.sts-float-labels-always .sts-share__link {
	width: auto;
	min-width: 120px;
	height: auto;
	padding: 8px 14px;
	gap: 8px;
	justify-content: flex-start;
}

.sts-float-labels-always .sts-share__label {
	display: inline-block;
}

/* Icon-only at rest; label tooltip flies out on hover/focus. */
.sts-float-labels-hover .sts-share__link {
	position: relative;
	overflow: visible;
}

.sts-float-labels-hover .sts-share__label {
	position: absolute;
	top: 50%;
	transform: translateY(-50%) translateX(-6px);
	padding: 6px 10px;
	border-radius: var(--sts-radius);
	background: inherit;
	color: #fff;
	font-size: 12px;
	font-weight: 500;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.15s ease, transform 0.15s ease;
}

.sts-float-labels-hover.sts-position-left .sts-share__label {
	left: calc(100% + 8px);
	transform-origin: left center;
}

.sts-float-labels-hover.sts-position-right .sts-share__label {
	right: calc(100% + 8px);
	transform: translateY(-50%) translateX(6px);
}

.sts-float-labels-hover .sts-share__link:hover .sts-share__label,
.sts-float-labels-hover .sts-share__link:focus-visible .sts-share__label {
	opacity: 1;
	transform: translateY(-50%) translateX(0);
}

/* Horizontal bar (Bottom / Bottom sticky): the tooltip flies out
   above the button instead of sideways. */
.sts-float-labels-hover.sts-position-bottom .sts-share__label,
.sts-float-labels-hover.sts-position-bottom-sticky .sts-share__label {
	top: auto;
	bottom: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%) translateY(6px);
}

.sts-float-labels-hover.sts-position-bottom .sts-share__link:hover .sts-share__label,
.sts-float-labels-hover.sts-position-bottom-sticky .sts-share__link:hover .sts-share__label,
.sts-float-labels-hover.sts-position-bottom .sts-share__link:focus-visible .sts-share__label,
.sts-float-labels-hover.sts-position-bottom-sticky .sts-share__link:focus-visible .sts-share__label {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

.sts-share__toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--sts-btn-size, 42px);
	height: 24px;
	margin-top: 2px;
	padding: 0;
	color: #fff;
	background: #777;
	border: 0;
	border-radius: var(--sts-radius);
	cursor: pointer;
	transition: background-color 0.2s ease, transform 0.3s ease;
}

.sts-share__toggle:hover {
	background: #555;
}

.sts-share__toggle .sts-icon-svg {
	width: 14px;
	height: 14px;
	transition: transform 0.3s ease;
}

.sts-share__toggle.sts-active .sts-icon-svg {
	transform: rotate(180deg);
}

/* ---------- Copy-link feedback ---------- */

.sts-share__item--copy .sts-share__link.sts-copied {
	background: #2563eb !important;
}

/* ---------- Native (Web Share API) button ---------- */

/* Hidden until frontend.js confirms navigator.share support. */
.sts-share__item--native {
	display: none;
}

.sts-share__item--native.sts-native-supported {
	display: block;
}

.sts-share--inline .sts-share__item--native.sts-native-supported {
	display: inline-flex;
}

.sts-copy-toast {
	position: fixed;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%) translateY(0);
	padding: 10px 18px;
	background: #1f2937;
	color: #fff;
	font-size: 13px;
	border-radius: 6px;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
	z-index: 9999;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.sts-copy-toast.sts-visible {
	opacity: 1;
	transform: translateX(-50%) translateY(-6px);
}

/* Anchored: toast pinned next to the clicked button (JS sets the
   inline top/left) instead of the default fixed bottom-center. */
.sts-copy-toast--anchored {
	bottom: auto;
}

/* Inline row button: toast opens above the button. */
.sts-copy-toast--anchored.sts-copy-toast--above {
	transform: translate(-50%, calc(-100% - 10px));
}

.sts-copy-toast--anchored.sts-copy-toast--above.sts-visible {
	transform: translate(-50%, calc(-100% - 16px));
}

/* Floating bar pinned to the left edge: toast opens to the right. */
.sts-copy-toast--anchored.sts-copy-toast--right {
	transform: translate(10px, -50%);
}

.sts-copy-toast--anchored.sts-copy-toast--right.sts-visible {
	transform: translate(16px, -50%);
}

/* Floating bar pinned to the right edge: toast opens to the left. */
.sts-copy-toast--anchored.sts-copy-toast--left {
	transform: translate(calc(-100% - 10px), -50%);
}

.sts-copy-toast--anchored.sts-copy-toast--left.sts-visible {
	transform: translate(calc(-100% - 16px), -50%);
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
	.sts-share--floating,
	.sts-share__list,
	.sts-share__link,
	.sts-share__toggle,
	.sts-share__toggle .sts-icon-svg,
	.sts-copy-toast {
		transition: none !important;
	}
}

/* ---------- Mobile visibility toggle ---------- */

@media only screen and (max-width: 768px) {
	.sts-share--floating.sts-hide-on-mobile {
		display: none !important;
	}
}

/* ---------- Responsive ---------- */

@media only screen and (max-width: 768px) {
	.sts-share__title {
		display: none;
	}

	/* Re-lay as a full-width bar docked to the bottom on mobile. */
	.sts-share--floating {
		top: auto !important;
		bottom: 0;
		left: 0 !important;
		right: 0 !important;
		width: 100%;
		background: #fff;
		box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
		padding: 8px max(8px, env(safe-area-inset-left)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-right));
	}

	.sts-share--floating .sts-share__float-inner {
		flex-direction: row;
		justify-content: center;
	}

	.sts-share--floating .sts-share__list {
		flex-direction: row;
		flex-wrap: wrap;
		justify-content: center;
		flex: 1;
	}

	.sts-share--floating.sts-position-left .sts-share__list.sts-collapsed,
	.sts-share--floating.sts-position-right .sts-share__list.sts-collapsed {
		transform: translateY(140%);
	}

	.sts-share--floating .sts-share__toggle {
		width: 32px;
		height: var(--sts-btn-size, 42px);
		margin: 0 0 0 6px;
	}

	.sts-share--floating .sts-share__toggle .sts-icon-svg {
		transform: rotate(90deg);
	}

	.sts-share--floating .sts-share__toggle.sts-active .sts-icon-svg {
		transform: rotate(270deg);
	}
}

@media only screen and (max-width: 480px) {
	.sts-share--inline .sts-share__label {
		display: none;
	}
}
