/*
 * Native share buttons -- floating sticky bar (bottom edge on mobile,
 * left edge on desktop) + one inline row placed directly above the
 * author-bio box, both shown at once. Uses the theme's own design
 * tokens so it matches dark/light mode automatically; no external
 * requests.
 *
 * Only ONE background color is used (the sticky bar / inline row
 * itself, via --bg-surface) -- the icon buttons underneath are
 * transparent, so there's no per-button colored box/gradient
 * competing with it.
 */

.myanas-share-sticky {
	display: flex;
	position: fixed;
	z-index: 1050; /* above the header's 1001-1003 and its dropdowns/overlay (999-9999), below the social popup modal (100000) */
	background: var(--bg-surface);
	border: 1px solid var(--border-subtle);
	box-shadow: var(--shadow);

	/* Mobile default: full-width bar pinned to the bottom edge. */
	left: 0;
	right: 0;
	bottom: 0;
	top: auto;
	transform: none;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	gap: 16px;
	padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
	border-radius: var(--radius) var(--radius) 0 0;
	border-bottom: none;
}

.myanas-share-sticky .myanas-share-icons {
	flex-direction: row;
}

.myanas-share-sticky .myanas-share-label {
	writing-mode: horizontal-tb;
	transform: none;
	margin-bottom: 0;
	margin-right: 4px;
}

@media (min-width: 1100px) {
	.myanas-share-sticky {
		/* Desktop: fixed to the left edge instead. */
		left: -4px;
		right: auto;
		bottom: auto;
		top: 50%;
		transform: translateY(-50%);
		flex-direction: column;
		gap: 10px;
		padding: 8px 2px;
		border-radius: var(--radius);
		border-bottom: 1px solid var(--border-subtle);
	}

	.myanas-share-sticky .myanas-share-icons {
		flex-direction: column;
	}

	.myanas-share-sticky .myanas-share-label {
		writing-mode: vertical-rl;
		transform: rotate(180deg);
		margin-bottom: 2px;
		margin-right: 0;
	}
}

.myanas-share-label {
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--text-secondary);
}

.myanas-share-icons {
	display: flex;
	align-items: center;
	gap: 10px;
}

.myanas-share-inline {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 12px;
	margin: 1rem 0 1rem;
	padding: 1rem 0;
	border-top: 1px solid var(--border-subtle);
	border-bottom: 1px solid var(--border-subtle);
}

.myanas-share-inline .myanas-share-label {
	margin-right: 4px;
}

.myanas-share-inline .myanas-share-icons {
	flex-direction: row;
	flex-wrap: wrap;
}

.myanas-share-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	background: transparent;
	border: 1px solid var(--border-subtle);
	border-radius: 10px;
	box-shadow: none;
	color: var(--text-secondary);
	cursor: pointer;
	transition: transform 0.15s ease, color 0.15s ease, border-color 0.15s ease;
	text-decoration: none;
	position: relative;
}

.myanas-share-btn:hover,
.myanas-share-btn:focus-visible {
	transform: translateY(-2px) scale(1.05);
	color: var(--coral-bright);
	border-color: var(--coral-bright);
}

.myanas-share-btn:focus-visible {
	outline: 2px solid var(--cyan-bright);
	outline-offset: 2px;
}

.myanas-share-copy-label {
	position: absolute;
	bottom: calc(100% + 6px);
	left: 50%;
	transform: translateX(-50%);
	white-space: nowrap;
	font-size: 0.75rem;
	color: var(--text-primary);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.15s ease;
}

.myanas-share-btn--copy.is-copied .myanas-share-copy-label {
	opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
	.myanas-share-btn {
		transition: none;
	}
}

/* Reserve space at the bottom of the page on mobile so the fixed
   bottom bar never covers the tail end of comments/content. */
body.has-myanas-share-sticky {
	padding-bottom: calc(52px + env(safe-area-inset-bottom));
}

@media (min-width: 1100px) {
	body.has-myanas-share-sticky {
		padding-bottom: 0;
	}
}
