/* ===========================================================================
   Borjino — shared stylesheet for static (crawlable) content pages.
   Reuses the landing's brand palette (indigo → violet) and the Persian
   Yekan Bakh variable font. RTL-first, mobile responsive, no external CDNs.
   =========================================================================== */

/* ── Persian / Arabic variable font (self-hosted, same file the SPA uses) ── */
@font-face {
  font-family: 'Yekan Bakh';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/YekanBakh/Yekan%20Bakh%20Variable/webfonts/YekanBakh-VF.woff2') format('woff2-variations'),
       url('/assets/YekanBakh/Yekan%20Bakh%20Variable/webfonts/YekanBakh-VF.woff') format('woff-variations');
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+0020-007F;
}

:root {
  --primary: #4f46e5;          /* indigo-600 */
  --primary-dark: #4338ca;
  --primary-light: #a5b4fc;
  --accent: #d946ef;           /* fuchsia/violet, matches landing gradient */
  --grad: linear-gradient(135deg, #6366f1, #a855f7);
  --grad-soft: linear-gradient(135deg, rgba(99,102,241,0.10), rgba(168,85,247,0.10));

  --ink: #1e1b3a;              /* headings */
  --body: #33324a;            /* body text */
  --muted: #6b7192;
  --line: #e6e6f2;
  --bg: #ffffff;
  --bg-soft: #f6f6fc;
  --bg-card: #ffffff;
  --success: #15803d;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(30,27,58,0.05);
  --shadow-md: 0 6px 18px -6px rgba(79,70,229,0.18);
  --shadow-lg: 0 20px 45px -18px rgba(79,70,229,0.28);
  --maxw: 860px;
  --maxw-wide: 1120px;
  --font: 'Yekan Bakh', 'Segoe UI', Tahoma, -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--body);
  line-height: 1.85;
  font-size: 1.02rem;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* RTL is set via <html dir="rtl"> on each page */

a { color: var(--primary); text-decoration: none; transition: color .18s; }
a:hover { color: var(--primary-dark); text-decoration: underline; }

h1, h2, h3, h4 { color: var(--ink); line-height: 1.4; font-weight: 800; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.5rem); margin-bottom: .75rem; }
h2 { font-size: clamp(1.35rem, 3.4vw, 1.85rem); margin: 2.4rem 0 .9rem; }
h3 { font-size: clamp(1.1rem, 2.6vw, 1.35rem); margin: 1.6rem 0 .6rem; font-weight: 700; }
p { margin: 0 0 1.05rem; }
strong { color: var(--ink); font-weight: 700; }

ul, ol { margin: 0 0 1.15rem; padding-inline-start: 1.4rem; }
li { margin-bottom: .5rem; }

:focus-visible { outline: 3px solid var(--primary-light); outline-offset: 2px; border-radius: 6px; }

/* ── Layout ── */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.15rem; }
.wrap-wide { max-width: var(--maxw-wide); margin: 0 auto; padding: 0 1.15rem; }
main { padding: 2.2rem 0 3rem; }

/* ── Header ── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid var(--line);
}
.site-header .bar {
  max-width: var(--maxw-wide); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .7rem 1.15rem; min-height: 60px;
}
.brand { font-weight: 900; font-size: 1.35rem; letter-spacing: -0.03em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; }
.site-nav { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.site-nav a { color: var(--body); font-size: .92rem; font-weight: 600; }
.site-nav a:hover { color: var(--primary); text-decoration: none; }
.nav-cta {
  background: var(--grad); color: #fff !important; padding: .5rem 1.1rem;
  border-radius: 999px; font-weight: 700; box-shadow: var(--shadow-md);
}
.nav-cta:hover { text-decoration: none; filter: brightness(1.05); }
@media (max-width: 680px) {
  .site-nav { gap: .8rem; }
  .site-nav .hide-sm { display: none; }
}

/* ── Hero band ── */
.page-hero {
  background: var(--grad-soft);
  border-bottom: 1px solid var(--line);
  padding: 2.4rem 0 2rem;
}
.eyebrow {
  display: inline-block; font-size: .82rem; font-weight: 700; color: var(--primary);
  background: rgba(99,102,241,0.10); padding: .3rem .85rem; border-radius: 999px;
  margin-bottom: .9rem;
}
.lead { font-size: 1.12rem; color: var(--muted); max-width: 60ch; }

/* ── Breadcrumb ── */
.crumb { font-size: .85rem; color: var(--muted); margin-bottom: 1rem; }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--primary); }
.crumb span { margin: 0 .35rem; opacity: .6; }

/* ── Article typography ── */
article.prose { max-width: var(--maxw); }
.prose h2 { scroll-margin-top: 80px; }
.prose figure, .prose table { margin: 1.4rem 0; }
.byline { font-size: .88rem; color: var(--muted); margin-bottom: 1.6rem;
  display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.byline .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--muted); opacity: .5; }

/* ── Cards ── */
.card {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.35rem; box-shadow: var(--shadow-sm);
}
.card-grid { display: grid; gap: 1.15rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.post-card { display: flex; flex-direction: column; height: 100%; transition: transform .18s, box-shadow .18s, border-color .18s; }
a.post-card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--primary-light); }
.post-card h3 { margin: 0 0 .5rem; color: var(--ink); }
.post-card p { color: var(--muted); font-size: .94rem; margin: 0 0 1rem; }
.post-card .tag { margin-top: auto; font-size: .82rem; color: var(--primary); font-weight: 700; }

/* ── Callout / info box ── */
.callout {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-inline-start: 4px solid var(--primary); border-radius: var(--radius);
  padding: 1.1rem 1.25rem; margin: 1.5rem 0;
}
.callout p:last-child { margin-bottom: 0; }

/* ── Tables ── */
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { padding: .7rem .8rem; text-align: start; border-bottom: 1px solid var(--line); }
thead th { background: var(--bg-soft); color: var(--ink); font-weight: 700; }
tbody tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: inherit; font-weight: 700; font-size: .96rem; cursor: pointer;
  padding: .7rem 1.4rem; border-radius: 999px; border: 1px solid transparent;
  transition: filter .18s, transform .12s, box-shadow .18s;
}
.btn-primary { background: var(--grad); color: #fff; box-shadow: var(--shadow-md); }
.btn-primary:hover { filter: brightness(1.06); text-decoration: none; color: #fff; }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost { background: #fff; color: var(--primary); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--primary-light); text-decoration: none; }

/* ── FAQ (details/summary, no JS) ── */
.faq details {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: .25rem 1.1rem; margin-bottom: .75rem; background: var(--bg-card);
}
.faq summary {
  cursor: pointer; font-weight: 700; color: var(--ink); padding: .85rem 0;
  list-style: none; display: flex; justify-content: space-between; gap: 1rem; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--primary); font-size: 1.3rem; font-weight: 700; }
.faq details[open] summary::after { content: '\2212'; }
.faq details[open] summary { border-bottom: 1px solid var(--line); }
.faq details > p { padding: .9rem 0 .4rem; color: var(--body); margin: 0; }

/* ── Internal-link CTA block ── */
.link-cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); margin: 1.8rem 0; }
.link-cards a {
  display: block; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.2rem; background: var(--bg-card); box-shadow: var(--shadow-sm);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.link-cards a:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--primary-light); }
.link-cards strong { display: block; color: var(--ink); margin-bottom: .3rem; }
.link-cards span { color: var(--muted); font-size: .9rem; }

/* ── Calculator ── */
.calc { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .calc { grid-template-columns: 1fr 1fr; align-items: start; } }
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 700; color: var(--ink); margin-bottom: .4rem; font-size: .92rem; }
.field .hint { font-weight: 400; color: var(--muted); font-size: .82rem; }
input[type="number"], select {
  width: 100%; font-family: inherit; font-size: 1rem; color: var(--ink);
  padding: .65rem .8rem; border: 1px solid var(--line); border-radius: 10px; background: #fff;
  transition: border-color .18s, box-shadow .18s;
}
input[type="number"]:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.15); }
.units-table input { padding: .45rem .55rem; }
.units-table td { padding: .4rem .45rem; }
.method-methods { display: grid; gap: .6rem; }
.result-total { font-size: 1.15rem; font-weight: 800; color: var(--ink); }
.result-total b { color: var(--primary); }
.badge-ok { color: var(--success); font-weight: 700; font-size: .88rem; }

/* ── Footer ── */
.site-footer {
  background: var(--bg-soft); border-top: 1px solid var(--line);
  margin-top: 3rem; padding: 2.4rem 0 1.6rem;
}
.footer-grid { display: grid; gap: 1.8rem; grid-template-columns: 1.4fr repeat(2, 1fr); }
@media (max-width: 680px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.site-footer h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: .9rem; }
.site-footer ul { list-style: none; padding: 0; }
.site-footer li { margin-bottom: .55rem; }
.site-footer a { color: var(--body); font-size: .92rem; }
.footer-brand p { color: var(--muted); font-size: .9rem; max-width: 30ch; }
.footer-bottom { border-top: 1px solid var(--line); margin-top: 1.8rem; padding-top: 1.2rem;
  color: var(--muted); font-size: .84rem; text-align: center; }

/* ── Utilities ── */
.mt0 { margin-top: 0; }
.center { text-align: center; }
.muted { color: var(--muted); }
.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; }
