/*
Theme Name: EgniTech One
Theme URI: https://egnitech.com/themes/egnitech-one
Author: Nippun Rana
Author URI: https://egnitech.com
Description: A lightweight, blazing-fast WordPress block theme by EgniTech. Features native dark/light mode support, modern typography with Inter, and a clean design system — all under 50 KB. Built for performance and full-site editing.
Requires at least: 7.0
Tested up to: 7.0
Requires PHP: 8.0
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: egnitech-one
Tags: one-column, custom-colors, custom-menu, custom-logo, editor-style, featured-images, full-site-editing, block-patterns, wide-blocks, block-styles, accessibility-ready, blog, portfolio
*/

/* ─── Critical base styles ─── */

/* Smooth color transitions for dark/light mode */
*,
*::before,
*::after {
	transition: background-color 0.25s ease, color 0.15s ease, border-color 0.25s ease;
}

/* Focus styles */
:where(.wp-site-blocks *:focus) {
	outline-width: 2px;
	outline-style: solid;
	outline-color: var(--wp--preset--color--accent);
}

/* Link underline refinement */
a {
	text-decoration-thickness: 1px !important;
	text-underline-offset: 0.15em;
}

/* Better text wrapping */
h1,
h2,
h3,
h4,
h5,
h6,
blockquote,
caption,
figcaption,
p {
	text-wrap: pretty;
}

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

/* Preformatted text overflow */
:where(pre) {
	overflow-x: auto;
}

/* Selection highlight */
::selection {
	background-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--base);
}

/* ─── Header Logo Toggle ─── */
:root,
html[data-scheme="light"] {
	--egnitech-show-light: flex;
	--egnitech-show-dark: none;
}

html[data-scheme="dark"] {
	--egnitech-show-light: none;
	--egnitech-show-dark: flex;
}

.egnitech-light-logo {
	display: var(--egnitech-show-light) !important;
}

.egnitech-dark-logo {
	display: var(--egnitech-show-dark) !important;
}

/* ─── Header Refinement ─── */
.egnitech-header-logo-container {
	display: flex;
	align-items: center;
	height: 48px;
}

.egnitech-header-logo-container .egnitech-light-logo img,
.egnitech-header-logo-container .egnitech-dark-logo img {
	height: 40px;
	width: auto;
	max-width: none;
	display: block;
	object-fit: contain;
}

/* Ensure vertical alignment with toggle */
.wp-site-blocks .wp-block-group.alignwide {
	align-items: center;
}

/* ─── Flexible Sticky Header ─── */
body.has-fixed-header .wp-site-blocks>header,
body.has-fixed-header .wp-site-blocks>.wp-block-template-part:first-child {
	position: sticky;
	top: 0;
	z-index: 100;
	background-color: var(--wp--preset--color--base);
}

/* ─── Blog Layout Grids ─── */
body.blog-layout-grid-2 .wp-block-post-template,
body.blog-layout-grid-3 .wp-block-post-template {
	list-style: none;
	padding-left: 0;
	margin: 0;
}

@media (min-width: 768px) {
	body.blog-layout-grid-2 .wp-block-post-template {
		display: grid;
		grid-template-columns: repeat(2, 1fr);
		gap: var(--wp--preset--spacing--60);
	}
	body.blog-layout-grid-3 .wp-block-post-template {
		display: grid;
		grid-template-columns: repeat(3, 1fr);
		gap: var(--wp--preset--spacing--50);
	}
}

/* ─── Sidebar Layout ─── */
.egnitech-layout-wrapper {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--60);
}

.egnitech-main-content {
	width: 100%;
}

.egnitech-sidebar-area {
	width: 100%;
}

body:not(.has-sidebar) .egnitech-sidebar-area {
	display: none !important;
}

body:not(.has-sidebar) .egnitech-main-content {
	width: 100% !important;
	max-width: 100% !important;
}

@media (min-width: 1024px) {
	body.has-sidebar .egnitech-layout-wrapper {
		display: grid;
		grid-template-columns: minmax(0, 1fr) 300px;
		align-items: start;
		gap: var(--wp--preset--spacing--70);
	}

	body.sidebar-left .egnitech-layout-wrapper {
		grid-template-columns: 300px minmax(0, 1fr);
	}

	body.sidebar-left .egnitech-sidebar-area {
		order: -1;
	}
}

/* ─── Breadcrumbs Styling ─── */
.egnitech-breadcrumbs {
	max-width: var(--wp--preset--layout--content-size);
	margin: var(--wp--preset--spacing--50) auto 0;
	padding: 0 var(--wp--preset--spacing--50);
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--secondary);
	display: flex;
	align-items: center;
	flex-wrap: wrap;
}

.egnitech-breadcrumbs a {
	color: var(--wp--preset--color--secondary);
	text-decoration: none;
	transition: color 0.15s ease;
}

.egnitech-breadcrumbs a:hover {
	color: var(--wp--preset--color--accent);
}

.egnitech-breadcrumb-sep {
	margin: 0 8px;
	opacity: 0.5;
}

.egnitech-breadcrumb-current {
	font-weight: 500;
	color: var(--wp--preset--color--contrast);
}