/* SmartShare — all selectors are prefixed to stay out of the theme's way. */

.sswp-share {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
	margin: 1.25em 0;
	line-height: 1;
}

.sswp-share,
.sswp-share * {
	box-sizing: border-box;
}

.sswp-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
}

.sswp-buttons > li {
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
	position: relative;
}

.sswp-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: var(--sswp-radius, 0);
	color: #fff !important;
	cursor: pointer;
	text-decoration: none !important;
	box-shadow: none !important;
	-webkit-appearance: none;
	appearance: none;
	transition: filter .15s ease, transform .15s ease;
}

.sswp-btn:hover,
.sswp-btn:focus {
	color: #fff !important;
	filter: brightness(.94);
}

.sswp-btn:hover {
	transform: translateY(-1px);
}

.sswp-btn:focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

.sswp-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
}

.sswp-btn svg {
	width: 19px;
	height: 19px;
	display: block;
}

/* The AI sparkle reads a touch smaller, so give it a little more room. */
.sswp-trigger-ai svg {
	width: 22px;
	height: 22px;
}

/* Per-button count revealed on hover/focus (overlays the icon). */
.sswp-count {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: inherit;
	border-radius: inherit;
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	opacity: 0;
	pointer-events: none;
	transition: opacity .15s ease .2s;
}

.sswp-btn:hover .sswp-count,
.sswp-btn:focus-visible .sswp-count {
	opacity: 1;
}

/* A count of 0 is never shown. */
.sswp-count.sswp-count-hide {
	display: none;
}

/* Copy-link feedback. */
.sswp-check {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	display: none;
	align-items: center;
	justify-content: center;
	background: inherit;
	border-radius: inherit;
}

.sswp-btn[data-sswp-copied] .sswp-check {
	display: flex;
}

.sswp-btn[data-sswp-copied] .sswp-count {
	opacity: 0 !important;
}

.sswp-share [data-sswp-copied] {
	position: relative;
}

.sswp-share [data-sswp-copied]::after {
	content: attr(data-copied-label);
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%);
	background: #111;
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	line-height: 1;
	padding: 5px 8px;
	border-radius: 4px;
	white-space: nowrap;
	z-index: 100000;
	pointer-events: none;
}

/* Like button: a short pop the moment it is liked. */
.sswp-btn-like.sswp-pop {
	animation: sswp-pop .28s ease;
}

@keyframes sswp-pop {
	0% { transform: scale(1); }
	40% { transform: scale(1.25); }
	100% { transform: scale(1); }
}

/* Dropdown trigger + panel (Share and AI). */
.sswp-menu-wrap {
	position: relative;
}

/* Default (horizontal layout): panel drops BELOW the trigger, centered on it,
   as a vertical column of icons, sliding down. */
.sswp-dropdown {
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	/* Transparent bridge so the hover doesn't drop between trigger and panel. */
	padding-top: 8px;
	display: none;
	z-index: 99999;
}

/* Opening is driven by JS (adds .sswp-open) so only one panel is ever open;
   :focus-within keeps keyboard navigation working. */
.sswp-menu-wrap:focus-within > .sswp-dropdown,
.sswp-dropdown.sswp-open {
	display: block;
}

.sswp-dropdown.sswp-open {
	animation: sswp-slide-down .18s ease;
}

@keyframes sswp-slide-down {
	from { opacity: 0; transform: translate(-50%, -8px); }
	to   { opacity: 1; transform: translate(-50%, 0); }
}

.sswp-dropdown-list {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0 !important;
	padding: 6px !important;
	list-style: none !important;
	background: #fff;
	border: 1px solid #e3e3e3;
	border-radius: 5px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, .16);
}

.sswp-dropdown-list > li {
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
	position: relative;
}

/* Shares + likes totals (numbers only). */
.sswp-totals {
	display: flex;
	align-items: center;
	gap: 14px;
}

.sswp-stat {
	display: inline-flex;
	align-items: center;
	gap: 5px;
}

.sswp-stat-icon {
	display: inline-flex;
}

.sswp-stat-icon svg {
	width: 16px;
	height: 16px;
	display: block;
}

.sswp-stat-shares .sswp-stat-icon {
	color: #4469ba;
}

.sswp-stat-likes .sswp-stat-icon {
	color: #e0245e;
}

.sswp-stat-num {
	font-size: 16px;
	font-weight: 800;
}

.sswp-stat-hide {
	display: none;
}

/* Live counts: the icons stay visible so the layout isn't empty, but the total
   NUMBER is hidden until the real value arrives — so the cached (possibly stale)
   number never flashes before it is corrected. The animation is a fallback that
   reveals the number anyway if the fetch is slow or JS is absent. */
.sswp-live:not(.sswp-live-ready) .sswp-stat-num {
	opacity: 0;
}

.sswp-live .sswp-stat-num {
	animation: sswp-reveal .25s ease 2s forwards;
}

@keyframes sswp-reveal {
	to { opacity: 1; }
}

/* Vertical floating layout (desktop). Positioning (fixed/top/left) is applied
   inline by the script; these rules only handle orientation. */
.sswp-vertical {
	flex-direction: column;
	align-items: center;
	gap: 8px;
	margin: 0;
	z-index: 9990;
	transition: opacity .3s ease;
}

.sswp-vertical.sswp-scroll-hidden {
	opacity: 0;
	pointer-events: none;
}

/* Optional background card so the floating bar (and its count numbers) stay
   readable over content, especially on mobile. Text color auto-contrasts. */
.sswp-vertical.sswp-has-card {
	background: var(--sswp-card-bg, #fff);
	padding: 8px 7px;
	border-radius: 5px;
	box-shadow: 0 3px 16px rgba(0, 0, 0, .18);
}

.sswp-vertical.sswp-has-card .sswp-stat-num {
	color: var(--sswp-card-fg, #222);
}

.sswp-vertical .sswp-buttons {
	flex-direction: column;
}

.sswp-vertical .sswp-totals {
	flex-direction: column;
	align-items: center;
	gap: 10px;
}

/* Vertical: stack each total as number above icon (count, then icon). */
.sswp-vertical .sswp-stat {
	flex-direction: column-reverse;
	align-items: center;
	gap: 3px;
}

/* Vertical layout: panel opens to the RIGHT of the trigger, vertically centered
   on it, as a horizontal row of icons, sliding in from the left. */
.sswp-vertical .sswp-dropdown {
	top: 50%;
	left: 100%;
	padding-top: 0;
	padding-left: 8px;
	transform: translateY(-50%);
}

.sswp-vertical .sswp-dropdown-list {
	flex-direction: row;
}

.sswp-vertical .sswp-dropdown.sswp-open {
	animation: sswp-slide-right .18s ease;
}

@keyframes sswp-slide-right {
	from { opacity: 0; transform: translate(-8px, -50%); }
	to   { opacity: 1; transform: translate(0, -50%); }
}

/* Mobile: smaller buttons. Layout is the same 4 controls + totals. */
@media (max-width: 781px) {
	.sswp-btn {
		width: 34px;
		height: 34px;
	}

	.sswp-btn svg {
		width: 16px;
		height: 16px;
	}

	.sswp-trigger-ai svg {
		width: 19px;
		height: 19px;
	}

	.sswp-count {
		font-size: 11px;
	}

	.sswp-stat-num {
		font-size: 15px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sswp-btn,
	.sswp-count {
		transition: none;
	}

	.sswp-btn:hover {
		transform: none;
	}

	.sswp-btn-like.sswp-pop {
		animation: none;
	}
}
