/*
 Theme Name: ZonicTheme
 Theme URI: https://example.com/zonictheme
 Author: ZonicLab
 Author URI: https://example.com
 Description: Lightweight Elementor-first theme optimized for performance and template libraries.
 Version: 1.0
 Requires at least: 6.0
 Tested up to: latest
 License: GPL v2 or later
 License URI: https://www.gnu.org/licenses/gpl-2.0.html
 Text Domain: zonictheme
 Tags: one-column, two-columns, custom-logo, custom-menu, footer-widgets, flexible-header, editor-style, rtl-language-support
*/

/* Reset & basic layout */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	line-height: 1.5;
	color: #111827;
	background-color: #ffffff;
}

/* Utility container */
.container {
	width: 100%;
	max-width: 1200px;
	margin-inline: auto;
	padding-inline: 1rem;
}

/* Screen reader text */
.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

.screen-reader-text:focus {
	clip: auto !important;
	height: auto;
	margin: 0;
	overflow: visible;
	position: static;
	width: auto;
}

/* Site structure */
.site {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	position: relative;
}

.site-content {
	flex: 1 0 auto;
}

/* Header */
.site-header {
	border-bottom: 1px solid #e5e7eb;
	background-color: #ffffff;
}

/* Zonic site header wrapper for Elementor-built headers */
.zonic-site-header {
	width: 100%;
	box-sizing: border-box;
	overflow: visible;
}

/* Ensure sticky header doesn't get constrained by parent flex context */
body.zonic-header-sticky .zonic-site-header {
	flex-shrink: 0;
}

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-block: 0.75rem;
	gap: 1rem;
}

.site-branding {
	display: flex;
	flex-direction: column;
	gap: 0.125rem;
}

.site-title {
	font-size: 1.125rem;
	margin: 0;
}

.site-title a {
	color: inherit;
	text-decoration: none;
}

.site-title a:hover,
.site-title a:focus {
	text-decoration: underline;
}

.site-description {
	margin: 0;
	font-size: 0.875rem;
	color: #6b7280;
}

/* Navigation */
.primary-navigation {
	display: none;
}

.primary-menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.primary-menu li {
	margin: 0;
}

.primary-menu a {
	text-decoration: none;
	color: #111827;
	font-size: 0.95rem;
	padding: 0.25rem 0.5rem;
	border-radius: 999px;
}

.primary-menu a:hover,
.primary-menu a:focus,
.primary-menu .current-menu-item > a {
	background-color: #f3f4f6;
}

/* Mobile menu toggle */
.site-header__toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	padding: 0;
	border: 1px solid #d1d5db;
	border-radius: 999px;
	background: #ffffff;
	cursor: pointer;
}

.site-header__toggle .toggle-bar {
	display: block;
	width: 1.25rem;
	height: 2px;
	background-color: #111827;
	position: relative;
}

.site-header__toggle .toggle-bar::before,
.site-header__toggle .toggle-bar::after {
	content: "";
	position: absolute;
	left: 0;
	width: 1.25rem;
	height: 2px;
	background-color: #111827;
}

.site-header__toggle .toggle-bar::before {
	top: -6px;
}

.site-header__toggle .toggle-bar::after {
	top: 6px;
}

/* Show nav when toggled on mobile */
.primary-navigation.is-open {
	display: block;
	margin-top: 0.75rem;
}

/* Footer */
.site-footer {
	border-top: 1px solid #e5e7eb;
	background-color: #f9fafb;
	padding-block: 1.5rem;
	font-size: 0.875rem;
	color: #4b5563;
}

.site-footer__inner {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	align-items: flex-start;
	justify-content: space-between;
}

.site-footer__nav {
	font-size: 0.875rem;
}

.footer-menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

.footer-menu a {
	color: #4b5563;
	text-decoration: none;
}

.footer-menu a:hover,
.footer-menu a:focus {
	text-decoration: underline;
}

/* Basic content layout (Elementor will override on Elementor pages) */
.site-main {
	padding-block: 2rem;
}

/* When using a Zonic builder header, let the template control spacing. */
body.zonic-has-header .site-main {
	padding-top: 0;
}


/*
 * Transparent header: overlay header on top of content.
 * Uses fixed positioning to ensure it overlays above all page content.
 * JavaScript will handle padding calculation to prevent content overlap.
 */
body.zonic-header-transparent .zonic-site-header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 1000;
	width: 100%;
}

body.zonic-header-transparent .site {
	padding-top: 0;
}

body.zonic-header-transparent .site-content {
	padding-top: 0;
}

/*
 * Sticky header: stays at top while scrolling but allows content above.
 * Uses position: sticky for better performance than fixed.
 * Sticky takes precedence over transparent when both are enabled.
 */
body.zonic-header-sticky .zonic-site-header {
	position: sticky;
	top: 0;
	z-index: 999;
	width: 100%;
}

.entry-header {
	margin-bottom: 1.5rem;
}

.entry-title {
	font-size: clamp(1.5rem, 2vw + 1rem, 2.25rem);
	margin: 0 0 0.5rem;
}

.entry-meta {
	font-size: 0.875rem;
	color: #6b7280;
	margin-bottom: 1.5rem;
}

.entry-content {
	max-width: 720px;
	margin-inline: auto;
}

/* Elementor pages: allow full-width content and let Elementor handle layout. */
body.elementor-page .entry-header {
	display: none;
}

body.elementor-page .entry-content {
	max-width: none;
	margin: 0;
	padding: 0;
}

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

/* Archive & index lists */
.post-list {
	display: grid;
	gap: 2rem;
}

.post-summary {
	border-bottom: 1px solid #e5e7eb;
	padding-bottom: 1.5rem;
}

.post-summary:last-child {
	border-bottom: 0;
}

/* Responsive */
@media (min-width: 768px) {
	.site-header__inner {
		align-items: center;
	}

	.site-header__toggle {
		display: none;
	}

	.primary-navigation {
		display: block;
	}

	.primary-menu {
		flex-direction: row;
		align-items: center;
	}
	
	.site-footer__inner {
		flex-direction: row;
		align-items: center;
	}
}

/* Default 404 page – center-aligned content, black rounded button (high specificity for body.error404) */
body.error404 .site-main {
	min-height: 60vh;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
}
body.error404 .site-main .zonic-404-default {
	text-align: center;
	max-width: 560px;
	margin-inline: auto;
	padding: 4rem 1.5rem;
	border-radius: 12px;
}
body.error404 .zonic-404-default .zonic-404-label {
	font-size: 0.9rem;
	font-weight: 400;
	color: #6b7280;
	margin: 0 0 0.5rem;
	letter-spacing: 0.02em;
	text-align: center;
}
body.error404 .zonic-404-default .page-header {
	margin-bottom: 1rem;
	text-align: center;
}
body.error404 .zonic-404-default .page-title {
	font-size: clamp(2rem, 5vw, 3rem);
	font-weight: 700;
	margin: 0;
	color: #111827;
	line-height: 1.2;
	text-align: center;
}
body.error404 .zonic-404-default .page-content {
	margin-top: 0;
	text-align: center;
}
body.error404 .zonic-404-default .zonic-404-lead {
	font-size: 1.05rem;
	font-weight: 400;
	color: #4b5563;
	line-height: 1.6;
	margin: 0 auto 2rem;
	max-width: 420px;
	text-align: center;
}
body.error404 .zonic-404-default .zonic-404-actions {
	margin-bottom: 0;
	text-align: center;
}
/* Black rounded button – override WordPress/theme default link styles */
body.error404 .zonic-404-default a.zonic-404-button {
	display: inline-block !important;
	padding: 0.75rem 1.5rem !important;
	background: #111827 !important;
	color: #fff !important;
	font-size: 0.95rem !important;
	font-weight: 500 !important;
	text-decoration: none !important;
	border-radius: 12px !important;
	border: none !important;
	box-shadow: none !important;
}
body.error404 .zonic-404-default a.zonic-404-button:hover {
	background: #1f2937 !important;
	color: #fff !important;
	text-decoration: none !important;
}

