/* ============================================================
   MAEDEH TAK — Complete Stylesheet
   ============================================================ */

/* ---------- 1. Tokens & color schemes ---------- */
@view-transition { navigation: auto; }

:root {
  --font-primary: 'PrimaryFont', 'Vazirmatn', 'Tahoma', 'Arial', sans-serif;
  --font-mono: 'Menlo', 'Consolas', monospace;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(32, 28, 29, 0.06);
  --shadow-md: 0 4px 16px rgba(32, 28, 29, 0.10);
  --shadow-lg: 0 12px 32px rgba(32, 28, 29, 0.14);
  --transition: 220ms cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 160ms;
  --dur-base: 260ms;
  --dur-slow: 500ms;

  --color-bg: #fdfcf7;
  --color-bg-alt: #f5efe0;
  --color-surface: #ffffff;
  --color-surface-alt: #f3eddb;
  --color-border: #e4dbc3;
  --color-text: #201c1d;
  --color-text-muted: #6b6257;
  --color-primary: #f2c30d;
  --color-primary-dark: #c99a00;
  --color-brand-ink: #201c1d;
  --color-accent: #7b4ae2;
  --color-accent-hover: #5f35bc;
  --color-success: #2e7d32;
  --color-warning: #b85d00;
  --color-danger: #b71c1c;
  --color-focus: #5b35c7;

  --gradient-primary: linear-gradient(135deg, #f2c30d 0%, #ffd93d 100%);
  --gradient-accent: linear-gradient(135deg, #7b4ae2 0%, #a78bfa 100%);
  --container-max: 1180px;
  --container-narrow: 820px;

  --z-fab: 9999;
  --z-header: 90;
  --z-backdrop: 100;
  --z-drawer: 101;
  --z-skip: 200;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #201c1d;
    --color-bg-alt: #2a2427;
    --color-surface: #2a2427;
    --color-surface-alt: #352e31;
    --color-border: #443b3f;
    --color-text: #f5f0e6;
    --color-text-muted: #ada093;
    --color-primary: #f2c30d;
    --color-primary-dark: #c99a00;
    --color-brand-ink: #201c1d;
    --color-accent: #b79bff;
    --color-accent-hover: #d4c4ff;
    --color-success: #81c784;
    --color-warning: #ffb74d;
    --color-danger: #ef9a9a;
    --color-focus: #b79bff;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.7);
    --gradient-accent: linear-gradient(135deg, #9d7ae8 0%, #c4b5fd 100%);
  }
}

[data-theme="dark"] {
  --color-bg: #201c1d;
  --color-bg-alt: #2a2427;
  --color-surface: #2a2427;
  --color-surface-alt: #352e31;
  --color-border: #443b3f;
  --color-text: #f5f0e6;
  --color-text-muted: #ada093;
  --color-primary: #f2c30d;
  --color-primary-dark: #c99a00;
  --color-brand-ink: #201c1d;
  --color-accent: #b79bff;
  --color-accent-hover: #d4c4ff;
  --color-success: #81c784;
  --color-warning: #ffb74d;
  --color-danger: #ef9a9a;
  --color-focus: #b79bff;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.7);
  --gradient-accent: linear-gradient(135deg, #9d7ae8 0%, #c4b5fd 100%);
}

[data-theme="light"] {
  --color-bg: #fdfcf7;
  --color-bg-alt: #f5efe0;
  --color-surface: #ffffff;
  --color-surface-alt: #f3eddb;
  --color-border: #e4dbc3;
  --color-text: #201c1d;
  --color-text-muted: #6b6257;
  --color-primary: #f2c30d;
  --color-primary-dark: #c99a00;
  --color-brand-ink: #201c1d;
  --color-accent: #7b4ae2;
  --color-accent-hover: #5f35bc;
  --color-success: #2e7d32;
  --color-warning: #b85d00;
  --color-danger: #b71c1c;
  --color-focus: #5b35c7;
  --shadow-sm: 0 1px 2px rgba(32, 28, 29, 0.06);
  --shadow-md: 0 4px 16px rgba(32, 28, 29, 0.10);
  --shadow-lg: 0 12px 32px rgba(32, 28, 29, 0.14);
  --gradient-accent: linear-gradient(135deg, #7b4ae2 0%, #a78bfa 100%);
}

/* ---------- 2. Fonts & base reset ---------- */
@font-face {
  font-family: 'PrimaryFont';
  src: url('/fonts/primary-font.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-block-start: 5.5rem;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font-family: var(--font-primary);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.0625rem);
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  overflow-wrap: break-word;
  opacity: 1;
  transition: opacity 180ms cubic-bezier(0.4, 0, 0.2, 1);
  text-align: start;
}
html.font-loading body { opacity: 0; }

img, video { display: block; max-width: 100%; height: auto; }
svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--color-accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-accent-hover); }
a:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 3px; border-radius: 4px; }
:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 3px; }

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 0.6em;
  color: var(--color-text);
  overflow-wrap: break-word;
}
h1 { font-size: clamp(1.75rem, 1.3rem + 2.2vw, 2.75rem); }
h2 { font-size: clamp(1.4rem, 1.1rem + 1.4vw, 2rem); }
h3 { font-size: clamp(1.15rem, 1rem + 0.8vw, 1.4rem); }
p { margin: 0 0 1em; }

::selection { background: var(--color-accent); color: #fff; }

/* ---------- 3. Layout primitives ---------- */
.container { width: min(100% - 2rem, var(--container-max)); margin-inline: auto; }
.container.narrow { max-width: var(--container-narrow); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.center { text-align: center; }

.skip-link {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 1rem;
  padding: 0.75rem 1rem;
  background: var(--color-brand-ink);
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-sm);
  font-weight: 700;
  z-index: var(--z-skip);
  transform: translateY(-150%);
  transition: transform var(--transition);
}
.skip-link:focus { transform: translateY(0.5rem); color: var(--color-primary); }

/* ---------- 4. Header, nav, drawer ---------- */
.site-header {
  position: sticky;
  inset-block-start: 0;
  z-index: var(--z-header);
  background: var(--color-bg);
  background: color-mix(in srgb, var(--color-bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-block-end: 1px solid var(--color-border);
  view-transition-name: site-header;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1.5rem);
  padding-block: 0.85rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  flex: 0 0 auto;
  min-width: 0;
  color: var(--color-text);
  font-weight: 800;
}
.brand-mark {
  display: inline-grid; place-items: center;
  width: 2.25rem; height: 2.25rem; border-radius: 10px;
  background: var(--gradient-primary); color: var(--color-brand-ink);
  flex: 0 0 auto;
  font-weight: 800;
}
.brand-name {
  font-size: clamp(1rem, 0.9rem + 0.4vw, 1.15rem);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brand.small { font-size: 0.95rem; }
.brand.small .brand-mark { width: 1.85rem; height: 1.85rem; }

.desktop-nav { flex: 1 1 auto; min-width: 0; }
.desktop-nav ul { display: flex; flex-wrap: wrap; gap: 0.25rem; list-style: none; margin: 0; padding: 0; }
.desktop-nav a {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-weight: 600;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
  position: relative;
  overflow: hidden;
}
.desktop-nav a:hover,
.desktop-nav a[aria-current="page"] { background: var(--color-surface-alt); color: var(--color-accent); }

.header-actions { display: flex; align-items: center; gap: 0.4rem; margin-inline-start: auto; flex: 0 0 auto; }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 2.75rem; height: 2.75rem;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-surface); color: var(--color-text);
  cursor: pointer;
  transition: background var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-spring),
              border-color var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
}
.icon-btn:hover {
  background: var(--color-surface-alt);
  transform: translateY(-1px) rotate(-6deg);
  box-shadow: var(--shadow-md);
}
.icon-btn:active { transform: translateY(0); }

.burger { display: none; }
.burger .burger-bar {
  display: block; width: 18px; height: 2px; border-radius: 2px;
  background: currentColor; margin: 3px 0;
  transition: transform var(--transition), opacity var(--transition);
}
.burger[aria-expanded="true"] .burger-bar:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.burger[aria-expanded="true"] .burger-bar:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] .burger-bar:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(32, 28, 29, 0.55);
  z-index: var(--z-backdrop);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--transition), visibility 0s linear 220ms;
}
.drawer-backdrop.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity var(--transition), visibility 0s;
}
.drawer {
  position: fixed;
  inset-block: 0;
  inset-inline-end: 0;
  width: min(90vw, 380px);
  max-width: 100%;
  z-index: var(--z-drawer);
  background: var(--color-surface);
  border-inline-start: 1px solid var(--color-border);
  display: flex; flex-direction: column;
  padding: 1rem;
  padding-block-end: max(1rem, env(safe-area-inset-bottom, 0rem));
  overflow: hidden;
  overscroll-behavior: contain;
  transform: translateX(100%);
  visibility: hidden;
  box-shadow: var(--shadow-lg);
  transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 280ms;
}
html[dir="rtl"] .drawer { transform: translateX(-100%); }
.drawer.open {
  transform: translateX(0);
  visibility: visible;
  transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1), visibility 0s;
}
html[dir="rtl"] .drawer.open { transform: translateX(0); }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-block-end: 1rem;
  border-block-end: 1px solid var(--color-border);
  flex: 0 0 auto;
}
.drawer-nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-block: 1rem; }
.drawer-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.drawer-nav a {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-weight: 600;
  overflow-wrap: break-word;
  transition: background var(--transition), color var(--transition);
}
.drawer-nav a:hover, .drawer-nav a[aria-current="page"] { background: var(--color-surface-alt); color: var(--color-accent); }
.drawer-sub { margin-inline-start: 1.5rem; margin-block-start: 0.25rem; }
.drawer-sub a { font-weight: 500; font-size: 0.9em; }
.drawer-footer {
  padding-block-start: 1rem;
  border-block-start: 1px solid var(--color-border);
  flex: 0 0 auto;
}

/* ---------- 5. Buttons, hero, sections ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.7rem 1.2rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--gradient-primary); color: var(--color-brand-ink); box-shadow: var(--shadow-md); }
.btn-primary:hover { box-shadow: var(--shadow-lg); color: var(--color-brand-ink); }
.btn-ghost { background: transparent; border-color: var(--color-border); color: var(--color-text); }
.btn-ghost:hover { background: var(--color-surface-alt); color: var(--color-text); }

.hero {
  padding-block: clamp(2rem, 5vw, 4rem) clamp(2.5rem, 6vw, 5rem);
  background: linear-gradient(180deg, var(--color-bg-alt) 0%, var(--color-bg) 100%);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.hero-inner { display: grid; grid-template-columns: 1fr; gap: 2rem; align-items: center; }
.hero-inner > * { min-width: 0; }
@media (min-width: 880px) { .hero-inner { grid-template-columns: 1.1fr 1fr; gap: 3rem; } }
.eyebrow {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-primary) 20%, var(--color-surface-alt));
  color: var(--color-text);
  font-weight: 700;
  font-size: 0.85em;
  margin-block-end: 1rem;
  overflow-wrap: break-word;
}
.lede { font-size: clamp(1.05rem, 0.95rem + 0.4vw, 1.2rem); color: var(--color-text-muted); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-block-start: 1.5rem; }
.hero-visual { min-width: 0; }
.hero-visual img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.section { padding-block: clamp(2rem, 4vw, 3.5rem); }
.section-alt { background: var(--color-bg-alt); }
.section-head { text-align: center; margin-block-end: 2rem; }
.section-sub { color: var(--color-text-muted); max-width: 60ch; margin-inline: auto; }
.page-head { margin-block-end: 1.5rem; }
.meta { color: var(--color-text-muted); font-size: 0.9em; display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

/* ---------- 6. Cards, prose, tables, FAQ, forms ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: 1.25rem;
}
.card-grid > * { min-width: 0; }
.card {
  display: flex; flex-direction: column;
  min-width: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  color: var(--color-text);
  text-decoration: none;
  transition: transform 400ms var(--ease-spring),
              box-shadow 400ms var(--ease-out),
              border-color 400ms var(--ease-out);
  transform-style: preserve-3d;
}
.card:hover {
  transform: translateY(-6px) rotateX(1.5deg) rotateY(-1.5deg);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
  color: var(--color-text);
}
.card-media { background: var(--color-surface-alt); overflow: hidden; }
.card-media img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: transform 700ms var(--ease-out); }
.card:hover .card-media img { transform: scale(1.06); }
.card-body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; }
.card-body h3 { margin: 0; font-size: 1.1rem; }
.card-body p { margin: 0; color: var(--color-text-muted); font-size: 0.95em; }
.card-cta {
  margin-block-start: auto;
  color: var(--color-accent);
  font-weight: 700;
  font-size: 0.9em;
  display: inline-flex; align-items: center; gap: 0.4rem;
  transition: gap var(--dur-base) var(--ease-out), color var(--dur-base);
}
.card:hover .card-cta { gap: 0.75rem; }
.card-cat { background: var(--color-surface); }

.prose { max-width: 70ch; overflow-wrap: break-word; }
.prose code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--color-surface-alt);
  overflow-wrap: anywhere;
}
.prose pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
  max-width: 100%;
  overflow-x: auto;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
}
.prose pre code { padding: 0; background: none; overflow-wrap: normal; }

.entity-hero img {
  width: 100%;
  max-height: 440px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.entity-article > .container > * + *,
.blog-article > .container > * + * { margin-block-start: 1.5rem; }

.specs-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.specs-table caption { caption-side: top; text-align: start; font-weight: 700; padding-block-end: 0.5rem; }
.specs-table th, .specs-table td { padding: 0.7rem 1rem; text-align: start; overflow-wrap: break-word; }
.specs-table thead th { background: var(--color-surface-alt); font-weight: 700; }
.specs-table tbody tr { transition: background var(--dur-base) var(--ease-out); }
.specs-table tbody tr + tr { border-block-start: 1px solid var(--color-border); }
.specs-table tbody tr:hover { background: color-mix(in srgb, var(--color-primary) 10%, transparent); }
.specs-table tbody th { font-weight: 600; color: var(--color-text-muted); width: 35%; }

.highlights-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.highlights-list li {
  position: relative;
  padding-inline-start: 2rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding-block: 0.8rem;
  padding-inline-end: 1rem;
}
.highlights-list li::before {
  content: "\2713";
  position: absolute;
  inset-inline-start: 0.85rem;
  inset-block-start: 0.65rem;
  color: var(--color-success);
  font-weight: 700;
}

:root { interpolate-size: allow-keywords; }
.faq-list { display: grid; gap: 0.6rem; }
.faq-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.faq-item summary {
  padding: 0.85rem 1rem;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  transition: background var(--transition);
}
.faq-item summary:hover { background: var(--color-surface-alt); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-weight: 700;
  color: var(--color-accent);
  flex: 0 0 auto;
  display: inline-block;
  transition: transform var(--dur-base) var(--ease-spring);
}
.faq-item[open] summary::after { content: "\2212"; transform: rotate(180deg); }
.faq-item::details-content {
  block-size: 0;
  overflow: hidden;
  transition: block-size 350ms var(--ease-out),
              content-visibility 350ms allow-discrete;
}
.faq-item[open]::details-content { block-size: auto; }
.faq-answer { padding: 0 1rem 1rem; color: var(--color-text-muted); overflow-wrap: break-word; }

.cta-band {
  padding: clamp(1.25rem, 4vw, 2rem);
  border-radius: var(--radius-lg);
  background: var(--gradient-primary);
  color: var(--color-brand-ink);
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 0.75rem;
}
.cta-band h2, .cta-band p { color: var(--color-brand-ink); }
.cta-band .btn-primary {
  background: var(--color-brand-ink);
  color: var(--color-primary);
  box-shadow: 0 4px 16px rgba(32, 28, 29, 0.25);
}
.cta-band .btn-primary:hover { color: #ffd93d; box-shadow: 0 8px 24px rgba(32, 28, 29, 0.35); }

/* ---------- 7. Footer, FAB, breadcrumbs, related, search ---------- */
.breadcrumbs { padding-block: 1rem; font-size: 0.9em; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; padding: 0; margin: 0; align-items: center; }
.breadcrumbs a { color: var(--color-text-muted); }
.breadcrumbs a:hover { color: var(--color-accent); }
.breadcrumbs i {
  color: var(--color-text-muted);
  font-size: 0.75em;
  display: inline-block;
  transition: transform var(--dur-base) var(--ease-out);
}
.breadcrumbs li:hover i { transform: translateX(-4px); }
html[dir="rtl"] .breadcrumbs li:hover i { transform: translateX(4px); }
.breadcrumbs li[aria-current="page"] { color: var(--color-text); font-weight: 700; }

.related { padding-block: clamp(2rem, 4vw, 3rem); background: var(--color-bg-alt); border-block-start: 1px solid var(--color-border); }
.related h2 { margin-block-end: 1rem; }
.related-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 0.75rem; list-style: none; margin: 0; padding: 0; }
.related-list > li { min-width: 0; }
.related-list a {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  overflow-wrap: break-word;
  transition: transform var(--dur-base) var(--ease-spring),
              border-color var(--dur-base),
              color var(--dur-base),
              box-shadow var(--dur-base);
}
.related-list a:hover {
  transform: translateY(-3px);
  border-color: var(--color-primary);
  color: var(--color-accent);
  box-shadow: var(--shadow-md);
}

.search-form { display: flex; gap: 0.5rem; margin-block-end: 1rem; }
.search-form input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: 1rem;
}
.search-form input[type="search"]:focus { border-color: var(--color-primary); outline-offset: 1px; }
.search-results { display: flex; flex-direction: column; gap: 0.5rem; }
.search-count { color: var(--color-text-muted); font-size: 0.9em; margin-block-end: 0.5rem; }
.search-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.search-list > li { min-width: 0; }
.search-list li[hidden] { display: none; }
.search-list a {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.25rem 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
}
.search-type {
  grid-column: 1; grid-row: 1 / span 2;
  align-self: start;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-accent) 15%, var(--color-surface-alt));
  color: var(--color-accent-hover);
  font-size: 0.75em;
  font-weight: 700;
  white-space: nowrap;
}
.search-title { grid-column: 2; font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.search-desc { grid-column: 2; color: var(--color-text-muted); font-size: 0.9em; min-width: 0; overflow-wrap: anywhere; }

.contact-block {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex; flex-direction: column; gap: 0.5rem;
  overflow-wrap: break-word;
}

.site-footer { background: var(--color-bg-alt); border-block-start: 1px solid var(--color-border); padding-block: 3rem 1rem; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 2rem; }
.footer-grid > * { min-width: 0; }
.footer-title { font-size: 1rem; font-weight: 800; margin-block-end: 0.6rem; }
.footer-links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.footer-links a { color: var(--color-text-muted); overflow-wrap: break-word; }
.footer-links a:hover { color: var(--color-accent); }
.footer-bottom { text-align: center; color: var(--color-text-muted); font-size: 0.85em; padding-block-start: 2rem; margin-block-start: 2rem; border-block-start: 1px solid var(--color-border); }

/* ---- Floating Action Button (Animated Navy Call Button) ---- */
.fab {
  position: fixed !important;
  bottom: 2rem !important;
  left: 2rem !important; /* Kept on the left to avoid scrollbar */
  z-index: 9999 !important;
  
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 3.5rem !important;
  height: 3.5rem !important;
  padding: 0 !important;
  border-radius: 50% !important;
  
  background-color: #0f172a !important; /* Deep Navy سرمه ای */
  color: #ffffff !important;
  text-decoration: none !important;
  border: none !important;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.4) !important;
  
  /* Ripple Pulse Animation */
  animation: fab-pulse-ring 2s infinite !important;
  transition: transform 0.3s ease, background-color 0.3s ease !important;
}

.fab:hover {
  transform: scale(1.08) !important;
  background-color: #1e293b !important; /* Slightly lighter navy on hover */
  color: #ffffff !important;
}

.fab svg {
  width: 1.5rem !important;
  height: 1.5rem !important;
  fill: currentColor !important;
}

/* Hide the text completely */
.fab-text {
  display: none !important;
}

/* Clean Ripple Keyframes */
@keyframes fab-pulse-ring {
  0% {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.4), 0 0 0 0 rgba(15, 23, 42, 0.3);
  }
  70% {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.4), 0 0 0 15px rgba(15, 23, 42, 0);
  }
  100% {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.4), 0 0 0 0 rgba(15, 23, 42, 0);
  }
}

.notfound .eyebrow { font-size: 2rem; }

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 280ms;
  animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- 8. Blog / article page — full coverage ---------- */
.blog-article {
  padding-block: clamp(1rem, 2vw, 2rem) clamp(2.5rem, 5vw, 4rem);
}
.blog-article > .container,
.entity-article > .container {
  max-width: min(var(--container-narrow), 100% - 2rem);
}

.blog-article .page-head,
.entity-article .page-head {
  margin-block-end: clamp(1.25rem, 2.5vw, 1.75rem);
}
.blog-article .page-head h1,
.entity-article .page-head h1 {
  margin-block-end: 0.5rem;
  letter-spacing: -0.01em;
  text-wrap: balance;
  position: relative;
  padding-block-end: 0.5rem;
}
.blog-article .page-head h1::after,
.entity-article .page-head h1::after {
  content: "";
  position: absolute;
  inset-block-end: 0;
  inset-inline-start: 0;
  block-size: 3px;
  inline-size: 3rem;
  border-radius: 2px;
  background: var(--gradient-primary);
  transform-origin: left center;
  animation: h1-underline 800ms var(--ease-out) both;
}
html[dir="rtl"] .blog-article .page-head h1::after,
html[dir="rtl"] .entity-article .page-head h1::after {
  transform-origin: right center;
}
@keyframes h1-underline {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

.blog-article .page-head .meta,
.entity-article .page-head .meta {
  margin-block: 0 1rem;
  padding-block-end: 0.85rem;
  border-block-end: 1px solid var(--color-border);
}
.blog-article .page-head .meta time { font-variant-numeric: tabular-nums; }
.blog-article .page-head .meta span[aria-hidden="true"],
.entity-article .page-head .meta span[aria-hidden="true"] {
  display: inline-block;
  animation: dot-pulse 2.2s ease-in-out infinite;
}
@keyframes dot-pulse {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 1; }
}
.blog-article .page-head .lede,
.entity-article .page-head .lede {
  font-size: clamp(1.05rem, 0.98rem + 0.35vw, 1.2rem);
  color: var(--color-text-muted);
  margin: 0;
}

.blog-article .entity-hero,
.entity-article .entity-hero {
  margin-block-end: clamp(1.5rem, 3vw, 2.25rem);
  overflow: hidden;
  border-radius: var(--radius-lg);
}
.blog-article .entity-hero img,
.entity-article .entity-hero img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: block;
}

/* Prose typography, rhythm, links, lists, hr, images */
.prose {
  font-size: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  line-height: 1.85;
}
.prose > * + * { margin-block-start: 1em; }
.prose > h2 { margin-block-start: 2.5rem; }
.prose > h3 { margin-block-start: 2rem; }
.prose > h2:first-child,
.prose > h3:first-child { margin-block-start: 0; }
.prose hr + h2,
.prose hr + h3 { margin-block-start: 1.25rem; }

.prose p { margin-block: 0 1.15em; }
.prose p, .prose li { color: var(--color-text); }
.prose strong { font-weight: 700; color: var(--color-text); }
.prose em { font-style: italic; }

.prose a {
  color: var(--color-accent);
  font-weight: 600;
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 2px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  padding-block-end: 1px;
  border-radius: 3px;
  transition: background-size var(--dur-base) var(--ease-out),
              color var(--dur-base) var(--ease-out);
}
.prose a:hover { color: var(--color-accent-hover); background-size: 100% 2px; }
.prose a:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; }
html[dir="rtl"] .prose a { background-position: 100% 100%; }

.prose hr {
  border: 0;
  height: 1px;
  margin-block: clamp(1.75rem, 3vw, 2.5rem);
  background: var(--color-border);
  transform-origin: center;
}

.prose ul,
.prose ol {
  padding-inline-start: 1.6rem;
  margin-block: 0 1.15em;
}
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li {
  margin-block: 0.4rem;
  transition: color var(--dur-base) var(--ease-out);
}
.prose li::marker {
  color: var(--color-accent);
  font-weight: 700;
  transition: color var(--dur-base) var(--ease-out);
}
.prose li:hover { color: var(--color-accent-hover); }
.prose li:hover::marker { color: var(--color-primary); }
.prose li > ul,
.prose li > ol { margin-block: 0.4rem 0; }

.prose :not(pre) > code { border: 1px solid var(--color-border); }

.prose img {
  border-radius: var(--radius-md);
  margin-block: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.prose blockquote {
  margin: 1.25rem 0;
  padding-inline-start: 1rem;
  border-inline-start: 3px solid var(--color-primary);
  color: var(--color-text-muted);
  transition: padding-inline-start var(--dur-base) var(--ease-out),
              border-inline-start-color var(--dur-base) var(--ease-out);
}
.prose blockquote:hover {
  padding-inline-start: 1.4rem;
  border-inline-start-color: var(--color-accent);
}

/* ---------- 9. Motion & interaction layer (pure CSS) ---------- */

/* Reading progress bar */
body::before {
  content: "";
  position: fixed;
  inset-block-start: 0;
  inset-inline-start: 0;
  block-size: 3px;
  inline-size: 100%;
  background: var(--gradient-accent);
  transform: scaleX(0);
  transform-origin: left center;
  z-index: 999;
  pointer-events: none;
}
html[dir="rtl"] body::before { transform-origin: right center; }
@supports (animation-timeline: scroll()) {
  body::before {
    animation: reading-progress linear both;
    animation-timeline: scroll(root);
  }
}
@keyframes reading-progress {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* Focus pulse */
:focus-visible { animation: focus-pulse 2s ease-in-out infinite; }
@keyframes focus-pulse {
  0%, 100% { outline-color: var(--color-focus); }
  50%      { outline-color: var(--color-primary); }
}

/* Header shadow on scroll */
@supports (animation-timeline: scroll()) {
  .site-header {
    animation: header-shadow linear both;
    animation-timeline: scroll(root);
    animation-range: 0 120px;
  }
}
@keyframes header-shadow { to { box-shadow: var(--shadow-md); } }

/* Nav underline sweep */
.desktop-nav a::after {
  content: "";
  position: absolute;
  inset-block-end: 0.3rem;
  inset-inline: 0.85rem;
  block-size: 2px;
  border-radius: 2px;
  background: var(--color-primary);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform var(--dur-base) var(--ease-out);
}
.desktop-nav a:hover::after,
.desktop-nav a[aria-current="page"]::after { transform: scaleX(1); }
.desktop-nav a[aria-current="page"] { box-shadow: none; }

/* Theme toggle spin */
#theme-toggle:hover { transform: translateY(-1px) rotate(20deg) scale(1.05); }

/* Button shine sweep */
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg,
    transparent 35%, rgba(255,255,255,0.55) 50%, transparent 65%);
  transform: translateX(-100%);
  transition: transform 700ms var(--ease-out);
  pointer-events: none;
}
.btn:hover::after { transform: translateX(100%); }
html[dir="rtl"] .btn::after {
  background: linear-gradient(-110deg,
    transparent 35%, rgba(255,255,255,0.55) 50%, transparent 65%);
  transform: translateX(100%);
}
html[dir="rtl"] .btn:hover::after { transform: translateX(-100%); }

/* Hero floating orbs */
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  z-index: -1;
  pointer-events: none;
}
.hero::before {
  inline-size: 360px; block-size: 360px;
  inset-block-start: -120px;
  inset-inline-start: -80px;
  background: var(--color-primary);
  animation: orb-float 14s ease-in-out infinite;
}
.hero::after {
  inline-size: 460px; block-size: 460px;
  inset-block-end: -160px;
  inset-inline-end: -120px;
  background: var(--color-accent);
  animation: orb-float 18s ease-in-out infinite reverse;
}
@keyframes orb-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(40px, -30px) scale(1.08); }
}

/* Hero image ken-burns on scroll */
@supports (animation-timeline: view()) {
  .blog-article .entity-hero img,
  .entity-article .entity-hero img {
    animation: hero-kenburns linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 100%;
  }
}
@keyframes hero-kenburns {
  from { transform: scale(1.08); filter: saturate(0.9) brightness(0.92); }
  to   { transform: scale(1);     filter: saturate(1) brightness(1); }
}

/* Prose reveal-up + hr draw on scroll */
@supports (animation-timeline: view()) {
  .prose > * {
    animation: reveal-up linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 60%;
  }
  .prose hr {
    animation: hr-draw linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 80%;
  }
}
@keyframes reveal-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes hr-draw {
  from { transform: scaleX(0); opacity: 0; }
  to   { transform: scaleX(1); opacity: 1; }
}

/* Prose headings gradient on hover */
.prose h2,
.prose h3 {
  background-image: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  transition: color var(--dur-slow) var(--ease-out),
              -webkit-text-fill-color var(--dur-slow) var(--ease-out);
}
.prose h2:hover,
.prose h3:hover {
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* Skip link spring */
.skip-link:focus { animation: skip-bounce 500ms var(--ease-spring); }
@keyframes skip-bounce {
  0%   { transform: translateY(-150%); }
  60%  { transform: translateY(1rem); }
  100% { transform: translateY(0.5rem); }
}

/* Drawer staggered entrance */
.drawer.open .drawer-nav li {
  animation: drawer-item-in 350ms var(--ease-out) both;
}
.drawer.open .drawer-nav li:nth-child(1) { animation-delay: 60ms; }
.drawer.open .drawer-nav li:nth-child(2) { animation-delay: 100ms; }
.drawer.open .drawer-nav li:nth-child(3) { animation-delay: 140ms; }
.drawer.open .drawer-nav li:nth-child(4) { animation-delay: 180ms; }
.drawer.open .drawer-nav li:nth-child(5) { animation-delay: 220ms; }
.drawer.open .drawer-nav li:nth-child(6) { animation-delay: 260ms; }
.drawer.open .drawer-nav li:nth-child(7) { animation-delay: 300ms; }
@keyframes drawer-item-in {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}
html[dir="rtl"] .drawer.open .drawer-nav li {
  animation-name: drawer-item-in-rtl;
}
@keyframes drawer-item-in-rtl {
  from { opacity: 0; transform: translateX(-24px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ---------- 10. Responsive & reduced motion ---------- */
@media (max-width: 879.98px) {
  .desktop-nav { display: none; }
  .burger { display: inline-grid; }
}

@media (max-width: 520px) {
  .blog-article .page-head h1,
  .entity-article .page-head h1 { font-size: 1.55rem; }
  .prose { font-size: 1rem; line-height: 1.75; }
  .prose > h2 { margin-block-start: 1.9rem; }
  .prose hr { margin-block: 1.5rem; }
}

@media (max-width: 420px) {
  .hero-cta .btn { width: 100%; }
  .specs-table tbody th { width: 40%; }
  .specs-table th, .specs-table td { padding: 0.6rem 0.75rem; }
}

@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;
    scroll-behavior: auto !important;
  }
  body::before,
  .hero::before,
  .hero::after,
  .prose > *,
  .prose hr,
  .prose h2,
  .prose h3,
  .blog-article .entity-hero img,
  .entity-article .entity-hero img,
  .drawer.open .drawer-nav li,
  .blog-article .page-head h1::after,
  .entity-article .page-head h1::after,
  .blog-article .page-head .meta span[aria-hidden="true"],
  .entity-article .page-head .meta span[aria-hidden="true"],
  :focus-visible,
  .fab {
    animation: none !important;
  }
  .card, .card-media img, .icon-btn, .btn::after, .related-list a,
  .prose a, .prose h2, .prose h3, .faq-item::details-content,
  .specs-table tbody tr, .breadcrumbs i, .desktop-nav a::after,
  .prose li, .prose li::marker, .prose blockquote {
    transition: none !important;
  }
  .prose > * { opacity: 1 !important; transform: none !important; }
  .prose hr { opacity: 1 !important; transform: none !important; }
  .blog-article .entity-hero img,
  .entity-article .entity-hero img { transform: none !important; filter: none !important; }
}