/*
Theme Name: Maynd
Theme URI: https://maynd.ir
Author: Maynd
Description: قالب اختصاصی و سبک سایت مایند (نماینده رسمی وب‌اینگیج در ایران). راست‌چین، بدون وابستگی به افزونه صفحه‌ساز.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.0
License: Proprietary
Text Domain: maynd
*/

/* ---------- Tokens ---------- */
@font-face {
  font-family: "Vazirmatn";
  src: url("assets/fonts/Vazirmatn-Variable.woff2") format("woff2-variations"),
       url("assets/fonts/Vazirmatn-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ink: #14213D;        /* متن اصلی، سرمه‌ای عمیق */
  --brand: #2346B8;      /* آبی برند */
  --brand-deep: #182F80;
  --signal: #13A06F;     /* سبز «پیام رسید» */
  --signal-soft: #E3F5EE;
  --paper: #FFFFFF;
  --mist: #F1F4FA;       /* سطح ثانویه */
  --line: #DCE2EE;
  --muted: #5B6782;

  --font: "Vazirmatn", Tahoma, sans-serif;
  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: 2.1rem;
  --step-4: clamp(2.2rem, 4.5vw, 3.4rem);

  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 32px);
  --radius-s: 6px;
  --radius-l: 18px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.95;
  direction: rtl;
  text-align: right;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-underline-offset: 4px; }
a:hover { color: var(--brand-deep); }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3, h4 { line-height: 1.45; margin: 0 0 .6em; font-weight: 800; letter-spacing: -0.01em; }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }
p { margin: 0 0 1.1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: var(--gutter); }
.skip-link { position: absolute; right: -9999px; top: 0; background: var(--ink); color: #fff; padding: 8px 16px; z-index: 100; }
.skip-link:focus { right: 16px; top: 16px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px;
  border-radius: var(--radius-s);
  font: inherit; font-weight: 700; font-size: var(--step-0);
  text-decoration: none; cursor: pointer; border: 2px solid transparent;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-deep); color: #fff; }
.btn-ghost { border-color: var(--line); color: var(--ink); background: var(--paper); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { background: var(--signal-soft); color: var(--ink); }

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 50; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: var(--step-1); }
.brand img { max-height: 40px; width: auto; }
.brand-mark { width: 34px; height: 34px; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.main-nav li { position: relative; }
.main-nav a { display: block; padding: 10px 14px; color: var(--ink); text-decoration: none; font-weight: 500; border-radius: var(--radius-s); }
.main-nav a:hover, .main-nav .current-menu-item > a { background: var(--mist); }
.main-nav .sub-menu { display: none; position: absolute; top: 100%; right: 0; min-width: 220px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-s); padding: 6px; flex-direction: column; box-shadow: 0 12px 30px rgba(20,33,61,.08); }
.main-nav li:hover > .sub-menu, .main-nav li:focus-within > .sub-menu { display: flex; }
.header-cta { display: flex; gap: 10px; align-items: center; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: var(--radius-s); width: 46px; height: 46px; cursor: pointer; color: var(--ink); }
@media (max-width: 960px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .main-nav { display: none; position: absolute; top: 100%; right: 0; left: 0; background: #fff; border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 16px; }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; }
  .main-nav .sub-menu { display: flex; position: static; border: 0; box-shadow: none; padding: 0 16px 0 0; }
  .header-cta .btn-ghost { display: none; }
}
@media (max-width: 480px) { .header-cta .btn-primary { padding: 0 14px; font-size: var(--step--1); } }

/* ---------- Hero: the customer journey ---------- */
.hero { padding: clamp(48px, 8vw, 96px) 0 clamp(40px, 6vw, 72px); }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(32px, 6vw, 72px); align-items: center; }
.hero h1 { max-width: 17ch; }
.hero-lead { font-size: var(--step-1); color: var(--muted); max-width: 46ch; line-height: 1.9; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.journey { margin: 0; position: relative; background: var(--mist); border-radius: var(--radius-l); padding: 28px 24px 24px; }
.journey-title { font-size: var(--step--1); color: var(--muted); margin: 0 0 18px; font-weight: 500; }
.journey ol { list-style: none; margin: 0; padding: 0; position: relative; }
.journey ol::before { content: ""; position: absolute; top: 14px; bottom: 14px; right: 13px; width: 2px; background: var(--line); }
.journey li { position: relative; display: grid; grid-template-columns: 28px 1fr; gap: 14px; align-items: start; padding: 10px 0; }
.journey .dot { width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 2px solid var(--line); position: relative; z-index: 1; display: grid; place-items: center; }
.journey .dot svg { width: 14px; height: 14px; }
.journey .step-body { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; line-height: 1.7; }
.journey .step-body strong { display: block; font-weight: 700; }
.journey .step-body span { font-size: var(--step--1); color: var(--muted); }
.journey .is-wait .step-body { background: transparent; border: 1px dashed var(--line); }
.journey .is-message .dot { border-color: var(--brand); background: var(--brand); color: #fff; }
.journey .is-message .step-body { border-color: var(--brand); }
.journey .is-win .dot { border-color: var(--signal); background: var(--signal); color: #fff; }
.journey .is-win .step-body { background: var(--signal-soft); border-color: var(--signal); }

/* The one orchestrated moment: the journey plays once on load */
@media (prefers-reduced-motion: no-preference) {
  .journey li { opacity: 0; transform: translateY(6px); animation: step-in .45s ease-out forwards; }
  .journey li:nth-child(1) { animation-delay: .15s; }
  .journey li:nth-child(2) { animation-delay: .55s; }
  .journey li:nth-child(3) { animation-delay: .95s; }
  .journey li:nth-child(4) { animation-delay: 1.35s; }
  .journey li:nth-child(5) { animation-delay: 1.75s; }
}
@keyframes step-in { to { opacity: 1; transform: none; } }

@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero h1 { max-width: none; }
}

/* ---------- Sections ---------- */
.section { padding: clamp(56px, 8vw, 96px) 0; }
.section-tint { background: var(--mist); }
.section-head { max-width: 60ch; margin-bottom: 36px; }
.section-head p { color: var(--muted); font-size: var(--step-1); line-height: 1.85; }

/* Clients */
.clients { padding: 28px 0; border-block: 1px solid var(--line); }
.clients .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.clients-label { color: var(--muted); font-size: var(--step--1); margin-left: 12px; }
.clients ul { display: contents; list-style: none; }
.clients li { font-weight: 700; color: var(--ink); opacity: .78; }
.clients img { max-height: 36px; width: auto; filter: grayscale(1); opacity: .8; }

/* Services: a list, not a card grid */
.services { border-top: 2px solid var(--ink); }
.service { display: grid; grid-template-columns: minmax(180px, 280px) 1fr auto; gap: 24px; align-items: baseline; padding: 24px 0; border-bottom: 1px solid var(--line); }
.service h3 { margin: 0; }
.service h3 small { display: block; font-size: var(--step--1); font-weight: 500; color: var(--muted); direction: ltr; text-align: right; }
.service p { margin: 0; color: var(--muted); }
.service a.more { white-space: nowrap; font-weight: 700; text-decoration: none; }
.service a.more:hover { text-decoration: underline; }
@media (max-width: 720px) { .service { grid-template-columns: 1fr; gap: 6px; } }

/* Prerequisites: a checklist */
.checklist { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; list-style: none; padding: 0; margin: 0; }
.checklist li { border-top: 3px solid var(--signal); padding-top: 18px; }
.checklist .tick { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--signal-soft); color: var(--signal); margin-bottom: 12px; }
.checklist p { color: var(--muted); }
@media (max-width: 860px) { .checklist { grid-template-columns: 1fr; } }

/* Why */
.why { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 64px; }
.why article { padding-block: 8px; }
.why p { color: var(--muted); }
@media (max-width: 860px) { .why { grid-template-columns: 1fr; } }

/* Quote */
.quote { max-width: 760px; margin: 0 auto; text-align: center; }
.quote blockquote { margin: 0 0 20px; font-size: var(--step-2); line-height: 1.8; font-weight: 500; }
.quote cite { font-style: normal; color: var(--muted); }
.quote cite strong { color: var(--ink); }

/* CTA band */
.cta-band { background: var(--ink); color: #fff; border-radius: var(--radius-l); padding: clamp(32px, 5vw, 56px); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.cta-band h2 { margin: 0 0 6px; color: #fff; }
.cta-band p { margin: 0; color: #C9D3EA; }

/* ---------- Content pages ---------- */
.page-hero { background: var(--mist); padding: clamp(40px, 6vw, 72px) 0 clamp(28px, 4vw, 48px); }
.page-hero h1 { font-size: var(--step-3); margin: 0; }
.page-hero .meta { color: var(--muted); font-size: var(--step--1); margin-top: 8px; }
.breadcrumbs { font-size: var(--step--1); color: var(--muted); margin-bottom: 12px; }
.breadcrumbs a { color: var(--muted); }
.entry { max-width: 760px; margin: 0 auto; padding: clamp(32px, 5vw, 56px) var(--gutter); }
.entry-content { font-size: 1.0625rem; }
.entry-content h2 { font-size: var(--step-2); margin-top: 1.8em; }
.entry-content h3 { margin-top: 1.5em; }
.entry-content img { border-radius: 10px; margin: 1.5em auto; }
.entry-content ul, .entry-content ol { padding-right: 1.4em; padding-left: 0; }
.entry-content blockquote { border-right: 4px solid var(--brand); margin: 1.5em 0; padding: 4px 20px; color: var(--muted); }
.entry-content table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: var(--step--1); display: block; overflow-x: auto; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: 8px 12px; }
.entry-content th { background: var(--mist); }
.entry-content .wp-block-button__link { background: var(--brand); color: #fff; border-radius: var(--radius-s); padding: 12px 22px; text-decoration: none; font-weight: 700; }
.entry-content input, .entry-content textarea, .entry-content select { font: inherit; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); }
.entry-content input[type=submit], .entry-content button { width: auto; background: var(--brand); color: #fff; border: 0; padding: 12px 26px; font-weight: 700; cursor: pointer; border-radius: var(--radius-s); }
.alignwide { max-width: 1000px; }

/* Blog list */
.post-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px 32px; padding: clamp(32px, 5vw, 56px) 0; }
.post-item a.thumb img { aspect-ratio: 16/9; object-fit: cover; border-radius: 10px; width: 100%; margin-bottom: 14px; background: var(--mist); }
.post-item h2 { font-size: var(--step-1); margin-bottom: 8px; }
.post-item h2 a { color: var(--ink); text-decoration: none; }
.post-item h2 a:hover { color: var(--brand); }
.post-item p { color: var(--muted); font-size: var(--step--1); line-height: 1.85; }
.post-item .cat { font-size: var(--step--1); color: var(--signal); font-weight: 700; text-decoration: none; }
@media (max-width: 900px) { .post-list { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .post-list { grid-template-columns: 1fr; } }
.pagination { display: flex; gap: 8px; justify-content: center; padding-bottom: 56px; flex-wrap: wrap; }
.pagination .page-numbers { min-width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--radius-s); text-decoration: none; color: var(--ink); padding: 0 10px; }
.pagination .current { background: var(--ink); color: #fff; border-color: var(--ink); }
.cat-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.cat-filter a { padding: 4px 14px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink); font-size: var(--step--1); background: #fff; }
.cat-filter a.is-active, .cat-filter a:hover { border-color: var(--brand); color: var(--brand); }

.related { border-top: 1px solid var(--line); margin-top: 48px; padding-top: 24px; }
.related ul { padding-right: 1.2em; }

/* Search form */
.search-form { display: flex; gap: 8px; max-width: 480px; }
.search-form input[type=search] { flex: 1; font: inherit; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-s); }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #C9D3EA; margin-top: 0; padding: 56px 0 24px; font-size: var(--step--1); }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.footer-grid h2 { font-size: var(--step-0); color: #fff; margin-bottom: 12px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; line-height: 2.3; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 40px; padding-top: 20px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.ltr { direction: ltr; unicode-bidi: embed; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

/* 404 */
.not-found { text-align: center; padding: 96px var(--gutter); }
.not-found .search-form { margin: 24px auto 0; }
