/* User Posts page */

.posts-section {
	padding: 120px 0;
}

.posts-feed {
	margin-top: 10px;
}

.post-box {
	background-color: var(--white-color);
	border-radius: 20px;
	min-height: auto;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 30px;
	margin-bottom: 30px;
	padding: 40px;
}

.post-header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 15px;
}

.post-avatar {
	flex-shrink: 0;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: var(--accent-color);
	color: var(--white-color);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: 0.02em;
}

.post-author h2 {
	display: flex;
	align-items: center;
	font-size: 20px;
	color: var(--primary-color);
	margin: 0;
}

.post-author p {
	color: var(--text-color);
	line-height: normal;
	margin: 5px 0 0;
}

.post-time {
	font-size: 14px;
	color: var(--text-color);
	white-space: nowrap;
}

.post-body {
	display: flex;
	flex-direction: column;
}

.post-thumbnails {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 15px;
}

.post-thumb {
	width: 88px;
	height: 88px;
	padding: 0;
	border: none;
	border-radius: 12px;
	overflow: hidden;
	cursor: pointer;
	background: var(--secondary-color);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-thumb:hover,
.post-thumb:focus-visible {
	transform: scale(1.03);
	box-shadow: 0 4px 14px rgba(8, 54, 59, 0.15);
	outline: 2px solid var(--accent-color);
	outline-offset: 2px;
}

.post-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.post-text {
	margin: 0;
	border-bottom: 1px solid var(--divider-color);
	padding-bottom: 15px;
	white-space: pre-wrap;
	word-break: break-word;
}

.post-comment {
	display: flex;
	gap: 10px;
}

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

.post-comment-author h3 {
	font-size: 16px;
	margin: 0;
	color: var(--primary-color);
}

.post-comment-author p {
	font-size: 14px;
	margin-bottom: 5px;
	color: var(--text-color);
}

.post-comment-text {
	margin-bottom: 0;
	color: var(--text-color);
	white-space: pre-wrap;
	word-break: break-word;
}

.posts-empty {
	text-align: center;
	align-items: center;
}

.posts-empty-icon {
	font-size: 42px;
	color: var(--accent-color);
	margin-bottom: 16px;
}

.posts-empty h3 {
	color: var(--primary-color);
	margin-bottom: 10px;
}

.posts-empty p {
	margin-bottom: 24px;
}

.posts-loader {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 24px 0;
	color: var(--text-color);
}

.posts-loader[hidden] {
	display: none !important;
}

.posts-loader-spinner {
	width: 22px;
	height: 22px;
	border: 2px solid var(--divider-color);
	border-top-color: var(--accent-color);
	border-radius: 50%;
	animation: posts-spin 0.7s linear infinite;
}

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

.posts-sentinel {
	height: 1px;
}

/* Photo lightbox */

.photo-lightbox {
	position: fixed;
	inset: 0;
	z-index: 10000;
	background: rgba(8, 54, 59, 0.92);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px 64px;
}

.photo-lightbox[hidden] {
	display: none !important;
}

.photo-lightbox-stage {
	position: relative;
	max-width: min(960px, 100%);
	max-height: calc(100vh - 48px);
	display: flex;
	flex-direction: column;
	align-items: center;
}

.photo-lightbox-image {
	max-width: 100%;
	max-height: calc(100vh - 96px);
	object-fit: contain;
	border-radius: 8px;
}

.photo-lightbox-counter {
	margin: 12px 0 0;
	color: var(--white-color);
	font-size: 14px;
	text-align: center;
}

.photo-lightbox-close {
	position: absolute;
	top: 20px;
	right: 20px;
	width: 44px;
	height: 44px;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	color: var(--white-color);
	font-size: 20px;
	cursor: pointer;
	transition: background 0.2s ease;
}

.photo-lightbox-close:hover,
.photo-lightbox-close:focus-visible {
	background: rgba(255, 255, 255, 0.22);
	outline: none;
}

.photo-lightbox-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 48px;
	height: 48px;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	color: var(--white-color);
	font-size: 18px;
	cursor: pointer;
	transition: background 0.2s ease;
}

.photo-lightbox-nav:hover,
.photo-lightbox-nav:focus-visible {
	background: rgba(255, 255, 255, 0.22);
	outline: none;
}

.photo-lightbox-prev {
	left: 16px;
}

.photo-lightbox-next {
	right: 16px;
}

.photo-lightbox-nav:disabled {
	opacity: 0.35;
	cursor: default;
}

@media (max-width: 767px) {
	.posts-section {
		padding: 60px 0;
	}

	.post-box {
		padding: 25px;
	}

	.post-box .post-header .post-author p {
		font-size: 14px;
	}

	.post-header {
		align-items: flex-start;
	}

	.post-author {
		flex: 1;
		min-width: 0;
	}

	.post-time {
		flex-basis: 100%;
		margin-left: calc(48px + 15px) !important;
		margin-top: -5px;
		white-space: normal;
	}

	.post-thumb {
		width: 72px;
		height: 72px;
	}

	.photo-lightbox {
		padding: 16px 48px;
	}

	.photo-lightbox-prev {
		left: 8px;
	}

	.photo-lightbox-next {
		right: 8px;
	}
}
