/*
Theme Name: Wokr Mag
Description: مجلهٔ وکر — the wokr.ai marketing design (dark espresso band, cream body, gold accents, Vazirmatn) as a WordPress theme. Faithful port of the Next.js /mag pages; the design tokens and lp-* classes mirror frontend/app/globals.css.
Version: 1.0.0
Author: Wokr
Text Domain: wokr-mag
*/

/* ── font: Vazirmatn variable (bundled — fonts/Vazirmatn[wght].woff2) ────── */
@font-face {
  font-family: "Vazirmatn";
  src: url("fonts/Vazirmatn-var.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
}

/* ── design tokens (mirrors frontend/app/globals.css) ────────────────────── */
:root {
  --nx: #17120e;
  --nx-2: #1f1813;
  --nx-line: #332a22;
  --nx-text: #f6efe6;
  --nx-soft: #b3a596;

  --lp-bg: #fbf8f3;
  --lp-bg-2: #f5efe5;
  --lp-card: #ffffff;
  --lp-line: #ebe2d5;
  --lp-ink: #1e1813;
  --lp-soft: #6d6358;

  --gold: #e0940e;
  --gold-2: #f5c453;
  --gold-deep: #9a5c07;

  --lp-r-sm: 12px;
  --lp-r: 18px;
  --lp-r-lg: 26px;

  --lp-shadow: 0 1px 2px rgba(30,24,19,.04), 0 8px 24px -12px rgba(30,24,19,.14);
  --lp-shadow-lg: 0 2px 4px rgba(30,24,19,.05), 0 40px 80px -40px rgba(30,24,19,.35);
  --lp-glow: 0 30px 90px -40px rgba(224,148,14,.55);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Vazirmatn", system-ui, sans-serif;
  background: var(--lp-bg);
  color: var(--lp-ink);
  overflow-x: hidden;
  min-height: 100vh;
}
img { max-width: 100%; height: auto; }

/* container (= shellWrap) */
.wokr-wrap { max-width: 1160px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 44px); }

/* ── grain / aurora / gradient word ──────────────────────────────────────── */
.lp-grain { position: relative; }
.lp-grain::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}
.lp-grad {
  background: linear-gradient(100deg, var(--gold-2), var(--gold) 55%, var(--gold-deep));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lp-aurora { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.lp-aurora::before,
.lp-aurora::after { content: ""; position: absolute; border-radius: 50%; filter: blur(70px); }
.lp-aurora::before {
  width: 46vw; height: 46vw; min-width: 340px; min-height: 340px;
  top: -14vw; inset-inline-end: -10vw;
  background: radial-gradient(closest-side, rgba(224,148,14,.30), transparent 70%);
}
.lp-aurora::after {
  width: 38vw; height: 38vw; min-width: 280px; min-height: 280px;
  bottom: -16vw; inset-inline-start: -8vw;
  background: radial-gradient(closest-side, rgba(245,196,83,.20), transparent 70%);
}
@media (prefers-reduced-motion: no-preference) {
  .lp-aurora::before { animation: lpDrift1 26s ease-in-out infinite alternate; }
  .lp-aurora::after  { animation: lpDrift2 32s ease-in-out infinite alternate; }
}
@keyframes lpDrift1 { to { transform: translate3d(-6%, 7%, 0) scale(1.12); } }
@keyframes lpDrift2 { to { transform: translate3d(7%, -6%, 0) scale(1.08); } }
.lp-aurora-soft { inset: 0 0 auto 0; height: 70vh; }
.lp-aurora-soft::before { background: radial-gradient(closest-side, rgba(224,148,14,.16), transparent 70%); }
.lp-aurora-soft::after  { background: radial-gradient(closest-side, rgba(224,148,14,.10), transparent 70%); }

/* ── nav ─────────────────────────────────────────────────────────────────── */
.lp-nav {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--nx) 72%, transparent);
  backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.lp-nav-row { display: flex; align-items: center; gap: 16px; height: 70px; }
.lp-navlink { font-size: 14.5px; font-weight: 600; color: var(--nx-soft); text-decoration: none; transition: color .18s; }
.lp-navlink:hover { color: var(--nx-text); }
.lp-navlink.is-active { color: var(--gold-2); }
.wokr-brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--nx-text); }
.wokr-brand b { font-weight: 900; font-size: 21px; letter-spacing: -.01em; }
/* the mark is the khatam SVG (wokr_mark_svg in functions.php) — per the brand
   guideline a letter tile may never stand in for it */
.wokr-mark { width: 32px; height: 32px; display: block; flex: none; }
.wokr-mark-sm { width: 28px; height: 28px; }
.lp-spacer { flex: 1; }
@media (max-width: 860px) { .lp-hide-sm { display: none !important; } }

/* ── buttons / pills ─────────────────────────────────────────────────────── */
.lp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 800; text-decoration: none; cursor: pointer;
  border-radius: 14px; padding: 14px 26px; font-size: 15.5px; border: 1px solid transparent;
  transition: transform .18s cubic-bezier(.2,.7,.3,1), box-shadow .18s, background .18s, border-color .18s;
}
.lp-btn:active { transform: translateY(1px); }
.lp-btn-gold { background: linear-gradient(160deg, var(--gold-2), var(--gold)); color: #241a08; box-shadow: var(--lp-glow); }
.lp-btn-gold:hover { box-shadow: 0 22px 60px -26px rgba(224,148,14,.75); }
.lp-btn-sm { padding: 10px 18px; font-size: 14px; border-radius: 12px; }
.lp-pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .01em;
  color: var(--gold-2); background: rgba(224,148,14,.1);
  border: 1px solid rgba(224,148,14,.28); border-radius: 999px; padding: 7px 15px;
}
.lp-pill-light { color: var(--gold-deep); background: rgba(224,148,14,.09); border-color: rgba(224,148,14,.3); }
a.lp-pill-light { text-decoration: none; }
.lp-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--gold); flex: none; }
.lp-rule { height: 2px; width: 54px; margin: 14px auto 0; border-radius: 2px;
  background: linear-gradient(90deg, var(--gold-2), var(--gold-deep)); }

/* ── hero (dark band) ────────────────────────────────────────────────────── */
.wokr-dark { position: relative; background: var(--nx); color: var(--nx-text); }
.wokr-hero { text-align: center; padding-top: clamp(44px, 6vw, 84px); padding-bottom: clamp(36px, 5vw, 64px); position: relative; }
.wokr-hero h1 {
  font-size: clamp(30px, 5vw, 52px); font-weight: 900; line-height: 1.16;
  letter-spacing: -.015em; margin: 20px auto 0; max-width: 22ch; text-wrap: balance;
}
.wokr-hero .wokr-sub {
  font-size: clamp(15.5px, 1.9vw, 18.5px); line-height: 1.95; color: var(--nx-soft);
  margin: 18px auto 0; max-width: 58ch;
}
@media (prefers-reduced-motion: no-preference) {
  .lp-in { animation: lpIn .6s cubic-bezier(.2,.7,.3,1) both; }
  .lp-in-1 { animation-delay: .06s; }
  .lp-in-2 { animation-delay: .12s; }
}
@keyframes lpIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ── light body / sections / cards ───────────────────────────────────────── */
.wokr-main { position: relative; }
.wokr-section { padding: clamp(48px, 6.5vw, 88px) 0; position: relative; }
.wokr-section-head { text-align: center; max-width: 660px; margin: 0 auto clamp(30px, 4vw, 46px); }
.wokr-section-head h2 { font-size: clamp(24px, 3.4vw, 38px); font-weight: 900; margin: 0; letter-spacing: -.015em; text-wrap: balance; }

.wokr-card {
  background: var(--lp-card); border: 1px solid var(--lp-line);
  border-radius: var(--lp-r); padding: 22px; box-shadow: var(--lp-shadow);
}
.lp-lift { transition: transform .22s cubic-bezier(.2,.7,.3,1), box-shadow .22s, border-color .22s; }
@media (hover: hover) {
  .lp-lift:hover { transform: translateY(-4px); box-shadow: var(--lp-shadow-lg); border-color: color-mix(in srgb, var(--gold) 45%, var(--lp-line)); }
}

.mag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.mag-grid a.mag-card-link { text-decoration: none; color: inherit; display: flex; }
.mag-card { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.mag-card .mag-thumb { margin: -22px -22px 6px; }
.mag-card .mag-thumb img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; border-radius: var(--lp-r) var(--lp-r) 0 0; }
.mag-card .mag-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.mag-card .lp-pill-light { font-size: 12px; }
.mag-card h3 { font-size: 18.5px; font-weight: 800; margin: 0; line-height: 1.6; }
.mag-card .mag-desc { font-size: 14.5px; line-height: 1.9; color: var(--lp-soft); margin: 0; flex: 1; }
.mag-card .mag-meta { display: flex; gap: 10px; font-size: 12.5px; color: var(--lp-soft); }

/* pagination */
.wokr-pagination { display: flex; justify-content: center; margin-top: 34px; }
.wokr-pagination .nav-links { display: flex; gap: 8px; flex-wrap: wrap; }
.wokr-pagination a, .wokr-pagination span.current, .wokr-pagination span.dots {
  display: inline-flex; min-width: 38px; height: 38px; align-items: center; justify-content: center;
  padding: 0 12px; border-radius: 12px; border: 1px solid var(--lp-line); background: var(--lp-card);
  color: var(--lp-ink); text-decoration: none; font-size: 14px; font-weight: 700;
}
.wokr-pagination span.current { background: linear-gradient(160deg, var(--gold-2), var(--gold)); color: #241a08; border-color: transparent; }

/* ── single article ──────────────────────────────────────────────────────── */
.mag-article-wrap { max-width: 820px; margin: 0 auto; padding: 40px clamp(20px, 4vw, 44px) 24px; }
.mag-meta-row {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  margin-bottom: 26px; font-size: 13.5px; color: var(--lp-soft);
}
.mag-meta-row .lp-spacer { flex: 1; }
.mag-meta-row .lp-pill-light { font-size: 12px; }

.mag-cta { margin-top: 44px; text-align: center; padding: 30px 24px; }
.mag-cta h2 { font-size: 21px; font-weight: 900; margin: 0; }
.mag-cta p { color: var(--lp-soft); font-size: 14.5px; line-height: 1.9; margin: 10px 0 18px; }

.mag-pillars { margin-bottom: clamp(34px, 5vw, 54px); }
.mag-related { margin-top: 46px; }
.mag-related h2 { font-size: 19px; font-weight: 900; margin: 0 0 16px; }
.mag-related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.mag-related-grid a { text-decoration: none; color: inherit; display: flex; }
.mag-related-grid h3 { font-size: 15.5px; font-weight: 800; margin: 0; line-height: 1.7; }
.mag-related-grid .mag-meta { font-size: 12.5px; color: var(--lp-soft); margin-top: 8px; }

/* ── article typography (= .mag-body from globals.css, + Gutenberg bits) ── */
.mag-body { font-size: 16.5px; line-height: 2.05; color: var(--lp-ink); }
.mag-body p { margin: 0 0 1.15em; }
.mag-body h2 { font-size: clamp(21px, 2.6vw, 26px); font-weight: 900; letter-spacing: -.01em; margin: 2em 0 .7em; }
.mag-body h3 { font-size: clamp(17.5px, 2.1vw, 20px); font-weight: 800; margin: 1.7em 0 .55em; }
.mag-body ul, .mag-body ol { margin: 0 0 1.15em; padding-inline-start: 1.4em; }
.mag-body li { margin: .35em 0; }
.mag-body a { color: var(--gold-deep); text-decoration: underline; text-underline-offset: 4px; }
.mag-body a:hover { color: var(--gold); }
.mag-body strong { font-weight: 800; }
.mag-body blockquote { margin: 1.4em 0; padding: 14px 18px; border-inline-start: 3px solid var(--gold);
  background: var(--lp-bg-2); border-radius: 10px; color: var(--lp-soft); }
.mag-body blockquote p:last-child { margin-bottom: 0; }
.mag-body hr { border: none; border-top: 1px solid var(--lp-line); margin: 2.2em 0; }
.mag-body code { font-size: .88em; background: var(--lp-bg-2); border: 1px solid var(--lp-line);
  border-radius: 6px; padding: 2px 7px; direction: ltr; unicode-bidi: embed; }
.mag-body pre { background: var(--nx); color: var(--nx-text); border-radius: 12px; padding: 16px 18px;
  overflow-x: auto; direction: ltr; margin: 0 0 1.3em; }
.mag-body pre code { background: none; border: none; padding: 0; color: inherit; }
.mag-body figure { margin: 0 0 1.3em; }

/* tables render as cards: dark header band, zebra rows, no raw browser look */
.mag-body .wp-block-table {
  overflow-x: auto;
  margin: 1.6em 0;
  border: 1px solid var(--lp-line);
  border-radius: var(--lp-r-sm);
  box-shadow: var(--lp-shadow);
  background: var(--lp-card);
}
.mag-body table { width: 100%; border-collapse: collapse; margin: 0; font-size: 14.5px; line-height: 1.9; }
.mag-body th, .mag-body td { padding: 11px 15px; text-align: right; vertical-align: top; border: none; }
.mag-body thead th {
  background: var(--nx);
  color: var(--nx-text);
  font-weight: 800;
  font-size: 13.5px;
  white-space: nowrap;
}
.mag-body tbody tr:nth-child(even) { background: var(--lp-bg-2); }
.mag-body tbody td { border-top: 1px solid var(--lp-line); }
.mag-body tbody td:first-child { font-weight: 700; }
.mag-body figcaption { font-size: 12.5px; color: var(--lp-soft); padding: 8px 15px 10px; text-align: right; }
.mag-body img { max-width: 100%; border-radius: 12px; }

/* ── فهرست مطالب (easy-table-of-contents) — the plugin ships an unstyled box
   with an ENGLISH "Table of Contents" title; the theme owns its whole look ── */
.mag-body #ez-toc-container, #ez-toc-container {
  float: none;
  width: 100%;
  margin: 1.8em 0;
  padding: 18px 20px 14px;
  background: var(--lp-bg-2);
  border: 1px solid var(--lp-line);
  border-inline-start: 3px solid var(--gold);
  border-radius: var(--lp-r-sm);
  box-shadow: none;
  font-size: 14px;
}
/* hide the plugin's own (English) title, print ours */
#ez-toc-container .ez-toc-title-container { display: none; }
#ez-toc-container::before {
  content: "فهرست مطالب";
  display: block;
  font-weight: 900;
  font-size: 15px;
  color: var(--lp-ink);
  margin-bottom: 10px;
}
#ez-toc-container nav ul, #ez-toc-container ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
#ez-toc-container nav ul li, #ez-toc-container ul li { margin: 7px 0; line-height: 1.9; }
#ez-toc-container ul ul { padding-inline-start: 18px; }
#ez-toc-container ul ul li { font-size: 13px; }
#ez-toc-container a {
  color: var(--gold-deep);
  text-decoration: none;
}
#ez-toc-container a:hover { color: var(--gold); text-decoration: underline; text-underline-offset: 4px; }

/* ── footer ──────────────────────────────────────────────────────────────── */
.wokr-footer-row { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; padding: 28px 0 10px; position: relative; }
.wokr-footer-tag { display: flex; align-items: center; gap: 11px; font-size: 13.5px; color: var(--nx-soft); }
.wokr-footer-links { display: flex; gap: 22px; flex-wrap: wrap; }
.wokr-footer-copy { padding-bottom: 26px; font-size: 12.5px; color: var(--nx-soft); position: relative; }

/* keep the admin bar from breaking the sticky nav */
body.admin-bar .lp-nav { top: 32px; }
@media (max-width: 782px) { body.admin-bar .lp-nav { top: 46px; } }
