/* سایتِ عمومیِ پلی‌گرام — بدونِ هیچ منبعِ بیرونی، تا صفحه بی‌اینترنتِ آزاد هم کامل باز شود. */

@font-face {
  font-family: 'IRANSans';
  src: url('fonts/IRANSansWeb.woff') format('woff');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'IRANSans';
  src: url('fonts/IRANSansWeb_Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg:        #f6f7f9;
  --surface:   #ffffff;
  --border:    #e3e6ea;
  --text:      #1b1f24;
  --muted:     #5b6471;
  --brand:     #1f6feb;
  --brand-dim: #e8f0fe;
  --warn-bg:   #fff6e5;
  --warn-brd:  #e8c074;
  --radius:    14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #14171c;
    --surface:   #1c2026;
    --border:    #2c323a;
    --text:      #e7eaee;
    --muted:     #a0a9b6;
    --brand:     #6ea8ff;
    --brand-dim: #1d2a3f;
    --warn-bg:   #2e2616;
    --warn-brd:  #6b5526;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'IRANSans', Tahoma, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.95;
  direction: rtl;
}

/* ── سربرگ ── */
.top {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.top-in {
  max-width: 1000px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}
.logo {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text);
  text-decoration: none;
  margin-inline-end: auto;
}
.logo span { color: var(--brand); }

nav { display: flex; flex-wrap: wrap; gap: 4px; }
nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 7px 12px;
  border-radius: 9px;
  font-size: 0.93rem;
  white-space: nowrap;
}
nav a:hover { background: var(--brand-dim); color: var(--brand); }
nav a[aria-current='page'] { background: var(--brand-dim); color: var(--brand); font-weight: 700; }

/* ── بدنه ── */
main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 28px 20px 56px;
}

h1 {
  font-size: 1.8rem;
  line-height: 1.5;
  margin: 10px 0 6px;
}
h2 {
  font-size: 1.22rem;
  margin: 34px 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
h3 { font-size: 1.04rem; margin: 22px 0 6px; }

.lead { color: var(--muted); font-size: 1.04rem; margin: 0 0 8px; }

p { margin: 10px 0; }
ul, ol { margin: 10px 0; padding-inline-start: 24px; }
li { margin: 5px 0; }

a { color: var(--brand); }

code, .num {
  font-family: 'IRANSans', Tahoma, monospace;
  background: var(--brand-dim);
  padding: 1px 7px;
  border-radius: 6px;
  font-size: 0.95em;
  direction: ltr;
  display: inline-block;
  unicode-bidi: embed;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin: 16px 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin: 18px 0;
}
.grid .card { margin: 0; }
.grid h3 { margin-top: 0; }
.grid p { color: var(--muted); font-size: 0.95rem; margin-bottom: 0; }

.note {
  background: var(--warn-bg);
  border: 1px solid var(--warn-brd);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 18px 0;
}
.note p:first-child { margin-top: 0; }
.note p:last-child { margin-bottom: 0; }

.todo {
  background: var(--warn-bg);
  border: 1px dashed var(--warn-brd);
  border-radius: 8px;
  padding: 2px 10px;
  font-weight: 700;
}

/* ── جدول ── */
.table-wrap { overflow-x: auto; margin: 18px 0; }
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-width: 540px;
}
th, td {
  padding: 13px 14px;
  text-align: right;
  border-bottom: 1px solid var(--border);
}
th { background: var(--brand-dim); font-weight: 700; font-size: 0.95rem; }
tr:last-child td { border-bottom: none; }
td.c, th.c { text-align: center; }
.badge {
  background: var(--brand);
  color: #fff;
  border-radius: 20px;
  padding: 2px 11px;
  font-size: 0.8rem;
  white-space: nowrap;
}

/* ── فهرستِ تماس ── */
dl.contact { margin: 0; }
dl.contact div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
dl.contact div:last-child { border-bottom: none; }
dl.contact dt { color: var(--muted); min-width: 170px; }
dl.contact dd { margin: 0; font-weight: 700; }

/* ── پانویس ── */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}
.foot-in {
  max-width: 1000px;
  margin: 0 auto;
  padding: 26px 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.foot-in h4 { margin: 0 0 8px; color: var(--text); font-size: 0.97rem; }
.foot-in ul { list-style: none; padding: 0; margin: 0; }
.foot-in a { color: var(--muted); text-decoration: none; }
.foot-in a:hover { color: var(--brand); }
.badges { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.copy {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 14px 20px;
  font-size: 0.86rem;
}

@media (max-width: 560px) {
  h1 { font-size: 1.45rem; }
  main { padding: 20px 16px 44px; }
  .card { padding: 16px; }
}
