/* DFB Pin Widget - frontend styles */

/* Host: widget that has a pin button attached */
.dfb-pin-host {
	position: relative;
}

/* The pin button itself */
.dfb-pin-btn {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 28px;
	height: 28px;
	padding: 0;
	margin: 0;
	background: transparent;
	border: 1px solid transparent;
	border-radius: 4px;
	cursor: pointer;
	color: #6c757d;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
	z-index: 5;
	line-height: 1;
}

.dfb-pin-btn:hover {
	background: rgba(0, 0, 0, 0.05);
	color: #333;
}

.dfb-pin-btn:focus-visible {
	outline: 2px solid #80bdff;
	outline-offset: 2px;
}

.dfb-pin-btn svg {
	width: 16px;
	height: 16px;
	transition: transform 0.2s ease;
	display: block;
}

/* Pinned state on the button */
.dfb-pin-btn.is-pinned {
	color: #b30000;
	border-color: rgba(179, 0, 0, 0.25);
	background: rgba(179, 0, 0, 0.06);
}

.dfb-pin-btn.is-pinned svg {
	transform: rotate(-45deg);
}

/* Pinned widget - fixed to viewport */
.dfb-pinned {
	position: fixed !important;
	z-index: 99998 !important; /* high but below WP admin bar (99999) */
	margin: 0 !important;       /* zero margin so widget's visual top edge matches top:value */
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	transition: box-shadow 0.2s ease;
}

/* Spacer inserted at top of sidebar to make room for pinned widget */
.dfb-pin-spacer {
	visibility: hidden;
	pointer-events: none;
}

/* Shield: covers the area above the pinned widget so other widgets
   scrolling past underneath are not visible in the gap.
   `top` and `height` are set inline by JS based on shieldTop/topOffset. */
.dfb-pin-shield {
	position: fixed !important;
	z-index: 99997 !important; /* just below .dfb-pinned (99998), below WP admin bar (99999) */
	pointer-events: none;
	margin: 0 !important;
	padding: 0 !important;
}

/* Disable pinning on small screens */
@media (max-width: 768px) {
	.dfb-pin-btn {
		display: none;
	}
	.dfb-pinned {
		position: static !important;
		box-shadow: none !important;
		max-height: none;
		overflow-y: visible;
	}
	.dfb-pin-spacer {
		display: none !important;
	}
	.dfb-pin-shield {
		display: none !important;
	}
}
