/*
 * Smart Share Buttons — frontend styles.
 * No resets, no globals. Everything is namespaced under .ssb-share.
 */

.ssb-share {
	--ssb-gap: 8px;
	--ssb-radius: 6px;
	--ssb-fg: #ffffff;
	--ssb-mono: #1a1a1a;
	--ssb-floating-offset: 100px;

	box-sizing: border-box;
	margin: 1em 0;
	font-family: inherit;
}

.ssb-share *,
.ssb-share *::before,
.ssb-share *::after {
	box-sizing: border-box;
}

.ssb-share .ssb-heading {
	margin: 0 0 .5em 0;
	font-size: 1em;
	font-weight: 600;
	color: inherit;
}

.ssb-share .ssb-list {
	display: flex;
	flex-wrap: wrap;
	gap: var(--ssb-gap);
	list-style: none;
	margin: 0;
	padding: 0;
}

.ssb-share .ssb-item {
	margin: 0;
	padding: 0;
	list-style: none;
}

.ssb-share .ssb-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 8px 12px;
	border-radius: var(--ssb-radius);
	background: var(--ssb-bg, #1a1a1a);
	color: var(--ssb-fg);
	font-size: 14px;
	line-height: 1.2;
	text-decoration: none;
	transition: transform .12s ease, opacity .12s ease, box-shadow .12s ease;
	box-shadow: 0 1px 0 rgba(0,0,0,.05);
	border: 0;
	cursor: pointer;
}

.ssb-share .ssb-button:hover,
.ssb-share .ssb-button:focus-visible {
	transform: translateY(-1px);
	opacity: .92;
	color: var(--ssb-fg);
	text-decoration: none;
}

.ssb-share .ssb-button:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.ssb-share .ssb-button:active {
	transform: translateY(0);
}

/* Icon */
.ssb-share .ssb-icon {
	width: 18px;
	height: 18px;
	fill: currentColor;
	flex-shrink: 0;
	display: block;
}

/* Label visibility */
.ssb-share.ssb-style-icon-only .ssb-label {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0,0,0,0);
	white-space: nowrap;
	border: 0;
}

.ssb-share.ssb-style-icon-only .ssb-button {
	padding: 8px;
	gap: 0;
	min-width: 36px;
	justify-content: center;
}

/* Sizes */
.ssb-share.ssb-size-small  .ssb-button { font-size: 12px; padding: 6px 10px; }
.ssb-share.ssb-size-small  .ssb-icon   { width: 14px; height: 14px; }
.ssb-share.ssb-size-small.ssb-style-icon-only .ssb-button { padding: 6px; min-width: 30px; }

.ssb-share.ssb-size-large  .ssb-button { font-size: 16px; padding: 12px 18px; }
.ssb-share.ssb-size-large  .ssb-icon   { width: 22px; height: 22px; }
.ssb-share.ssb-size-large.ssb-style-icon-only .ssb-button { padding: 12px; min-width: 46px; }

/* Shapes */
.ssb-share.ssb-shape-square  .ssb-button { border-radius: 0; }
.ssb-share.ssb-shape-rounded .ssb-button { border-radius: 6px; }
.ssb-share.ssb-shape-pill    .ssb-button { border-radius: 999px; }
.ssb-share.ssb-shape-circle  .ssb-button { border-radius: 50%; padding: 8px; min-width: 36px; }
.ssb-share.ssb-shape-circle  .ssb-label  {
	position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Alignment */
.ssb-share.ssb-align-center .ssb-list { justify-content: center; }
.ssb-share.ssb-align-right  .ssb-list { justify-content: flex-end; }

/* Monochrome (single-colour) mode */
.ssb-share.ssb-mono .ssb-button {
	background: var(--ssb-mono);
}

/* Brand colours — coloured mode only.
 * Each rule sets the background; the icon picks up currentColor (white). */
.ssb-share.ssb-colored [data-ssb-platform="facebook"]      { background: #1877F2; }
.ssb-share.ssb-colored [data-ssb-platform="twitter"]       { background: #000000; }
.ssb-share.ssb-colored [data-ssb-platform="linkedin"]      { background: #0A66C2; }
.ssb-share.ssb-colored [data-ssb-platform="pinterest"]     { background: #BD081C; }
.ssb-share.ssb-colored [data-ssb-platform="reddit"]        { background: #FF4500; }
.ssb-share.ssb-colored [data-ssb-platform="tumblr"]        { background: #36465D; }
.ssb-share.ssb-colored [data-ssb-platform="vk"]            { background: #0077FF; }
.ssb-share.ssb-colored [data-ssb-platform="odnoklassniki"] { background: #EE8208; }
.ssb-share.ssb-colored [data-ssb-platform="whatsapp"]      { background: #25D366; }
.ssb-share.ssb-colored [data-ssb-platform="telegram"]      { background: #0088CC; }
.ssb-share.ssb-colored [data-ssb-platform="messenger"]     { background: #00B2FF; }
.ssb-share.ssb-colored [data-ssb-platform="line"]          { background: #06C755; }
.ssb-share.ssb-colored [data-ssb-platform="viber"]         { background: #7360F2; }
.ssb-share.ssb-colored [data-ssb-platform="mastodon"]      { background: #6364FF; }
.ssb-share.ssb-colored [data-ssb-platform="bluesky"]       { background: #0085FF; }
.ssb-share.ssb-colored [data-ssb-platform="weibo"]         { background: #E6162D; }
.ssb-share.ssb-colored [data-ssb-platform="pocket"]        { background: #EF4056; }
.ssb-share.ssb-colored [data-ssb-platform="flipboard"]     { background: #E12828; }
.ssb-share.ssb-colored [data-ssb-platform="instapaper"]    { background: #1F1F1F; }
.ssb-share.ssb-colored [data-ssb-platform="digg"]          { background: #000000; }
.ssb-share.ssb-colored [data-ssb-platform="email"]         { background: #555555; }
.ssb-share.ssb-colored [data-ssb-platform="copy"]          { background: #444444; }

/* Floating sidebar */
.ssb-share.ssb-context-floating {
	position: fixed;
	top: var(--ssb-floating-offset);
	z-index: 999;
	margin: 0;
	background: rgba(255,255,255,.94);
	padding: 8px;
	border-radius: 8px;
	box-shadow: 0 4px 16px rgba(0,0,0,.12);
	backdrop-filter: blur(8px);
}

.ssb-share.ssb-floating-left  { left: 12px; }
.ssb-share.ssb-floating-right { right: 12px; }

.ssb-share.ssb-context-floating .ssb-list {
	flex-direction: column;
}

.ssb-share.ssb-context-floating .ssb-button {
	min-width: 40px;
	padding: 8px;
	justify-content: center;
}

.ssb-share.ssb-context-floating .ssb-label {
	position: absolute;
	width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

@media (max-width: 782px) {
	.ssb-share.ssb-context-floating.ssb-hide-mobile { display: none; }
}

/* Dark mode (system preference) */
@media (prefers-color-scheme: dark) {
	.ssb-share.ssb-context-floating {
		background: rgba(20,20,20,.85);
		box-shadow: 0 4px 16px rgba(0,0,0,.45);
	}
	.ssb-share.ssb-mono .ssb-button {
		background: var(--ssb-mono, #f0f0f0);
		color: #111;
	}
}

/* Toast (used by the Copy Link button) */
.ssb-toast {
	position: fixed;
	left: 50%;
	bottom: 32px;
	transform: translateX(-50%);
	background: #111;
	color: #fff;
	padding: 10px 16px;
	border-radius: 6px;
	box-shadow: 0 6px 20px rgba(0,0,0,.25);
	font-size: 14px;
	z-index: 100000;
	opacity: 0;
	pointer-events: none;
	transition: opacity .2s ease, transform .2s ease;
}
.ssb-toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(-4px); }

/* Print — hide. */
@media print {
	.ssb-share { display: none !important; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
	.ssb-share .ssb-button { transition: none; }
	.ssb-share .ssb-button:hover,
	.ssb-share .ssb-button:focus-visible { transform: none; }
}
