/* UVT website. One stylesheet, no external fonts or scripts. */

:root {
  --bg: #fbfbfd;
  --surface: #ffffff;
  --surface-2: #f1f3f8;
  --text: #1b1e27;
  --muted: #555b6b;
  --border: #dde1ea;
  --accent: #2f5bd3;
  --accent-text: #ffffff;
  --accent-soft: #e7edfc;
  --warn-bg: #fff6df;
  --warn-border: #e7c463;
  --code-bg: #eef0f5;
  --radius: 12px;
  --max: 64rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12141b;
    --surface: #1a1d26;
    --surface-2: #222632;
    --text: #e9ebf1;
    --muted: #a8aebd;
    --border: #333847;
    --accent: #8aa8ff;
    --accent-text: #0e1220;
    --accent-soft: #232c45;
    --warn-bg: #2d2714;
    --warn-border: #7d6828;
    --code-bg: #262a36;
  }
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
}

:lang(fa) body,
html[lang="fa"] body {
  font-family: Vazirmatn, "Noto Naskh Arabic", "Noto Sans Arabic", Tahoma, system-ui, sans-serif;
  line-height: 1.9;
}

a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

img { max-width: 100%; height: auto; }

code, kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--code-bg);
  border-radius: 5px;
  padding: 0.1em 0.35em;
  overflow-wrap: anywhere;
}
kbd { border: 1px solid var(--border); border-bottom-width: 2px; }

.skip-link {
  position: absolute;
  inset-inline-start: 0.5rem;
  top: 0.5rem;
  background: var(--surface);
  padding: 0.5rem 1rem;
  z-index: 10;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  margin-inline-end: auto;
}
.brand img { width: 28px; height: 28px; }
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a { text-decoration: none; color: var(--text); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--accent); text-decoration: underline; }
.lang-switch {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem 0.8rem;
  text-decoration: none;
  font-size: 0.95rem;
}

/* Main content */
main { padding: 2rem 0 3rem; }

h1, h2, h3 { line-height: 1.25; }
h1 { font-size: clamp(1.9rem, 5vw, 2.7rem); margin: 0 0 0.75rem; }
h2 { font-size: 1.55rem; margin: 2.75rem 0 0.75rem; }
h3 { font-size: 1.2rem; margin: 1.75rem 0 0.5rem; }

.lead { font-size: 1.2rem; color: var(--muted); max-width: 44rem; }
.muted { color: var(--muted); }
.small { font-size: 0.92rem; }

.hero {
  display: grid;
  gap: 1.5rem;
  align-items: center;
  padding: 1.5rem 0 1rem;
}
.hero-icon { width: 96px; height: 96px; }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.25rem 0; }
.btn {
  display: inline-block;
  padding: 0.7rem 1.25rem;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid var(--accent);
}
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-secondary { color: var(--accent); background: transparent; }
.btn:hover { filter: brightness(1.08); text-decoration: none; }

.cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  margin: 1rem 0;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
}
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }

.steps { counter-reset: step; list-style: none; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.steps > li {
  counter-increment: step;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}
.steps > li::before {
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

ol, ul { padding-inline-start: 1.5rem; }
li + li { margin-top: 0.3rem; }

.note {
  background: var(--accent-soft);
  border-inline-start: 4px solid var(--accent);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
}
.warn {
  background: var(--warn-bg);
  border-inline-start: 4px solid var(--warn-border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
}
.note p, .warn p { margin: 0.25rem 0; }

/* Help page layout */
.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}
.toc h2 { margin: 0 0 0.5rem; font-size: 1.15rem; }
.toc ol { columns: 2 14rem; column-gap: 2rem; margin: 0; }
.toc li { break-inside: avoid; }

section { scroll-margin-top: 1rem; }
section > h2 { padding-top: 0.5rem; border-top: 1px solid var(--border); }
.back-top { font-size: 0.9rem; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 1rem 0; }
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
th, td {
  text-align: start;
  vertical-align: top;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
}
th { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }

@media (max-width: 40rem) {
  table.stack, table.stack thead, table.stack tbody, table.stack tr, table.stack th, table.stack td { display: block; }
  table.stack thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }
  table.stack tr { border-bottom: 1px solid var(--border); padding: 0.5rem 0; }
  table.stack td { border: 0; padding: 0.25rem 0.85rem; }
  table.stack td::before {
    content: attr(data-label);
    display: block;
    font-weight: 700;
    color: var(--muted);
    font-size: 0.85rem;
  }
}

/* FAQ */
details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 1rem;
  margin: 0.6rem 0;
}
summary { cursor: pointer; font-weight: 600; }
details[open] summary { margin-bottom: 0.4rem; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 1.5rem 0 2rem;
  color: var(--muted);
  font-size: 0.95rem;
}
.site-footer p { margin: 0.35rem 0; }
.site-footer ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0 0 0.75rem; }

/* Persian / RTL tweaks */
[dir="rtl"] .ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

@media print {
  .site-header, .site-footer, .toc, .btn-row { display: none; }
  body { background: #fff; color: #000; }
}
