/* Gab Feed Sidebar — front-end styles. Scoped under .gabfs-feed. */

.gabfs-feed {
	/* Borders + muted text derive from the inherited theme text color, so the
	   feed looks right on light and dark themes alike. First value is a static
	   fallback for browsers without color-mix(). */
	--gabfs-border: rgba(128, 128, 128, 0.25);
	--gabfs-border: color-mix(in srgb, currentColor 14%, transparent);
	--gabfs-muted: rgba(128, 128, 128, 0.9);
	--gabfs-muted: color-mix(in srgb, currentColor 62%, transparent);
	/* Max lines of post body before truncating (keeps a sidebar tidy). */
	--gabfs-clamp: 10;
	font-size: 0.92em;
	line-height: 1.5;
	word-wrap: break-word;
	overflow-wrap: anywhere;
}

.gabfs-title {
	margin: 0 0 0.75em;
	font-size: 1.05em;
}

.gabfs-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.gabfs-post {
	padding: 0.85em 0;
	border-bottom: 1px solid var(--gabfs-border);
}

.gabfs-post:first-child {
	padding-top: 0;
}

.gabfs-empty {
	color: var(--gabfs-muted);
	font-style: italic;
	padding: 0.5em 0;
	list-style: none;
}

.gabfs-post-head {
	display: flex;
	align-items: center;
	gap: 0.5em;
	margin-bottom: 0.4em;
}

.gabfs-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	flex: 0 0 auto;
	object-fit: cover;
	background: var(--gabfs-border);
}

.gabfs-author {
	display: flex;
	flex-direction: column;
	min-width: 0;
	line-height: 1.2;
}

.gabfs-name {
	color: inherit; /* author name in body text colour, not link colour */
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.gabfs-name:hover {
	text-decoration: underline;
}

.gabfs-handle {
	color: var(--gabfs-muted);
	font-size: 0.85em;
}

.gabfs-reblog {
	color: var(--gabfs-muted);
	font-size: 0.8em;
}

.gabfs-content {
	margin: 0.2em 0 0.45em;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: var(--gabfs-clamp, 10);
	line-clamp: var(--gabfs-clamp, 10);
	overflow: hidden;
}

.gabfs-content p {
	margin: 0 0 0.5em;
}

.gabfs-content p:last-child {
	margin-bottom: 0;
}

/* Leave link colour to the theme's own <a> styles so the feed matches the site. */
.gabfs-content a {
	word-break: break-word;
}

.gabfs-media {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
	gap: 4px;
	margin: 0.45em 0;
}

.gabfs-media-item {
	position: relative;
	display: block;
	border-radius: 6px;
	overflow: hidden;
}

.gabfs-media-item img {
	display: block;
	width: 100%;
	height: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
}

.gabfs-play {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.5em;
	color: #fff;
	background: rgba(0, 0, 0, 0.25);
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.gabfs-time {
	display: inline-block;
	color: var(--gabfs-muted);
	font-size: 0.82em;
	text-decoration: none;
}

.gabfs-time:hover {
	text-decoration: underline;
}

.gabfs-footer {
	margin: 0.75em 0 0;
	font-size: 0.85em;
}

.gabfs-footer a {
	text-decoration: none;
	font-weight: 600;
}

.gabfs-footer a:hover {
	text-decoration: underline;
}

/* Highlight + slide-in for posts added live. */
.gabfs-post.gabfs-new {
	animation: gabfs-flash 2.5s ease-out;
}

@keyframes gabfs-flash {
	0% {
		background: rgba(37, 99, 235, 0.12);
		transform: translateY(-6px);
		opacity: 0;
	}
	15% {
		opacity: 1;
		transform: translateY(0);
	}
	100% {
		background: transparent;
	}
}

@media (prefers-reduced-motion: reduce) {
	.gabfs-post.gabfs-new {
		animation: none;
	}
}

/* Editor placeholder */
.gabfs-editor-card {
	border: 1px dashed rgba(0, 0, 0, 0.2);
	border-radius: 6px;
	padding: 12px 14px;
}
