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

html {
  min-height: 100%;
  scroll-behavior: smooth;
  background: var(--gt-bg);
}

/* Persian UI uses Vazirmatn as the default typeface. The explicit selectors
   also override Bootstrap's body font variable for every Persian locale. */
html[lang^="fa"] {
  --gt-font-body: var(--gt-font-fa);
  --bs-body-font-family: var(--gt-font-fa);
}

html[lang^="fa"] body {
  font-family: var(--gt-font-fa);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--gt-bg);
  color: var(--gt-text);
  font-family: var(--gt-font-body);
  font-size: 0.975rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
  /* Safety net for phones: wide tables and cards scroll inside their own
     container instead of widening the page. */
  overflow-x: clip;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.6em;
  color: var(--gt-text);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

h1 { font-size: clamp(2.1rem, 4.6vw, 3.9rem); }
h2 { font-size: clamp(1.55rem, 2.8vw, 2.35rem); }
h3 { font-size: clamp(1.15rem, 1.8vw, 1.4rem); }

p { margin: 0 0 1rem; }

a {
  color: var(--gt-primary);
  text-decoration: none;
  transition: color var(--gt-transition);
}

a:hover { color: var(--gt-primary-hover); }

img, svg { max-width: 100%; }

button, input, select, textarea { font: inherit; }

code, .gt-code {
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 0.82em;
  color: var(--gt-text);
  background: var(--gt-surface-2);
  border: 1px solid var(--gt-border);
  border-radius: 7px;
  padding: 0.14rem 0.42rem;
  unicode-bidi: plaintext;
}

:focus-visible {
  outline: 3px solid rgba(212, 175, 55, 0.55);
  outline-offset: 2px;
  border-radius: 6px;
}

/* FocusOnNavigate moves focus to the page heading (tabindex="-1"). That focus is
   programmatic, so the gold ring reads as a stray box around the title. */
:where([tabindex="-1"]):focus-visible {
  outline: none;
}

.gt-skip-link {
  position: absolute;
  inset-block-start: -100px;
  inset-inline-start: 1rem;
  z-index: 2000;
  background: var(--gt-primary);
  color: var(--gt-on-primary);
  padding: 0.6rem 1rem;
  border-radius: 0 0 var(--gt-radius-sm) var(--gt-radius-sm);
  transition: inset-block-start var(--gt-transition);
}

.gt-skip-link:focus {
  inset-block-start: 0;
  color: var(--gt-on-primary);
}

.gt-main {
  min-height: 55vh;
}

.container {
  width: 100%;
  max-width: var(--gt-container);
  margin-inline: auto;
  padding-inline: clamp(1rem, 2.4vw, 2rem);
}

.gt-muted { color: var(--gt-muted); }
.gt-text-link { color: var(--gt-primary); font-weight: 600; }
.gt-inline-form { display: inline-flex; margin: 0; }

.gt-prose {
  max-width: 860px;
}

.gt-prose p,
.gt-prose li {
  color: var(--gt-text);
  font-size: 1.04rem;
  line-height: 2;
}

.gt-stack {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
