/**
 * Custom Post Meta Styling for BigCloudy Blog
 * To match blog2.png design requirements
 */

/* Hide share buttons on mobile and tablet devices */
@media (max-width: 1019px) {
	.cs-entry__metabar {
		display: none !important;
	}
}

/* Position share buttons on LEFT side, content uses full width */
@media (min-width: 1020px) {
	/* Content area uses full width - no grid columns for metabar */
	.single .cs-entry__container {
		grid-template-columns: minmax(0, 1fr) !important;
		column-gap: 0 !important;
		padding: 0 !important;
		position: relative !important;
	}
	
	/* Make content expand to fill available width */
	.single .cs-entry__content-wrap {
		max-width: 100% !important;
		width: 100% !important;
		margin: 0 auto !important;
	}
	
	/* Remove content width restriction - let it expand naturally */
	.single .entry-content {
		max-width: 100% !important;
		width: 100% !important;
	}
	
	/* Entry content paragraphs and elements use full width */
	.single .entry-content > * {
		max-width: 100% !important;
	}
	
	/* For pages with sidebar, ensure proper spacing */
	.cs-sidebar-enabled .cs-entry__content-wrap {
		padding-right: 30px !important;
	}
	
	/* Position metabar on LEFT side - CENTERED VERTICALLY */
	/* BUT stop before footer to prevent overlap */
	.cs-entry__metabar {
		position: fixed !important;
		left: 80px !important; /* Increased distance from screen edge */
		top: 50% !important; /* Center vertically */
		transform: translateY(-50%) !important; /* Perfect vertical centering */
		width: 60px !important;
		z-index: 1000 !important;
		height: auto !important;
		/* Constrain to viewport - stop at bottom */
		max-height: calc(100vh - 100px) !important; /* Leave space at bottom */
	}
	
	/* Style the metabar inner container */
	.cs-entry__metabar-inner {
		position: relative !important;
		padding: 0 !important;
	}
	
	/* Hide share buttons when footer is visible (using CSS only approach) */
	/* This uses a containing element approach */
	body.admin-bar .cs-entry__metabar {
		top: calc(50% + 16px) !important; /* Adjust for admin bar */
	}
	
	/* DON'T override theme's sticky sidebar - just ensure nothing blocks it */
}

/* Ensure parent containers allow sticky sidebar to work */
@media (min-width: 1020px) {
	/* Remove any overflow that might block sticky positioning */
	body,
	.cs-site,
	.cs-site-content,
	.cs-main,
	.cs-main-content,
	.cs-content,
	.cs-content-area {
		overflow: visible !important;
	}
	
	/* Ensure sidebar area can stick properly */
	.cs-sidebar__area {
		overflow: visible !important;
		display: block !important;
	}
	
	/* Let theme's native sticky sidebar work - don't override position or top */
	/* The theme's JavaScript will calculate the proper top position dynamically */
}

/* Remove the restrictive content width variables */
:root {
	--cs-entry-content-width: 100% !important;
	--cs-entry-content-medium-width: 100% !important;
}

/* Table of Contents - Active section styling (simple bold, no background) */
.powerkit_toc_widget ol li.active > a,
.powerkit_toc_widget ol li.active-child > a,
.pk-toc ol li.active > a,
.pk-toc ol li.active-child > a {
	font-weight: bold !important;
	background-color: transparent !important;
	background: none !important;
	text-decoration: none !important;
}

/* Category tags styling - pill-shaped with blue background */
.cs-entry__post-meta .cs-meta-category {
	background-color: #3b82f6;
	color: #ffffff !important;
	padding: 6px 16px;
	border-radius: 20px;
	display: inline-block;
	font-size: 0.75rem;
	font-weight: 500;
	text-transform: uppercase;
	margin-right: 8px;
	letter-spacing: 0.5px;
}

.cs-entry__post-meta .cs-meta-category a {
	color: #ffffff !important;
}

.cs-entry__post-meta .cs-meta-category:hover {
	background-color: #2563eb;
}

/* Views and Reading Time icons */
.cs-entry__post-meta .cs-meta-views,
.cs-entry__post-meta .cs-meta-reading-time {
	display: inline-flex;
	align-items: center;
	margin-right: 15px;
	color: #6b7280;
	font-size: 0.813rem;
}

.cs-entry__post-meta .cs-meta-icon {
	margin-right: 5px;
	display: inline-flex;
	align-items: center;
}

/* Post meta container above title */
.cs-entry__post-meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	margin-bottom: 15px;
	gap: 8px;
}

/* Date styling with "Written on" and "Updated on" labels */
.cs-entry__details .cs-meta-date {
	color: #6b7280;
	font-size: 0.875rem;
	line-height: 1.6;
}

/* Horizontal dates (for single post pages) */
.cs-date-written {
	color: #374151;
}

.cs-date-separator {
	margin: 0 8px;
	color: #d1d5db;
}

.cs-date-updated {
	color: #6b7280;
}

/* Vertical dates (for homepage and archives) - Maximum specificity for AJAX content */
.cs-date-vertical,
span.cs-date-vertical,
.cs-meta-date .cs-date-vertical,
.cs-entry__post-meta .cs-date-vertical,
.cs-entry__details .cs-date-vertical,
article .cs-date-vertical,
.cs-posts-area .cs-date-vertical,
.cs-entry-default .cs-date-vertical {
	display: block !important;
	font-size: 0.688rem !important;
	line-height: 1.4 !important;
	color: #6b7280 !important;
	font-weight: 400 !important;
}

.cs-date-vertical.cs-date-written,
span.cs-date-vertical.cs-date-written,
.cs-meta-date span.cs-date-written.cs-date-vertical {
	color: #6b7280 !important;
	margin-bottom: 4px !important;
	font-size: 0.688rem !important;
}

.cs-date-vertical.cs-date-updated,
span.cs-date-vertical.cs-date-updated,
.cs-meta-date span.cs-date-updated.cs-date-vertical {
	color: #9ca3af !important;
	margin-top: 2px !important;
	font-size: 0.688rem !important;
}

/* Hide separator in vertical layout */
.cs-meta-date .cs-date-separator,
.cs-date-vertical ~ .cs-date-separator {
	display: none !important;
}

/* Ensure vertical dates container allows block display */
.cs-entry__post-meta .cs-meta-date:has(.cs-date-vertical),
.cs-entry__details .cs-meta-date:has(.cs-date-vertical),
.cs-entry__post-meta .cs-meta-date,
.cs-entry__details .cs-meta-date {
	display: flex !important;
	flex-direction: column !important;
	align-items: flex-start !important;
}

/* Force inline-block to become block for date spans */
.cs-meta-date span[class*="cs-date"] {
	display: block !important;
}

/* Additional override for any inherited font-size */
article .cs-date-vertical,
.cs-posts-area .cs-date-vertical,
.cs-entry-default .cs-date-vertical,
div[class*="cs-entry"] .cs-date-vertical {
	font-size: 0.688rem !important;
}

/* Author section below title */
.cs-entry__details-data {
	display: flex;
	align-items: center;
	gap: 12px;
}

.cs-author-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	overflow: hidden;
	display: inline-block;
}

.cs-author-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.cs-entry__details-meta {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.cs-entry__author-meta {
	font-size: 0.938rem;
	font-weight: 500;
	color: #111827;
}

.cs-entry__author-meta a {
	color: #111827;
	text-decoration: none;
}

.cs-entry__author-meta a:hover {
	color: #3b82f6;
}

/* Entry header details section - CENTERED */
.cs-entry__header-details {
	margin-top: 15px;
	padding-top: 15px;
	border-top: 1px solid #e5e7eb;
	text-align: center !important;
	display: flex !important;
	justify-content: center !important;
	align-items: center !important;
	flex-direction: column !important;
}

/* Center the author and date information */
.cs-entry__header-details .cs-entry__details-data {
	justify-content: center !important;
	text-align: center !important;
	margin: 0 auto !important;
}

/* Center the date meta within header details */
.cs-entry__header-details .cs-meta-date {
	align-items: center !important;
	text-align: center !important;
}

/* Title spacing */
.cs-entry__title {
	margin: 15px 0;
	font-size: 2.25rem;
	line-height: 1.25;
	font-weight: 700;
	color: #111827;
}

/* Responsive adjustments */
@media (max-width: 768px) {
	.cs-entry__post-meta {
		flex-direction: column;
		align-items: flex-start;
	}
	
	.cs-entry__title {
		font-size: 1.75rem;
	}
}

/* Dark mode support */
[data-site-scheme="dark"] .cs-entry__post-meta .cs-meta-category {
	background-color: #2563eb;
}

[data-site-scheme="dark"] .cs-entry__title {
	color: #f9fafb;
}

[data-site-scheme="dark"] .cs-entry__author-meta,
[data-site-scheme="dark"] .cs-entry__author-meta a {
	color: #f9fafb;
}

[data-site-scheme="dark"] .cs-date-written {
	color: #e5e7eb;
}

[data-site-scheme="dark"] .cs-entry__header-details {
	border-top-color: #374151;
}

/* ============================================
   Footer Menu - Section Headers Fix (SEO)
   ============================================ */
/* Parent menu items with href="#" - styled as non-clickable headers */
#menu-footer-menu > li.menu-item-has-children > a[href="#"] {
	cursor: default !important;
	pointer-events: none !important;
	text-decoration: none !important;
}

/* Prevent hover effects on section headers */
#menu-footer-menu > li.menu-item-has-children > a[href="#"]:hover {
	color: inherit !important;
	text-decoration: none !important;
}

