/*
 * طراحی تازهٔ سایت (شاخهٔ site-redesign).
 *
 * ۱) هدر و فوتر تازه — روی همهٔ صفحه‌های سایت.
 * ۲) پایهٔ صفحه‌های بازطراحی‌شده — فقط داخل .nm-page.
 *
 * فایل‌های طراحی این قواعد را روی html/body/a/section/h1 می‌گذاشتند. این‌جا همه
 * زیر .nm-page محدود شده‌اند تا به صفحه‌های قدیمی (فروشگاه، بازار، دانشنامه و…)
 * سرایت نکنند. قواعد واکنش‌گرای طراحی با سلکتورهای [style*=...] روی استایل‌های
 * درون‌خطی کار می‌کنند؛ برای همین استایل‌های درون‌خطی صفحه‌ها عیناً نگه داشته شده.
 */

/* ───────────── هدر ───────────── */
.nm-header { position: sticky; top: 0; z-index: 50; background: rgba(251, 248, 242, 0.94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid #E6DED0; font-family: 'Vazirmatn', system-ui, sans-serif; }
.nm-header__in { max-width: 1280px; margin: 0 auto; padding: 14px 32px; display: flex; align-items: center; gap: 32px; }
.nm-header a { text-decoration: none; }
.nm-logo img { display: block; width: 52px; height: 52px; border-radius: 50%; }
.nm-logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; font-family: 'Noto Naskh Arabic', serif; font-size: 28px; font-weight: 700; color: #1F3324 !important; line-height: 1; }
.nm-nav { display: flex; align-items: center; gap: 4px; flex: 1; flex-wrap: wrap; }
.nm-nav__link, .nm-nav__menu-btn { font: inherit; font-size: 15px; font-weight: 500; color: #1E241F; background: transparent; border: 0; padding: 10px 14px; border-radius: 8px; cursor: pointer; white-space: nowrap; transition: background .15s; }
.nm-nav__menu-btn { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.nm-nav__menu-btn span { font-size: 10px; color: #7A4A2A; }
.nm-nav__link:hover, .nm-nav__menu-btn:hover { background: #F1EADD; color: #1E241F; }
.nm-nav__drop { position: relative; }
.nm-nav__panel { position: absolute; top: 100%; right: 0; padding-top: 8px; z-index: 60; }
.nm-nav__panel-in { width: 420px; background: #FFFFFF; border: 1px solid #E6DED0; border-radius: 14px; box-shadow: 0 24px 48px -16px rgba(31, 51, 36, 0.25); padding: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.nm-nav__item { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 10px; color: #1E241F; transition: background .15s; }
.nm-nav__item:hover { background: #F4EEE3; color: #1E241F; }
.nm-nav__item b { font-weight: 700; font-size: 15px; }
.nm-nav__item small { font-size: 12.5px; color: #5E655E; line-height: 1.6; }
.nm-header__actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.nm-btn-outline { font-size: 14px; font-weight: 600; color: #2F4A34; border: 1px solid #2F4A34; padding: 10px 18px; border-radius: 999px; white-space: nowrap; transition: background .15s; }
.nm-btn-outline:hover { background: #F1EADD; color: #2F4A34; }
.nm-btn-solid { font-size: 14px; font-weight: 600; color: #FBF8F2 !important; background: #2F4A34; padding: 11px 20px; border-radius: 999px; white-space: nowrap; transition: background .15s; }
.nm-btn-solid:hover { background: #1F3324; color: #FBF8F2; }

/* هدر صفحه‌های طرح: مسیر صفحه به‌جای منوی اصلی */
.nm-crumbs { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; flex-wrap: wrap; font-size: 14px; color: #5E655E; }
.nm-crumbs a { color: #5E655E; padding: 8px 4px; white-space: nowrap; transition: color .15s; }
.nm-crumbs a:hover { color: #1F3324; }
.nm-crumbs__current { color: #1F3324; font-weight: 700; padding: 8px 4px; white-space: nowrap; }
.nm-crumbs__link { flex-shrink: 0; font-size: 14px; font-weight: 600; color: #2F4A34 !important; padding: 10px 6px; white-space: nowrap; transition: color .15s; }
.nm-crumbs__link:hover { color: #7A4A2A !important; }
.nm-header .nm-btn-solid { flex-shrink: 0; }

@media (max-width: 780px) {
    .nm-header__in { padding: 12px 16px; gap: 12px; flex-wrap: wrap; }
    .nm-crumbs { order: 3; flex: 1 1 100%; width: 100%; font-size: 12px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    .nm-crumbs > * { flex-shrink: 0; white-space: nowrap; }
    .nm-crumbs a { font-size: 12px; }
    .nm-crumbs__link { margin-inline-start: auto; font-size: 12px; }
    .nm-logo { font-size: 24px; }
    .nm-logo img { width: 44px; height: 44px; }
    /* منو در موبایل یک ردیف افقی قابل‌پیمایش زیر لوگو است (مثل طراحی) */
    .nm-nav { order: 3; flex: 0 0 calc(100% + 32px); flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
    .nm-nav::-webkit-scrollbar { display: none; }
    .nm-nav > * { flex-shrink: 0; white-space: nowrap; }
    .nm-nav__link { font-size: 12px; }
    .nm-nav__drop { position: static; }
    .nm-nav__panel { right: 16px; left: 16px; }
    .nm-nav__panel-in { width: auto; grid-template-columns: 1fr; }
    .nm-header__actions { margin-inline-start: auto; }
    .nm-btn-outline, .nm-btn-solid { font-size: 12px; }
}

/* ───────────── فوتر ───────────── */
.nm-footer { background: #1F3324; color: #C9D1C6; font-family: 'Vazirmatn', system-ui, sans-serif; }
.nm-footer a { text-decoration: none; }
.nm-footer__in { max-width: 1280px; margin: 0 auto; padding: 72px 32px 36px; display: flex; flex-direction: column; gap: 48px; }
.nm-footer__grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 40px; }
.nm-footer__brand { display: flex; flex-direction: column; gap: 18px; }
.nm-footer__logo { display: block; width: 72px; height: 72px; border-radius: 50%; }
.nm-footer__about { font-size: 14.5px; line-height: 2.05; color: #C9D1C6; max-width: 380px; margin: 0; }
.nm-footer__col { display: flex; flex-direction: column; gap: 12px; }
.nm-footer__col-title { font-size: 13px; font-weight: 700; color: #E8D3A8; margin-bottom: 4px; }
.nm-footer__col a { font-size: 14.5px; color: #C9D1C6; transition: color .15s; }
.nm-footer__col a:hover { color: #FBF8F2; }
.nm-footer__bottom { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding-top: 24px; border-top: 1px solid rgba(232, 211, 168, 0.2); font-size: 13px; color: #93A091; }
.nm-footer__bottom a { color: #93A091; }
.nm-footer__bottom a:hover { color: #FBF8F2; }
@media (max-width: 780px) {
    /* همان قاعدهٔ طراحی: دو ستون، ستون معرفی تمام‌عرض */
    .nm-footer__in { padding-left: 18px; padding-right: 18px; }
    .nm-footer__grid { grid-template-columns: 1fr 1fr; gap: 28px; }
    .nm-footer__brand { grid-column: 1 / -1; }
}

/* ───────────── پایهٔ صفحه‌های بازطراحی‌شده ───────────── */
html:has(.nm-page) { scroll-behavior: smooth; }
body:has(.nm-page) { background: #FBF8F2; overflow-x: hidden; }
.nm-page { background: #FBF8F2; color: #1E241F; font-family: 'Vazirmatn', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
.nm-page * { box-sizing: border-box; }
.nm-page a { color: #2F4A34; text-decoration: none; }
.nm-page a:hover { color: #7A4A2A; }
.nm-page h1, .nm-page h2, .nm-page h3, .nm-page p { margin: 0; }
.nm-page section { scroll-margin-top: 100px; }
.nm-page img { display: block; max-width: 100%; }
.nm-page button, .nm-page a, .nm-page input { touch-action: manipulation; }
.nm-page button:focus-visible, .nm-page a:focus-visible, .nm-page input:focus-visible { outline: 3px solid #B0844E; outline-offset: 4px; }
.nm-page button { font-family: inherit; }

/* کلاس‌های مشترک طراحی (ماشین‌حساب، جدول، مدارک) */
.nm-grid, .nm-card, .nm-grid > * { min-width: 0; }
.nm-scroll { width: 100%; }
.nm-wrap { max-width: 1280px; margin: auto; padding: 96px 32px; }
.nm-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.65fr); gap: 22px; }
.nm-card { border-radius: 20px; padding: 28px; background: #FBF8F2; color: #1F3324; border: 1px solid #DCD1BE; }
.nm-dark { background: #26402C; color: #FBF8F2; border-color: #46604a; }
/* با پیشوند .nm-page تا بر «.nm-page h2/p/a» بچربد، ولی بدون !important تا استایل درون‌خطی طراحی همچنان برنده باشد */
.nm-page .nm-h { font-family: 'Noto Naskh Arabic', serif; font-size: clamp(30px, 3.4vw, 46px); line-height: 1.5; margin: 0 0 22px; }
.nm-page .nm-p { line-height: 2; font-size: 15px; margin: 14px 0; }
.nm-fields { display: grid; gap: 16px; }
.nm-fields label { display: grid; gap: 7px; font-size: 13px; }
.nm-fields input, .nm-fields select { width: 100%; min-width: 0; border: 1px solid #6e806b; border-radius: 9px; background: #FBF8F2; color: #1F3324; padding: 10px; font: inherit; direction: ltr; }
.nm-tabs { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 24px; }
.nm-btn { font: inherit; font-size: 13px; font-weight: 700; border: 1px solid #DCD1BE; border-radius: 999px; padding: 10px 16px; cursor: pointer; }
.nm-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 22px 0; }
.nm-stat { background: #1F3324; color: #FBF8F2; border-radius: 12px; padding: 18px; }
.nm-stat small { display: block; color: #C9D1C6; font-size: 12px; margin-bottom: 8px; }
.nm-stat b { font-size: 18px; color: #E8D3A8; }
.nm-scroll { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
.nm-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 800px; }
.nm-table th { background: #EFE6D6; color: #1F3324; }
.nm-table th, .nm-table td { padding: 14px 12px; text-align: right; border-bottom: 1px solid #E6DED0; white-space: nowrap; }
.nm-chart { display: flex; align-items: flex-end; gap: 5px; height: 230px; min-width: 650px; padding-top: 20px; border-bottom: 1px solid #DCD1BE; }
.nm-bar { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 5px; }
.nm-bar small { font-size: 10px; }
.nm-links { display: flex; gap: 12px; flex-wrap: wrap; }
.nm-page .nm-link { display: inline-block; background: #2F4A34; color: #FBF8F2; padding: 12px 22px; border-radius: 999px; font-size: 14px; font-weight: 700; }
.nm-missing { border: 1px dashed #B0844E; border-radius: 12px; padding: 20px; min-height: 105px; background: #FBF8F2; color: #7A4A2A; }
.nm-missing small { display: block; color: #8A8F86; margin-top: 14px; }
.nm-photo-note { font-size: 12px; line-height: 1.8; color: #7A4A2A; background: #F4EEE3; padding: 10px 16px; border-radius: 8px; }
.nm-row { display: flex; justify-content: space-between; gap: 20px; border-bottom: 1px solid #E6DED0; padding: 16px 0; line-height: 1.8; }

/* آکاردئون پرسش‌ها: details/summary بدون نشانگر پیش‌فرض مرورگر */
.nm-page details > summary { list-style: none; cursor: pointer; }
.nm-page details > summary::-webkit-details-marker { display: none; }

/* قواعد واکنش‌گرای فایل‌های طراحی، محدود به .nm-page */
@media (max-width: 780px) {
    .nm-wrap { padding: 56px 18px; }
    .nm-grid { grid-template-columns: 1fr; }
    .nm-card { padding: 20px; }
    .nm-page section[style*="grid-template-columns:minmax"],
    .nm-page section div[style*="grid-template-columns:minmax"],
    .nm-page section div[style*="grid-template-columns:repeat(5"],
    .nm-page section div[style*="grid-template-columns:repeat(6"] { grid-template-columns: 1fr !important; gap: 24px !important; }
    .nm-page section > div[style*="padding:104px"],
    .nm-page section[style*="padding:104px"],
    .nm-page section > div[style*="padding:112px"],
    .nm-page section > div[style*="padding:72px"],
    .nm-page section[style*="padding:64px"] { padding: 56px 18px !important; }
    /* شبکه‌هایی که minmax(0 دارند ولی با آن شروع نمی‌شوند (قاعدهٔ دوم طراحی) */
    .nm-page section[style*="grid-template-columns"][style*="minmax(0"]:not([style*="repeat("]),
    .nm-page section div[style*="grid-template-columns"][style*="minmax(0"]:not([style*="repeat("]) { grid-template-columns: 1fr !important; gap: 24px !important; }
    /* بخش‌هایی که max-width را روی خود section دارند: حاشیهٔ موبایل ۱۸ و فاصلهٔ ۵۶ */
    .nm-page section[style*="max-width:1280px"],
    .nm-page section > div[style*="max-width:1280px"] { padding: 56px 18px !important; }
    .nm-page section div[style*="grid-template-columns:repeat(4"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .nm-page figure[style*="grid-column:span 2"] { grid-column: span 2 !important; }
    .nm-page h1 { font-size: 36px !important; }
    .nm-table { font-size: 12px; }
    .nm-page input, .nm-page textarea, .nm-page select { font-size: 16px !important; }
    .nm-page section div[style*="padding:36px"] { padding: 22px !important; }
    .nm-page section div[style*="padding:40px 44px"],
    .nm-page section div[style*="padding:48px"] { padding: 24px !important; }
}

/* فرم صفحه‌های طرح (PlanLeadForm) — حالت‌های style-focus / style-hover طراحی */
.plf-input:focus { border-color: #2F4A34 !important; }
.plf-submit:hover { background: #1F3324 !important; }
.plf-submit[disabled] { opacity: .7; cursor: wait; }
.plf-again:hover { background: #F1EADD !important; }

/* قاعده‌های موبایل قالب بیرونی فایل نهایی طراحی (Nakhleman-Final-Responsive) — جدا از CSS خود صفحه‌ها.
   قاعدهٔ h1{32px} آن‌جا عمداً نیامده: در طراحی، ۳۶px صفحه‌ها بعد از آن می‌آید و برنده است. */
@media (max-width: 780px) {
    .nm-page div[style*="grid-template-columns"][style*="minmax(3"],
    .nm-page section[style*="grid-template-columns"][style*="minmax(3"] { grid-template-columns: 1fr !important; }
    .nm-page section div[style*="grid-template-columns"][style*="repeat(3"] { grid-template-columns: 1fr !important; }
    .nm-page section div[style*="grid-template-columns:1.3fr 1fr"],
    .nm-page section div[style*="grid-template-columns:1.2fr 1fr"] { grid-template-columns: 1fr !important; grid-template-rows: auto !important; grid-auto-rows: 200px !important; }
    .nm-page section div[style*="grid-row:span 2"] { grid-row: auto !important; min-height: 220px; }
    .nm-page span[style*="left:-14px"] { display: none !important; }
    .nm-page section div[style*="grid-template-columns"][style*="repeat(3"] > div[style*="border-left"] { border-left: 0 !important; border-bottom: 1px solid rgba(232, 211, 168, 0.18); }
}
@media (max-width: 420px) {
    .nm-page section div[style*="grid-template-columns"][style*="repeat(4"] { grid-template-columns: 1fr !important; }
}

/* تیتر هیرو: واژهٔ «آینده» طلایی با خط زیر قلم‌مویی (۱۷ آبان ۱۴۰۵) */
.nm-hl { position: relative; display: inline-block; color: #EBCB8B; white-space: nowrap; }
.nm-hl::after {
    content: ""; position: absolute; inset-inline: -0.04em; bottom: -0.02em; height: 0.3em; z-index: -1; pointer-events: none;
    background: no-repeat center / 100% 100% url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 24' preserveAspectRatio='none'%3E%3Cpath d='M4 15C46 8 104 5 196 10' fill='none' stroke='%23C9A061' stroke-width='6' stroke-linecap='round'/%3E%3Cpath d='M22 19C70 14 128 13 182 16' fill='none' stroke='%23C9A061' stroke-width='2.5' stroke-linecap='round' opacity='.6'/%3E%3C/svg%3E");
}
.nm-hl { isolation: isolate; }
/* هیروی روشن نسخهٔ ۵: رنگ تیره‌تر تا روی زمینهٔ کرم خوانا بماند */
.nm-home-v5 .nm-hl { color: #8A5A2E; }
