/**
 * Texra Theme — Main Styles
 *
 * @package Texra
 */

/* ------------------------------------------------------------------
   CSS Variables
   ------------------------------------------------------------------ */
:root {
	--texra-primary: #2563eb;
	--texra-primary-dark: #1d4ed8;
	--texra-secondary: #0f172a;
	--texra-text: #334155;
	--texra-text-light: #64748b;
	--texra-bg: #ffffff;
	--texra-bg-alt: #f8fafc;
	--texra-border: #e2e8f0;
	--texra-radius: 8px;
	--texra-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
	--texra-container: 1200px;
	--texra-header-height: 72px;
	--texra-font: 'Vazirmatn', Tahoma, Arial, sans-serif;
	--texra-transition: 0.25s ease;
}

/* ------------------------------------------------------------------
   Reset & Base
   ------------------------------------------------------------------ */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	font-family: var(--texra-font);
	font-size: 16px;
	line-height: 1.7;
	color: var(--texra-text);
	background-color: var(--texra-bg);
	direction: rtl;
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

a {
	color: var(--texra-primary);
	text-decoration: none;
	transition: color var(--texra-transition);
}

a:hover,
a:focus {
	color: var(--texra-primary-dark);
}

h1, h2, h3, h4, h5, h6 {
	color: var(--texra-secondary);
	line-height: 1.3;
	margin-top: 0;
}

p {
	margin-top: 0;
}

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

.screen-reader-text:focus {
	background-color: var(--texra-bg);
	border-radius: var(--texra-radius);
	clip: auto !important;
	clip-path: none;
	color: var(--texra-secondary);
	display: block;
	font-size: 14px;
	height: auto;
	left: 5px;
	line-height: normal;
	padding: 15px 23px 14px;
	text-decoration: none;
	top: 5px;
	width: auto;
	z-index: 100000;
}

/* ------------------------------------------------------------------
   Layout
   ------------------------------------------------------------------ */
.container {
	width: 100%;
	max-width: var(--texra-container);
	margin-inline: auto;
	padding-inline: 20px;
}

.content-area {
	max-width: var(--texra-container);
	margin-inline: auto;
	padding-inline: 20px;
}

@media (min-width: 992px) {
	body:not(.texra-full-width) .content-area:has(.sidebar) {
		display: grid;
		grid-template-columns: 1fr 300px;
		gap: 40px;
		align-items: start;
	}
}

.site-main {
	padding-block: 40px;
}

.content-area .container {
	padding-inline: 0;
	max-width: none;
}

.site-main--full-width,
.texra-full-width .site-main {
	padding-block: 0;
}

.entry-content--full-width {
	max-width: none;
	padding: 0;
}

/* ------------------------------------------------------------------
   Header
   ------------------------------------------------------------------ */
.site-header {
	position: sticky;
	top: 0;
	z-index: 1000;
	background: var(--texra-bg);
	border-bottom: 1px solid var(--texra-border);
	box-shadow: 0 1px 3px rgb(0 0 0 / 0.05);
}

.header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: var(--texra-header-height);
	gap: 20px;
}

.site-branding {
	flex-shrink: 0;
}

.site-title {
	margin: 0;
	font-size: 1.5rem;
	font-weight: 700;
}

.site-title a {
	color: var(--texra-secondary);
}

.site-title a:hover {
	color: var(--texra-primary);
}

.site-description {
	margin: 0;
	font-size: 0.875rem;
	color: var(--texra-text-light);
}

.custom-logo-link {
	display: block;
}

.custom-logo {
	max-height: 60px;
	width: auto;
}

/* Navigation */
.main-navigation ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.main-navigation a {
	display: block;
	padding: 8px 16px;
	color: var(--texra-secondary);
	font-weight: 500;
	border-radius: var(--texra-radius);
	transition: background var(--texra-transition), color var(--texra-transition);
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a {
	background: var(--texra-bg-alt);
	color: var(--texra-primary);
}

.menu-toggle {
	display: none;
	background: none;
	border: 1px solid var(--texra-border);
	border-radius: var(--texra-radius);
	padding: 8px 12px;
	cursor: pointer;
}

.menu-toggle-icon {
	display: block;
	width: 24px;
	height: 2px;
	background: var(--texra-secondary);
	position: relative;
}

.menu-toggle-icon::before,
.menu-toggle-icon::after {
	content: '';
	position: absolute;
	width: 24px;
	height: 2px;
	background: var(--texra-secondary);
	left: 0;
	transition: transform var(--texra-transition);
}

.menu-toggle-icon::before { top: -7px; }
.menu-toggle-icon::after { top: 7px; }

/* ------------------------------------------------------------------
   Posts Grid
   ------------------------------------------------------------------ */
.posts-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	gap: 30px;
	margin-bottom: 40px;
}

.post-card {
	background: var(--texra-bg);
	border: 1px solid var(--texra-border);
	border-radius: var(--texra-radius);
	overflow: hidden;
	transition: box-shadow var(--texra-transition), transform var(--texra-transition);
}

.post-card:hover {
	box-shadow: var(--texra-shadow);
	transform: translateY(-2px);
}

.post-card-thumbnail img {
	width: 100%;
	height: 200px;
	object-fit: cover;
}

.post-card-body {
	padding: 20px;
}

.post-card .entry-title {
	font-size: 1.25rem;
	margin-bottom: 8px;
}

.post-card .entry-title a {
	color: var(--texra-secondary);
}

.entry-meta {
	font-size: 0.875rem;
	color: var(--texra-text-light);
	margin-bottom: 12px;
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.read-more {
	display: inline-block;
	margin-top: 12px;
	font-weight: 600;
	color: var(--texra-primary);
}

/* ------------------------------------------------------------------
   Single / Page
   ------------------------------------------------------------------ */
.entry-header {
	margin-bottom: 24px;
}

.entry-title {
	font-size: 2rem;
}

.post-thumbnail {
	margin-bottom: 24px;
	border-radius: var(--texra-radius);
	overflow: hidden;
}

.entry-content {
	line-height: 1.8;
}

.entry-content > * + * {
	margin-top: 1.25em;
}

.entry-footer {
	margin-top: 32px;
	padding-top: 20px;
	border-top: 1px solid var(--texra-border);
	color: var(--texra-text-light);
	font-size: 0.875rem;
}

/* ------------------------------------------------------------------
   Sidebar
   ------------------------------------------------------------------ */
.sidebar {
	padding-block: 40px;
}

.widget {
	margin-bottom: 30px;
}

.widget-title {
	font-size: 1.125rem;
	margin-bottom: 16px;
	padding-bottom: 8px;
	border-bottom: 2px solid var(--texra-primary);
}

/* ------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------ */
.site-footer {
	background: var(--texra-secondary);
	color: #cbd5e1;
	margin-top: 60px;
}

.footer-widgets {
	padding: 50px 0 30px;
	border-bottom: 1px solid rgb(255 255 255 / 0.1);
}

.footer-widgets-inner {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 30px;
}

.footer-widget-area .widget-title {
	color: #fff;
	border-color: var(--texra-primary);
}

.site-info {
	padding: 20px 0;
}

.site-info-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 16px;
	font-size: 0.875rem;
}

.site-info p {
	margin: 0;
}

#footer-menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
}

#footer-menu a {
	color: #94a3b8;
}

#footer-menu a:hover {
	color: #fff;
}

/* ------------------------------------------------------------------
   Pagination
   ------------------------------------------------------------------ */
.pagination,
.nav-links {
	display: flex;
	justify-content: center;
	gap: 8px;
	flex-wrap: wrap;
	margin-top: 40px;
}

.page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	border: 1px solid var(--texra-border);
	border-radius: var(--texra-radius);
	color: var(--texra-text);
	transition: all var(--texra-transition);
}

.page-numbers:hover,
.page-numbers.current {
	background: var(--texra-primary);
	border-color: var(--texra-primary);
	color: #fff;
}

/* ------------------------------------------------------------------
   Forms & Buttons
   ------------------------------------------------------------------ */
.search-form {
	display: flex;
	gap: 8px;
	max-width: 400px;
}

.search-field {
	flex: 1;
	padding: 10px 16px;
	border: 1px solid var(--texra-border);
	border-radius: var(--texra-radius);
	font-family: inherit;
	font-size: 1rem;
}

.search-submit,
.button,
input[type="submit"] {
	padding: 10px 20px;
	background: var(--texra-primary);
	color: #fff;
	border: none;
	border-radius: var(--texra-radius);
	font-family: inherit;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: background var(--texra-transition);
}

.search-submit:hover,
.button:hover,
input[type="submit"]:hover {
	background: var(--texra-primary-dark);
}

/* Comments */
.comment-list {
	list-style: none;
	padding: 0;
	margin: 0 0 30px;
}

.comment-list .comment {
	padding: 20px 0;
	border-bottom: 1px solid var(--texra-border);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%;
	padding: 10px 16px;
	border: 1px solid var(--texra-border);
	border-radius: var(--texra-radius);
	font-family: inherit;
	margin-bottom: 12px;
}

/* ------------------------------------------------------------------
   404
   ------------------------------------------------------------------ */
.error-404 {
	text-align: center;
	padding: 60px 0;
}

.error-404 .page-title {
	font-size: 2.5rem;
	margin-bottom: 16px;
}

/* ------------------------------------------------------------------
   Elementor Compatibility
   ------------------------------------------------------------------ */
.texra-elementor-page .entry-content {
	max-width: none;
}

.texra-elementor-page .entry-content > .elementor {
	margin-inline: calc(-1 * ((100vw - 100%) / 2));
	max-width: 100vw;
}

.elementor-page .entry-content {
	padding: 0;
}

.texra-blank-canvas {
	margin: 0;
}

.site--blank .site-main {
	padding: 0;
}

/* Elementor full-width sections */
.elementor-section.elementor-section-stretched {
	width: 100vw !important;
	margin-left: calc(-50vw + 50%) !important;
	margin-right: calc(-50vw + 50%) !important;
}

/* ------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------ */
@media (max-width: 768px) {
	.menu-toggle {
		display: block;
	}

	.main-navigation {
		position: absolute;
		top: var(--texra-header-height);
		right: 0;
		left: 0;
		background: var(--texra-bg);
		border-bottom: 1px solid var(--texra-border);
		padding: 16px 20px;
		display: none;
	}

	.main-navigation.is-open {
		display: block;
	}

	.main-navigation ul {
		flex-direction: column;
	}

	.entry-title {
		font-size: 1.5rem;
	}

	.site-info-inner {
		flex-direction: column;
		text-align: center;
	}
}

/* ------------------------------------------------------------------
   LTR override (when site language is English)
   ------------------------------------------------------------------ */
html[dir="ltr"] body {
	direction: ltr;
}
