/**
 * Custom styles for AI Webwise theme
 * This file contains minimal custom styles that complement Tailwind CSS
 */

/* Smooth scrolling */
html {
	scroll-behavior: smooth;
}

/* Hide scrollbar for horizontal scroll containers */
.scrollbar-hide {
	-ms-overflow-style: none;  /* IE and Edge */
	scrollbar-width: none;  /* Firefox */
}

.scrollbar-hide::-webkit-scrollbar {
	display: none;  /* Chrome, Safari and Opera */
}

/* Custom line clamp utilities */
.line-clamp-1 {
	overflow: hidden;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 1;
}

.line-clamp-3 {
	overflow: hidden;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
}

/* Ensure images are responsive */
img {
	max-width: 100%;
	height: auto;
}

/* Smooth transitions for interactive elements */
a, button {
	transition: all 0.2s ease-in-out;
}

/* Focus styles for accessibility */
*:focus-visible {
	outline: 2px solid #0d41e1;
	outline-offset: 2px;
}

/* Sidebar width */
#category-sidebar {
	width: 260px;
}

/* Content area width and positioning */
#content-area {
	width: calc(100% - 260px);
	margin-left: 260px;
}

/* Mobile and Tablet: Full width content area when sidebar is hidden */
@media (max-width: 1023px) {
	#content-area {
		width: 100%;
		margin-left: 0;
	}
}

/* Sidebar scrollbar styling */
#category-sidebar::-webkit-scrollbar {
	width: 6px;
}

#category-sidebar::-webkit-scrollbar-track {
	background: #f8fafc;
}

#category-sidebar::-webkit-scrollbar-thumb {
	background: #cbd5e1;
	border-radius: 3px;
	transition: background 0.2s ease;
}

#category-sidebar::-webkit-scrollbar-thumb:hover {
	background: #94a3b8;
}

/* Enhanced sidebar link hover effects */
#category-sidebar nav a {
	position: relative;
}

/* Fix sidebar when admin bar is present */
.admin-bar #category-sidebar {
	top: 32px;
	height: calc(100vh - 32px);
}

/* Fix any extra spacing issues with admin bar */
#wpadminbar {
	position: fixed !important;
}

/* Enhanced header styling */
#masthead {
	box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

/* Search input enhancements */
#masthead input[type="search"]:focus {
	box-shadow: 0 0 0 3px rgba(13, 65, 225, 0.1);
}

/* Search icon styling */
#masthead img[alt="Search"] {
	filter: brightness(0) saturate(100%) invert(55%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(100%) contrast(100%);
	transition: filter 0.2s ease;
}

/* Submit Tool button plus icon styling - make it white */
#masthead a[href*="submit-ai-tools"] img {
	filter: brightness(0) invert(1);
}

/* CTA button styling */
#masthead a[href*="submit-ai-tools"] {
	box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

#masthead a[href*="submit-ai-tools"]:hover {
	box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1);
}

/* Prevent horizontal scroll */
html, body {
	overflow-x: hidden;
	max-width: 100vw;
	width: 100%;
}

#page {
	overflow-x: hidden;
	max-width: 100vw;
	width: 100%;
}

/* Ensure no element causes horizontal overflow */
* {
	box-sizing: border-box;
}

/* Prevent elements from overflowing viewport */
section, main, header, footer {
	max-width: 100%;
	overflow-x: hidden;
}

/* Ensure grid doesn't overflow */
#posts-container {
	width: 100%;
	max-width: 100%;
	overflow-x: hidden;
	box-sizing: border-box;
}

/* Category icon styling */
#category-sidebar .category-icon-wrapper img,
#category-sidebar a img[alt*="icon"] {
	width: 20px;
	height: 20px;
	object-fit: contain;
	flex-shrink: 0;
}

/* Ensure SVG icons maintain aspect ratio */
#category-sidebar a img[src*=".svg"] {
	filter: none;
	position: relative;
	top: -1px;
	transition: filter 0.2s ease;
}

/* Active state - Primary blue color (#0d41e1) */
#category-sidebar nav a[aria-current="page"] img[src*=".svg"],
#category-sidebar nav a.bg-blue-50 img[src*=".svg"] {
	filter: brightness(0) saturate(100%) invert(27%) sepia(95%) saturate(2598%) hue-rotate(217deg) brightness(100%) contrast(100%);
}

/* Hover state - Darker gray */
#category-sidebar nav a:hover:not([aria-current="page"]):not(.bg-blue-50) img[src*=".svg"] {
	filter: brightness(0) saturate(100%) invert(40%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(100%) contrast(100%);
}

/* Default state - Gray-500 */
#category-sidebar nav a:not([aria-current="page"]):not(:hover):not(.bg-blue-50) img[src*=".svg"] {
	filter: brightness(0) saturate(100%) invert(55%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(100%) contrast(100%);
}

/* Ensure category nav items have proper spacing */
#category-sidebar nav a {
	margin-left: 0;
}

/* Footer styling */
#colophon {
	box-shadow: 0 -1px 3px 0 rgba(0, 0, 0, 0.05);
}

/* Footer menu links */
#footer-menu a {
	color: #4b5563;
	text-decoration: none;
	transition: color 0.2s ease;
	padding: 0.25rem 0;
}

#footer-menu a:hover {
	color: #0d41e1;
}

/* Scroll to Top Button */
#scroll-to-top {
	width: 48px;
	height: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}

#scroll-to-top img {
	filter: brightness(0) invert(1);
	transition: transform 0.2s ease;
}

#scroll-to-top:hover img {
	transform: translateY(-2px);
}

#scroll-to-top:active img {
	transform: translateY(0);
}

/* Mobile: Adjust scroll to top button position */
@media (max-width: 768px) {
	#scroll-to-top {
		bottom: 1.5rem;
		right: 1.5rem;
		width: 44px;
		height: 44px;
	}
}

/* Mobile and Tablet: Hide sidebar on small and medium screens */
@media (max-width: 1023px) {
	.admin-bar #category-sidebar {
		top: 0;
		height: 100vh;
	}
}

/* Typography Styles for Post Content */
/* These styles ensure headings and paragraphs are properly styled within entry-content */
/* Using !important to ensure they override any conflicting styles */
.entry-content h1,
.entry-content .prose h1,
div.entry-content h1,
.entry-content .wp-block-heading h1,
.entry-content article h1,
.entry-content section h1 {
	font-size: 1.875rem !important; /* 30px */
	font-weight: 800 !important;
	line-height: 1.2 !important;
	margin-top: 2rem !important;
	margin-bottom: 1.5rem !important;
	color: #111827 !important;
	letter-spacing: -0.025em !important;
}

.entry-content h2,
.entry-content .prose h2,
div.entry-content h2,
.entry-content .wp-block-heading h2,
.entry-content article h2,
.entry-content section h2 {
	font-size: 1.5rem !important; /* 24px */
	font-weight: 700 !important;
	line-height: 1.3 !important;
	margin-top: 1.75rem !important;
	margin-bottom: 1.25rem !important;
	color: #111827 !important;
	letter-spacing: -0.025em !important;
}

.entry-content h3,
.entry-content .prose h3,
div.entry-content h3,
.entry-content .wp-block-heading h3,
.entry-content article h3,
.entry-content section h3 {
	font-size: 1.25rem !important; /* 20px */
	font-weight: 700 !important;
	line-height: 1.4 !important;
	margin-top: 1.5rem !important;
	margin-bottom: 1rem !important;
	color: #111827 !important;
}

.entry-content h4,
.entry-content .prose h4,
div.entry-content h4,
.entry-content .wp-block-heading h4,
.entry-content article h4,
.entry-content section h4 {
	font-size: 1.125rem !important; /* 18px */
	font-weight: 600 !important;
	line-height: 1.4 !important;
	margin-top: 1.25rem !important;
	margin-bottom: 0.75rem !important;
	color: #111827 !important;
}

.entry-content h5,
.entry-content .prose h5,
div.entry-content h5,
.entry-content .wp-block-heading h5,
.entry-content article h5,
.entry-content section h5 {
	font-size: 1rem !important; /* 16px */
	font-weight: 600 !important;
	line-height: 1.4 !important;
	margin-top: 1rem !important;
	margin-bottom: 0.75rem !important;
	color: #111827 !important;
}

.entry-content h6,
.entry-content .prose h6,
div.entry-content h6,
.entry-content .wp-block-heading h6,
.entry-content article h6,
.entry-content section h6 {
	font-size: 0.875rem !important; /* 14px */
	font-weight: 600 !important;
	line-height: 1.4 !important;
	margin-top: 1rem !important;
	margin-bottom: 0.5rem !important;
	color: #1f2937 !important;
}

.entry-content p,
.entry-content .prose p,
div.entry-content p,
.entry-content .wp-block-paragraph p,
.entry-content article p,
.entry-content section p {
	font-size: 1.0625rem !important; /* 17px */
	line-height: 1.75 !important;
	margin-bottom: 1.5rem !important;
	color: #374151 !important;
	font-weight: 400 !important;
}

/* Responsive typography adjustments */
@media (min-width: 640px) {
	.entry-content h1,
	.entry-content .prose h1,
	div.entry-content h1,
	.entry-content .wp-block-heading h1,
	.entry-content article h1,
	.entry-content section h1 {
		font-size: 2.25rem !important; /* 36px */
	}
	
	.entry-content h2,
	.entry-content .prose h2,
	div.entry-content h2,
	.entry-content .wp-block-heading h2,
	.entry-content article h2,
	.entry-content section h2 {
		font-size: 1.875rem !important; /* 30px */
	}
	
	.entry-content h3,
	.entry-content .prose h3,
	div.entry-content h3,
	.entry-content .wp-block-heading h3,
	.entry-content article h3,
	.entry-content section h3 {
		font-size: 1.5rem !important; /* 24px */
	}
	
	.entry-content h4,
	.entry-content .prose h4,
	div.entry-content h4,
	.entry-content .wp-block-heading h4,
	.entry-content article h4,
	.entry-content section h4 {
		font-size: 1.25rem !important; /* 20px */
	}
	
	.entry-content h5,
	.entry-content .prose h5,
	div.entry-content h5,
	.entry-content .wp-block-heading h5,
	.entry-content article h5,
	.entry-content section h5 {
		font-size: 1.125rem !important; /* 18px */
	}
	
	.entry-content h6,
	.entry-content .prose h6,
	div.entry-content h6,
	.entry-content .wp-block-heading h6,
	.entry-content article h6,
	.entry-content section h6 {
		font-size: 1rem !important; /* 16px */
	}
	
	.entry-content p,
	.entry-content .prose p,
	div.entry-content p,
	.entry-content .wp-block-paragraph p,
	.entry-content article p,
	.entry-content section p {
		font-size: 1.125rem !important; /* 18px */
	}
}

/* Links in content */
.entry-content a,
.entry-content .prose a,
div.entry-content a {
	color: #0d41e1 !important;
	font-weight: 500 !important;
	text-decoration: none !important;
	transition: color 0.2s ease;
}

.entry-content a:hover,
.entry-content .prose a:hover,
div.entry-content a:hover {
	text-decoration: underline !important;
}

/* Strong text */
.entry-content strong,
.entry-content .prose strong,
div.entry-content strong {
	font-weight: 600 !important;
	color: #111827 !important;
}

/* Lists */
/* Unordered lists - show bullets/dots */
.entry-content ul,
.entry-content .prose ul,
div.entry-content ul,
.entry-content .wp-block-list ul,
.entry-content article ul,
.entry-content section ul {
	margin-top: 1.5rem !important;
	margin-bottom: 1.5rem !important;
	padding-left: 1.5rem !important;
	list-style-type: disc !important;
	list-style-position: outside !important;
}

/* Ordered lists - show numbers */
.entry-content ol,
.entry-content .prose ol,
div.entry-content ol,
.entry-content .wp-block-list ol,
.entry-content article ol,
.entry-content section ol {
	margin-top: 1.5rem !important;
	margin-bottom: 1.5rem !important;
	padding-left: 1.5rem !important;
	list-style-type: decimal !important;
	list-style-position: outside !important;
}

.entry-content li,
.entry-content .prose li,
div.entry-content li,
.entry-content .wp-block-list-item,
.entry-content article li,
.entry-content section li {
	font-size: 1.0625rem !important;
	line-height: 1.75 !important;
	color: #374151 !important;
	margin-bottom: 0.5rem !important;
	padding-left: 0.5rem !important;
	display: list-item !important;
}

@media (min-width: 640px) {
	.entry-content li,
	.entry-content .prose li,
	div.entry-content li,
	.entry-content .wp-block-list-item,
	.entry-content article li,
	.entry-content section li {
		font-size: 1.125rem !important;
	}
}

/* Blockquotes */
.entry-content blockquote,
.entry-content .prose blockquote,
div.entry-content blockquote {
	border-left: 4px solid #0d41e1 !important;
	padding-left: 1.5rem !important;
	font-style: italic !important;
	color: #4b5563 !important;
	margin: 1.5rem 0 !important;
	font-size: 1.125rem !important;
}

/* Code */
.entry-content code,
.entry-content .prose code,
div.entry-content code {
	font-size: 0.875rem !important;
	background-color: #f3f4f6 !important;
	padding: 0.125rem 0.375rem !important;
	border-radius: 0.25rem !important;
	color: #1f2937 !important;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important;
}

/* Pre blocks */
.entry-content pre,
.entry-content .prose pre,
div.entry-content pre {
	background-color: #111827 !important;
	color: #f3f4f6 !important;
	padding: 1rem !important;
	border-radius: 0.5rem !important;
	margin: 1.5rem 0 !important;
	overflow-x: auto !important;
	font-size: 0.875rem !important;
	line-height: 1.5 !important;
}

.entry-content pre code,
.entry-content .prose pre code,
div.entry-content pre code {
	background-color: transparent !important;
	padding: 0 !important;
	color: inherit !important;
}

/* Images */
.entry-content img,
.entry-content .prose img,
div.entry-content img {
	border-radius: 0.5rem !important;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
	margin: 1.5rem 0 !important;
	max-width: 100% !important;
	height: auto !important;
}

/* Horizontal rules */
.entry-content hr,
.entry-content .prose hr,
div.entry-content hr {
	border: 0 !important;
	border-top: 1px solid #d1d5db !important;
	margin: 2rem 0 !important;
}

/* Tables */
.entry-content table,
.entry-content .prose table,
div.entry-content table {
	width: 100% !important;
	margin: 1.5rem 0 !important;
	border-collapse: collapse !important;
}

.entry-content th,
.entry-content .prose th,
div.entry-content th {
	border: 1px solid #d1d5db !important;
	background-color: #f9fafb !important;
	padding: 0.75rem !important;
	text-align: left !important;
	font-weight: 600 !important;
}

.entry-content td,
.entry-content .prose td,
div.entry-content td {
	border: 1px solid #d1d5db !important;
	padding: 0.75rem !important;
}

/* AJAX Search Dropdown Styles */
/* Ensure parent containers allow overflow - CRITICAL for dropdown visibility */
#masthead,
#masthead > div,
#masthead > div > div,
#masthead form,
#masthead .relative {
	overflow: visible !important;
	position: relative !important;
}

/* Ensure body and page don't clip dropdown */
body,
#page,
#content-area {
	overflow-x: hidden !important;
	overflow-y: visible !important;
}

#ai-webwise-search-dropdown {
	position: absolute !important;
	top: 100% !important;
	left: 0 !important;
	right: 0 !important;
	margin-top: 0.5rem !important;
	background: white !important;
	border-radius: 0.75rem !important;
	box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
	border: 1px solid #e5e7eb !important;
	z-index: 99999 !important;
	max-height: 28rem !important;
	overflow-y: auto !important;
	overflow-x: hidden !important;
	display: none !important;
	visibility: visible !important;
	backdrop-filter: blur(10px);
}

#ai-webwise-search-dropdown:not(.hidden) {
	display: block !important;
}

/* Search Results Container */
#ai-webwise-search-results {
	max-height: 24rem;
	overflow-y: auto;
	padding: 0.25rem 0;
}

/* Search Result Item */
.search-result-item {
	padding: 0.875rem 1rem;
	transition: all 0.2s ease;
	cursor: pointer;
	border-bottom: 1px solid #f3f4f6;
	position: relative;
}

.search-result-item:last-child {
	border-bottom: none;
}

.search-result-item:hover,
.search-result-item.bg-blue-50 {
	background-color: #eff6ff;
	border-left: 3px solid #0d41e1;
	padding-left: calc(1rem - 3px);
}

.search-result-item:active {
	background-color: #dbeafe;
}

/* Loading Spinner */
#ai-webwise-search-loading {
	padding: 2rem 1.5rem;
	text-align: center;
}

#ai-webwise-search-loading .animate-spin {
	animation: spin 1s linear infinite;
}

@keyframes spin {
	from {
		transform: rotate(0deg);
	}
	to {
		transform: rotate(360deg);
	}
}

/* No Results Message */
#ai-webwise-search-no-results {
	padding: 2rem 1.5rem;
	text-align: center;
}

#ai-webwise-search-no-results p {
	color: #6b7280;
	font-size: 0.875rem;
}

/* Search Dropdown Scrollbar */
#ai-webwise-search-results::-webkit-scrollbar {
	width: 6px;
}

#ai-webwise-search-results::-webkit-scrollbar-track {
	background: #f9fafb;
}

#ai-webwise-search-results::-webkit-scrollbar-thumb {
	background: #d1d5db;
	border-radius: 3px;
}

#ai-webwise-search-results::-webkit-scrollbar-thumb:hover {
	background: #9ca3af;
}

/* Mobile adjustments */
@media (max-width: 1024px) {
	#ai-webwise-search-dropdown {
		position: fixed;
		left: 1rem;
		right: 1rem;
		top: auto;
		bottom: 1rem;
		max-height: 50vh;
		margin-top: 0;
	}
}

