/* Mobile-only overrides for theme xSky1.
   Loaded via media query from templates/head.html.
   Keep desktop look unchanged. */

@media screen and (max-width: 1200px) {
	html,
	body {
		overflow-x: hidden;
		-webkit-text-size-adjust: 100%;
	}

	body {
		text-align: left;
		font-size: 16px;
		line-height: 1.75;
		letter-spacing: 0.1px;
		text-rendering: optimizeLegibility;
	}

	#headerimg .title {
		font-size: 28px;
		line-height: 1.15;
		display: inline;
	}
	#headerimg .description {
		font-size: 12px;
		line-height: 1.2;
		margin-left: 10px;
		display: inline;
	}

	/* Mobile sidebar quick nav */
	.mobile-sidebar-nav {
		display: flex;
		padding: 6px 16px 0 16px;
		flex-wrap: wrap;
		gap: 6px;
		box-sizing: border-box;
	}
	.mobile-sidebar-btn {
		font: inherit;
		font-size: 14px;
		line-height: 1.2;
		padding: 6px 8px;
		border: 1px solid #D5D7CC;
		background: #fff;
		color: inherit;
		border-radius: 6px;
		cursor: pointer;
	}
	.mobile-sidebar-btn.is-active {
		font-weight: 700;
	}
	.mobile-sidebar-panels {
		display: block;
		padding: 0 16px 4px 16px;
		box-sizing: border-box;
	}
	.js #sidebar {
		display: none !important;
	}
	.js #mobile_sidebar_panels {
		display: none;
	}
	.js #mobile_sidebar_panels.is-open {
		display: block;
	}
	.js #mobile_sidebar_panels .widget {
		display: none;
	}
	.js #mobile_sidebar_panels .widget.is-open {
		display: block;
	}

	/* Content typography */
	#content,
	.entry {
		font-size: 16px;
		line-height: 1.75;
	}
	.post h2,
	#post h2,
	#postlist .post h2 {
		font-size: 22px;
		line-height: 1.25;
		margin: 18px 0 6px;
	}
	.post small,
	#postlist .post small {
		font-size: 13px;
		line-height: 1.4;
		display: block;
		margin-bottom: 10px;
	}
	.postmetadata {
		font-size: 13px;
		line-height: 1.5;
	}
	.post-header {
				display: flex !important;
				flex-direction: row !important;
				direction: ltr;
		flex-wrap: wrap;
		gap: 8px;
	}
		/* Keep the title row compact on mobile.
		   mobile.css has generic `.post h2` / `.post small` rules which would otherwise
		   override the post header layout and make meta appear before the title visually. */
		.post-header h2,
		.post-header H2 {
				margin: 0 !important;
		}
		.post-header-meta small,
		.post-header-meta SMALL {
				display: inline !important;
				margin: 0 !important;
		}
		.post-header-meta .postmetadata {
				margin: 0 !important;
		}
	.post-header-meta {
		flex-wrap: wrap;
		gap: 8px;
	}
	.entry p {
		margin: 0 0 12px;
	}

	#container {
		width: auto;
		max-width: 100%;
		margin: 0;
		overflow: visible;
		display: flex;
		flex-direction: column;
	}

	#page {
		width: auto;
		max-width: 100%;
		margin: 0;
		border-left: 0;
		border-right: 0;
		box-sizing: border-box;
	}

	#headerimg {
		padding: 16px 16px 16px 64px;
		background-position: 16px 50%;
		background-size: 36px auto;
	}

	#content {
		float: none;
		width: auto;
		padding: 16px;
		box-sizing: border-box;
		min-width: 0;
		order: 1;
	}

	.narrowcolumn,
	.widecolumn {
		float: none;
		width: auto;
		margin: 0;
		padding: 0;
		box-sizing: border-box;
	}

	#sidebar {
		float: none;
		width: auto;
		padding: 0 16px 20px 16px;
		box-sizing: border-box;
		min-width: 0;
		order: 2;
		display: block !important;
	}

	#sidebar .widget,
	.mobile-sidebar-panels .widget {
		padding: 12px 14px;
		margin-bottom: 10px;
		border-radius: 12px;
	}
	#sidebar .widget-title,
	.mobile-sidebar-panels .widget-title {
		font-size: 16px;
		line-height: 1.3;
		margin-bottom: 4px;
	}
	#sidebar ul li a,
	.mobile-sidebar-panels ul li a {
		line-height: 1.4;
		font-size: 15px;
		padding: 2px 0;
	}

	/* Navigation/menu: keep it from forcing huge widths on mobile */
	#mainnav {
		right: 16px;
	}
	#mainnav #nav li {
		width: auto;
		min-height: 44px;
		font-size: 18px;
	}
	#mainnav #nav li a {
		min-height: 44px;
		line-height: 44px;
		height: 44px;
	}
	#menu-icon {
		font-size: 36px;
		width: 56px;
		height: 56px;
		line-height: 56px;
	}

	/* Content overflow guards */
	#content img,
	.entry img {
		max-width: 100%;
		height: auto;
	}

	#content table {
		display: block;
		max-width: 100%;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	#content pre,
	.entry pre {
		max-width: 100%;
		overflow-x: auto;
		box-sizing: border-box;
	}

	#content a {
		overflow-wrap: anywhere;
		word-break: break-word;
	}

	#footer {
		padding: 16px;
		box-sizing: border-box;
	}
	#footer p {
		padding: 0;
	}
	#footer .status,
	#footer .copyright {
		overflow-wrap: anywhere;
		word-break: break-word;
	}
}
