/* Design tokens using CSS variables for accents and theme */
:root {
	--bg: #efefef;
	--text: #626262;
	--muted: #9a9a9a;
	--primary: #1876f2;
	--surface: #ffffff;
	--shadow: rgba(0, 0, 0, 0.06);
	--shadow-strong: rgba(0, 0, 0, 0.12);
}
html[data-theme="dark"] {
	--bg: #0f172a; /* slate-900 */
	--text: #d1d5db; /* gray-300 */
	--muted: #9ca3af; /* gray-400 */
	--primary: #3b82f6; /* blue-500 */
	--surface: #111827; /* gray-900 */
	--shadow: rgba(0, 0, 0, 0.4);
	--shadow-strong: rgba(0, 0, 0, 0.6);
}

* {
	margin: 0;
	padding: 0;
	font-family: "Gill Sans", "Gill Sans MT", Calibri, "Trebuchet MS", sans-serif;
	box-sizing: border-box;
}
body {
	background: var(--bg);
	color: var(--text);
}
nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	/* Gradient accent while keeping brand primary */
	background: linear-gradient(90deg, var(--primary), #1a73e8);
	padding: 5px 5%;
	position: sticky;
	top: 0;
	z-index: 100;
	backdrop-filter: saturate(1.2);
}
.logo {
	width: 180px;
	margin-right: 32px;
	image-rendering: -webkit-optimize-contrast;
	image-rendering: crisp-edges;
}
.nav-left,
.nav-right {
	display: flex;
	align-items: center;
}
.nav-left ul li {
	list-style: none;
	display: inline-block;
}
.nav-left ul li img {
	width: 28px;
	margin: 0 15px;
}
.nav-user-icon img {
	width: 40px;
	border-radius: 50%;
	cursor: pointer;
}
.nav-user-icon {
	margin-left: 30px;
}
.search-box {
	background: #efefef;
	width: 350px;
	border-radius: 20px;
	display: flex;
	align-items: center;
	padding: 0 15px;
}
.search-box img {
	width: 18px;
}
.search-box input {
	width: 100%;
	background: transparent;
	padding: 10px;
	outline: none;
	border: 0;
}
.online {
	position: relative;
}
.online:after {
	content: "";
	width: 7px;
	height: 7px;
	border: 2px solid #fff;
	border-radius: 50%;
	background: #41db51;
	position: absolute;
	top: 0;
	right: 0;
}
.container {
	display: flex;
	justify-content: space-between;
	padding: 13px 5%;
}
.left-sidebar {
	flex-basis: 25%;
	position: sticky;
	top: 70px;
	align-self: flex-start;
}
.right-sidebar {
	flex-basis: 25%;
	position: sticky;
	top: 70px;
	align-self: flex-start;
	background: var(--surface);
	padding: 20px;
	border-radius: 4%;
	color: var(--text);
}
.main-content {
	flex-basis: 47%;
}
.imp-links a,
.shortcut-links a {
	text-decoration: none;
	display: flex;
	margin-bottom: 30px;
	color: var(--text);
	width: fit-content;
}
.imp-links a img {
	width: 25px;
	margin-right: 15px;
}
.imp-links a:last-child {
	color: var(--primary);
}
.imp-links {
	border-bottom: 1px solid #ccc;
}
.shortcut-links a img {
	width: 40px;
	border-radius: 4px;
	margin-right: 15px;
}
.shortcut-links p {
	margin: 25px 0;
	color: #626262;
	font-weight: 500;
}
.sidebar-title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 18px;
}
.right-sidebar h4 {
	font-weight: 700;
	font-size: 16px;
	color: var(--text);
}
.sidebar-title a {
	text-decoration: none;
	color: var(--primary);
	font-size: 12px;
	font-weight: 600;
}
.event {
	display: flex;
	font-size: 14px;
	margin-bottom: 20px;
}
.left-event {
	border-radius: 10px;
	height: 65px;
	width: 65px;
	margin-right: 15px;
	padding-top: 10px;
	text-align: center;
	position: relative;
	overflow: hidden;
	box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.event p {
	font-size: 12px;
}
.event a {
	font-size: 12px;
	text-decoration: none;
	color: #1876f2;
}
.left-event span {
	position: absolute;
	bottom: 0;
	left: 0;
	width: 100%;
	background: #1876f2;
	color: #fff;
	font-size: 10px;
	padding: 4px 0;
}
.right-event p img {
	width: 9px;
	height: 2vh;
}
.sidebar-ads {
	width: 100%;
	margin-bottom: 20px;
	border-radius: 4px;
}
.online-list {
	display: flex;
	align-items: center;
	margin-bottom: 20px;
}
.online-list .online img {
	width: 20px;
	border-radius: 50%;
}
.online-list .online::after {
	top: unset;
	bottom: 0;
}
.story-gallery {
	display: flex;
	justify-content: space-between;
	margin-bottom: 20px;
}
.story {
	flex-basis: 18%;
	padding-top: 32%;
	position: relative;
	background-position: center;
	background-size: cover;
	border-radius: 10px;
}
.story img {
	position: absolute;
	width: 45px;
	border-radius: 50%;
	top: 10px;
	left: 10px;
	border: 5px solid #1876f2;
}
.story p {
	position: absolute;
	bottom: 10px;
	width: 100%;
	text-align: center;
	color: #fff;
	font-size: 14px;
}
.story1 {
	background-image: linear-gradient(transparent, rgba(0, 0, 0, 0.5)),
		url(images/status-1.png);
}
.story2 {
	background-image: linear-gradient(transparent, rgba(0, 0, 0, 0.5)),
		url(images/status-2.png);
}
.story3 {
	background-image: linear-gradient(transparent, rgba(0, 0, 0, 0.5)),
		url(images/status-3.png);
}
.story4 {
	background-image: linear-gradient(transparent, rgba(0, 0, 0, 0.5)),
		url(images/status-4.png);
}
.story5 {
	background-image: linear-gradient(transparent, rgba(0, 0, 0, 0.5)),
		url(images/status-5.png);
}
.story.story1 img {
	top: unset;
	left: 50%;
	bottom: 40px;
	transform: translateX(-50%);
	border: 0;
	width: 35px;
}
.write-post-container {
	width: 100%;
	background: white;
	border-radius: 6px;
	padding: 20px;
	color: #626262;
}
.user-profile {
	display: flex;
	align-items: center;
}
.user-profile img {
	width: 45px;
	border-radius: 50%;
	margin-right: 10px;
}
.user-profile p {
	margin-bottom: -5px;
	font-weight: 600;
	color: var(--text);
}
.user-profile small {
	font-size: 12px;
	color: var(--muted);
}
.post-input-container {
	padding-left: 55px;
	padding-top: 20px;
}
.post-input-container textarea {
	width: 100%;
	outline: 0;
	border: 0;
	border-bottom: 1px solid #ccc;
	background: transparent;
	resize: none;
}
.add-post-link {
	display: flex;
	margin-top: 10px;
}
.add-post-link a {
	text-decoration: none;
	align-items: center;
	color: #626262;
	margin-right: 30px;
	font-size: 13px;
}
.add-post-link a img {
	width: 20px;
	margin-right: 10px;
}
.post-container {
	width: 100%;
	background: #fff;
	border-radius: 6px;
	padding: 20px;
	color: #626262;
	margin: 20px 0;
}
.user-profile span {
	font-size: 13px;
	color: #9a9a9a;
}
.post-text {
	color: var(--muted);
	margin: 15px 0;
	font-size: 15px;
}
.post-text span {
	color: var(--text);
	font-weight: 600;
}
.post-text a {
	color: var(--primary);
	text-decoration: none;
	font-weight: 600;
}
.post-img {
	width: 100%;
	border-radius: 4px;
	margin-bottom: 5px;
}
.post-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.activity-icons div img {
	width: 18px;
	margin-right: 10px;
}
.activity-icons div {
	display: inline-flex;
	align-items: center;
	margin-right: 30px;
}
.post-profile-icon img {
	width: 20px;
	border-radius: 50%;
	margin-right: 5px;
}
.post-row a {
	color: #9a9a9a;
}
.load-more-btn {
	display: flex;
	margin: auto;
	cursor: pointer;
	padding: 5px 10px;
	border: 1px solid var(--muted);
	color: var(--text);
	background: linear-gradient(180deg, rgba(255,255,255,0.8), rgba(255,255,255,0.6));
	border-radius: 8px;
}
.footer {
	text-align: center;
	color: #9a9a9a;
	padding: 10px 0 20px;
	font-size: 13px;
}

/* Smooth scrolling for in-page anchors */
html {
	scroll-behavior: smooth;
}

/* Subtle shadows and rounded corners for posts and cards */
.post-container {
	border-radius: 8px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.post-container:hover {
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
	transform: translateY(-2px);
}
.write-post-container {
	border-radius: 8px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.write-post-container:hover {
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
	transform: translateY(-1px);
}
.right-sidebar {
	border-radius: 8px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.right-sidebar:hover {
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

/* Hover effects and smooth transitions for buttons and icons */
.load-more-btn {
	transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.load-more-btn:hover {
	background: #1876f2;
	color: #fff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
	transform: translateY(-1px);
}
.activity-icons div {
	cursor: pointer;
	padding: 6px 8px;
	border-radius: 6px;
	transition: transform 0.15s ease, background-color 0.15s ease;
}
.activity-icons div:hover {
	transform: translateY(-1px);
	background-color: rgba(0, 0, 0, 0.05);
}
.activity-icons div img {
	transition: transform 0.15s ease;
}
.activity-icons div:hover img {
	transform: scale(1.05);
}

/* Comment toggle box for posts */
.comments-box {
	display: none;
	margin-top: 10px;
	border-top: 1px solid #eee;
	padding-top: 10px;
}
.comments-box textarea {
	width: 100%;
	min-height: 64px;
	border: 1px solid #ccc;
	border-radius: 6px;
	padding: 8px;
	outline: none;
}
.comments-box textarea:focus {
	border-color: #1876f2;
}

/* Fade-in on scroll */
.reveal {
	opacity: 0;
	transform: translateY(12px);
}
.reveal-visible {
	opacity: 1;
	transform: none;
	transition: opacity 0.6s ease, transform 0.6s ease;
	will-change: opacity, transform;
}

/* Pointer for accordions */
details > summary {
	cursor: pointer;
}

/* Responsive layout */
@media (max-width: 1024px) {
	.container {
		padding: 10px 3%;
	}
}
@media (max-width: 767px) {
	.container {
		display: block; /* single column */
	}
	.left-sidebar,
	.right-sidebar,
	.main-content {
		flex-basis: 100%;
	}
	.left-sidebar,
	.right-sidebar {
		position: static;
		top: unset;
	}
	.search-box {
		width: 100%;
	}
	.story-gallery {
		overflow-x: auto;
		display: flex;
		gap: 10px;
		max-width: 100%;
		overscroll-behavior-x: contain;
	}
	.story {
		flex: 0 0 auto;
		min-width: 140px;
	}
}
@media (max-width: 600px) {
	.logo {
		width: 120px;
		margin-right: 20px;
	}
	.nav-left ul li img {
		width: 24px;
		margin: 0 10px;
	}
	.post-container {
		padding: 16px;
	}
	.add-post-link a {
		margin-right: 16px;
	}
}

/* --- Enhancements: tabs, accordions, cards --- */
/* Accordon using native <details> and <summary> */
.accordion {
	border: 1px solid #ccc;
	border-radius: 6px;
	padding: 8px 12px;
	margin: 10px 0;
	background: #fff;
}
.accordion.slim {
	padding: 6px 8px;
	margin: 8px 0;
}
.accordion > summary {
	cursor: pointer;
	color: #626262;
	font-weight: 500;
	list-style: none;
}
.accordion > summary::-webkit-details-marker {
	display: none;
}
.accordion .accordion-body {
	margin-top: 8px;
}

/* Tabs using radio inputs */
.tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	margin-bottom: 10px;
}
.tabs input[type="radio"] {
	display: none;
}
.tabs label {
	padding: 6px 10px;
	border: 1px solid #9a9a9a;
	border-radius: 4px;
	cursor: pointer;
	color: #626262;
	font-size: 13px;
	background: #fff;
}
/* active tab visual without changing brand palette */
#tab-overview:checked ~ label[for="tab-overview"],
#tab-features:checked ~ label[for="tab-features"],
#tab-usage:checked ~ label[for="tab-usage"],
#tab-faq:checked ~ label[for="tab-faq"] {
	border-color: #1876f2;
	color: #1876f2;
}
.tab-panels {
	width: 100%;
}
.tab-panel {
	display: none;
}
#tab-overview:checked ~ .tab-panels #panel-overview,
#tab-features:checked ~ .tab-panels #panel-features,
#tab-usage:checked ~ .tab-panels #panel-usage,
#tab-faq:checked ~ .tab-panels #panel-faq {
	display: block;
}

/* Cards */
.card-group {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 12px;
	margin-top: 10px;
}
.info-card {
	border: 1px solid #ccc;
	border-radius: 6px;
	padding: 12px;
	background: #fff;
}
.card-title {
	font-size: 14px;
	color: #626262;
	margin-bottom: 6px;
	font-weight: 600;
}

/* Section header (reuses post-container spacing) */
.section-header h4 {
	font-weight: 600;
	font-size: 16px;
	color: #626262;
}
.section-header .post-text {
	margin-top: 4px;
}

/* Sidebar accordion spacing tweaks */
.sidebar-accordion summary {
	color: #626262;
}

/* Accessibility utilities and focus states */
.skip-link {
	position: absolute;
	left: -999px;
	top: 0;
	background: var(--primary);
	color: #fff;
	padding: 8px 12px;
	border-radius: 6px;
	z-index: 1000;
}
.skip-link:focus {
	left: 12px;
}
.sr-only {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}
:focus-visible {
	outline: 2px solid var(--primary);
	outline-offset: 2px;
}

/* Keyboard focus for activity icons */
.activity-icons .like,
.activity-icons .comment,
.activity-icons .share {
	cursor: pointer;
	border-radius: 6px;
	padding: 4px 6px;
}
.activity-icons .like:hover,
.activity-icons .comment:hover,
.activity-icons .share:hover,
.activity-icons .like:focus-visible,
.activity-icons .comment:focus-visible,
.activity-icons .share:focus-visible {
	background: rgba(24, 118, 242, 0.08);
}

/* Timestamp style for readability */
.timestamp {
	font-size: 12px;
	color: var(--muted);
}

/* Reaction badge (placeholder) */
.reaction-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	color: var(--muted);
}
.reaction-badge img {
	width: 16px;
	height: 16px;
}

/* Ensure images are responsive */
img {
	max-width: 100%;
	height: auto;
}


/* Notification badge UI */
.nav-left ul li.has-badge { position: relative; }
.nav-left ul li.has-badge .badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--color-accent, #0a84ff);
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Profile hover preview card */
.user-profile { position: relative; }
.profile-preview {
  position: absolute;
  left: 52px;
  top: 0;
  transform: translateY(-8px);
  background: var(--surface, #fff);
  color: var(--text, #111);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  padding: 10px;
  display: none;
  width: 240px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 10;
}
.preview-avatar { width: 48px; height: 48px; border-radius: 50%; }
.preview-meta { margin-left: 8px; display: inline-block; vertical-align: top; }
.user-profile:hover .profile-preview,
.user-profile:focus-within .profile-preview { display: block; }
.profile-preview .primary-btn.small { font-size: 12px; padding: 6px 10px; border-radius: 8px; }

/* Empty state design */
.empty-state { text-align: center; padding: 24px; border: 1px dashed rgba(0,0,0,0.15); border-radius: 12px; background: rgba(0,0,0,0.02); margin: 12px 0; }
.empty-state .empty-illustration { width: 120px; height: auto; opacity: 0.8; }
.empty-state h2 { margin: 8px 0 4px; font-size: 18px; }
.empty-state p { margin: 0 0 12px; color: var(--text-muted, #555); }
.empty-state .primary-btn { background: var(--color-accent, #0a84ff); color: #fff; border: none; padding: 8px 14px; border-radius: 10px; cursor: pointer; }

/* Mobile-first redesign adjustments */
/* Desktop: Improve visibility of About Shortcuts under More Shortcuts in left sidebar */
@media (min-width: 901px) {
  .left-sidebar details:not(.sidebar-accordion) { margin-top: 12px; }
  .left-sidebar details:not(.sidebar-accordion) > summary {
    font-weight: 600;
    color: var(--text);
    padding: 6px 0;
  }
  .left-sidebar details:not(.sidebar-accordion) > summary:hover { color: var(--primary); }
  .left-sidebar details:not(.sidebar-accordion) .post-text {
    color: var(--text);
    font-size: 14px;
    line-height: 1.45;
  }
}
@media (max-width: 767px) {
	.container {
		display: block; /* single column */
	}
	.left-sidebar,
	.right-sidebar,
	.main-content {
		flex-basis: 100%;
	}
	.left-sidebar,
	.right-sidebar {
		position: static;
		top: unset;
	}
	.search-box {
		width: 100%;
	}
	.story-gallery {
		overflow-x: auto;
		display: flex;
		gap: 10px;
		max-width: 100%;
		overscroll-behavior-x: contain;
	}
	.story {
		flex: 0 0 auto;
		min-width: 140px;
	}
}
@media (max-width: 600px) {
	.logo {
		width: 120px;
		margin-right: 20px;
	}
	.nav-left ul li img {
		width: 24px;
		margin: 0 10px;
	}
	.post-container {
		padding: 16px;
	}
	.add-post-link a {
		margin-right: 16px;
	}
}

/* --- Enhancements: tabs, accordions, cards --- */
/* Accordon using native <details> and <summary> */
.accordion {
	border: 1px solid #ccc;
	border-radius: 6px;
	padding: 8px 12px;
	margin: 10px 0;
	background: #fff;
}
.accordion.slim {
	padding: 6px 8px;
	margin: 8px 0;
}
.accordion > summary {
	cursor: pointer;
	color: #626262;
	font-weight: 500;
	list-style: none;
}
.accordion > summary::-webkit-details-marker {
	display: none;
}
.accordion .accordion-body {
	margin-top: 8px;
}

/* Tabs using radio inputs */
.tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	margin-bottom: 10px;
}
.tabs input[type="radio"] {
	display: none;
}
.tabs label {
	padding: 6px 10px;
	border: 1px solid #9a9a9a;
	border-radius: 4px;
	cursor: pointer;
	color: #626262;
	font-size: 13px;
	background: #fff;
}
/* active tab visual without changing brand palette */
#tab-overview:checked ~ label[for="tab-overview"],
#tab-features:checked ~ label[for="tab-features"],
#tab-usage:checked ~ label[for="tab-usage"],
#tab-faq:checked ~ label[for="tab-faq"] {
	border-color: #1876f2;
	color: #1876f2;
}
.tab-panels {
	width: 100%;
}
.tab-panel {
	display: none;
}
#tab-overview:checked ~ .tab-panels #panel-overview,
#tab-features:checked ~ .tab-panels #panel-features,
#tab-usage:checked ~ .tab-panels #panel-usage,
#tab-faq:checked ~ .tab-panels #panel-faq {
	display: block;
}

/* Cards */
.card-group {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 12px;
	margin-top: 10px;
}
.info-card {
	border: 1px solid #ccc;
	border-radius: 6px;
	padding: 12px;
	background: #fff;
}
.card-title {
	font-size: 14px;
	color: #626262;
	margin-bottom: 6px;
	font-weight: 600;
}

/* Section header (reuses post-container spacing) */
.section-header h4 {
	font-weight: 600;
	font-size: 16px;
	color: #626262;
}
.section-header .post-text {
	margin-top: 4px;
}

/* Sidebar accordion spacing tweaks */
.sidebar-accordion summary {
	color: #626262;
}

/* Accessibility utilities and focus states */
.skip-link {
	position: absolute;
	left: -999px;
	top: 0;
	background: var(--primary);
	color: #fff;
	padding: 8px 12px;
	border-radius: 6px;
	z-index: 1000;
}
.skip-link:focus {
	left: 12px;
}
.sr-only {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}
:focus-visible {
	outline: 2px solid var(--primary);
	outline-offset: 2px;
}

/* Keyboard focus for activity icons */
.activity-icons .like,
.activity-icons .comment,
.activity-icons .share {
	cursor: pointer;
	border-radius: 6px;
	padding: 4px 6px;
}
.activity-icons .like:hover,
.activity-icons .comment:hover,
.activity-icons .share:hover,
.activity-icons .like:focus-visible,
.activity-icons .comment:focus-visible,
.activity-icons .share:focus-visible {
	background: rgba(24, 118, 242, 0.08);
}

/* Timestamp style for readability */
.timestamp {
	font-size: 12px;
	color: var(--muted);
}

/* Reaction badge (placeholder) */
.reaction-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	color: var(--muted);
}
.reaction-badge img {
	width: 16px;
	height: 16px;
}

/* Ensure images are responsive */
img {
	max-width: 100%;
	height: auto;
}


/* Notification badge UI */
.nav-left ul li.has-badge { position: relative; }
.nav-left ul li.has-badge .badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--color-accent, #0a84ff);
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Profile hover preview card */
.user-profile { position: relative; }
.profile-preview {
  position: absolute;
  left: 52px;
  top: 0;
  transform: translateY(-8px);
  background: var(--surface, #fff);
  color: var(--text, #111);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  padding: 10px;
  display: none;
  width: 240px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 10;
}
.preview-avatar { width: 48px; height: 48px; border-radius: 50%; }
.preview-meta { margin-left: 8px; display: inline-block; vertical-align: top; }
.user-profile:hover .profile-preview,
.user-profile:focus-within .profile-preview { display: block; }
.profile-preview .primary-btn.small { font-size: 12px; padding: 6px 10px; border-radius: 8px; }

/* Empty state design */
.empty-state { text-align: center; padding: 24px; border: 1px dashed rgba(0,0,0,0.15); border-radius: 12px; background: rgba(0,0,0,0.02); margin: 12px 0; }
.empty-state .empty-illustration { width: 120px; height: auto; opacity: 0.8; }
.empty-state h2 { margin: 8px 0 4px; font-size: 18px; }
.empty-state p { margin: 0 0 12px; color: var(--text-muted, #555); }
.empty-state .primary-btn { background: var(--color-accent, #0a84ff); color: #fff; border: none; padding: 8px 14px; border-radius: 10px; cursor: pointer; }

/* Mobile-first block removed in favor of desktop-first base and max-width overrides */

/* Progressive enhancements at larger screens */
/* Sticky sidebars with independently scrollable feed */
html, body { height: 100%; overflow: hidden; }

/* Constrain the content area to viewport height below the header */
.container { height: calc(100vh - 70px); overflow: hidden; }

/* Sidebars stick under the header and can scroll if their content exceeds viewport */
.left-sidebar, .right-sidebar {
  position: sticky; /* ensure stickiness even if previously overridden */
  top: 70px;
  align-self: flex-start;
  max-height: calc(100vh - 70px);
  overflow-y: auto;
}

/* Middle column (feed) scrolls within the viewport */
.main-content { height: 100%; overflow-y: auto; }
.post-container { padding: 4vw; }
.post-text { font-size: clamp(0.9rem, 2.5vw, 1rem); }
.primary-btn { min-height: 44px; padding: 0.5rem 1rem; }
.user-profile img { width: clamp(32px, 9vw, 44px); height: auto; }
.nav-left ul li img { width: clamp(20px, 6vw, 28px); }
.activity-icons img { width: clamp(18px, 5vw, 24px); }

/* Breakpoints per request */
/* default: <=480px (mobile) already applied via base styles */
@media (max-width: 767px) {
  /* large phones and below: single-column feed, sidebars hidden */
  .container { display: block; }
  .left-sidebar, .right-sidebar { display: none; }
  .main-content { width: 100%; }
  .menu-toggle { display: inline-flex; }
  .left-sidebar.is-collapsed { display: none; }
  .left-sidebar.is-open { display: block; }
}
@media (max-width: 1024px) {
  /* tablets and iPads: two-column layout (left + main), right sidebar optional */
  .container { display: grid; grid-template-columns: 1fr 2fr; gap: 16px; }
  .left-sidebar { display: block; }
  .right-sidebar { display: none; }
  .main-content { width: 100%; }
}

/* iPhone SE-only CSS truncation and alignment to the existing anchors (without HTML label spans), ensuring text stays within first column */
 @media (max-width: 375px) {
  /* Keep single-column feed; refine spacing to fit the narrow viewport */
  .container { padding: 10px 3%; }

  /* Navbar stacks into two rows for clarity */
  header nav { display: flex; flex-direction: column; gap: 8px; }
  .nav-left, .nav-right { width: 100%; }

  /* Left nav: logo and notification icons fit tighter */
  .nav-left { justify-content: space-between; }
  .nav-left ul { display: flex; align-items: center; gap: 8px; margin: 0; padding: 0; }
  .nav-left ul li img { width: 20px; margin: 0; }
  .nav-left ul li.has-badge .badge { top: -3px; right: -3px; min-width: 14px; height: 14px; border-radius: 7px; font-size: 10px; line-height: 14px; padding: 0 3px; }

  /* Right nav: search takes the remaining width, small avatar and button */
  .nav-right { display: flex; align-items: center; gap: 8px; }
  .search-box { flex: 1; width: auto; padding: 0 10px; }
  .nav-user-icon img { width: 28px; }
  #theme-toggle { padding: 4px 8px; font-size: 12px; margin-left: 0; }

  /* Left sidebar item alignment when visible in small layouts */
  .imp-links a, .shortcut-links a { align-items: center; gap: 10px; }
  .imp-links a img { width: 22px; }
  .shortcut-links a img { width: 32px; }

  /* Story gallery becomes horizontal scroll with stable card widths */
  .story-gallery { overflow-x: auto; display: flex; flex-wrap: nowrap; gap: 8px; -webkit-overflow-scrolling: touch; }
  .story { flex: 0 0 auto; min-width: 110px; padding-top: 30%; }
  .story img { width: 36px; border-width: 4px; }
  .story p { font-size: 12px; }

  /* Write post and action icons stay aligned */
  .write-post-container { padding: 12px; }
  .add-post-link { display: flex; flex-wrap: wrap; gap: 10px; }
  .add-post-link a { flex: 1 1 32%; min-width: 100px; margin-right: 0; display: flex; align-items: center; gap: 6px; }
  .add-post-link a img { width: 18px; }

  /* Post actions wrap neatly */
  .post-row { flex-wrap: wrap; row-gap: 8px; }
  .activity-icons { display: flex; flex-wrap: wrap; gap: 12px; }
  .activity-icons div { margin-right: 0; }
  /* Ensure left sidebar links and shortcuts never misalign or wrap awkwardly */
  .imp-links a, .shortcut-links a { width: 100%; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; line-height: 1.2; }
  .imp-links a img { flex: 0 0 18px; width: 18px; }
  .shortcut-links a img { flex: 0 0 24px; width: 24px; }
  /* Shortcut section tightening for iPhone SE */
  .shortcut-links p { margin: 12px 0; font-size: 13px; }
  .shortcut-links a { margin-bottom: 12px; min-width: 0; }
  /* Nested items inside More Shortcuts accordion keep alignment */
  .sidebar-accordion summary { font-size: 13px; }
  .sidebar-accordion a { width: 100%; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sidebar-accordion a img { width: 20px; flex: 0 0 20px; }

  /* Truncate long labels inside shortcut links and accordion items */
  .shortcut-links a .label { display: inline-block; min-width: 0; flex: 1 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sidebar-accordion a .label { display: inline-block; min-width: 0; flex: 1 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* iPhone 12 Pro (portrait 390px): apply same small-screen fixes with slightly relaxed spacing */
@media (min-width: 376px) and (max-width: 390px) {
  /* Container spacing */
  .container { padding: 10px 3%; }

  /* Navbar stacks for clarity */
  header nav { display: flex; flex-direction: column; gap: 10px; }
  .nav-left, .nav-right { width: 100%; }
  .nav-left { justify-content: space-between; }
  .nav-left ul { display: flex; align-items: center; gap: 10px; margin: 0; padding: 0; }
  .nav-left ul li img { width: 22px; margin: 0; }
  .nav-left ul li.has-badge .badge { top: -3px; right: -3px; min-width: 15px; height: 15px; border-radius: 8px; font-size: 11px; line-height: 15px; padding: 0 3px; }

  /* Right nav: search fills available space */
  .nav-right { display: flex; align-items: center; gap: 10px; }
  .search-box { flex: 1; width: auto; padding: 0 12px; }
  .nav-user-icon img { width: 30px; }
  #theme-toggle { padding: 5px 10px; font-size: 13px; margin-left: 0; }

  /* Left sidebar items align on one line, truncate long text */
  .imp-links a, .shortcut-links a { width: 100%; display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; line-height: 1.3; }
  .imp-links a img { flex: 0 0 20px; width: 20px; }
  .shortcut-links a img { flex: 0 0 26px; width: 26px; }
  .shortcut-links p { margin: 14px 0; font-size: 14px; }
  .shortcut-links a { margin-bottom: 14px; min-width: 0; }

  /* Story gallery: horizontal scroll */
  .story-gallery { overflow-x: auto; display: flex; flex-wrap: nowrap; gap: 10px; -webkit-overflow-scrolling: touch; }
  .story { flex: 0 0 auto; min-width: 115px; padding-top: 30%; }
  .story img { width: 38px; border-width: 4px; }
  .story p { font-size: 12px; }

  /* Post composer and actions */
  .write-post-container { padding: 14px; }
  .add-post-link { display: flex; flex-wrap: wrap; gap: 12px; }
  .add-post-link a { flex: 1 1 30%; min-width: 120px; margin-right: 0; display: flex; align-items: center; gap: 8px; }
  .add-post-link a img { width: 20px; }

  /* Post actions wrap neatly */
  .post-row { flex-wrap: wrap; row-gap: 10px; }
  .activity-icons { display: flex; flex-wrap: wrap; gap: 14px; }
  .activity-icons div { margin-right: 0; }

  /* Accordion tweaks */
  .sidebar-accordion summary { font-size: 14px; }
  .sidebar-accordion a { width: 100%; display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sidebar-accordion a img { width: 22px; flex: 0 0 22px; }
}

/* iPhone 14 Pro Max (portrait 430px): apply same fixes with comfortable spacing and sizes */
@media (min-width: 391px) and (max-width: 430px) {
  /* Container spacing */
  .container { padding: 12px 3%; }

  /* Navbar stacks with a bit more gap */
  header nav { display: flex; flex-direction: column; gap: 12px; }
  .nav-left, .nav-right { width: 100%; }
  .nav-left { justify-content: space-between; }
  .nav-left ul { display: flex; align-items: center; gap: 12px; margin: 0; padding: 0; }
  .nav-left ul li img { width: 24px; margin: 0; }
  .nav-left ul li.has-badge .badge { top: -3px; right: -3px; min-width: 16px; height: 16px; border-radius: 8px; font-size: 11px; line-height: 16px; padding: 0 4px; }

  /* Right nav: search fills available space */
  .nav-right { display: flex; align-items: center; gap: 12px; }
  .search-box { flex: 1; width: auto; padding: 0 12px; }
  .nav-user-icon img { width: 32px; }
  #theme-toggle { padding: 6px 10px; font-size: 13px; margin-left: 0; }

  /* Left sidebar items align on one line, truncate long text */
  .imp-links a, .shortcut-links a { width: 100%; display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; line-height: 1.3; }
  .imp-links a img { flex: 0 0 22px; width: 22px; }
  .shortcut-links a img { flex: 0 0 28px; width: 28px; }
  .shortcut-links p { margin: 14px 0; font-size: 14px; }
  .shortcut-links a { margin-bottom: 14px; min-width: 0; }

  /* Story gallery: horizontal scroll */
  .story-gallery { overflow-x: auto; display: flex; flex-wrap: nowrap; gap: 12px; -webkit-overflow-scrolling: touch; }
  .story { flex: 0 0 auto; min-width: 125px; padding-top: 30%; }
  .story img { width: 40px; border-width: 4px; }
  .story p { font-size: 13px; }

  /* Post composer and actions */
  .write-post-container { padding: 16px; }
  .add-post-link { display: flex; flex-wrap: wrap; gap: 12px; }
  .add-post-link a { flex: 1 1 30%; min-width: 120px; margin-right: 0; display: flex; align-items: center; gap: 8px; }
  .add-post-link a img { width: 22px; }

  /* Post actions wrap neatly */
  .post-row { flex-wrap: wrap; row-gap: 12px; }
  .activity-icons { display: flex; flex-wrap: wrap; gap: 16px; }
  .activity-icons div { margin-right: 0; }

  /* Accordion tweaks */
  .sidebar-accordion summary { font-size: 14px; }
  .sidebar-accordion a { width: 100%; display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sidebar-accordion a img { width: 22px; flex: 0 0 22px; }
}
