/* ==========================================================================
   Khulna Social — newsfeed + profile
   ========================================================================== */

:root {
	--ks-primary: #0A2647;
	--ks-bg: #FFFFFF;
	--ks-accent: #10B981;
	--ks-border: #E7ECF3;
	--ks-muted: #6B7A90;
	--ks-danger: #E24C4C;
}

.ks-feed, .ks-profile {
	max-width: 640px;
	margin: 0 auto;
	width: 100%;
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	color: var(--ks-primary);
}

/* ---------------- Composer note ----------------
   Posts are written from the Khulna Auth profile page now — this is
   just a small pointer shown where the composer used to sit. */
.ks-composer-note {
	text-align: center;
	color: var(--ks-muted);
	background: var(--ks-bg);
	border: 1px dashed var(--ks-border);
	border-radius: 14px;
	padding: 14px;
	margin-bottom: 16px;
	font-size: 14px;
}

.ks-composer-note p {
	margin: 0;
}

/* ---------------- Post card ----------------
   Facebook-style: full-width, no side borders or rounded corners — just a
   thin hairline between posts (border-bottom on each, border-top only on
   the very first one so consecutive posts don't get a doubled-up line). */
.ks-post {
	background: var(--ks-bg);
	border: none;
	border-bottom: 1px solid var(--ks-border);
	border-radius: 0;
	padding: 14px;
	margin: 0;
	box-sizing: border-box;
}

.ks-feed-list .ks-post:first-child {
	border-top: 1px solid var(--ks-border);
}

.ks-post-header {
	display: flex;
	align-items: center;
	gap: 10px;
}

.ks-avatar-link img {
	border-radius: 50%;
	display: block;
}

.ks-post-meta {
	display: flex;
	flex-direction: column;
	flex: 1;
}

.ks-post-meta-top {
	display: flex;
	align-items: center;
	gap: 5px;
}

.ks-author-name {
	font-weight: 600;
	color: var(--ks-primary);
	text-decoration: none;
	font-size: 14px;
}

.ks-meta-dot {
	color: var(--ks-muted);
	font-size: 13px;
}

/* Facebook-style Follow link. Display only for now — no click behaviour
   is wired up yet. */
/* Small inline "Name · Follow" link used in the post header — visually
   distinct from the bigger .ks-follow-btn pill button on the profile page,
   but both share the .ks-follow-toggle class so one click handler covers them. */
.ks-post-follow-btn {
	background: none;
	border: none;
	padding: 0;
	color: #1877F2;
	font-weight: 600;
	font-size: 13px;
	cursor: pointer;
}

.ks-post-follow-btn:hover {
	text-decoration: underline;
}

.ks-post-follow-btn.is-following {
	color: var(--ks-muted);
}

.ks-post-time {
	font-size: 12px;
	color: var(--ks-muted);
}

.ks-post-delete {
	background: none;
	border: none;
	color: var(--ks-muted);
	font-size: 18px;
	cursor: pointer;
	line-height: 1;
}

.ks-post-delete:hover {
	color: var(--ks-danger);
}

.ks-post-title {
	margin: 10px 0 4px;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.35;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 1;
	overflow: hidden;
}

.ks-post-content {
	margin: 10px 0;
	font-size: 15px;
	line-height: 1.5;
	white-space: normal;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 1;
	overflow: hidden;
}

.ks-post.is-expanded .ks-post-title,
.ks-post.is-expanded .ks-post-content {
	display: block;
	-webkit-line-clamp: unset;
	overflow: visible;
}

.ks-post.is-expanded .ks-post-content {
	white-space: pre-wrap;
}

.ks-post-seemore {
	background: none;
	border: none;
	padding: 0 0 8px;
	color: var(--ks-primary, #1D4ED8);
	font-weight: 700;
	font-size: 13px;
	cursor: pointer;
}

.ks-post-image {
	width: calc(100% + 28px);
	margin-left: -14px;
	margin-right: -14px;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border-radius: 0;
	margin-bottom: 6px;
}

.ks-post-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	display: block;
}

.ks-post-actions {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px 14px;
	padding-top: 8px;
	border-top: 1px solid var(--ks-border);
	margin-top: 8px;
}

.ks-post-price {
	margin-left: auto;
	color: #1D4ED8;
	font-weight: 700;
	font-size: 15px;
	white-space: nowrap;
}

.ks-like-btn, .ks-comment-toggle, .ks-share-btn, .ks-cart-btn {
	background: none;
	border: none;
	display: flex;
	align-items: center;
	gap: 6px;
	color: var(--ks-muted);
	cursor: pointer;
	font-size: 13px;
	padding: 4px 6px;
	border-radius: 8px;
	transition: color 0.15s ease, transform 0.1s ease;
}

.ks-like-btn:active, .ks-comment-toggle:active, .ks-share-btn:active, .ks-cart-btn:active, .ks-buy-btn:active {
	transform: scale(0.95);
}

.ks-buy-btn {
	background: #1D4ED8;
	color: #fff;
	border: none;
	font-weight: 600;
	font-size: 13px;
	padding: 6px 14px;
	border-radius: 8px;
	cursor: pointer;
	white-space: nowrap;
	transition: transform 0.1s ease;
}

.ks-like-btn.is-liked {
	color: var(--ks-danger);
}

.ks-like-btn.is-liked .dashicons-heart:before {
	content: "\f487"; /* filled heart look via color; dashicons heart is outline by default */
}

.ks-share-btn.is-shared {
	color: var(--ks-primary, #1D4ED8);
}

/* ---------------- Comments ---------------- */
.ks-comments {
	margin-top: 10px;
	border-top: 1px solid var(--ks-border);
	padding-top: 10px;
}

.ks-comment {
	display: flex;
	gap: 8px;
	margin-bottom: 8px;
}

.ks-comment img {
	border-radius: 50%;
	flex-shrink: 0;
}

.ks-comment-body {
	background: #F4F7FB;
	border-radius: 10px;
	padding: 6px 10px;
	font-size: 13px;
}

.ks-comment-author {
	font-weight: 600;
	margin-right: 6px;
	color: var(--ks-primary);
}

.ks-comment-form {
	display: flex;
	gap: 8px;
	margin-top: 6px;
}

.ks-comment-input {
	flex: 1;
	border: 1px solid var(--ks-border);
	border-radius: 16px;
	padding: 6px 12px;
	font-size: 13px;
	outline: none;
}

.ks-comment-form button {
	background: var(--ks-accent);
	color: #fff;
	border: none;
	border-radius: 16px;
	padding: 6px 14px;
	font-size: 13px;
	cursor: pointer;
}

/* ---------------- Infinite scroll ---------------- */
.ks-feed-sentinel {
	height: 1px;
}

.ks-no-more {
	text-align: center;
	color: var(--ks-muted);
	font-size: 13px;
	padding: 14px 0 20px;
}

/* ---------------- Profile ---------------- */
.ks-profile-header {
	display: flex;
	align-items: flex-start;
	gap: 16px;
	background: var(--ks-primary);
	color: #fff;
	border-radius: 16px;
	padding: 20px;
	margin-bottom: 18px;
}

.ks-profile-header img {
	border-radius: 50%;
	border: 3px solid #fff;
	flex-shrink: 0;
}

.ks-profile-info {
	flex: 1;
}

.ks-profile-name {
	margin: 0 0 4px;
	font-size: 20px;
}

.ks-profile-location {
	margin: 0 0 6px;
	font-size: 12px;
	color: rgba(255, 255, 255, 0.7);
	display: flex;
	align-items: center;
	gap: 4px;
}

.ks-profile-location .dashicons {
	font-size: 14px;
	width: 14px;
	height: 14px;
}

.ks-profile-bio {
	margin: 0 0 10px;
	font-size: 13px;
	color: rgba(255, 255, 255, 0.8);
}

.ks-profile-stats {
	display: flex;
	gap: 16px;
	font-size: 13px;
}

.ks-follow-btn {
	background: var(--ks-accent);
	color: #fff;
	border: none;
	border-radius: 18px;
	padding: 8px 18px;
	font-weight: 600;
	cursor: pointer;
	align-self: flex-start;
}

.ks-follow-btn.is-following {
	background: transparent;
	border: 1px solid #fff;
}

@media (max-width: 480px) {
	.ks-profile-header { flex-wrap: wrap; }
	.ks-follow-btn { margin-top: 8px; }
}

/* ---------------- Profile sections: My Post / Share Post / My Store / All Details ---------------- */
.ks-profile-sections {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 8px;
	margin-bottom: 16px;
}

.ks-profile-section {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	padding: 12px 4px;
	background: #FBFCFE;
	border: 1px solid var(--ks-border);
	border-radius: 12px;
	color: var(--ks-primary);
	cursor: pointer;
	font-size: 12px;
	font-weight: 600;
	text-align: center;
}

.ks-profile-section:hover {
	border-color: var(--ks-accent);
}

.ks-profile-section.is-active {
	background: var(--ks-primary);
	border-color: var(--ks-primary);
	color: #fff;
}

.ks-profile-section .dashicons {
	width: 20px;
	height: 20px;
	font-size: 20px;
}

.ks-profile-section-label {
	line-height: 1.2;
}

.ks-profile-section-panel .ks-feed {
	padding: 0;
}

.ks-no-posts {
	color: var(--ks-muted);
	font-size: 14px;
	text-align: center;
	padding: 24px 0;
}

.ks-profile-details {
	font-size: 13px;
	color: var(--ks-muted);
}

.ks-profile-details p {
	margin: 4px 0;
}

.ks-profile-details strong {
	color: var(--ks-primary);
}

/* ---------------- My Store: product grid (3 per row) ---------------- */
.ks-store-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
}

.ks-store-item {
	background: var(--ks-bg);
	border: 1px solid var(--ks-border);
	border-radius: 10px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.ks-store-item-image {
	aspect-ratio: 1 / 1;
	background: var(--ks-border);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.ks-store-item-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ks-store-item-image .dashicons {
	font-size: 26px;
	width: 26px;
	height: 26px;
	color: var(--ks-muted);
}

.ks-store-item-name {
	font-size: 12px;
	font-weight: 600;
	color: var(--ks-primary);
	padding: 6px 8px 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ks-store-item-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 6px;
	padding: 4px 8px 8px;
}

.ks-store-item-price {
	font-size: 12px;
	font-weight: 700;
	color: var(--ks-accent);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Display only for now — no click behaviour is wired up yet. */
.ks-store-cart-btn {
	flex-shrink: 0;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	border: none;
	background: var(--ks-primary);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
}

.ks-store-cart-btn .dashicons {
	font-size: 14px;
	width: 14px;
	height: 14px;
}

@media (max-width: 360px) {
	.ks-store-grid {
		gap: 6px;
	}
}

/* ---------------- People carousel (horizontal scroll, avatar + name + Follow only) ----------------
   Card width is a percentage of the container, same idea as the 3-per-row
   product/store grids — so on the Marketplace page (960px container) a
   card ends up the same size as a product card, and on the Newsfeed
   (640px container) the row still shows ~3 cards with a peek of the next
   one to hint that it scrolls. */
.ks-people-carousel {
	margin: 0 0 14px;
}

.ks-people-carousel-title {
	font-size: 13px;
	font-weight: 700;
	color: var(--ks-primary);
	margin: 0 0 8px;
}

.ks-people-scroll {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	overflow-y: hidden;
	padding-bottom: 4px;
	scroll-snap-type: x proximity;
	-webkit-overflow-scrolling: touch;
}

.ks-people-scroll::-webkit-scrollbar {
	height: 5px;
}

.ks-people-scroll::-webkit-scrollbar-thumb {
	background: var(--ks-border);
	border-radius: 4px;
}

/* Exactly 4 full cards fit edge-to-edge on a phone screen — no dead
   half-visible 5th card left peeking off the right side. Desktop/tablet
   (no max-width match) keeps the wider 30% card, ~3 per view, since
   there's room to spare there anyway. */
.ks-people-card {
	position: relative;
	flex: 0 0 30%;
	scroll-snap-align: start;
	background: var(--ks-bg);
	border: 1px solid var(--ks-border);
	border-radius: 10px;
	padding: 10px 4px;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 5px;
}

/* Facebook-style dismiss ("Not interested") button, top-right corner. */
.ks-people-dismiss {
	position: absolute;
	top: 4px;
	right: 4px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	border: none;
	background: var(--ks-accent);
	color: #fff;
	font-size: 13px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
	z-index: 1;
}

.ks-people-dismiss:hover {
	opacity: 0.85;
}

.ks-people-avatar-link {
	display: block;
	line-height: 0;
}

.ks-people-avatar-link img {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	object-fit: cover;
}

.ks-people-name {
	font-size: 12px;
	font-weight: 600;
	color: var(--ks-primary);
	text-decoration: none;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ks-people-follow-btn {
	background: var(--ks-accent);
	color: #fff;
	border: none;
	border-radius: 14px;
	padding: 5px 8px;
	font-size: 11px;
	font-weight: 600;
	cursor: pointer;
	width: 100%;
}

.ks-people-follow-btn.is-following {
	background: transparent;
	border: 1px solid var(--ks-border);
	color: var(--ks-muted);
}

.ks-people-sentinel {
	flex: 0 0 1px;
}

@media (max-width: 640px) {
	.ks-people-scroll {
		gap: 6px;
	}
	.ks-people-card {
		flex: 0 0 calc((100% - 18px) / 4); /* 4 cards, 3 gaps of 6px */
		padding: 8px 3px;
	}
	.ks-people-avatar-link img {
		width: 44px;
		height: 44px;
	}
	.ks-people-name {
		font-size: 10px;
	}
	.ks-people-follow-btn {
		font-size: 9px;
		padding: 4px 2px;
		border-radius: 10px;
	}
	.ks-people-dismiss {
		width: 15px;
		height: 15px;
		font-size: 11px;
		top: 2px;
		right: 2px;
	}
}
