/*
Theme Name: DBMug
Theme URI: https://dbmug.ir
Author: ژابیز
Description: تم اختصاصی سایت معرفی DBMug — پایش، بکاپ و بازیابی SQL Server. راست‌چین، فارسی، سبک و بدون وابستگی به صفحه‌ساز. خواهرخوانده‌ی قالب BugMug.
Version: 1.0.2
License: GPL-2.0-or-later
Text Domain: dbmug
*/

/*
IRAN Sans-serif fonts are considered a proprietary software. To gain information about the laws regarding the use of these fonts, please visit www.fontiran.com
--------------------------------------------------------------------------------------
This set of fonts are used in this project under the license: (KBMJU7GR)
--------------------------------------------------------------------------------------
*/

/* Narengi Pro — self-hosted, same licence and same variable build as the
   BugMug site: one 188KB file covering weights 100-900. Not the FaNum cut:
   that one draws Latin 0-9 with Persian glyphs, which would turn version
   numbers, IPs and T-SQL in the articles into Persian digits. Licence details
   in assets/fonts/FontLicense.txt. */
@font-face {
  font-family: "Narengi";
  src: url("assets/fonts/NarengiVF.woff2") format("woff2-variations"),
       url("assets/fonts/NarengiVF.woff2") format("woff2"),
       url("assets/fonts/NarengiVF.woff")  format("woff");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #262A33;
  --ink-2: #333846;
  --accent: #FF6B4A;
  --accent-dark: #e15535;
  /* Status colours, used only for health signals (pills, alert card). The
     family colour stays coral; a green brand accent would read as a second
     brand next to BugMug. */
  --ok: #2A9457;
  --warn: #B98300;
  --crit: #C92A5E;
  --bg: #ffffff;
  --bg-soft: #f6f6f9;
  --line: #e7e7ee;
  --text: #2b2f38;
  --muted: #71767f;
  --radius: 14px;
  --maxw: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Narengi, Vazirmatn, IRANSans, Tahoma, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.85;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.accent { color: var(--accent); }

/* Latin identifiers inside Persian prose: object names, DMVs, file paths.
   Without an isolated LTR run, the bidi algorithm moves a trailing dot or
   parenthesis to the wrong side of "sys.dm_os_wait_stats". */
.ltr, code, .mono { direction: ltr; unicode-bidi: isolate; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: #fff; border: none;
  padding: 11px 22px; border-radius: 999px; font-size: 15px; font-weight: 500;
  line-height: 1; cursor: pointer; transition: filter .15s, transform .15s; font-family: inherit;
}
.btn.sm { padding: 9px 18px; font-size: 14px; }
.btn.lg { padding: 14px 30px; font-size: 16px; }
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn.ghost { background: transparent; border: 1px solid rgba(255,255,255,.35); }
.btn.dark { background: var(--ink); }
.btn.outline { background: #fff; color: var(--ink); border: 1px solid var(--line); }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.9); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 20px; height: 64px; }
/* direction:ltr so "DBMug" is not reordered into "MugDB" — the exact bug the
   dashboard header carried for a week. */
.brand { display: flex; align-items: center; gap: 9px; font-size: 19px; font-weight: 700; color: var(--ink); direction: ltr; }
.brand .accent { color: var(--accent); }
.nav .links { display: flex; gap: 26px; margin-inline-start: 18px; }
.nav .links a { color: var(--ink-2); font-size: 14px; font-weight: 500; }
.nav .links a:hover { color: var(--accent); }
.nav .spacer { margin-inline-start: auto; }
.nav .cta { display: flex; gap: 12px; align-items: center; }
.nav .cta a.login { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.nav .cta a.login:hover { color: var(--accent); }
@media (max-width: 860px){ .nav .links { display: none; } }

/* hero */
.hero { background: var(--ink); color: #fff; padding: 84px 0 96px; position: relative; overflow: hidden; }
.hero h1 { font-size: 46px; line-height: 1.35; margin: 0 0 18px; font-weight: 700; }
.hero h1 .accent { color: var(--accent); }
.hero p.lead { font-size: 19px; color: #c7cad2; max-width: 640px; margin: 0 0 30px; }
.hero .cta-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.hero .note { color: #8f95a3; font-size: 14px; margin: 16px 0 0; }
.hero .grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; }
@media (max-width: 900px){ .hero .grid { grid-template-columns: 1fr; } .hero h1 { font-size: 33px; } }

/* Alert card — what a message from DBMug actually looks like, shown instead of
   a code sample. This product is not installed with a script tag, and a fake
   snippet would promise an integration that does not exist. */
.phone { background: #1b1e26; border: 1px solid #333846; border-radius: 20px; padding: 20px; box-shadow: 0 20px 50px rgba(0,0,0,.35); }
.phone .bar { display: flex; align-items: center; gap: 8px; color: #8f95a3; font-size: 12.5px; margin-bottom: 14px; }
.phone .bar .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--crit); }
.sms { background: #23262f; border-radius: 14px 14px 14px 4px; padding: 14px 16px; color: #e6e6ea; font-size: 14.5px; line-height: 1.95; }
.sms + .sms { margin-top: 10px; }
.sms .tag { color: var(--accent); font-weight: 700; }
.sms .ok { color: #7bd39a; font-weight: 700; }
.sms .num { direction: ltr; unicode-bidi: isolate; }
.phone .time { color: #6b7180; font-size: 11.5px; margin-top: 8px; text-align: left; direction: ltr; }

/* sections */
section { padding: 84px 0; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 52px; }
.section-head .kicker { color: var(--accent); font-weight: 500; font-size: 14px; letter-spacing: .5px; }
.section-head h2 { font-size: 34px; margin: 8px 0 12px; color: var(--ink); font-weight: 700; }
.section-head p { color: var(--muted); font-size: 17px; margin: 0; }
.soft { background: var(--bg-soft); }

/* feature grid */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 900px){ .features { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 600px){ .features { grid-template-columns: 1fr; } }
.feature { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; transition: box-shadow .18s, transform .18s; }
.feature:hover { box-shadow: 0 14px 40px rgba(38,42,51,.08); transform: translateY(-3px); }
.feature .ico { width: 46px; height: 46px; border-radius: 12px; background: #fff0eb; color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 16px; }
.feature h3 { margin: 0 0 8px; font-size: 18px; color: var(--ink); font-weight: 700; }
.feature p { margin: 0; color: var(--muted); font-size: 15px; }

/* steps */
.steps { display: grid; grid-template-columns: repeat(3,1fr); gap: 22px; }
@media (max-width: 780px){ .steps { grid-template-columns: 1fr; } }
.step { position: relative; padding: 26px; border: 1px dashed var(--line); border-radius: var(--radius); }
.step .num { width: 38px; height: 38px; border-radius: 50%; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; margin-bottom: 14px; }
.step h3 { margin: 0 0 6px; color: var(--ink); font-size: 17px; }
.step p { margin: 0; color: var(--muted); font-size: 15px; }

/* deployment models — hosted vs on-premise, side by side */
.models { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
@media (max-width: 820px){ .models { grid-template-columns: 1fr; } }
.model { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 26px; display: flex; flex-direction: column; }
.model.pick { border-color: var(--accent); box-shadow: 0 16px 44px rgba(255,107,74,.15); position: relative; }
.model.pick .tag { position: absolute; top: -13px; inset-inline-start: 26px; background: var(--accent); color: #fff; font-size: 12px; padding: 4px 12px; border-radius: 999px; }
.model h3 { margin: 0 0 4px; font-size: 21px; color: var(--ink); }
.model .who { color: var(--muted); font-size: 14.5px; margin: 0 0 16px; }
.model ul { list-style: none; padding: 0; margin: 0 0 22px; flex: 1; }
.model li { padding: 7px 0; color: var(--text); font-size: 15px; display: flex; gap: 8px; align-items: flex-start; }
.model li::before { content: "✓"; color: var(--accent); font-weight: 700; }
.model li.no::before { content: "—"; color: var(--muted); }
.model .btn { width: 100%; justify-content: center; }

/* Quote request instead of a price table: terms are agreed per customer. */
.quote { max-width: 760px; margin: 0 auto; text-align: center; }
.quote .rows { text-align: start; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 26px; margin-top: 26px; }
.quote .rows div { padding: 11px 0; border-bottom: 1px dashed var(--line); font-size: 15px; }
.quote .rows div:last-child { border-bottom: none; }
.quote .rows b { color: var(--ink); }

/* CTA band */
.cta-band { background: var(--ink); color: #fff; text-align: center; border-radius: 24px; padding: 60px 30px; }
.cta-band h2 { font-size: 32px; margin: 0 0 12px; }
.cta-band p { color: #c7cad2; margin: 0 0 26px; font-size: 17px; }

/* FAQ */
.faq-list { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.faq-item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 22px; }
.faq-item summary {
  cursor: pointer; font-size: 16px; font-weight: 500; color: var(--ink);
  padding: 14px 0; list-style: none; position: relative; padding-inline-end: 28px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; position: absolute; inset-inline-end: 2px; top: 50%;
  transform: translateY(-50%); color: var(--accent); font-size: 22px; font-weight: 400;
}
.faq-item[open] summary::after { content: "−"; }
.faq-item p { margin: 0 0 16px; color: var(--muted); font-size: 15px; }

/* footer */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0; color: var(--muted); font-size: 14px; }
.site-footer .row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.site-footer .spacer { margin-inline-start: auto; }
.site-footer a:hover { color: var(--accent); }

/* generic page */
.page-wrap { max-width: 820px; margin: 0 auto; padding: 60px 20px; }
.page-wrap h1 { color: var(--ink); }
.page-wrap img { border-radius: var(--radius); }

/* blog listing */
.blog-wrap { max-width: var(--maxw); margin: 0 auto; padding: 56px 20px 80px; }
.blog-head { text-align: center; margin-bottom: 44px; }
.blog-head h1 { color: var(--ink); font-size: 34px; margin: 0 0 8px; }
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 900px){ .post-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 600px){ .post-grid { grid-template-columns: 1fr; } }
.post-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .18s, transform .18s; }
.post-card:hover { box-shadow: 0 14px 40px rgba(38,42,51,.08); transform: translateY(-3px); }
.post-card .thumb img { width: 100%; height: 180px; object-fit: cover; display: block; }
.post-card .body { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.post-card h2 { font-size: 18px; margin: 6px 0 8px; color: var(--ink); line-height: 1.6; }
.post-card h2 a:hover { color: var(--accent); }
.post-card p { color: var(--muted); font-size: 14px; margin: 0 0 14px; flex: 1; }
.readmore { color: var(--accent); font-weight: 500; font-size: 14px; }
.post-meta { color: var(--muted); font-size: 13px; }
.post-meta .by { color: var(--ink-2); font-weight: 500; }

/* single post */
.post-wrap { max-width: 760px; margin: 0 auto; padding: 40px 20px 80px; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 18px; display: flex; gap: 8px; flex-wrap: wrap; }
.crumb a:hover { color: var(--accent); }
.post-title { color: var(--ink); font-size: 34px; line-height: 1.5; margin: 0 0 12px; }
.post-hero img { width: 100%; border-radius: var(--radius); margin: 22px 0; }
.prose { font-size: 17px; line-height: 2.1; color: var(--text); }
.prose h2 { color: var(--ink); font-size: 24px; margin: 38px 0 12px; }
.prose h3 { color: var(--ink); font-size: 19px; margin: 28px 0 10px; }
.prose p { margin: 0 0 18px; }
.prose ul, .prose ol { margin: 0 0 18px; padding-inline-start: 24px; }
.prose li { margin: 6px 0; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose blockquote { border-inline-start: 3px solid var(--accent); background: var(--bg-soft); margin: 22px 0; padding: 12px 18px; border-radius: 0 var(--radius) var(--radius) 0; color: var(--ink-2); }
.prose code { background: var(--bg-soft); padding: 2px 7px; border-radius: 6px; font-size: 14px; direction: ltr; display: inline-block; unicode-bidi: isolate; }
/* T-SQL is the bulk of the code here and it is wide; a tighter line-height
   keeps a 20-line query on one screen. */
.prose pre {
  background: #1b1e26; color: #e6e6ea; padding: 16px 18px; border-radius: var(--radius);
  overflow-x: auto; direction: ltr; text-align: left;
  font-size: 13.5px; line-height: 1.75;
  font-family: "Cascadia Mono", Consolas, "Courier New", monospace;
}
.prose pre code { background: none; padding: 0; display: inline; font-size: inherit; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 22px; font-size: 15px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 9px 12px; text-align: start; }
.prose th { background: var(--bg-soft); color: var(--ink); font-weight: 600; }
.post-cta { margin-top: 48px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; text-align: center; }
.post-cta h3 { color: var(--ink); margin: 0 0 8px; font-size: 20px; }
.post-cta p { color: var(--muted); margin: 0 0 18px; }
.pager { margin-top: 40px; text-align: center; }
.pager .page-numbers { display: inline-block; padding: 8px 13px; margin: 0 3px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink-2); }
.pager .page-numbers.current { background: var(--accent); color: #fff; border-color: var(--accent); }

/* author box — these articles are signed, so the byline gets a real block */
.author-box { margin-top: 44px; display: flex; gap: 16px; align-items: flex-start; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.author-box .av { width: 54px; height: 54px; border-radius: 50%; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; flex: none; }
.author-box .who { font-size: 16px; font-weight: 600; color: var(--ink); margin: 0 0 4px; }
.author-box p { margin: 0; color: var(--muted); font-size: 14.5px; }

/* ---------------------------------------------------------------------------
 * Topic-cluster components: pillar link, hub list, related posts, TOC.
 * Same structure as the BugMug site — these carry the internal link graph the
 * content plan depends on, so they are styled to be noticed.
 * ------------------------------------------------------------------------- */
.cluster-pillar {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  background: #fff6f3; border: 1px solid #ffd9cd; border-right: 3px solid var(--accent);
  border-radius: 0 10px 10px 0; padding: 13px 16px; margin: 20px 0 26px;
}
.cluster-pillar .lbl { font-size: 12px; color: var(--muted); }
.cluster-pillar a { font-weight: 600; color: var(--ink); font-size: 15px; }
.cluster-pillar a:hover { color: var(--accent); }

.cluster-hub { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin: 34px 0; background: var(--bg-soft); }
.cluster-hub h2 { font-size: 19px; margin: 0 0 14px; color: var(--ink); }
.cluster-hub ul { margin: 0; padding: 0; list-style: none; columns: 2; column-gap: 28px; }
@media (max-width: 640px) { .cluster-hub ul { columns: 1; } }
.cluster-hub li { break-inside: avoid; margin-bottom: 9px; font-size: 14px; line-height: 1.6; }
.cluster-hub a { color: var(--ink-2); }
.cluster-hub a:hover { color: var(--accent); }

.toc { border: 1px solid var(--line); border-radius: 12px; background: var(--bg-soft); padding: 14px 18px; margin: 0 0 28px; }
.toc > summary { cursor: pointer; font-weight: 600; font-size: 14.5px; color: var(--ink); list-style: none; }
.toc > summary::-webkit-details-marker { display: none; }
.toc > summary::before { content: '\2630'; margin-left: 8px; color: var(--accent); }
.toc ol { margin: 12px 0 2px; padding-inline-start: 20px; }
.toc li { margin-bottom: 6px; font-size: 14px; line-height: 1.6; }
.toc li.lvl-3 { margin-inline-start: 16px; font-size: 13.5px; list-style-type: circle; }
.toc a { color: var(--ink-2); }
.toc a:hover { color: var(--accent); }

.related { margin-top: 44px; padding-top: 30px; border-top: 1px solid var(--line); }
.related h2 { font-size: 20px; margin: 0 0 18px; color: var(--ink); }
.related-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 640px) { .related-grid { grid-template-columns: 1fr; } }
.related-card {
  display: flex; flex-direction: column; gap: 7px;
  border: 1px solid var(--line); border-radius: 12px; padding: 15px 17px; background: #fff;
  transition: border-color .15s, transform .15s;
}
.related-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.related-card .rc-cat { font-size: 11.5px; color: var(--accent); font-weight: 500; }
.related-card .rc-title { font-size: 14.5px; font-weight: 600; color: var(--ink); line-height: 1.55; }
.related-card .rc-time { font-size: 12px; color: var(--muted); }

.post-tags { margin-top: 26px; display: flex; gap: 8px; flex-wrap: wrap; }
.post-tags a { font-size: 12.5px; color: var(--ink-2); background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; }
.post-tags a:hover { color: var(--accent); border-color: var(--accent); }

/* a TOC jump must not hide the heading under the sticky header */
.prose h2, .prose h3 { scroll-margin-top: 90px; }
