/*
 * Nusha Moments: design system.
 * Brand colours from assets/nusha tem.jpg: sage #A2A38D, rose #CA9F91, black.
 * Darker tones of the same hues carry text and buttons (WCAG AA ≥ 4.5:1; see docs/DECISIONS.md).
 * Mobile-first, logical properties only.
 *
 *  1. Tokens   2. Font & base   3. Layout & Astra resets   4. Header & drawer
 *  5. Footer   6. Elementor sections   7. Content pages, search, 404   8. Motion
 */

/* 1 ------------------------------------------------------------------ */
:root {
	/* Brand */
	--nusha-sage: #a2a38d;
	--nusha-sage-50: #f3f3ee;
	--nusha-sage-100: #e6e7dd;
	--nusha-sage-700: #5e604c;
	--nusha-sage-800: #4f5140;
	--nusha-sage-900: #33352a;
	--nusha-rose: #ca9f91;
	--nusha-rose-50: #f8efeb;
	--nusha-rose-700: #8a5a4b;
	--nusha-black: #000000;

	/* Neutrals & surfaces */
	--nusha-ink: #1c1c1a;
	--nusha-ink-2: #6b6c62;
	--nusha-bg: #fbfaf7;
	--nusha-surface: #ffffff;
	--nusha-line: #e6e4dc;

	/* Functional */
	--nusha-wa: #1f7a4d;
	--nusha-wa-hover: #17613d;
	--nusha-ok: #2e6b3f;
	--nusha-ok-bg: #e7f3ea;
	--nusha-no: #8c3b2e;
	--nusha-no-bg: #f8ece8;
	--nusha-unknown: #6a5410;
	--nusha-unknown-bg: #fbf3dc;
	--nusha-focus: #5e604c;

	/* Typography */
	--nusha-font: "Vazirmatn", "Vazirmatn Fallback", "Vazirmatn Fallback Arial", system-ui, -apple-system, "Segoe UI", sans-serif;
	--nusha-fs-sm: 0.875rem;
	--nusha-fs-md: 1rem;
	--nusha-fs-lg: clamp(1.1rem, 1rem + 0.4vw, 1.25rem);
	--nusha-fs-xl: clamp(1.4rem, 1.15rem + 1vw, 1.9rem);
	--nusha-fs-2xl: clamp(1.75rem, 1.3rem + 2vw, 2.75rem);
	--nusha-fs-3xl: clamp(2rem, 1.3rem + 3.2vw, 3.6rem);

	/* Spacing */
	--nusha-space-1: 4px;
	--nusha-space-2: 8px;
	--nusha-space-3: 12px;
	--nusha-space-4: 16px;
	--nusha-space-6: 24px;
	--nusha-space-8: 32px;
	--nusha-space-12: 48px;
	--nusha-section: clamp(48px, 7vw, 104px);

	/* Shape & depth */
	--nusha-r-sm: 10px;
	--nusha-r-md: 16px;
	--nusha-r-lg: 24px;
	--nusha-r-xl: 36px;
	--nusha-r-pill: 999px;
	--nusha-shadow-1: 0 1px 2px rgb(28 28 26 / 0.06);
	--nusha-shadow-2: 0 12px 32px -16px rgb(28 28 26 / 0.28);
	--nusha-shadow-3: 0 30px 60px -30px rgb(51 53 42 / 0.45);

	/* Layout. Breakpoints (used in media queries): 640px, 900px, 1200px */
	--nusha-gutter: 16px;
	--nusha-max: 1200px;
	--nusha-header-h: 68px;

	/* Motion */
	--nusha-ease: cubic-bezier(0.22, 1, 0.36, 1);
	--nusha-dur: 0.35s;
	--nusha-dur-slow: 0.7s;
}
@media (min-width: 640px) { :root { --nusha-gutter: 24px; } }
@media (min-width: 1200px) { :root { --nusha-gutter: 32px; --nusha-header-h: 80px; } }

/* 2 ------------------------------------------------------------------ */
/*
 * Metric-matched fallbacks: while Vazirmatn downloads, Tahoma/Arial are scaled so Persian text wraps
 * like Vazirmatn and the swap does not move the layout (CLS). Ratios measured in Chrome on 2026-10-25
 * with a Persian sample: Vazirmatn/Tahoma 0.949 (400) and 0.862 (800); Vazirmatn/Arial 1.165–1.172.
 */
@font-face { font-family: "Vazirmatn Fallback"; src: local("Tahoma"); font-weight: 100 599; size-adjust: 94.9%; }
@font-face { font-family: "Vazirmatn Fallback"; src: local("Tahoma Bold"), local("Tahoma-Bold"), local("Tahoma"); font-weight: 600 900; size-adjust: 86.2%; }
@font-face { font-family: "Vazirmatn Fallback Arial"; src: local("Arial"), local("ArialMT"); font-weight: 100 900; size-adjust: 116.8%; }

@font-face {
	font-family: "Vazirmatn";
	src: url("../fonts/vazirmatn-var.woff2") format("woff2-variations"), url("../fonts/vazirmatn-var.woff2") format("woff2");
	font-weight: 100 900;
	font-style: normal;
	font-display: swap;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body.nusha-site {
	font-family: var(--nusha-font);
	font-size: var(--nusha-fs-md);
	line-height: 1.85;
	color: var(--nusha-ink);
	background: var(--nusha-bg);
	-webkit-font-smoothing: antialiased;
	overflow-x: clip;
}
.nusha-site :where(h1, h2, h3, h4, h5, h6),
.nusha-site .entry-title,
.nusha-site .elementor-heading-title {
	font-family: var(--nusha-font);
	color: var(--nusha-ink);
	font-weight: 800;
	line-height: 1.4;
	letter-spacing: 0;
	text-wrap: balance;
}
.nusha-site :where(p) { text-wrap: pretty; }
.nusha-site :where(a) { color: var(--nusha-sage-700); text-underline-offset: 3px; }
.nusha-site :where(a:hover) { color: var(--nusha-ink); }
.nusha-site :where(button, input, select, textarea) { font-family: inherit; }
.nusha-site :focus-visible { outline: 3px solid var(--nusha-focus); outline-offset: 3px; }
.nusha-site ::selection { background: var(--nusha-rose); color: var(--nusha-ink); }
.nusha-site bdi[dir="ltr"], .nusha-site [dir="ltr"] { unicode-bidi: isolate; }

.nusha-site .skip-link.screen-reader-text:focus {
	/* Astra's skip link (header.php): visible when focused. */
	position: fixed !important; inset-inline-start: 12px; inset-block-start: 12px; z-index: 100000;
	width: auto; height: auto; margin: 0; padding: 10px 18px; clip: auto; clip-path: none; overflow: visible; white-space: nowrap;
	border-radius: var(--nusha-r-sm); background: var(--nusha-ink); color: #fff !important; font-weight: 700; text-decoration: none;
}

/* 3 ------------------------------------------------------------------ */
.nusha-site #content > .ast-container { max-width: none; padding: 0; display: block; }
.nusha-site .site-content #primary { margin: 0; padding: 0; width: 100%; }
.nusha-site .ast-separate-container #primary,
.nusha-site.ast-plain-container .site-content > .ast-container { padding: 0; }
.nusha-site .ast-article-single:not(.nusha-container), .nusha-site .ast-article-post:not(.nusha-container) { background: transparent; padding: 0; margin: 0; border: 0; }
.nusha-site .ast-article-single.nusha-container { background: transparent; margin-block: 0; margin-inline: auto; border: 0; padding-block: 0; }
.nusha-site .entry-content > .elementor { margin: 0; }

/* Generic (non-Elementor) pages: readable column. */
.nusha-site:not(.elementor-page) .page .entry-content,
.nusha-site:not(.elementor-page) .page .entry-header {
	max-width: 760px; margin-inline: auto; padding-inline: var(--nusha-gutter);
}
.nusha-site:not(.elementor-page) .page .entry-header { padding-block-start: var(--nusha-space-12); }
.nusha-site:not(.elementor-page) .page .entry-content { padding-block-end: var(--nusha-section); }
.nusha-site:not(.elementor-page) .page .entry-title { font-size: var(--nusha-fs-2xl); }
.nusha-site .entry-content h2 { font-size: var(--nusha-fs-lg); margin-block: 1.6em 0.5em; }

/* 4 ------------------------------------------------------------------ */
.nusha-header {
	position: sticky; inset-block-start: 0; z-index: 100;
	background: rgb(251 250 247 / 0.92);
	-webkit-backdrop-filter: saturate(1.4) blur(12px);
	backdrop-filter: saturate(1.4) blur(12px);
	border-block-end: 1px solid transparent;
	transition: border-color var(--nusha-dur), box-shadow var(--nusha-dur);
}
.admin-bar .nusha-header { inset-block-start: 32px; }
@media (max-width: 782px) { .admin-bar .nusha-header { inset-block-start: 46px; } }
@media (max-width: 600px) { .admin-bar .nusha-header { inset-block-start: 0; } }
.nusha-header.is-scrolled { border-color: var(--nusha-line); box-shadow: var(--nusha-shadow-1); }
.nusha-header__inner { display: flex; align-items: center; gap: var(--nusha-space-4); min-height: var(--nusha-header-h); }

.nusha-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.nusha-brand img { display: block; width: auto; }
.nusha-brand__mark { height: 40px; }
.nusha-brand__word { height: 30px; }
@media (min-width: 1200px) { .nusha-brand__mark { height: 46px; } .nusha-brand__word { height: 34px; } }

.nusha-nav { display: none; margin-inline: auto; }
@media (min-width: 900px) { .nusha-nav { display: block; } }
.nusha-nav__list { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.nusha-nav__list a {
	display: inline-flex; align-items: center; min-height: 44px; padding: 6px 16px;
	border-radius: var(--nusha-r-pill); color: var(--nusha-ink) !important; font-weight: 600; text-decoration: none;
	transition: background-color var(--nusha-dur);
}
.nusha-nav__list a:hover { background: var(--nusha-sage-50); }
.nusha-nav__list .current-menu-item > a, .nusha-nav__list .current_page_item > a, .nusha-nav__list a[aria-current="page"] { background: var(--nusha-sage-100); }

.nusha-header__actions { display: flex; align-items: center; gap: var(--nusha-space-2); margin-inline-start: auto; }
@media (min-width: 900px) { .nusha-header__actions { margin-inline-start: 0; } }
.nusha-header__wa { min-height: 44px; padding: 8px 18px; font-size: var(--nusha-fs-sm); }
@media (max-width: 479px) {
	.nusha-header__wa { padding: 10px; }
	.nusha-header__wa-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
.nusha-icon-btn {
	display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0;
	border: 1px solid var(--nusha-line); border-radius: 50%; background: var(--nusha-surface); color: var(--nusha-ink); cursor: pointer;
}
.nusha-icon-btn:hover { background: var(--nusha-sage-50); color: var(--nusha-ink); }
@media (min-width: 900px) { .nusha-header__toggle { display: none; } }

.nusha-drawer {
	margin: 0; margin-inline-start: auto; padding: 0; border: 0;
	width: min(88vw, 360px); max-width: none; height: 100dvh; max-height: none;
	background: var(--nusha-bg); color: var(--nusha-ink);
}
.nusha-drawer::backdrop { background: rgb(28 28 26 / 0.45); }
.nusha-drawer[open] { animation: nusha-drawer-in var(--nusha-dur) var(--nusha-ease); }
@keyframes nusha-drawer-in { from { transform: translateX(var(--nusha-drawer-from, 100%)); } to { transform: none; } }
[dir="rtl"] .nusha-drawer { --nusha-drawer-from: -100%; }
.nusha-drawer__panel { display: flex; flex-direction: column; gap: var(--nusha-space-6); padding: var(--nusha-space-4) var(--nusha-space-6) var(--nusha-space-8); height: 100%; overflow-y: auto; }
.nusha-drawer__head { display: flex; align-items: center; justify-content: space-between; }
.nusha-drawer__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.nusha-drawer__list a { display: flex; min-height: 52px; align-items: center; padding-inline: 12px; border-radius: var(--nusha-r-sm); color: var(--nusha-ink) !important; font-size: var(--nusha-fs-lg); font-weight: 700; text-decoration: none; }
.nusha-drawer__list a:hover, .nusha-drawer__list .current-menu-item > a { background: var(--nusha-sage-50); }
.nusha-drawer__social { margin-block-start: auto; }

/* 5 ------------------------------------------------------------------ */
.nusha-footer { background: var(--nusha-sage-900); color: #ecebe4; padding-block: var(--nusha-space-12) var(--nusha-space-6); }
.nusha-footer a { color: #fff !important; text-decoration: none; }
.nusha-footer a:hover { text-decoration: underline; }
.nusha-footer__grid { display: grid; gap: var(--nusha-space-8); }
@media (min-width: 900px) { .nusha-footer__grid { grid-template-columns: 1.4fr 1fr 1.2fr; } }
.nusha-footer__brand p { max-width: 36ch; margin: var(--nusha-space-4) 0 0; color: #d9d8cf; }
.nusha-footer__title { margin: 0 0 var(--nusha-space-3); font-size: var(--nusha-fs-md); color: #fff !important; }
.nusha-footer__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.nusha-footer__list a { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; }
.nusha-footer__channel .nusha-icon { color: var(--nusha-rose); }
.nusha-footer__value { color: #d9d8cf; font-size: var(--nusha-fs-sm); }
.nusha-footer__bottom { margin-block-start: var(--nusha-space-8); padding-block-start: var(--nusha-space-6); border-block-start: 1px solid rgb(255 255 255 / 0.14); font-size: var(--nusha-fs-sm); color: #d9d8cf; }
.nusha-footer__bottom p { margin: 0; }

/* 6 ------------------------------------------------------------------ */
/* Elementor pages compose these classes (set under Advanced → CSS Classes). */
/* Sections stack vertically: never wrap. Elementor's default "wrap" on a column container makes Chrome under-measure
   children with aspect-ratio boxes (category cards overlapped the next section; measured 577px for 857px of content). */
.nusha-el-section, .nusha-el-hero { --flex-wrap: nowrap !important; }
.nusha-el-section { padding-block: var(--nusha-section); }
.nusha-el-section--tint { background: var(--nusha-sage-50); }
.nusha-el-section--rose { background: var(--nusha-rose-50); }
.nusha-el-eyebrow .elementor-heading-title {
	display: inline-flex; align-items: center; gap: 8px;
	font-size: var(--nusha-fs-sm) !important; font-weight: 700 !important; color: var(--nusha-rose-700) !important;
}
.nusha-el-eyebrow .elementor-heading-title::before { content: ""; inline-size: 10px; block-size: 10px; border-radius: 50%; background: var(--nusha-rose); }
.nusha-el-title .elementor-heading-title { font-size: var(--nusha-fs-2xl) !important; }
.nusha-el-hero-title .elementor-heading-title { font-size: var(--nusha-fs-3xl) !important; line-height: 1.3 !important; }
.nusha-el-lead, .nusha-el-lead p { font-size: var(--nusha-fs-lg); color: var(--nusha-ink-2); max-width: 46ch; }
.nusha-el-lead p:last-child { margin-block-end: 0; }
.nusha-el-text p { color: var(--nusha-ink-2); }

.nusha-el-hero { position: relative; overflow: hidden; background: var(--nusha-sage-50); }
.nusha-el-hero::before {
	content: ""; position: absolute; inset: 0; pointer-events: none;
	background: url("../img/nusha-pattern.png") center / 520px auto repeat;
	opacity: 0.04;
}
.nusha-el-hero > .e-con-inner { position: relative; }
.nusha-el-hero-media img {
	width: 100%; aspect-ratio: 4 / 5; object-fit: cover;
	border-radius: var(--nusha-r-xl) var(--nusha-r-xl) var(--nusha-r-xl) 120px;
	box-shadow: var(--nusha-shadow-3);
}
[dir="rtl"] .nusha-el-hero-media img { border-radius: var(--nusha-r-xl) var(--nusha-r-xl) 120px var(--nusha-r-xl); }
.nusha-el-hero--page .nusha-el-hero-title .elementor-heading-title { font-size: var(--nusha-fs-2xl) !important; }

.nusha-el-btn .elementor-button {
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 52px; padding: 12px 26px; border-radius: var(--nusha-r-pill); line-height: 1.3;
	background: var(--nusha-sage-800); color: #fff; font-family: var(--nusha-font); font-weight: 700; font-size: var(--nusha-fs-md);
	transition: background-color var(--nusha-dur) var(--nusha-ease);
}
.nusha-el-btn .elementor-button:hover, .nusha-el-btn .elementor-button:focus-visible { background: var(--nusha-ink); color: #fff; }
.nusha-el-btn--ghost .elementor-button { background: transparent; color: var(--nusha-ink); box-shadow: inset 0 0 0 2px currentColor; }
.nusha-el-btn--ghost .elementor-button:hover { background: var(--nusha-surface); color: var(--nusha-ink); }

.nusha-el-step {
	padding: var(--nusha-space-6); background: var(--nusha-surface);
	border: 1px solid var(--nusha-line); border-radius: var(--nusha-r-lg);
}
.nusha-el-step-num .elementor-heading-title {
	display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
	background: var(--nusha-sage); color: var(--nusha-ink) !important; font-size: var(--nusha-fs-lg) !important;
}
.nusha-el-step h3.elementor-heading-title { font-size: var(--nusha-fs-lg) !important; }

.nusha-el-band { background: var(--nusha-sage-800); color: #fff; border-radius: var(--nusha-r-xl); overflow: hidden; position: relative; }
.nusha-el-band::after {
	content: ""; position: absolute; inset-block: -40px; inset-inline-end: -40px; width: 260px; pointer-events: none;
	background: url("../img/nusha-mark-light.png") center / contain no-repeat; opacity: 0.1;
}
.nusha-el-band .elementor-heading-title { color: #fff !important; }
.nusha-el-band p { color: #ecebe4; }

.nusha-el-prose { max-width: 70ch; }
.nusha-el-prose p, .nusha-el-prose li { color: var(--nusha-ink); }
.nusha-el-prose h2 { font-size: var(--nusha-fs-lg); margin-block: 1.5em 0.4em; }
.nusha-el-card {
	padding: var(--nusha-space-6); background: var(--nusha-surface);
	border: 1px solid var(--nusha-line); border-radius: var(--nusha-r-lg);
}

/* 7 ------------------------------------------------------------------ */
.nusha-results { padding-block: var(--nusha-space-8) var(--nusha-section); }
.nusha-results__title { font-size: var(--nusha-fs-2xl); margin: 0 0 var(--nusha-space-2); }
.nusha-results__form { display: flex; gap: var(--nusha-space-2); max-width: 560px; margin-block: var(--nusha-space-4) var(--nusha-space-8); }
.nusha-results__form input {
	flex: 1; min-width: 0; min-height: 48px; padding: 8px 16px; border: 1px solid #c9c7bd; border-radius: var(--nusha-r-pill); background: #fff; font: inherit;
}
.nusha-results__pages { list-style: none; margin: var(--nusha-space-8) 0 0; padding: 0; display: grid; gap: var(--nusha-space-3); }
.nusha-results__pages a { display: block; padding: var(--nusha-space-4); background: var(--nusha-surface); border: 1px solid var(--nusha-line); border-radius: var(--nusha-r-md); text-decoration: none; color: var(--nusha-ink) !important; font-weight: 700; }

.nusha-404 { padding-block: var(--nusha-section); text-align: center; }
.nusha-404__mark { width: 96px; height: auto; margin-inline: auto; display: block; opacity: 0.9; }
.nusha-404__title { font-size: var(--nusha-fs-2xl); margin: var(--nusha-space-6) 0 var(--nusha-space-2); }
.nusha-404__text { color: var(--nusha-ink-2); margin: 0 auto var(--nusha-space-6); max-width: 46ch; }
.nusha-404__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--nusha-space-3); }
.nusha-404 .nusha-grid { margin-block-start: var(--nusha-space-12); text-align: start; }

/* 8 ------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
	.elementor-invisible { visibility: visible !important; }
}

/* Persian numerals for ordered lists in page/product content only (not navigation lists such as the breadcrumb). */
html[dir="rtl"] .nusha-site :is(.entry-content, .elementor-widget-text-editor, .nusha-prose) ol { list-style-type: persian; }

/* Astra's scroll-to-top button in brand colours. */
.nusha-site #ast-scroll-top {
	width: 44px; height: 44px; border-radius: 50%; line-height: 44px;
	background-color: var(--nusha-sage-800); color: #fff; box-shadow: var(--nusha-shadow-2);
}
.nusha-site #ast-scroll-top:hover, .nusha-site #ast-scroll-top:focus-visible { background-color: var(--nusha-ink); }
