:root {
	/* Light theme variables */
	--bg-primary: #f8f9fa;
	--bg-secondary: #ffffff;
	--bg-tertiary: #f8f9fa;
	--text-primary: #333333;
	--text-secondary: #666666;
	--border-color: #eeeeee;
	--shadow: 0 2px 10px rgba(0,0,0,0.1);
	--accent: #3498db;
	--accent-hover: #2980b9;
}

[data-theme="dark"] {
	/* Dark theme variables */
	--bg-primary: #1a1a1a;
	--bg-secondary: #2d2d2d;
	--bg-tertiary: #404040;
	--text-primary: #ffffff;
	--text-secondary: #cccccc;
	--border-color: #444444;
	--shadow: 0 2px 10px rgba(0,0,0,0.3);
	--accent: #3498db;
	--accent-hover: #2980b9;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
	font-family: 'Segoe UI', system-ui, sans-serif;
	line-height: 1.6;
	color: var(--text-primary);
	background: var(--bg-primary);
	transition: background-color 0.3s ease, color 0.3s ease;
	overflow-x: hidden;
	font-size: 16px;
}

.container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 15px;
}

header {
	background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
	color: white;
	padding: 1rem 0;
	position: sticky;
	top: 0;
	z-index: 100;
}

.header-content {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 1rem;
}

.logo {
	font-size: 1.5rem;
	font-weight: bold;
	min-width: 0;
	flex-shrink: 1;
}

nav ul {
	display: flex;
	list-style: none;
	gap: 1rem;
	align-items: center;
	flex-wrap: wrap;
}

nav a {
	color: white;
	text-decoration: none;
	cursor: pointer;
	padding: 0.5rem;
	border-radius: 4px;
	transition: background-color 0.3s ease;
}

nav a:hover {
	color: #3498db;
	background-color: rgba(255,255,255,0.1);
}

#language-selector {
	padding: 0.4rem 0.6rem;
	border-radius: 4px;
	border: 1px solid rgba(255,255,255,0.3);
	background: rgba(255,255,255,0.1);
	color: white;
	min-width: 80px;
}

#theme-toggle {
	background: none;
	border: none;
	color: white;
	cursor: pointer;
	font-size: 1.3rem;
	padding: 0.5rem;
	border-radius: 4px;
	transition: background-color 0.3s ease;
}

#theme-toggle:hover {
	background-color: rgba(255,255,255,0.1);
}

main {
	display: grid;
	grid-template-columns: 1fr 300px;
	gap: 2rem;
	padding: 2rem 0;
	max-width: 100%;
	overflow-x: hidden;
}

.posts-container,
.full-post {
	background: var(--bg-secondary);
	border-radius: 8px;
	box-shadow: var(--shadow);
	overflow-x: hidden;
}

.post {
	padding: 1.5rem;
	border-bottom: 1px solid var(--border-color);
	cursor: pointer;
	transition: background-color 0.3s ease;
}

.post:hover { background: var(--bg-tertiary); }

.post-title {
	font-size: 1.3rem;
	font-weight: 600;
	color: var(--text-primary);
	margin-bottom: 0.5rem;
	line-height: 1.4;
}

.post-meta {
	color: var(--text-secondary);
	font-size: 0.9rem;
	display: flex;
	gap: 1rem;
	margin-bottom: 1rem;
	flex-wrap: wrap;
}

.post-excerpt {
	color: var(--text-secondary);
	margin-bottom: 1rem;
	font-size: 0.95rem;
	line-height: 1.5;
}

.post-tags {
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.tag {
	background: var(--accent);
	color: white;
	padding: 0.3rem 0.7rem;
	border-radius: 15px;
	font-size: 0.8rem;
	white-space: nowrap;
}

.sidebar {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	min-width: 300px;
	max-width: 300px;
}

.widget {
	background: var(--bg-secondary);
	padding: 1.5rem;
	border-radius: 8px;
	box-shadow: var(--shadow);
}

.widget h3 {
	color: var(--text-primary);
	margin-bottom: 1rem;
	font-size: 1.1rem;
}

.widget p, .widget li {
	font-size: 0.95rem;
	line-height: 1.5;
}

.full-post {
	padding: 1rem;
	margin-top: 3rem;
	width: 100%;
	min-width: 0;
	overflow-x: hidden;
}

#full-post-content, #frontpage-content {
	width: 100%;
	max-width: 100%;
	min-width: 0;
	overflow-x: auto;
	word-wrap: break-word;
	overflow-wrap: break-word;
}

#full-post-content h1,
#full-post-content h2,
#full-post-content h3,
#frontpage-content h1,
#frontpage-content h2,
#frontpage-content h3 {
	word-wrap: break-word;
	overflow-wrap: break-word;
	hyphens: auto;
}

.full-post.active { display: block; }

.back-button {
	background: var(--accent);
	color: white;
	border: none;
	padding: 0.8rem 1.5rem;
	border-radius: 4px;
	cursor: pointer;
	margin-bottom: 1rem;
	position: fixed;
	top: 1.5rem;
	right: 2rem;
	z-index: 1000;
	box-shadow: 0 4px 12px rgba(0,0,0,0.2);
	font-size: 0.9rem;
	display: none;
}

.back-button:hover { background: var(--accent-hover); }

.hero-section {
	text-align: center;
	padding: 2rem 1rem;
	background: var(--bg-tertiary);
	border-radius: 8px;
	margin-bottom: 2rem;
}

.hero-title {
	font-size: 1.8rem;
	color: var(--text-primary);
	margin-bottom: 1rem;
}

.hero-section p {
	font-size: 1rem;
	color: var(--text-secondary);
}

.pagination-controls.bottom {
	margin-top: 1rem;
	border-top: 1px solid var(--border-color);
	border-bottom: none;
}

.page-btn {
	padding: 0.6rem 1rem;
	border: 1px solid var(--border-color);
	background: var(--bg-secondary);
	color: var(--text-primary);
	cursor: pointer;
	transition: background-color 0.3s ease;
	border-radius: 4px;
	font-size: 0.9rem;
}

.page-btn:hover { background: var(--bg-tertiary); }
.page-btn.active { background: var(--accent); color: white; }
.page-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.search-container {
	padding: 1rem;
	background: var(--bg-tertiary);
	border-radius: 8px;
}

.tag-filter-button {
	padding: 0.4rem 0.8rem;
	margin: 0.2rem;
	border: 1px solid var(--border-color);
	background: var(--bg-secondary);
	color: var(--text-primary);
	border-radius: 15px;
	cursor: pointer;
	font-size: 0.85rem;
}

.tag-filter-button:hover { background: var(--bg-tertiary); }
.tag-filter-button.active { background: var(--accent); color: white; border-color: var(--accent); }

.tag-show-toggle {
	padding: 0.5rem 1rem;
	margin: 0.5rem 0.2rem;
	border: 2px solid var(--accent);
	background: var(--bg-secondary);
	color: var(--accent);
	border-radius: 20px;
	cursor: pointer;
	font-size: 0.9rem;
	font-weight: 600;
	transition: all 0.3s ease;
	width: 100%;
	max-width: 200px;
}

.tag-show-toggle:hover {
	background: var(--accent);
	color: white;
}

.search-result {
	padding: 1rem;
	border-bottom: 1px solid var(--border-color);
	cursor: pointer;
	background: var(--bg-secondary);
}

.search-result:hover { background: var(--bg-tertiary); }
.search-highlight { background-color: yellow; font-weight: bold; }

[data-theme="dark"] .search-highlight {
	background-color: #ffd700;
	color: #000;
}

[data-theme="dark"] input, [data-theme="dark"] select {
	background: var(--bg-secondary);
	color: var(--text-primary);
	border: 1px solid var(--border-color);
}

#frontpage-page {
	background: var(--bg-primary);
	min-height: 80vh;
	display: block;
	padding: 2rem 0;
	width: 100%;
	overflow-x: hidden;
}

.frontpage-hero {
	text-align: center;
	max-width: 900px;
	width: 100%;
	padding: 3rem 2rem;
	background: var(--bg-secondary);
	border-radius: 12px;
	box-shadow: var(--shadow);
	margin: 0 auto;
}

.profile-image {
	width: 150px;
	height: 150px;
	border-radius: 50%;
	margin: 0 auto 2rem;
	object-fit: cover;
	border: 4px solid var(--accent);
}

.frontpage-hero h1 {
	font-size: 2.5rem;
	color: var(--text-primary);
	margin-bottom: 1rem;
	font-weight: 700;
}

.frontpage-hero p {
	font-size: 1.2rem;
	color: var(--text-secondary);
	line-height: 1.6;
	margin-bottom: 2rem;
}

.social-links {
	display: flex;
	justify-content: center;
	gap: 1.5rem;
	margin-top: 2rem;
	flex-wrap: wrap;
}

.social-links a {
	color: var(--text-secondary);
	text-decoration: none;
	padding: 0.75rem;
	border-radius: 50%;
	transition: all 0.3s ease;
	background: var(--bg-tertiary);
	width: 55px;
	height: 55px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.social-links a i {
	font-size: 1.5rem;
}

.social-links a:hover {
	color: var(--accent);
	transform: translateY(-2px);
	box-shadow: var(--shadow);
}

/* Dark theme specific adjustments for frontpage */
[data-theme="dark"] .social-links a:hover {
	box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

/* Prevent visited link colors on frontpage social buttons */
.social-links a:link,
.social-links a:visited,
.social-links a:hover,
.social-links a:active {
	color: var(--text-secondary) !important;
	text-decoration: none !important;
}

.social-links a:hover:link,
.social-links a:hover:visited,
.social-links a:hover:hover,
.social-links a:hover:active {
	color: var(--accent) !important;
	transform: translateY(-2px);
	box-shadow: var(--shadow);
}

/* Dark theme social links */
[data-theme="dark"] .social-links a:link,
[data-theme="dark"] .social-links a:visited,
[data-theme="dark"] .social-links a:hover,
[data-theme="dark"] .social-links a:active {
	color: var(--text-secondary) !important;
}

[data-theme="dark"] .social-links a:hover:link,
[data-theme="dark"] .social-links a:hover:visited,
[data-theme="dark"] .social-links a:hover:hover,
[data-theme="dark"] .social-links a:hover:active {
	color: var(--accent) !important;
	box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

.frontpage-layout {
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 2rem;
	margin: 0 auto;
	max-width: 1200px;
	width: 100%;
}

/* Hide sidebar on frontpage */
.frontpage-active .sidebar {
	display: none !important;
}

.frontpage-active main {
	grid-template-columns: 1fr !important;
	max-width: none;
}

/* Tables in posts */
#full-post-content table, #frontpage-content table {
	width: 100%;
	max-width: 100%;
	overflow-x: auto;
	display: block;
	white-space: normal;
}

#full-post-content td, #full-post-content th, #frontpage-content td, #frontpage-content th {
	word-wrap: break-word;
	max-width: 200px;
}

/* Fix paragraph spacing within the content areas */
#full-post-content p, #about-content p, #frontpage-content p {
	margin-bottom: 1em;
	font-size: 1rem;
	line-height: 1.6;
}

/* Code Block and Inline Code Styling */
pre {
	font-family: 'Courier New', 'Monaco', 'Menlo', monospace;
	font-size: 0.9rem;
	border-radius: 4px;
	padding: 1rem;
	margin: 1rem 0;
	background: #f0f0f0;
	border: 1px solid #e0e0e0;
	color: var(--text-primary);
	overflow-x: auto;
	white-space: pre-wrap;
	word-wrap: break-word;
	word-break: normal;
}

pre code {
	background: transparent;
	border: none;
	color: inherit;
	padding: 0;
	white-space: pre-wrap;
	word-break: normal;
}

*:not(pre) > code {
	padding: 0.3rem 0.6rem;
	white-space: normal;
	background: #e9e9e9;
	border: 1px solid #dcdcdc;
	color: var(--text-primary);
}

[data-theme="dark"] pre {
	background: #333333;
	border: 1px solid #444444;
	color: #e0e0e0;
}

[data-theme="dark"] *:not(pre) > code {
	background: #444444;
	border: 1px solid #555555;
	color: #ffffff;
}

/* Dark theme links */
[data-theme="dark"] a {
	color: #64b5f6;
}

[data-theme="dark"] a:hover {
	color: #90caf9;
}

[data-theme="dark"] a:visited {
	color: #ba68c8;
}

/* Recent posts styling */
#recent-posts {
	list-style: none;
}

#recent-posts li {
	margin-bottom: 0.8rem;
	padding-bottom: 0.8rem;
	border-bottom: 1px solid var(--border-color);
}

#recent-posts li:last-child {
	border-bottom: none;
	margin-bottom: 0;
	padding-bottom: 0;
}

#recent-posts a {
	color: var(--accent);
	text-decoration: none;
	font-size: 0.9rem;
	line-height: 1.4;
	display: block;
}

#recent-posts a:hover {
	text-decoration: underline;
}

/* Footer styling */
footer {
	background: var(--bg-secondary);
	border-top: 1px solid var(--border-color);
	padding: 2rem 0;
	margin-top: 3rem;
	text-align: center;
}

footer p {
	color: var(--text-secondary);
	font-size: 0.9rem;
	margin: 0;
}

footer a {
	color: var(--accent);
	text-decoration: none;
}

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

/* Mobile footer */
@media (max-width: 768px) {
	footer {
	padding: 1.5rem 0;
	margin-top: 2rem;
	}
	
	footer p {
	font-size: 0.85rem;
	line-height: 1.4;
	}
}

/* Share buttons */
.share-buttons {
	display: flex;
	gap: 0.5rem;
	align-items: center;
	margin: 2rem 0;
	padding: 1.5rem;
	background: var(--bg-tertiary);
	border-radius: 8px;
	border: 1px solid var(--border-color);
	flex-wrap: wrap;
}

.share-buttons span {
	font-weight: 600;
	color: var(--text-primary);
	margin-right: 1rem;
	font-size: 0.9rem;
}

.share-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.5rem;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	text-decoration: none;
	transition: all 0.3s ease;
	font-size: 1.1rem;
}

.share-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.share-btn.facebook {
	background: #1877f2;
	color: white;
}

.share-btn.twitter {
	background: #1da1f2;
	color: white;
}

.share-btn.linkedin {
	background: #0077b5;
	color: white;
}

.share-btn.telegram {
	background: #0088cc;
	color: white;
}

.share-btn.whatsapp {
	background: #25d366;
	color: white;
}

.share-btn.email {
	background: var(--accent);
	color: white;
}

.share-btn.copy {
	background: var(--bg-secondary);
	color: var(--text-primary);
	border: 2px solid var(--border-color);
}

.share-btn.copy.copied {
	background: #28a745;
	color: white;
	border-color: #28a745;
}

.share-btn.instagram {
	background: linear-gradient(45deg, #f09433 0%,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%);
	color: white;
}

.share-btn.snapchat {
	background: #fffc00;
	color: black;
}

.share-btn.mastodon {
	background: #595aff;
	color: white;
}

/* Mobile share buttons */
@media (max-width: 768px) {
	.share-buttons {
	padding: 1rem;
	gap: 0.4rem;
	}
	
	.share-buttons span {
	width: 100%;
	margin-bottom: 0.5rem;
	margin-right: 0;
	}
	
	.share-btn {
	width: 44px;
	height: 44px;
	}
}

/* Prevent visited link colors on share buttons */
.share-btn:link,
.share-btn:visited,
.share-btn:hover,
.share-btn:active {
	color: inherit !important;
}

.share-btn.facebook:link,
.share-btn.facebook:visited,
.share-btn.facebook:hover,
.share-btn.facebook:active {
	background: #1877f2 !important;
	color: white !important;
}

.share-btn.twitter:link,
.share-btn.twitter:visited,
.share-btn.twitter:hover,
.share-btn.twitter:active {
	background: #1da1f2 !important;
	color: white !important;
}

.share-btn.linkedin:link,
.share-btn.linkedin:visited,
.share-btn.linkedin:hover,
.share-btn.linkedin:active {
	background: #0077b5 !important;
	color: white !important;
}

.share-btn.telegram:link,
.share-btn.telegram:visited,
.share-btn.telegram:hover,
.share-btn.telegram:active {
	background: #0088cc !important;
	color: white !important;
}

.share-btn.whatsapp:link,
.share-btn.whatsapp:visited,
.share-btn.whatsapp:hover,
.share-btn.whatsapp:active {
	background: #25d366 !important;
	color: white !important;
}

.share-btn.email:link,
.share-btn.email:visited,
.share-btn.email:hover,
.share-btn.email:active {
	background: var(--accent) !important;
	color: white !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
	.container {
	padding: 0 10px;
	}

	.header-content {
	flex-direction: column;
	gap: 0.5rem;
	align-items: stretch;
	}

	.logo {
	text-align: center;
	font-size: 1.3rem;
	}

	nav ul {
	justify-content: center;
	gap: 0.5rem;
	flex-wrap: wrap;
	}

	nav a {
	font-size: 0.9rem;
	padding: 0.4rem 0.6rem;
	}

	#language-selector {
	min-width: 70px;
	font-size: 0.9rem;
	}

	main {
	grid-template-columns: 1fr;
	gap: 1rem;
	padding: 1rem 0;
	}

	.sidebar {
	order: -1;
	display: grid;
	grid-template-columns: 1fr;
	gap: 1rem;
	min-width: unset;
	max-width: unset;
	}

	.widget {
	padding: 1rem;
	}

	.post {
	padding: 1rem;
	}

	.post-title {
	font-size: 1.2rem;
	}

	.post-meta {
	font-size: 0.85rem;
	gap: 0.5rem;
	}

	.post-excerpt {
	font-size: 0.9rem;
	}

	.hero-section {
	padding: 1.5rem 1rem;
	}

	.hero-title {
	font-size: 1.5rem;
	}

	.hero-section p {
	font-size: 0.95rem;
	}

	.pagination-controls {
	flex-direction: column;
	gap: 0.5rem;
	padding: 0.8rem;
	text-align: center;
	}

	.pagination-controls.bottom {
	margin-top: 0.5rem;
	}

	.pagination-controls label {
	font-size: 0.9rem;
	}

	#page-info, #page-info-bottom {
	font-size: 0.9rem;
	margin-left: 0;
	}

	#pagination-buttons, #pagination-buttons-bottom {
	display: flex;
	flex-wrap: wrap;
	gap: 0.3rem;
	justify-content: center;
	padding: 0.8rem;
	}

	.page-btn {
	padding: 0.5rem 0.8rem;
	font-size: 0.85rem;
	min-width: 44px;
	}

	.back-button {
	position: fixed;
	top: 1rem;
	right: 1rem;
	padding: 0.6rem 1rem;
	font-size: 0.85rem;
	}

	.full-post {
	padding: 1rem;
	margin-top: 3rem;
	}

	pre {
	font-size: 0.8rem;
	padding: 0.8rem;
	margin: 0.8rem 0;
	}

	.tag {
	font-size: 0.75rem;
	padding: 0.25rem 0.5rem;
	}

	.search-container {
	padding: 0.8rem;
	}

	#search-input {
	font-size: 1rem;
	padding: 0.8rem;
	}

	.search-result {
	padding: 0.8rem;
	}

	.search-result h3 {
	font-size: 1.1rem;
	}

	body {
	font-size: 15px;
	}

	.widget h3 {
	font-size: 1rem;
	}

	.widget p, .widget li {
	font-size: 0.9rem;
	}

	#recent-posts a {
	font-size: 0.85rem;
	}

	.frontpage-hero {
	padding: 2rem 1rem;
	margin: 0 1rem;
	}

	.frontpage-hero h1 {
	font-size: 2rem;
	}

	.frontpage-hero p {
	font-size: 1rem;
	}

	.profile-image {
	width: 120px;
	height: 120px;
	}

	.social-links {
	gap: 1rem;
	}

	.social-links a {
	width: 45px;
	height: 45px;
	font-size: 1.3rem;
	}
}

@media (max-width: 480px) {
	.container {
	padding: 0 8px;
	}

	.logo {
	font-size: 1.2rem;
	}

	nav a {
	font-size: 0.85rem;
	padding: 0.3rem 0.5rem;
	}

	.post {
	padding: 0.8rem;
	}

	.post-title {
	font-size: 1.1rem;
	}

	.hero-title {
	font-size: 1.3rem;
	}

	.hero-section {
	padding: 1rem;
	}

	.widget {
	padding: 0.8rem;
	}

	.full-post {
	padding: 0.8rem;
	}

	.back-button {
	padding: 0.5rem 0.8rem;
	font-size: 0.8rem;
	top: 0.5rem;
	right: 0.5rem;
	}

	@media (max-width: 320px) {
	#pagination-buttons, #pagination-buttons-bottom {
		flex-direction: column;
		align-items: center;
	}

	.page-btn {
		width: 100%;
		max-width: 200px;
	}
	}
}

/* Ensure good touch targets on mobile */
@media (hover: none) and (pointer: coarse) {
	.post, nav a, .page-btn, .tag-filter-button, .back-button {
	min-height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	}

	.post {
	justify-content: flex-start;
	flex-direction: column;
	align-items: stretch;
	}
}

/* Ensure proper scaling on small screens */
html, body {
	width: 100%;
	max-width: 100%;
	overflow-x: hidden; /* prevent sideways scrolling */
}

/* Fix images overflowing */
img {
	max-width: 100%;
	height: auto;
	display: block;
}

/* Tables should wrap text instead of forcing scroll */
#full-post-content table,
#frontpage-content table {
	width: 100%;
	max-width: 100%;
	overflow-x: auto;
	display: block;
	white-space: normal;   /* allow wrapping */
	word-wrap: break-word;
	overflow-wrap: break-word;
}

/* Prevent long words/URLs from breaking layout */
#full-post-content,
#frontpage-content,
#about-content {
	word-wrap: break-word;
	overflow-wrap: anywhere;
}

/* Ensure sidebar doesn't force width on mobile */
@media (max-width: 768px) {
	.sidebar {
	min-width: 0 !important;
	max-width: 100% !important;
	width: 100% !important;
	}
}

/* Make sure main grid never forces overflow */
main {
	grid-template-columns: 1fr minmax(0, 300px);
}

/* Sidebar flexible instead of fixed */
.sidebar {
	min-width: 0;
	max-width: 100%;
	width: 100%;
}

/* --- Responsive Fix: Sidebar collapse earlier --- */
@media (max-width: 768px) {
	body {
	grid-template-columns: 1fr; /* full width content */
	grid-template-areas:
		"header"
		"main"
		"footer";
	}

	main {
	grid-template-columns: 1fr !important; /* no sidebar */
	}

	.sidebar {
	width: 100% !important;
	min-width: 0 !important;
	max-width: 100% !important;
	order: 2; /* put sidebar below main content */
	}

	/* Ensure tables/images don’t overflow */
	img {
	max-width: 100% !important;
	height: auto !important;
	}

	table {
	display: block;
	width: 100% !important;
	max-width: 100% !important;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	}
	.full-post {
	padding: 1rem;
	margin-top: 3rem;
	width: calc(100vw - 20px);
	margin-left: calc(-1 * (50vw - 50%));
	box-sizing: border-box;
	}
	
	#full-post-content {
	width: 100%;
	max-width: none;
	padding: 0;
	box-sizing: border-box;
	}
	
	#full-post-content * {
	max-width: 100%;
	box-sizing: border-box;
	}
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    z-index: 1000;
    opacity: 0; 
    pointer-events: none; 
}

.skip-link:focus {
    top: 6px;
    opacity: 1; 
    pointer-events: auto;
}

/* Search highlights */
.search-highlight,
mark.search-highlight {
    background-color: #fff3cd;
    color: #856404;
    padding: 0 2px;
    border-radius: 2px;
}

/* Enhanced share buttons */
.share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin: 1rem 0;
    padding: 1rem;
    background: var(--background-secondary, #f8f9fa);
    border-radius: 8px;
    border: 1px solid var(--border-color, #dee2e6);
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.share-btn.facebook { background: #1877f2; color: white; }
.share-btn.twitter { background: #1da1f2; color: white; }
.share-btn.linkedin { background: #0077b5; color: white; }
.share-btn.telegram { background: #0088cc; color: white; }
.share-btn.whatsapp { background: #25d366; color: white; }
.share-btn.email { background: #6c757d; color: white; }
.share-btn.copy { background: #28a745; color: white; }

.share-btn.copied { background: #20c997; }
.share-btn.error { background: #dc3545; }

/* Enhanced pagination */
.pagination-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 2rem 0;
    padding: 1rem;
    background: var(--background-secondary, #f8f9fa);
    border-radius: 8px;
}

/* Dark theme support */
[data-theme="dark"] {
    --background: #1a1a1a;
    --background-secondary: #2d2d2d;
    --text-color: #e0e0e0;
    --border-color: #404040;
    --accent-light: #404040;
}

[data-theme="dark"] .search-highlight,
[data-theme="dark"] mark.search-highlight {
    background-color: #ffc107;
    color: #000;
}

/* Print styles */
@media print {
    .share-buttons,
    .pagination-controls,
    .back-button,
    .sidebar {
        display: none !important;
    }
    
    .full-post {
        display: block !important;
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .share-buttons {
        justify-content: center;
    }
    
    .pagination-controls {
        flex-direction: column;
        text-align: center;
    }
    
    .page-btn {
        margin: 0.25rem;
    }
}

/* Fix navigation link colors */
nav ul li a {
    color: inherit !important;
    text-decoration: none;
}

nav ul li a:hover {
    color: var(--accent, #007bff) !important;
}

nav ul li a:visited {
    color: inherit !important;
}

/* Ensure consistent link styling throughout */
a:not(.share-btn):not(.page-btn) {
    color: var(--text-color, #333);
}

a:not(.share-btn):not(.page-btn):hover {
    color: var(--accent, #007bff);
}

/* Dark theme link fixes */
[data-theme="dark"] a:not(.share-btn):not(.page-btn) {
    color: var(--text-color, #e0e0e0);
}

/* Normal link colors for content links only - exclude all buttons and interactive elements */
#full-post-content a:not(.share-btn):not(.page-btn):not(.tag):not(.back-button):not([role="button"]):not([onclick]),
#about-content a:not(.share-btn):not(.page-btn):not(.tag):not(.back-button):not([role="button"]):not([onclick]), 
#frontpage-content a:not(.share-btn):not(.page-btn):not(.tag):not(.back-button):not([role="button"]):not([onclick]):not(.social-links a) {
    color: #0066cc !important; /* Blue for unvisited links */
    text-decoration: underline;
}

#full-post-content a:not(.share-btn):not(.page-btn):not(.tag):not(.back-button):not([role="button"]):not([onclick]):visited,
#about-content a:not(.share-btn):not(.page-btn):not(.tag):not(.back-button):not([role="button"]):not([onclick]):visited,
#frontpage-content a:not(.share-btn):not(.page-btn):not(.tag):not(.back-button):not([role="button"]):not([onclick]):not(.social-links a):visited {
    color: #800080 !important; /* Purple for visited links */
}

#full-post-content a:not(.share-btn):not(.page-btn):not(.tag):not(.back-button):not([role="button"]):not([onclick]):hover,
#about-content a:not(.share-btn):not(.page-btn):not(.tag):not(.back-button):not([role="button"]):not([onclick]):hover,
#frontpage-content a:not(.share-btn):not(.page-btn):not(.tag):not(.back-button):not([role="button"]):not([onclick]):not(.social-links a):hover {
    color: #004499 !important; /* Darker blue on hover */
    text-decoration: underline;
}

/* Dark theme versions */
[data-theme="dark"] #full-post-content a:not(.share-btn):not(.page-btn):not(.tag):not(.back-button):not([role="button"]):not([onclick]),
[data-theme="dark"] #about-content a:not(.share-btn):not(.page-btn):not(.tag):not(.back-button):not([role="button"]):not([onclick]),
[data-theme="dark"] #frontpage-content a:not(.share-btn):not(.page-btn):not(.tag):not(.back-button):not([role="button"]):not([onclick]):not(.social-links a) {
    color: #66b3ff !important; /* Light blue for dark theme */
}

[data-theme="dark"] #full-post-content a:not(.share-btn):not(.page-btn):not(.tag):not(.back-button):not([role="button"]):not([onclick]):visited,
[data-theme="dark"] #about-content a:not(.share-btn):not(.page-btn):not(.tag):not(.back-button):not([role="button"]):not([onclick]):visited,
[data-theme="dark"] #frontpage-content a:not(.share-btn):not(.page-btn):not(.tag):not(.back-button):not([role="button"]):not([onclick]):not(.social-links a):visited {
    color: #cc99ff !important; /* Light purple for visited in dark theme */
}

[data-theme="dark"] #full-post-content a:not(.share-btn):not(.page-btn):not(.tag):not(.back-button):not([role="button"]):not([onclick]):hover,
[data-theme="dark"] #about-content a:not(.share-btn):not(.page-btn):not(.tag):not(.back-button):not([role="button"]):not([onclick]):hover,
[data-theme="dark"] #frontpage-content a:not(.share-btn):not(.page-btn):not(.tag):not(.back-button):not([role="button"]):not([onclick]):not(.social-links a):hover {
    color: #99ccff !important; /* Lighter blue on hover in dark theme */
}

/* Cookie Consent System Styles */

.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #2c3e50;
    color: white;
    padding: 1rem;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
    z-index: 10000;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    font-family: system-ui, sans-serif;
}

.cookie-banner.show {
    transform: translateY(0);
}

.cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.cookie-text {
    flex: 1;
    min-width: 300px;
}

.cookie-text h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.cookie-text p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.cookie-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.cookie-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    font-weight: 500;
}

.cookie-btn.accept {
    background: #1e7e34;;
    color: white;
}

.cookie-btn.accept:hover {
    background: #229954;
}

.cookie-btn.decline {
    background: #bd2130;
    color: white;
}

.cookie-btn.decline:hover {
    background: #c0392b;
}

.cookie-btn.settings {
    background: transparent;
    color: white;
    border: 1px solid #bdc3c7;
}

.cookie-btn.settings:hover {
    background: rgba(255,255,255,0.1);
}

/* Cookie Settings Modal */
.cookie-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 10001;
    font-family: system-ui, sans-serif;
}

.cookie-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.cookie-modal-content {
    background: white;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.cookie-modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cookie-modal-header h2 {
    margin: 0;
    color: #2c3e50;
}

.cookie-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #7f8c8d;
}

.cookie-modal-body {
    padding: 1.5rem;
}

.cookie-category {
    margin-bottom: 1.5rem;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 1rem;
}

.cookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.cookie-category h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1rem;
}

.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.2s;
    border-radius: 24px;
}

.cookie-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.2s;
    border-radius: 50%;
}

.cookie-toggle input:checked + .cookie-slider {
    background-color: #27ae60;
}

.cookie-toggle input:checked + .cookie-slider:before {
    transform: translateX(26px);
}

.cookie-toggle input:disabled + .cookie-slider {
    background-color: #95a5a6;
    cursor: not-allowed;
}

.cookie-category p {
    margin: 0.5rem 0;
    color: #7f8c8d;
    font-size: 0.9rem;
    line-height: 1.4;
}

.cookie-modal-footer {
    padding: 1.5rem;
    border-top: 1px solid #eee;
    text-align: right;
}

.cookie-save-btn {
    background: #3498db;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

.cookie-save-btn:hover {
    background: #2980b9;
}

/* Dark theme support */
[data-theme="dark"] .cookie-modal-content {
    background: #34495e;
    color: white;
}

[data-theme="dark"] .cookie-modal-header {
    border-bottom-color: #4a5f7a;
}

[data-theme="dark"] .cookie-modal-header h2,
[data-theme="dark"] .cookie-category h3 {
    color: white;
}

[data-theme="dark"] .cookie-category {
    border-color: #4a5f7a;
}

[data-theme="dark"] .cookie-category p {
    color: #bdc3c7;
}

[data-theme="dark"] .cookie-modal-footer {
    border-top-color: #4a5f7a;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .cookie-banner-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .cookie-text {
        min-width: auto;
    }
    
    .cookie-buttons {
        justify-content: center;
        width: 100%;
    }
    
    .cookie-btn {
        flex: 1;
        min-width: 100px;
    }
    
    .cookie-modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .cookie-modal-header,
    .cookie-modal-body,
    .cookie-modal-footer {
        padding: 1rem;
    }
    
    .cookie-category {
        padding: 0.75rem;
    }
}

img {
    loading: lazy;
    decoding: async;
}

.profile-image {
    loading: eager;
}

@font-face {
	font-family: system-ui;
	font-display: swap;
}

/* Force logo to always be white regardless of theme */
.logo a {
    color: white !important;
    text-decoration: none;
}

/* Or if you want different colors for light/dark themes: */
header .logo a {
    color: white;
    text-decoration: none;
}

[data-theme="dark"] header .logo a {
    color: white;
}

/* Ensure it stays white in light theme too */
html:not([data-theme="dark"]) header .logo a {
    color: white;
}
