/**
 * Native Styles - MakerOnsite
 * Replaces Elementor styling
 */

/* Header */
#site-header {
	background: #fff;
	border-bottom: 2px solid #f0f0f0;
	padding: 0;
	box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.header-inner {
	max-width: 1200px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 20px;
	height: 64px;
}

.header-logo img {
	height: 40px !important;
	width: auto !important;
	display: block !important;
}

/* Primary menu - top level */
#site-navigation > ul,
#site-navigation ul.menu {
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
	display: flex !important;
	gap: 0 !important;
	align-items: center !important;
	flex-wrap: nowrap !important;
}

#site-navigation li,
#site-navigation ul.menu li {
	position: relative !important;
	list-style: none !important;
	display: block !important;
}

#site-navigation a,
#site-navigation ul.menu li a {
	color: #444;
	text-decoration: none;
	font-weight: 500;
	font-size: 15px;
	padding: 20px 16px;
	display: block;
	white-space: nowrap;
	transition: color 0.2s ease, background-color 0.2s ease;
}

#site-navigation a:hover,
#site-navigation ul.menu li a:hover {
	color: #2563eb;
	background-color: #f8fafc;
}

/* Sub-menus - hidden by default */
#site-navigation ul.sub-menu,
#site-navigation ul.menu ul {
	display: none !important;
	position: absolute !important;
	top: 100% !important;
	left: 0 !important;
	min-width: 200px;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 0 0 8px 8px;
	box-shadow: 0 4px 12px rgba(0,0,0,0.1);
	z-index: 9999 !important;
	padding: 8px 0 !important;
	margin: 0 !important;
	flex-wrap: nowrap !important;
}

#site-navigation ul.sub-menu li,
#site-navigation ul.menu ul li {
	width: 100% !important;
	display: block !important;
	border-bottom: none;
}

#site-navigation ul.sub-menu li:last-child,
#site-navigation ul.menu ul li:last-child {
	border-bottom: none;
}

#site-navigation ul.sub-menu a,
#site-navigation ul.menu ul li a {
	padding: 10px 20px;
	font-size: 14px;
	font-weight: 400;
	color: #555;
	border-bottom: none;
}

#site-navigation ul.sub-menu a:hover,
#site-navigation ul.menu ul li a:hover {
	background: #f1f5f9;
	color: #2563eb;
}

/* Show sub-menu on hover */
#site-navigation li:hover > ul.sub-menu,
#site-navigation ul.menu li:hover > ul {
	display: block !important;
}

/* Nested sub-menus */
#site-navigation ul.sub-menu ul.sub-menu,
#site-navigation ul.menu ul ul {
	top: 0 !important;
	left: 100% !important;
	border-radius: 8px;
}

/* Menu item with children indicator */
#site-navigation .menu-item-has-children > a::after,
#site-navigation ul.menu li.menu-item-has-children::after {
	content: " ▾" !important;
	font-size: 10px;
	color: #999;
	margin-left: 4px;
	position: static !important;
	transform: none !important;
}

/* Header search */
.header-search .search-form {
	display: flex;
	align-items: center;
}

.header-search input[type="search"] {
	padding: 8px 12px;
	border: 1px solid #e5e7eb;
	border-radius: 6px 0 0 6px;
	font-size: 14px;
	outline: none;
	transition: border-color 0.2s ease;
}

.header-search input[type="search"]:focus {
	border-color: #2563eb;
}

.header-search input[type="submit"] {
	padding: 8px 16px;
	background: #2563eb;
	color: #fff;
	border: none;
	border-radius: 0 6px 6px 0;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	transition: background-color 0.2s ease;
}

.header-search input[type="submit"]:hover {
	background: #1d4ed8;
}

/* Main Content */
.content-area {
	max-width: 1200px;
	margin: 0 auto;
	padding: 20px;
}

/* Single Post */
.single-post-wrapper {
	display: flex;
	gap: 30px;
}

.post-sidebar {
	width: 280px;
	flex-shrink: 0;
}

.sidebar-sticky {
	position: sticky;
	top: 80px;
}

.entry-content {
	width: 100%;
}

@media (max-width: 768px) {
	.single-post-wrapper {
		flex-direction: column;
	}
	.post-sidebar {
		width: 100%;
	}
}

/* TOC */
.toc-box {
	background: #f9f9f9;
	border: 1px solid #eee;
	border-radius: 8px;
	padding: 15px;
	margin-bottom: 20px;
}

.toc-box h3 {
	margin: 0 0 10px;
	font-size: 16px;
}

.toc-box ul {
	list-style: none;
	padding: 0;
	margin: 0;
}

.toc-box li {
	padding: 4px 0;
}

.toc-box a {
	color: #333;
	text-decoration: none;
}

.toc-box a:hover {
	color: #0073aa;
}

.toc-level-3 {
	padding-left: 15px !important;
}

.toc-level-4 {
	padding-left: 30px !important;
}

/* Entry Header */
.entry-header {
	margin-bottom: 20px;
}

.entry-title {
	font-size: 28px;
	margin: 0 0 10px;
	color: #333;
}

.entry-meta {
	display: flex;
	gap: 15px;
	flex-wrap: wrap;
	font-size: 14px;
	color: #666;
}

.entry-meta i {
	margin-right: 4px;
}

.entry-meta a {
	color: #0073aa;
}

.entry-featured-image {
	margin-bottom: 20px;
}

.entry-featured-image img {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
}

/* Entry Content */
.entry-content {
	font-size: 16px;
	line-height: 1.8;
	color: #333;
}

.entry-content h2 {
	font-size: 22px;
	margin: 30px 0 15px;
	color: #333;
	border-bottom: 2px solid #eee;
	padding-bottom: 8px;
}

.entry-content h3 {
	font-size: 18px;
	margin: 25px 0 12px;
	color: #444;
}

.entry-content img {
	max-width: 100%;
	height: auto;
}

.entry-content pre, .entry-content code {
	background: #f5f5f5;
	padding: 2px 6px;
	border-radius: 4px;
	font-size: 14px;
}

.entry-content pre {
	padding: 15px;
	overflow-x: auto;
}

/* Post Navigation */
.post-navigation {
	display: flex;
	justify-content: space-between;
	margin-top: 30px;
	padding-top: 20px;
	border-top: 1px solid #eee;
}

.post-navigation a {
	color: #0073aa;
	text-decoration: none;
}

/* Related Posts */
.related-posts {
	background: #f9f9f9;
	border-radius: 8px;
	padding: 15px;
	margin-bottom: 20px;
}

.related-posts h4 {
	margin: 0 0 10px;
	font-size: 16px;
}

.related-item {
	display: flex;
	gap: 10px;
	margin-bottom: 10px;
}

.related-thumb img {
	width: 60px;
	height: 60px;
	object-fit: cover;
	border-radius: 4px;
}

.related-info a {
	color: #333;
	text-decoration: none;
	font-size: 14px;
	line-height: 1.4;
}

.related-date {
	font-size: 12px;
	color: #999;
}

/* WeChat QR */
.wechat-qr {
	text-align: center;
	margin-top: 20px;
}

.wechat-qr img {
	max-width: 200px;
	border-radius: 8px;
}

/* Sidebar Ad */
.sidebar-ad {
	margin: 20px 0;
}

/* Archive / Index */
.page-header {
	margin-bottom: 30px;
}

.page-title {
	font-size: 24px;
	color: #333;
}

.posts-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 25px;
}

.posts-grid-small {
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

/* Post Card */
.post-card {
	background: #fff;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0,0,0,0.08);
	transition: transform 0.2s, box-shadow 0.2s;
}

.post-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.post-card-thumb {
	overflow: hidden;
}

.post-card-thumb img {
	width: 100%;
	height: 200px;
	object-fit: cover;
	transition: transform 0.3s;
}

.post-card:hover .post-card-thumb img {
	transform: scale(1.05);
}

.post-card-content {
	padding: 15px;
}

.post-card-title {
	font-size: 18px;
	margin: 0 0 8px;
	line-height: 1.4;
}

.post-card-title a {
	color: #333;
	text-decoration: none;
}

.post-card-title a:hover {
	color: #0073aa;
}

.post-card-meta {
	font-size: 13px;
	color: #999;
	margin-bottom: 8px;
}

.post-card-meta a {
	color: #0073aa;
}

.post-card-excerpt {
	font-size: 14px;
	color: #666;
	line-height: 1.6;
}

.post-card-small .post-card-thumb img {
	height: 120px;
}

.post-card-small .post-card-title {
	font-size: 14px;
}

/* Section */
.section-latest, .section-category {
	margin: 40px 0;
}

.section-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
}

.section-header h2 {
	font-size: 22px;
	color: #333;
	margin: 0;
}

.section-more {
	color: #0073aa;
	text-decoration: none;
	font-size: 14px;
}

/* Hero */
.hero-section {
	background: linear-gradient(135deg, rgba(30, 30, 60, 0.75) 0%, rgba(20, 20, 50, 0.85) 100%),
		url('https://res.makeronsite.com/makeronsite/hero-circuit-board.jpg');
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	color: #fff;
	padding: 80px 20px;
	text-align: center;
	border-radius: 12px;
	margin-bottom: 40px;
	min-height: 300px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.hero-inner {
	max-width: 800px;
	margin: 0 auto;
}

.hero-title {
	font-size: 42px;
	font-weight: 700;
	margin: 0 0 12px;
	text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.hero-subtitle {
	font-size: 20px;
	opacity: 0.95;
	text-shadow: 0 1px 4px rgba(0,0,0,0.3);
	margin: 0;
}

@media (max-width: 768px) {
	.hero-section {
		padding: 50px 15px;
		min-height: 220px;
	}
	.hero-title {
		font-size: 32px;
	}
	.hero-subtitle {
		font-size: 16px;
	}
}

/* Footer */
#site-footer {
	background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
	color: #cbd5e1;
	border-top: 3px solid #2563eb;
	margin-top: 60px;
	padding: 0;
}

.footer-top {
	max-width: 1200px;
	margin: 0 auto;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 40px;
	padding: 50px 20px 40px;
}

.footer-col h4 {
	margin: 0 0 16px;
	font-size: 16px;
	font-weight: 700;
	color: #f1f5f9;
	letter-spacing: 0.5px;
	text-transform: uppercase;
}

.footer-col h4::after {
	content: '';
	display: block;
	width: 40px;
	height: 2px;
	background: #2563eb;
	margin-top: 8px;
	border-radius: 1px;
}

.footer-col p, .footer-col li {
	font-size: 14px;
	color: #94a3b8;
	line-height: 1.8;
}

.footer-col ul {
	list-style: none;
	padding: 0;
	margin: 0;
}

.footer-col ul.children {
	margin-left: 16px;
	margin-top: 4px;
}

.footer-col a {
	color: #94a3b8;
	text-decoration: none;
	transition: color 0.2s ease;
}

.footer-col a:hover {
	color: #60a5fa;
	text-decoration: none;
}

.footer-col li:hover > a {
	color: #60a5fa;
}

/* Footer categories - inline layout */
.footer-categories {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 20px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.footer-categories li {
	margin: 0;
}

.footer-categories li a {
	color: #94a3b8;
	text-decoration: none;
	transition: color 0.2s ease;
	font-size: 14px;
}

.footer-categories li a:hover {
	color: #60a5fa;
}

.footer-bottom {
	background: #0c1020;
	color: #64748b;
	text-align: center;
	padding: 20px;
	font-size: 13px;
	border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-bottom a {
	color: #64748b;
	transition: color 0.2s ease;
}

.footer-bottom a:hover {
	color: #94a3b8;
}

@media (max-width: 768px) {
	.footer-top {
		grid-template-columns: 1fr;
		gap: 30px;
		padding: 30px 20px 25px;
	}
	.footer-categories {
		gap: 6px 16px;
	}
}

.footer-bottom {
	background: #1f2937;
	color: #9ca3af;
	text-align: center;
	padding: 20px;
	font-size: 13px;
}

.footer-bottom a {
	color: #9ca3af;
	transition: color 0.2s ease;
}

.footer-bottom a:hover {
	color: #d1d5db;
}

@media (max-width: 768px) {
	.footer-top {
		grid-template-columns: 1fr;
		gap: 30px;
	}
}

/* Pagination */
.nav-links {
	display: flex;
	justify-content: center;
	gap: 5px;
	margin: 30px 0;
}

.nav-links a, .nav-links span {
	padding: 8px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	text-decoration: none;
	color: #333;
}

.nav-links .current {
	background: #0073aa;
	color: #fff;
	border-color: #0073aa;
}

/* 404 */
.error-404 {
	text-align: center;
	padding: 60px 20px;
}

.error-404 .page-title {
	font-size: 36px;
}

.btn-home {
	padding: 10px 25px;
	background: #0073aa;
	color: #fff;
	text-decoration: none;
	border-radius: 6px;
	margin-top: 20px;
}
