/* SocialEchoBox Frontend */

/* ── Feed-Wrapper ────────────────────────── */

.seb-feed-wrapper {
	margin-bottom: 32px;
}

/* ── Filter-Bar ──────────────────────────── */

.seb-filter-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 20px;
}

.seb-filter-bar__btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 16px;
	border: 1px solid #ddd;
	border-radius: 999px;
	background: #f5f5f5;
	color: #555;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s ease;
	line-height: 1.4;
}

.seb-filter-bar__btn:hover {
	background: #e8e8e8;
	border-color: #ccc;
}

.seb-filter-bar__btn.is-active {
	background: #7cb342;
	border-color: #7cb342;
	color: #fff;
}

.seb-filter-bar__btn .seb-icon {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
}

.seb-filter-bar__btn.is-active .seb-icon {
	color: #fff;
}

/* ── Feed-Layouts ─────────────────────────── */

.seb-feed--grid {
	display: grid;
	gap: 24px;
}

.seb-feed--cols-1 { grid-template-columns: 1fr; }
.seb-feed--cols-2 { grid-template-columns: repeat(2, 1fr); }
.seb-feed--cols-3 { grid-template-columns: repeat(3, 1fr); }
.seb-feed--cols-4 { grid-template-columns: repeat(4, 1fr); }

.seb-feed--list {
	display: flex;
	flex-direction: column;
	gap: 24px;
	max-width: 680px;
}

/* Masonry-Layout via CSS column-count (keine JS-Abhängigkeit) */
.seb-feed--masonry {
	column-gap: 24px;
}
.seb-feed--masonry.seb-feed--cols-1 { column-count: 1; }
.seb-feed--masonry.seb-feed--cols-2 { column-count: 2; }
.seb-feed--masonry.seb-feed--cols-3 { column-count: 3; }
.seb-feed--masonry.seb-feed--cols-4 { column-count: 4; }

.seb-feed--masonry .seb-post {
	break-inside: avoid;
	margin-bottom: 24px;
	display: inline-block; /* Fallback gegen Column-Breaks */
	width: 100%;
}

@media (max-width: 768px) {
	.seb-feed--cols-3,
	.seb-feed--cols-4 {
		grid-template-columns: repeat(2, 1fr);
	}
	.seb-feed--masonry.seb-feed--cols-3,
	.seb-feed--masonry.seb-feed--cols-4 {
		column-count: 2;
	}
}

@media (max-width: 480px) {
	.seb-feed--grid {
		grid-template-columns: 1fr !important;
	}
	.seb-feed--masonry {
		column-count: 1 !important;
	}

	.seb-filter-bar {
		gap: 6px;
	}

	.seb-filter-bar__btn {
		padding: 5px 12px;
		font-size: 12px;
	}
}

/* ── Post-Card ────────────────────────────── */

.seb-post {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.seb-post.is-hidden {
	display: none;
}

/* Header */
.seb-post__header {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 16px;
}

.seb-post__platform-icon {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
	display: flex;
	align-items: center;
}

.seb-post__platform-icon .seb-icon {
	width: 100%;
	height: 100%;
}

.seb-post__platform-icon--bluesky   { color: #0085ff; }
.seb-post__platform-icon--mastodon  { color: #6364ff; }
.seb-post__platform-icon--instagram { color: #e4405f; }
.seb-post__platform-icon--threads   { color: #000000; }
.seb-post__platform-icon--facebook  { color: #1877f2; }
.seb-post__platform-icon--youtube   { color: #ff0000; }
.seb-post__platform-icon--vimeo     { color: #1ab7ea; }

.seb-post__author {
	flex: 1;
	min-width: 0;
}

.seb-post__author strong {
	display: block;
	font-size: 14px;
	line-height: 1.3;
}

.seb-post__handle {
	font-size: 12px;
	color: #666;
}

/* Media */
.seb-post__media {
	width: 100%;
}

.seb-post__media--gallery {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 2px;
}

.seb-post__image {
	width: 100%;
	height: auto;
	display: block;
	object-fit: cover;
}

.seb-post__media--gallery .seb-post__image {
	aspect-ratio: 1;
	object-fit: cover;
}

/* Lightbox Trigger */
.seb-lightbox-trigger {
	display: block;
	cursor: zoom-in;
	line-height: 0;
}

.seb-lightbox-trigger:focus {
	outline: 2px solid #7cb342;
	outline-offset: -2px;
}

/* Video */
.seb-post__video-wrapper {
	position: relative;
	cursor: pointer;
}

.seb-post__video-wrapper--local {
	cursor: default;
}

.seb-post__video {
	width: 100%;
	height: auto;
	display: block;
	border-radius: 0;
}

.seb-post__video-thumb {
	width: 100%;
	height: auto;
	display: block;
}

.seb-post__video-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.4);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s;
}

.seb-post__video-wrapper:hover .seb-post__video-overlay {
	background: rgba(0, 0, 0, 0.6);
}

.seb-post__play-icon {
	font-size: 48px;
	color: #fff;
}

/* Consent-Dialog */
.seb-consent-dialog {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.85);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 20px;
	text-align: center;
	z-index: 10;
}

.seb-consent-dialog__text {
	color: #fff;
	font-size: 14px;
	margin-bottom: 16px;
	max-width: 280px;
}

.seb-consent-dialog__btn {
	display: inline-block;
	padding: 8px 20px;
	background: #fff;
	color: #333;
	border: none;
	border-radius: 4px;
	font-size: 14px;
	cursor: pointer;
	text-decoration: none;
}

.seb-consent-dialog__btn:hover {
	background: #f0f0f0;
}

/* Content */
.seb-post__content {
	padding: 12px 16px;
	font-size: 14px;
	line-height: 1.6;
	flex: 1;
	word-wrap: break-word;
	overflow-wrap: break-word;
}

.seb-post__content p {
	margin: 0 0 8px;
}

.seb-post__content p:last-child {
	margin-bottom: 0;
}

.seb-post__content a {
	color: #0073aa;
	text-decoration: none;
}

.seb-post__content a:hover {
	text-decoration: underline;
}

/* Footer */
.seb-post__footer {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px 16px 12px;
	font-size: 12px;
	color: #666;
	border-top: 1px solid #f0f0f0;
}

.seb-post__date {
	color: #999;
}

.seb-post__engagement {
	display: flex;
	gap: 8px;
}

.seb-post__link {
	margin-left: auto;
	color: #0073aa;
	text-decoration: none;
	font-size: 12px;
}

.seb-post__link:hover {
	text-decoration: underline;
}

/* ── Load More ───────────────────────────── */

.seb-load-more {
	display: flex;
	justify-content: center;
	margin-top: 24px;
}

.seb-load-more__btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 28px;
	border: 1px solid #ddd;
	border-radius: 6px;
	background: #fff;
	color: #333;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s ease;
}

.seb-load-more__btn:hover {
	background: #f5f5f5;
	border-color: #bbb;
}

.seb-load-more__btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.seb-load-more__btn.is-loading {
	pointer-events: none;
}

/* Spinner */
.seb-spinner {
	display: inline-block;
	width: 16px;
	height: 16px;
	border: 2px solid #ccc;
	border-top-color: #7cb342;
	border-radius: 50%;
	animation: seb-spin 0.6s linear infinite;
}

@keyframes seb-spin {
	to { transform: rotate(360deg); }
}

/* ── Lightbox ────────────────────────────── */

.seb-lightbox {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.92);
	opacity: 0;
	transition: opacity 0.25s ease;
}

.seb-lightbox.is-visible {
	opacity: 1;
}

.seb-lightbox__image {
	max-width: 90vw;
	max-height: 90vh;
	object-fit: contain;
	border-radius: 4px;
	box-shadow: 0 4px 40px rgba(0, 0, 0, 0.5);
	user-select: none;
}

.seb-lightbox__close {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 40px;
	height: 40px;
	border: none;
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
	font-size: 24px;
	line-height: 1;
	border-radius: 50%;
	cursor: pointer;
	transition: background 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
}

.seb-lightbox__close:hover {
	background: rgba(255, 255, 255, 0.3);
}

.seb-lightbox__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	border: none;
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
	font-size: 22px;
	line-height: 1;
	border-radius: 50%;
	cursor: pointer;
	transition: background 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
}

.seb-lightbox__nav:hover {
	background: rgba(255, 255, 255, 0.3);
}

.seb-lightbox__nav--prev {
	left: 16px;
}

.seb-lightbox__nav--next {
	right: 16px;
}

.seb-lightbox__nav:disabled {
	opacity: 0.3;
	cursor: default;
}

/* Body scroll lock */
body.seb-lightbox-open {
	overflow: hidden;
}

/* Audio-Embed (Mixcloud etc.) */
.seb-post__audio {
	background: #f6f7f7;
	border-radius: 4px;
	overflow: hidden;
	margin: 6px 0;
}
.seb-audio-embed {
	display: block;
	border: 0;
	width: 100%;
}
