/* ==========================================================================
   mobail — Design tokens
   ========================================================================== */
@font-face {
	font-family: "Vazirmatn";
	src: url("../fonts/Vazirmatn-Variable.woff2") format("woff2-variations"),
		url("../fonts/Vazirmatn-Variable.woff2") format("woff2");
	font-weight: 100 900;
	font-style: normal;
	font-display: swap;
}

:root {
	--ink: #0e1726;
	--ink-2: #3b4658;
	--ink-3: #5c6678;
	--line: #e3e7ee;
	--surface: #ffffff;
	--canvas: #f5f7fa;
	--accent: #1f4fd8;
	--accent-ink: #ffffff;
	--accent-soft: #eaf0ff;
	--danger: #c62828;
	--success: #1a7f37;

	--radius: 12px;
	--radius-sm: 8px;
	--shadow: 0 1px 2px rgba(14, 23, 38, .06), 0 4px 16px rgba(14, 23, 38, .04);

	--font: "Vazirmatn", Tahoma, "Segoe UI", system-ui, sans-serif;
	--fs-xs: .8125rem;
	--fs-sm: .9375rem;
	--fs-md: 1rem;
	--fs-lg: 1.25rem;
	--fs-xl: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem);

	--gap: clamp(16px, 2vw, 24px);
	--container: 1240px;
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	font-family: var(--font);
	font-size: var(--fs-md);
	line-height: 1.85;
	color: var(--ink);
	background: var(--canvas);
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
}

img, svg, video { max-width: 100%; height: auto; }
img { display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 4px; }

h1, h2, h3, h4 { line-height: 1.45; margin: 0 0 .5em; font-weight: 750; letter-spacing: -.01em; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

input, select, textarea, button { font: inherit; color: inherit; }

input[type="text"], input[type="search"], input[type="email"], input[type="tel"],
input[type="password"], input[type="number"], select, textarea {
	border: 1px solid var(--line);
	background: var(--surface);
	border-radius: var(--radius-sm);
	padding: .6em .8em;
	min-height: 44px;
}

.button, button[type="submit"] {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .4em;
	min-height: 44px;
	padding: .5em 1.2em;
	border: 0;
	border-radius: var(--radius-sm);
	background: var(--accent);
	color: var(--accent-ink);
	font-weight: 650;
	cursor: pointer;
	text-decoration: none;
}
.button:hover, button[type="submit"]:hover { filter: brightness(1.08); text-decoration: none; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

.skip-link {
	position: absolute;
	inset-inline-start: 8px;
	top: -60px;
	z-index: 1000;
	background: var(--ink);
	color: #fff;
	padding: 10px 16px;
	border-radius: var(--radius-sm);
}
.skip-link:focus { top: 8px; }

.container { width: min(100% - 2 * 16px, var(--container)); margin-inline: auto; }
.container--narrow { width: min(100% - 2 * 16px, 820px); }

.site-main { padding-block: var(--gap) calc(var(--gap) * 3); min-height: 60vh; }
.site-main:focus { outline: none; }

/* ==========================================================================
   Topbar & Header
   ========================================================================== */
.topbar { background: var(--ink); color: #cfd6e2; font-size: var(--fs-xs); }
.topbar__inner { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 36px; flex-wrap: wrap; }
.topbar__support { margin: 0; }
.topbar__support a { color: #fff; font-weight: 700; }
.topbar__hours { opacity: .7; margin-inline-start: 8px; }
.topbar__menu { display: flex; gap: 16px; list-style: none; margin: 0; padding: 0; }
.topbar__menu a { color: #cfd6e2; }

.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 0; position: relative; } }

.site-header__inner {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 12px 20px;
	min-height: 68px;
	padding-block: 10px;
}

.site-brand__text { display: inline-flex; align-items: center; gap: 8px; font-size: 1.35rem; font-weight: 850; color: var(--ink); letter-spacing: -.02em; }
.site-brand__text:hover { text-decoration: none; }
.site-brand__mark { width: 14px; height: 24px; border-radius: 4px; border: 3px solid var(--accent); position: relative; }
.site-brand__mark::after { content: ""; position: absolute; bottom: 2px; inset-inline: 3px; height: 2px; border-radius: 2px; background: var(--accent); }
.custom-logo { max-height: 44px; width: auto; }

.header-search { display: flex; align-items: center; background: var(--canvas); border: 1px solid var(--line); border-radius: 999px; padding-inline: 14px 6px; max-width: 560px; width: 100%; justify-self: center; }
.header-search input { flex: 1; border: 0; background: transparent; min-height: 42px; padding: 0; }
.header-search input:focus { outline: none; }
.header-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.header-search button { background: transparent; color: var(--ink-2); min-height: 36px; padding: 0 8px; }

.header-actions { display: flex; align-items: center; gap: 8px; }
.header-account, .header-cart { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); padding: 8px 10px; border-radius: var(--radius-sm); font-size: var(--fs-sm); position: relative; }
.header-account:hover, .header-cart:hover { background: var(--canvas); text-decoration: none; }
.header-cart__count { min-width: 20px; height: 20px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 12px; line-height: 20px; text-align: center; padding-inline: 5px; font-weight: 700; }

.nav-toggle { display: none; background: transparent; border: 0; padding: 8px; color: var(--ink); min-height: 44px; }

.primary-nav { border-top: 1px solid var(--line); }
.primary-nav__menu { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; overflow-x: auto; scrollbar-width: none; }
.primary-nav__menu > li { position: relative; }
.primary-nav__menu a { display: block; padding: 10px 12px; color: var(--ink-2); font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; }
.primary-nav__menu a:hover, .primary-nav__menu .current-menu-item > a { color: var(--accent); text-decoration: none; }
.primary-nav__menu .sub-menu { display: none; position: absolute; top: 100%; inset-inline-start: 0; min-width: 200px; list-style: none; margin: 0; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); z-index: 20; }
.primary-nav__menu li:hover > .sub-menu, .primary-nav__menu li:focus-within > .sub-menu { display: block; }

@media (max-width: 900px) {
	.site-header__inner { grid-template-columns: auto 1fr auto; }
	.site-brand { justify-self: start; }
	.nav-toggle { display: inline-flex; }
	.header-search { grid-column: 1 / -1; grid-row: 2; max-width: none; }
	.header-account span { display: none; }
	.primary-nav { display: none; }
	.primary-nav.is-open { display: block; }
	.primary-nav__menu { flex-direction: column; overflow: visible; padding-block: 8px; }
	.primary-nav__menu .sub-menu { position: static; display: block; box-shadow: none; border: 0; padding: 0; padding-inline-start: 16px; }
}

/* ==========================================================================
   Layout
   ========================================================================== */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: calc(var(--gap) * 1.5); align-items: start; }
.layout:not(:has(.layout__aside)) { grid-template-columns: minmax(0, 1fr); }
.layout--shop { grid-template-columns: 260px minmax(0, 1fr); }
.layout__aside { position: sticky; top: 140px; }
@media (max-width: 1000px) {
	.layout, .layout--shop { grid-template-columns: minmax(0, 1fr); }
	.layout__aside { position: static; }
}

.grid { display: grid; gap: var(--gap); }
.grid--2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }

.page-title { font-size: var(--fs-xl); }
.archive-head { margin-bottom: var(--gap); }
.archive-head__desc { color: var(--ink-2); }

.breadcrumbs, .woocommerce-breadcrumb { font-size: var(--fs-xs); color: var(--ink-3); margin-bottom: 12px; }
.breadcrumbs a, .woocommerce-breadcrumb a { color: var(--ink-2); }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.section-head h2 { font-size: var(--fs-lg); margin: 0; }
.section-head a { font-size: var(--fs-sm); font-weight: 600; }

.home-section { margin-top: calc(var(--gap) * 2); }

/* ==========================================================================
   Cards
   ========================================================================== */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card__media img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .3s ease; }
.card:hover .card__media img { transform: scale(1.02); }
.card__media { overflow: hidden; display: block; }
.card__body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card__cat { font-size: var(--fs-xs); font-weight: 700; color: var(--accent); }
.card__title { font-size: 1.05rem; margin: 0; }
.card__title a { color: var(--ink); }
.card__excerpt { color: var(--ink-2); font-size: var(--fs-sm); margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card__date { color: var(--ink-3); font-size: var(--fs-xs); margin-top: auto; }

.card--hero .card__title { font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem); }
.card--compact { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; }
.card--compact .card__body { padding: 10px 0; }
.card--compact .card__title { font-size: var(--fs-sm); font-weight: 650; }

.home-lead { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: var(--gap); }
.home-lead__list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 16px; }
.home-lead__list .card--compact:last-child { border-bottom: 0; }
@media (max-width: 860px) { .home-lead { grid-template-columns: 1fr; } }

.cat-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: calc(var(--gap) * 1.5); }
.cat-pills a { padding: 6px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; font-size: var(--fs-sm); color: var(--ink-2); font-weight: 600; }
.cat-pills a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ==========================================================================
   Article
   ========================================================================== */
.entry { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(18px, 3vw, 40px); }
.entry__title { font-size: var(--fs-xl); margin-top: 6px; }
.entry__lead { font-size: 1.1rem; color: var(--ink-2); }
.entry__media { margin: 20px 0; }
.entry__media img { border-radius: var(--radius-sm); width: 100%; }
.entry__media figcaption { color: var(--ink-3); font-size: var(--fs-xs); margin-top: 6px; }

.post-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--ink-3); font-size: var(--fs-xs); }
.post-meta__author { color: var(--ink); font-weight: 700; }

.entry-content { font-size: 1.0625rem; }
.entry-content > * { margin-block: 0 1.1em; }
.entry-content h2 { font-size: 1.4rem; margin-top: 1.6em; }
.entry-content h3 { font-size: 1.15rem; margin-top: 1.4em; }
.entry-content img { border-radius: var(--radius-sm); }
.entry-content blockquote { border-inline-start: 4px solid var(--accent); margin-inline: 0; padding: 4px 16px; background: var(--accent-soft); border-radius: var(--radius-sm); }
.entry-content table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); display: block; overflow-x: auto; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: 8px 10px; text-align: start; }
.entry-content th { background: var(--canvas); }
.entry-content code { direction: ltr; unicode-bidi: embed; background: var(--canvas); padding: 2px 6px; border-radius: 4px; }

.tag-list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 24px 0 0; }
.tag-list a { font-size: var(--fs-xs); padding: 4px 10px; background: var(--canvas); border-radius: 999px; color: var(--ink-2); }

.related-products, .related-posts, .comments { margin-top: calc(var(--gap) * 1.5); }

/* ==========================================================================
   Search results & empty
   ========================================================================== */
.search-form { display: flex; gap: 8px; flex-wrap: wrap; }
.search-form input[type="search"] { flex: 1; min-width: 200px; }
.search-results { display: grid; gap: 12px; }
.search-hit { display: flex; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; align-items: center; }
.search-hit__thumb img { width: 88px; height: 88px; object-fit: contain; }
.search-hit__type { font-size: var(--fs-xs); color: var(--accent); font-weight: 700; }
.search-hit__title { font-size: 1.05rem; margin: 2px 0; }
.search-hit__title a { color: var(--ink); }
.search-hit p { margin: 0; color: var(--ink-2); font-size: var(--fs-sm); }

.empty-state { text-align: center; padding: 48px 16px; }
.empty-state__code { font-size: 4rem; font-weight: 900; color: var(--accent); margin: 0; line-height: 1; }
.empty-state .search-form { justify-content: center; max-width: 520px; margin: 16px auto; }

/* ==========================================================================
   Widgets, comments, pagination
   ========================================================================== */
.widget { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: var(--gap); }
.widget__title { font-size: 1rem; }
.widget ul { list-style: none; padding: 0; margin: 0; }
.widget li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.widget li:last-child { border-bottom: 0; }

.pagination .nav-links, .woocommerce-pagination ul { display: flex; gap: 6px; justify-content: center; margin-top: var(--gap); flex-wrap: wrap; }
.page-numbers { display: inline-flex; min-width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); padding-inline: 10px; }
.page-numbers.current { background: var(--accent); color: #fff; border-color: var(--accent); }

.comments { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(16px, 3vw, 32px); }
.comment-list { list-style: none; padding: 0; }
.comment-body { border-bottom: 1px solid var(--line); padding-block: 12px; }
.comment-form textarea { width: 100%; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--ink); color: #b9c2d0; padding-block: 40px 20px; font-size: var(--fs-sm); }
.site-footer a { color: #e6ebf2; }
.site-footer .widget { background: transparent; border-color: rgba(255,255,255,.1); }
.site-footer .widget li { border-color: rgba(255,255,255,.08); }
.site-footer__widgets { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--gap); margin-bottom: 24px; }
.site-footer__bottom { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; border-top: 1px solid rgba(255,255,255,.1); padding-top: 20px; }
.site-footer__brand { color: #fff; font-weight: 800; font-size: 1.1rem; margin: 0 0 4px; }
.site-footer__text { margin: 0; max-width: 520px; }
.social-links, .footer-menu { display: flex; gap: 14px; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; }
.site-footer__copy { text-align: center; opacity: .6; margin: 20px 0 0; font-size: var(--fs-xs); }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ==========================================================================
   WordPress core classes (Theme Review requirements)
   ========================================================================== */
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { display: block; margin-inline: auto; }
.alignwide { max-width: min(100%, 1100px); }
.alignfull { max-width: 100%; }
.wp-caption { max-width: 100%; }
.wp-caption-text, .gallery-caption { color: var(--ink-3); font-size: var(--fs-xs); margin-top: 6px; }
.sticky .card__title::before { content: "★ "; color: var(--accent); }
.bypostauthor > .comment-body .fn { color: var(--accent); }
.wp-block-image figcaption { color: var(--ink-3); font-size: var(--fs-xs); }

/* Post navigation, page links, closed comments */
.post-navigation { margin-top: calc(var(--gap) * 1.5); }
.post-navigation .nav-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--gap); }
.post-navigation a { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; color: var(--ink); font-weight: 650; }
.post-navigation .nav-next { text-align: end; }
.nav-label { display: block; color: var(--ink-3); font-size: var(--fs-xs); font-weight: 600; }
.page-links { display: flex; gap: 8px; align-items: center; margin-top: 16px; }
.comments__closed { color: var(--ink-3); }
