/**
 * Pro Social Share
 * Styles for the share bar and its two possible placements.
 *
 * Color logic (summary):
 * - "Transparent" background (default): each button shows its icon in its
 *   own brand color (--pss-brand-color, supplied inline per button), with
 *   no visible circle behind it.
 * - "Custom" background (admin-chosen hex): the button background becomes
 *   that color for ALL buttons, and the icon defaults to white to stay
 *   legible on top of it (unless the admin ALSO forced a custom icon
 *   color, which takes precedence).
 * - "Custom" icon color: always overrides the default brand color,
 *   regardless of the background setting.
 */

.pro-social-share-wrapper {
	position: relative;
	margin-bottom: 1.5em;
}

.pro-social-share-wrapper img {
	display: block;
	width: 100%;
	height: auto;
}

/* Placement: bar below the image, buttons in a horizontal row. */
.pro-social-share-wrapper--below .pro-social-share-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 12px;
}

/* Placement: bar to the right of the image, buttons in a vertical column. */
.pro-social-share-wrapper--right {
	display: flex;
	flex-direction: row;
	align-items: flex-start;
	gap: 12px;
}

.pro-social-share-wrapper--right img {
	flex: 1 1 auto;
	min-width: 0;
}

.pro-social-share-wrapper--right .pro-social-share-bar {
	display: flex;
	flex-direction: column;
	gap: 10px;
	flex: 0 0 auto;
}

/* On mobile, the vertical column moves below the image instead of
   dangerously compressing the main image's width. */
@media (max-width: 600px) {
	.pro-social-share-wrapper--right {
		flex-direction: column;
	}

	.pro-social-share-wrapper--right .pro-social-share-bar {
		flex-direction: row;
		flex-wrap: wrap;
	}
}

/* Individual button. */
.pro-social-share-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: var(--pss-radius, 50%);
	background-color: var(--pss-bg, transparent);
	color: var(--pss-icon-override, var(--pss-brand-color, #333));
	text-decoration: none;
	transition: opacity 0.15s ease, transform 0.15s ease;
	cursor: pointer;
	position: relative;
}

.pro-social-share-button:hover {
	opacity: 0.85;
	transform: translateY(-1px);
}

.pro-social-share-button svg {
	width: 20px;
	height: 20px;
	fill: currentColor;
}

/* When a custom background is active and no custom icon color was forced,
   the icon should stay white to contrast against the solid badge. This is
   handled via a utility class added in PHP rather than pure CSS, since
   CSS alone can't test one variable's value to derive another. */
.pro-social-share-bg-active .pro-social-share-button {
	color: var(--pss-icon-override, #ffffff);
}

/* Small visual confirmation after clicking "Copy link". */
.pro-social-share-button--copy-confirmed::after {
	content: attr(data-pss-message);
	position: absolute;
	bottom: 110%;
	left: 50%;
	transform: translateX(-50%);
	background: #1f2937;
	color: #fff;
	font-size: 12px;
	padding: 4px 8px;
	border-radius: 4px;
	white-space: nowrap;
	pointer-events: none;
}
