/* ═══════════════════════════════════════════════
   A1Host — Responsive Layout System
   Breakpoints: 1024px (tablet) | 768px (mobile) | 480px (small)
   ═══════════════════════════════════════════════ */

/* ── Nav ── */
.a1-nav-links  { display:flex; gap:32px; align-items:center; }
.a1-nav-cta    { display:flex; }
.a1-nav-burger { display:none; background:none; border:none; cursor:pointer; padding:8px; color:#0a192f; }
.a1-nav-drawer { display:none; position:fixed; inset:0; z-index:200; }
.a1-nav-drawer.open { display:block; }
.a1-nav-overlay { position:absolute; inset:0; background:rgba(0,0,0,.45); backdrop-filter:blur(2px); }
.a1-nav-panel {
  position:absolute; top:0; right:0; bottom:0; width:280px;
  background:#fff; padding:24px; display:flex; flex-direction:column; gap:8px;
  box-shadow:-8px 0 32px rgba(0,0,0,.12);
  animation: slideIn .25s ease;
}
@keyframes slideIn { from { transform:translateX(100%); } to { transform:translateX(0); } }
.a1-nav-panel a {
  display:block; padding:14px 16px; border-radius:10px;
  font-family:'Vazirmatn',Tahoma,sans-serif; font-size:16px; font-weight:600;
  color:#0a192f; text-decoration:none; transition:background .15s; text-align:right;
}
.a1-nav-panel a:hover { background:#f5f3f5; color:#775a19; }
.a1-nav-panel .a1-panel-cta {
  margin-top:auto; display:block; padding:14px; border-radius:10px;
  background:#0a192f; color:#fff !important; text-align:center; font-weight:700;
}
.a1-nav-close {
  align-self:flex-start; background:none; border:none; cursor:pointer;
  color:#44474d; padding:4px; margin-bottom:8px;
}

/* ── Layout grids ── */
.a1-hero-grid    { display:grid; grid-template-columns:1fr 1fr; gap:48px; align-items:center; }
.a1-2col-grid    { display:grid; grid-template-columns:1fr 1fr; gap:32px; }
.a1-3col-grid    { display:grid; grid-template-columns:repeat(3,1fr); gap:32px; }
.a1-4col-grid    { display:grid; grid-template-columns:repeat(4,1fr); gap:24px; align-items:end; }
.a1-faqblog-grid { display:grid; grid-template-columns:1fr 1fr; gap:64px; }
.a1-bento        { display:grid; grid-template-columns:repeat(12,1fr); gap:24px; }
.a1-blog-hero    { display:grid; grid-template-columns:3fr 2fr; min-height:400px; }
.a1-archive-cats { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; }
.a1-archive-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:32px; }
.a1-footer-inner { display:flex; flex-direction:row; gap:48px; flex-wrap:wrap; }
.a1-trust-strip  { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:32px; }

/* ── Tablet (≤ 1024px) ── */
@media (max-width:1024px) {
  .a1-4col-grid    { grid-template-columns:repeat(2,1fr); }
  .a1-archive-grid { grid-template-columns:repeat(2,1fr); }
  .a1-archive-cats { grid-template-columns:repeat(2,1fr); }
  .a1-bento > [style*="grid-column:span 8"] { grid-column:span 12 !important; }
  .a1-bento > [style*="grid-column:span 4"] { grid-column:span 12 !important; }
}

/* ── Mobile (≤ 768px) ── */
@media (max-width:768px) {

  /* ─ Nav ─ */
  .a1-nav-links  { display:none !important; }
  .a1-nav-cta    { display:none !important; }
  .a1-nav-burger { display:flex !important; align-items:center; justify-content:center; }

  /* ─ Prevent overflow ─ */
  main { overflow-x:hidden; }
  body { overflow-x:hidden; }

  /* ─ Hero grids → single column ─ */
  .a1-hero-grid { grid-template-columns:1fr !important; gap:24px; }
  .a1-hero-img  { display:none !important; }  /* inline style داره پس !important لازم است */

  /* ─ Blog hero card → stack ─ */
  .a1-blog-hero { grid-template-columns:1fr !important; min-height:unset; }
  .a1-blog-hero-img { display:none !important; }
  .a1-blog-hero > div:last-child { display:none !important; }
  .a1-blog-hero > div:first-child { padding:28px !important; }

  /* ─ All other 2/3/4-col grids → single column ─ */
  .a1-2col-grid    { grid-template-columns:1fr !important; gap:20px; }
  .a1-3col-grid    { grid-template-columns:1fr !important; }
  .a1-4col-grid    { grid-template-columns:1fr !important; }
  .a1-faqblog-grid { grid-template-columns:1fr !important; gap:40px; }

  /* ─ Archive ─ */
  .a1-archive-cats { grid-template-columns:repeat(2,1fr) !important; }
  .a1-archive-grid { grid-template-columns:1fr !important; gap:20px; }

  /* ─ Bento → full width ─ */
  .a1-bento > * { grid-column:span 12 !important; }

  /* ─ Footer ─ */
  .a1-footer-inner { flex-direction:column !important; gap:32px; }
  .a1-footer-brand { width:100% !important; flex:none !important; }
  .a1-footer-links { display:grid !important; grid-template-columns:1fr 1fr !important; }
  .a1-footer-trust { display:none !important; }

  /* ─ Trust strip → vertical centered ─ */
  .a1-trust-strip { flex-direction:column; align-items:center; }
  .a1-trust-strip > div { width:100%; justify-content:center; }

  /* ─ Hero CTA buttons → stack ─ */
  .a1-hero-btns { flex-direction:column !important; align-items:stretch !important; gap:12px !important; }
  .a1-hero-btns a { text-align:center !important; }

  /* ─ Pricing toggle → 2×2 wrap ─ */
  .a1-period-toggle { flex-wrap:wrap !important; }
  .a1-period-toggle button { flex:1 1 40%; min-width:120px; }

  /* ─ Typography ─ */
  .a1-h1 { font-size:clamp(26px,7vw,36px) !important; }
  .a1-h2 { font-size:clamp(22px,6vw,28px) !important; }
  .a1-hero-grid h1 { word-break:break-word; overflow-wrap:break-word; }

  /* ─ Search form ─ */
  .a1-si { padding-left:16px !important; font-size:14px !important; box-sizing:border-box !important; }
  form[role="search"] button[type="submit"] { padding:8px 10px !important; font-size:13px !important; }

  /* ─ FAQ ─ */
  .a1-faq-tabs { flex-wrap:wrap !important; min-width:unset !important; justify-content:flex-end !important; }
  .a1-faq-tabs button { white-space:normal !important; text-align:right; flex:0 0 auto; }
  .a1-accordion-btn { padding:16px !important; }

  /* ─ Section padding reduction ─ */
  section[style*="padding:96px"] { padding:48px 0 !important; }
  section[style*="padding:64px"] { padding:40px 0 !important; }
}

/* ── Small mobile (≤ 480px) ── */
@media (max-width:480px) {
  .a1-nav-panel { width:100%; }
  .a1-period-toggle button { flex:1 1 100%; }
  .a1-faq-tabs button { font-size:13px !important; padding:10px 16px !important; }
}

/* ── Global RTL: only default text (not center-aligned elements) ── */
/* NOTE: این rule فقط برای بلاک‌هایی اعمال می‌شه که text-align تعریف نشده */
[dir="rtl"] p:not([style*="text-align:center"]),
[dir="rtl"] li { text-align:right; }

/* ── Archive hero image: on mobile show below text ── */
/* دسکتاپ: رفتار پیش‌فرض grid (کنار متن) */
.a1-archive-hero-img { display:flex; justify-content:center; align-items:center; }

@media (max-width:768px) {
  /* موبایل: نشان داده می‌شود، زیر متن */
  .a1-archive-hero-img { display:flex !important; }
  .a1-archive-hero-img img { max-width:280px !important; margin:0 auto; }
}

/* ── Print / accessibility ── */
@media (prefers-reduced-motion: reduce) {
  .floating-animation { animation:none !important; }
  .a1-nav-panel       { animation:none !important; }
}
