/**
 * Share-link copy button — appears next to every primary page title.
 *
 * Injected by frontend/js/opl-share-copy.js into:
 *   .header-title h1   (archives, taxonomy archives, page templates)
 *   .review-name h1    (single inspiration / templates / articles)
 *
 * Subtle in default state, lifts on hover. Click copies the current URL
 * (location.href) to clipboard, swaps the link icon for a green tick,
 * fades in "Copied to clipboard" toast for 1.5s, then reverts.
 *
 * @package onepagelove
 * @version 19.14.2
 */

.opl-share-copy {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	vertical-align: middle;
	margin-left: 12px;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--text-faint);
	cursor: pointer;
	border-radius: 8px;
	opacity: .45;
	position: relative;
	-webkit-appearance: none;
	appearance: none;
	transition: opacity .15s ease, color .15s ease, background .15s ease;
}
.opl-share-copy:hover,
.opl-share-copy:focus-visible {
	opacity: 1;
	color: var(--text-title);
	background: var(--bg-surface, rgba(0,0,0,.04));
	outline: none;
}
.opl-share-copy svg {
	width: 18px;
	height: 18px;
	display: block;
}
.opl-share-copy.is-copied {
	opacity: 1;
	color: #46b450;
}
.opl-share-copy-toast {
	position: absolute;
	left: 100%;
	top: 50%;
	transform: translateY(-50%);
	margin-left: 8px;
	padding: 0;
	font-family: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	font-size: 13px;
	font-weight: 500;
	line-height: 1;
	letter-spacing: 0;
	white-space: nowrap;
	color: #46b450;
	opacity: 0;
	pointer-events: none;
	transition: opacity .2s ease;
}
.opl-share-copy.is-copied .opl-share-copy-toast {
	opacity: 1;
}

/* Single inspiration posts wrap the title in <span class="review-name">;
   set the wrap to inline-flex so the button sits next to the text on the
   same baseline rather than dropping below. The archive .header-title
   doesn't need this because the H1 is the direct child. */
.review-name {
	display: inline-flex;
	align-items: baseline;
	gap: 0;
	flex-wrap: wrap;
}

/* Hide on mobile — the button + toast would crowd narrow viewports
   and tap targets sit too close to nav. Single-post share is still
   reachable via the browser's own share menu on mobile. */
@media (max-width: 520px) {
	.opl-share-copy { display: none; }
}
