/* ==========================================================================
   Floating Share FAB + Back Button (Mobile)
   Shared across all single pages. Mobile-only display.
   ========================================================================== */

/* ---- Container ---- */
.ptg-share-fab {
	position: fixed;
	bottom: 128px;
	left: 16px;
	z-index: 1000;
	display: none;
}

@media (max-width: 768px) {
	.ptg-share-fab.is-visible {
		display: block;
	}
}

/* ---- Trigger Button ---- */
.ptg-share-fab__trigger {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: none;
	background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
	transition: transform 0.2s, box-shadow 0.2s;
	position: relative;
	z-index: 2;
	-webkit-tap-highlight-color: transparent;
}

.ptg-share-fab__trigger:active {
	transform: scale(0.95);
}

.ptg-share-fab__icon--close {
	display: none;
}

.ptg-share-fab.is-open .ptg-share-fab__icon--share {
	display: none;
}

.ptg-share-fab.is-open .ptg-share-fab__icon--close {
	display: block;
}

/* ---- Menu (expands upward) ---- */
.ptg-share-fab__menu {
	position: absolute;
	bottom: 56px;
	left: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
	opacity: 0;
	pointer-events: none;
	transform: translateY(8px);
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.ptg-share-fab.is-open .ptg-share-fab__menu {
	opacity: 1;
	pointer-events: auto;
	transform: translateY(0);
}

/* ---- Share Items ---- */
.ptg-share-fab__item {
	width: 42px;
	height: 42px;
	border-radius: 50%;
	border: 1px solid #e5e7eb;
	background: #fff;
	color: #6b7280;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
	-webkit-tap-highlight-color: transparent;
	/* Start hidden, animate in */
	opacity: 0;
	transform: translateY(10px) scale(0.8);
}

.ptg-share-fab__item:active {
	transform: scale(0.92);
}

.ptg-share-fab.is-open .ptg-share-fab__item {
	opacity: 1;
	transform: translateY(0) scale(1);
}

/* Staggered animation */
.ptg-share-fab.is-open .ptg-share-fab__item:nth-child(1) { transition-delay: 0.15s; }
.ptg-share-fab.is-open .ptg-share-fab__item:nth-child(2) { transition-delay: 0.1s; }
.ptg-share-fab.is-open .ptg-share-fab__item:nth-child(3) { transition-delay: 0.05s; }
.ptg-share-fab.is-open .ptg-share-fab__item:nth-child(4) { transition-delay: 0s; }

/* Brand colors on hover/active */
.ptg-share-fab__item--x:hover,
.ptg-share-fab__item--x:active {
	background: #000;
	color: #fff;
	border-color: #000;
}

.ptg-share-fab__item--linkedin:hover,
.ptg-share-fab__item--linkedin:active {
	background: #0a66c2;
	color: #fff;
	border-color: #0a66c2;
}

.ptg-share-fab__item--line:hover,
.ptg-share-fab__item--line:active {
	background: #06c755;
	color: #fff;
	border-color: #06c755;
}

.ptg-share-fab__item--copy:hover,
.ptg-share-fab__item--copy:active {
	background: #6366f1;
	color: #fff;
	border-color: #6366f1;
}

/* ---- Toast ---- */
.ptg-share-fab__toast {
	position: absolute;
	left: 56px;
	bottom: 8px;
	background: #111827;
	color: #fff;
	font-size: 0.7rem;
	font-weight: 600;
	padding: 6px 12px;
	border-radius: 6px;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s;
}

.ptg-share-fab__toast.is-visible {
	opacity: 1;
}

/* ==========================================================================
   Floating Back Button
   Sits above the bottom nav (72px), share FAB stacks above it (128px).
   ========================================================================== */

.ptg-back-fab {
	position: fixed;
	bottom: 72px;
	left: 16px;
	z-index: 1000;
	display: none;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: 1px solid #e5e7eb;
	background: #fff;
	color: var(--color-text-secondary, #4b5563);
	cursor: pointer;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
	transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.2s;
	-webkit-tap-highlight-color: transparent;
}

@media (max-width: 768px) {
	.ptg-back-fab.is-visible {
		display: flex;
	}
}

.ptg-back-fab:hover {
	color: var(--color-primary, #0066cc);
	border-color: var(--color-primary, #0066cc);
	background: var(--color-primary-bg, rgba(0, 102, 204, 0.06));
}

.ptg-back-fab:active {
	transform: scale(0.95);
}

.ptg-back-fab svg {
	transition: transform 0.2s ease;
}

.ptg-back-fab:active svg {
	transform: translateX(-2px);
}

/* ==========================================================================
   Dark Mode
   ========================================================================== */

.dark-mode .ptg-share-fab__item {
	background: #1f2937;
	border-color: #374151;
	color: #9ca3af;
}

.dark-mode .ptg-share-fab__item--x:hover,
.dark-mode .ptg-share-fab__item--x:active {
	background: #fff;
	color: #000;
	border-color: #fff;
}

.dark-mode .ptg-share-fab__item--linkedin:hover,
.dark-mode .ptg-share-fab__item--linkedin:active {
	background: #0a66c2;
	color: #fff;
	border-color: #0a66c2;
}

.dark-mode .ptg-share-fab__item--line:hover,
.dark-mode .ptg-share-fab__item--line:active {
	background: #06c755;
	color: #fff;
	border-color: #06c755;
}

.dark-mode .ptg-share-fab__item--copy:hover,
.dark-mode .ptg-share-fab__item--copy:active {
	background: #6366f1;
	color: #fff;
	border-color: #6366f1;
}

.dark-mode .ptg-share-fab__toast {
	background: #f3f4f6;
	color: #111827;
}

.dark-mode .ptg-back-fab {
	background: #1f2937;
	border-color: #374151;
	color: #9ca3af;
}

.dark-mode .ptg-back-fab:hover {
	color: #818cf8;
	border-color: rgba(129, 140, 248, 0.4);
	background: rgba(129, 140, 248, 0.08);
}
