/* Bluesky Sidebar - offcanvas panel styles */

:root {
	--bsky-accent: #1185fe;
	--bsky-panel-bg: #ffffff;
	--bsky-panel-text: #0f1419;
	--bsky-panel-width: 380px;
}

.bsky-sidebar-toggle,
.bsky-sidebar-panel,
.bsky-sidebar-overlay {
	box-sizing: border-box;
}

.bsky-sidebar-toggle *,
.bsky-sidebar-panel *,
.bsky-sidebar-overlay * {
	box-sizing: border-box;
}

/* Toggle button */
.bsky-sidebar-toggle {
	position: fixed;
	top: 50%;
	transform: translateY(-50%) rotate(180deg);
	writing-mode: vertical-rl;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 14px 10px;
	background: var(--bsky-accent);
	color: #fff;
	border: none;
	border-radius: 8px 0 0 8px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.02em;
	z-index: 100000;
	box-shadow: -2px 2px 10px rgba(0, 0, 0, 0.15);
	transition: padding 0.15s ease;
}

.bsky-sidebar-toggle[data-position="right"] {
	right: 0;
	border-radius: 8px 0 0 8px;
}

.bsky-sidebar-toggle[data-position="left"] {
	left: 0;
	transform: translateY(-50%) rotate(0deg);
	border-radius: 0 8px 8px 0;
}

.bsky-sidebar-toggle:hover {
	filter: brightness(1.08);
}

.bsky-sidebar-toggle-icon {
	display: inline-flex;
	transform: rotate(180deg);
}

.bsky-sidebar-toggle[data-position="left"] .bsky-sidebar-toggle-icon {
	transform: none;
}

/* Overlay */
.bsky-sidebar-overlay {
	position: fixed;
	inset: 0;
	background: rgba(15, 20, 25, 0.45);
	z-index: 100001;
	opacity: 0;
	transition: opacity 0.25s ease;
}

.bsky-sidebar-overlay.is-visible {
	opacity: 1;
}

/* Panel */
.bsky-sidebar-panel {
	position: fixed;
	top: 0;
	bottom: 0;
	width: var(--bsky-panel-width);
	max-width: 92vw;
	background: var(--bsky-panel-bg);
	color: var(--bsky-panel-text);
	z-index: 100002;
	display: flex;
	flex-direction: column;
	box-shadow: 0 0 24px rgba(0, 0, 0, 0.2);
	transition: transform 0.3s ease;
}

.bsky-sidebar-panel[data-position="right"] {
	right: 0;
	transform: translateX(100%);
}

.bsky-sidebar-panel[data-position="left"] {
	left: 0;
	transform: translateX(-100%);
}

.bsky-sidebar-panel.is-open {
	transform: translateX(0);
}

.bsky-sidebar-panel-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	border-bottom: 1px solid rgba(15, 20, 25, 0.1);
	flex-shrink: 0;
}

.bsky-sidebar-panel-title {
	font-size: 16px;
	font-weight: 700;
}

.bsky-sidebar-panel-title a {
	color: inherit;
	text-decoration: none;
}

.bsky-sidebar-panel-title a:hover {
	text-decoration: underline;
}

.bsky-sidebar-close {
	background: transparent;
	border: none;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	color: inherit;
	padding: 4px 8px;
	border-radius: 4px;
}

.bsky-sidebar-close:hover {
	background: rgba(15, 20, 25, 0.06);
}

.bsky-sidebar-panel-body {
	overflow-y: auto;
	padding: 16px 20px 32px;
	flex: 1;
}

/* Profile summary */
.bsky-sidebar-profile {
	padding-bottom: 16px;
	margin-bottom: 16px;
	border-bottom: 1px solid rgba(15, 20, 25, 0.1);
}

.bsky-sidebar-profile-stats {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	font-size: 14px;
}

.bsky-sidebar-profile-stat {
	opacity: 0.75;
}

.bsky-sidebar-profile-stat strong {
	opacity: 1;
	font-weight: 700;
	margin-right: 3px;
}

.bsky-sidebar-profile-bio {
	margin-top: 10px;
	font-size: 14px;
	line-height: 1.5;
}

/* Feed timeline */
.bsky-sidebar-timeline {
	list-style: none;
	margin: 0;
	padding: 0;
}

.bsky-sidebar-post {
	position: relative;
	padding: 0 0 20px 0;
	margin: 0 0 0 20px;
	border-left: 2px solid rgba(15, 20, 25, 0.1);
	padding-left: 16px;
}

.bsky-sidebar-post:last-child {
	border-left-color: transparent;
}

.bsky-sidebar-post-row {
	display: flex;
	gap: 12px;
}

.bsky-sidebar-post-avatar {
	flex-shrink: 0;
	margin-left: -29px;
}

.bsky-sidebar-post-avatar img {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	display: block;
	background: var(--bsky-panel-bg);
	border: 2px solid var(--bsky-panel-bg);
	object-fit: cover;
}

.bsky-sidebar-post-body {
	min-width: 0;
	flex: 1;
}

.bsky-sidebar-repost-label {
	display: flex;
	align-items: center;
	gap: 4px;
	font-size: 12px;
	font-weight: 600;
	opacity: 0.6;
	margin: 0 0 8px;
}

.bsky-sidebar-icon-repost {
	display: inline-flex;
	flex-shrink: 0;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

.bsky-sidebar-post-divider {
	margin: 16px 0 0;
	border: none;
	border-top: 1px solid rgba(15, 20, 25, 0.1);
}

.bsky-sidebar-post:last-child .bsky-sidebar-post-divider {
	display: none;
}

.bsky-sidebar-post-meta {
	display: flex;
	align-items: baseline;
	gap: 8px;
	flex-wrap: wrap;
}

.bsky-sidebar-post-author {
	font-weight: 700;
	font-size: 14px;
}

.bsky-sidebar-post-time {
	font-size: 13px;
	opacity: 0.6;
}

.bsky-sidebar-post-text {
	margin-top: 4px;
	font-size: 14px;
	line-height: 1.5;
	word-wrap: break-word;
}

.bsky-sidebar-post-text a {
	color: var(--bsky-accent);
	text-decoration: none;
}

.bsky-sidebar-post-text a:hover {
	text-decoration: underline;
}

.bsky-sidebar-post-embed {
	display: block;
	margin-top: 10px;
	border-radius: 10px;
	overflow: hidden;
	border: 1px solid rgba(15, 20, 25, 0.1);
}

.bsky-sidebar-post-embed-image img {
	width: 100%;
	display: block;
}

.bsky-sidebar-post-embed-link {
	text-decoration: none;
	color: inherit;
}

.bsky-sidebar-post-embed-link img {
	width: 100%;
	display: block;
	max-height: 160px;
	object-fit: cover;
}

.bsky-sidebar-embed-link-body {
	display: block;
	padding: 8px 10px;
	font-size: 13px;
}

.bsky-sidebar-embed-link-title {
	font-weight: 600;
}

.bsky-sidebar-post-stats {
	display: flex;
	align-items: center;
	gap: 20px;
	margin-top: 10px;
}

.bsky-sidebar-stat {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 12px;
	opacity: 0.6;
}

.bsky-sidebar-stat svg {
	flex-shrink: 0;
}

.bsky-sidebar-post-link {
	display: inline-block;
	margin-top: 10px;
	font-size: 12px;
	color: var(--bsky-accent);
	text-decoration: none;
}

.bsky-sidebar-post-link:hover {
	text-decoration: underline;
}

.bsky-sidebar-empty {
	font-size: 14px;
	opacity: 0.7;
}

@media (max-width: 480px) {
	.bsky-sidebar-panel {
		width: 100vw;
		max-width: 100vw;
	}
}
