/* Article Share: a quiet outline button on the date line and its menu. */

.xy-share {
	--xy-share-line: rgb(0 0 0 / 14%);
	--xy-share-hover: rgb(0 0 0 / 32%);
	--xy-share-text: #474747;
	--xy-share-ink: #161616;
	--xy-share-surface: #fff;
	--xy-share-soft: rgb(0 0 0 / 5%);
	--xy-share-focus: var(--c-main, #3c3fde);
	--xy-share-x: #000;
	--xy-share-shadow: 0 10px 30px -8px rgb(0 0 0 / 22%), 0 0 0 1px rgb(0 0 0 / 6%);

	position: relative;
	display: inline-flex;
	align-items: center;
	vertical-align: middle;
}

.s-dark .xy-share,
.site-s-dark .xy-share {
	--xy-share-line: rgb(255 255 255 / 16%);
	--xy-share-hover: rgb(255 255 255 / 36%);
	--xy-share-text: #c4c4cc;
	--xy-share-ink: #ececec;
	--xy-share-surface: #1d1d27;
	--xy-share-soft: rgb(255 255 255 / 7%);
	--xy-share-focus: #a3a5ff;
	--xy-share-x: #33333d;
	--xy-share-shadow: 0 10px 30px -8px rgb(0 0 0 / 70%), 0 0 0 1px rgb(255 255 255 / 10%);
}

.xy-share-button {
	position: relative;
	display: inline-flex;
	gap: 5px;
	align-items: center;
	height: 24px;
	margin: 0;
	padding: 0 10px 0 8px;
	border: 1px solid var(--xy-share-line);
	border-radius: 999px;
	background: transparent;
	box-shadow: none;
	color: var(--xy-share-text);
	font: 600 12px/1 var(--ui-font, inherit);
	letter-spacing: 0;
	text-transform: none;
	white-space: nowrap;
	cursor: pointer;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;

	/* SmartMag gives buttons `transition: all`; name the properties that animate. */
	transition: border-color 0.15s, color 0.15s, transform 0.2s cubic-bezier(0.2, 1.4, 0.4, 1);
}

/* Extend the tap area to 44px without changing the button's size. */
.xy-share-button::after {
	position: absolute;
	inset: -10px -4px;
	content: "";
}

.xy-share-button:hover,
.xy-share-button[aria-expanded="true"] {
	border-color: var(--xy-share-hover);
	background: transparent;
	color: var(--xy-share-ink);
}

.xy-share-button:focus-visible {
	outline: 2px solid var(--xy-share-focus);
	outline-offset: 2px;
}

.xy-share-button:active {
	transform: scale(0.95);
}

.xy-share-icon {
	flex: none;
	width: 11px;
	height: 11px;
}

/* Set by the script when an item starts a wrapped line. */
.post-meta .meta-item.is-line-start {
	margin-top: 6px;
}

.post-meta .meta-item.is-line-start::before {
	display: none;
}

/* Menu */

.xy-share-menu {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	z-index: 30;
	display: grid;
	gap: 2px;
	min-width: 196px;
	padding: 6px;
	border-radius: 12px;
	background: var(--xy-share-surface);
	box-shadow: var(--xy-share-shadow);
	animation: xy-share-in 0.16s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.xy-share-menu[hidden] {
	display: none;
}

/* Two classes so SmartMag's `.post-meta-items a` color does not win. */
.xy-share .xy-share-item {
	display: flex;
	gap: 10px;
	align-items: center;
	width: 100%;
	margin: 0;
	padding: 8px 10px;
	border: 0;
	border-radius: 8px;
	background: none;
	box-shadow: none;
	color: var(--xy-share-ink);
	font: 500 13px/1.2 var(--ui-font, inherit);
	letter-spacing: 0;
	text-align: left;
	text-decoration: none;
	text-transform: none;
	white-space: nowrap;
	cursor: pointer;
	transition: none;
}

.xy-share .xy-share-item:hover,
.xy-share .xy-share-item:focus-visible {
	background: var(--xy-share-soft);
	color: var(--xy-share-ink);
}

.xy-share .xy-share-item:focus-visible {
	outline: 2px solid var(--xy-share-focus);
	outline-offset: -2px;
}

.xy-share-badge {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	color: #fff;
	font-size: 11px;
	line-height: 1;
}

.xy-share-badge.is-whatsapp {
	background: #25d366;
}

.xy-share-badge.is-facebook {
	background: #1877f2;
}

.xy-share-badge.is-x {
	background: var(--xy-share-x);
}

.xy-share-badge.is-linkedin {
	background: #0a66c2;
}

.xy-share-badge.is-copy {
	background: var(--xy-share-soft);
	color: var(--xy-share-ink);
}

.xy-share-rule {
	height: 1px;
	margin: 4px 6px;
	background: var(--xy-share-line);
}

@keyframes xy-share-in {
	from {
		opacity: 0;
		transform: translateY(-4px);
	}
}

@media (hover: none), (pointer: coarse) {
	.xy-share-button {
		height: 28px;
		padding: 0 10px 0 9px;
		font-size: 12.5px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.xy-share-menu {
		animation: none;
	}

	.xy-share-button {
		transition: none;
	}
}
