/**
 * base.css — RTL defaults, base typography, body, focus, reduced motion.
 *
 * Estedad is the only typeface. Font files are not bundled in this
 * repository — see the theme's README "Fonts" section for why, and the
 * fallback stack below that keeps the site legible until they're added.
 *
 * Unlike the retired plugin build, this theme has no parent theme and no
 * Elementor "Global Fonts" layer to fight, so a plain `body` rule is
 * enough — no !important, no extra selector scoping needed.
 */

@font-face {
  font-family: 'Estedad';
  src: url('../fonts/Estedad-Variable.woff2') format('woff2-variations'),
       url('../fonts/Estedad-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-family: 'Estedad', 'Vazirmatn', 'IRANSans', Tahoma, system-ui, sans-serif;
}

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

html {
  direction: rtl;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-family);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  font-weight: 400;
  color: var(--color-text);
  background: var(--color-bg);
  transition: background-color var(--motion-normal) var(--ease-out),
              color var(--motion-normal) var(--ease-out);

  /* Sticky footer: body is at least one viewport tall (never more, unless
     content genuinely needs it — min-height is a floor, not a fixed
     height, so this never forces scroll on a normal-length page), and the
     one <main> that's always a direct child of body absorbs any leftover
     space, pushing .site-footer down to the bottom instead of leaving it
     stranded right under a short page's content. */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

body > main {
  flex: 1 0 auto;
}

/* page-blank.php ("قالب خام") has no header/footer and no <main> of ours —
   its whole point is that the theme doesn't touch the body at all, so the
   sticky-footer flex context above (which that template has no footer to
   need anyway) is turned back off here. */
.sayid-blank-page {
  display: block;
  min-height: 0;
}

img,
picture,
video,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  transition: color var(--motion-fast) var(--ease-out);
}

a:hover,
a:focus-visible {
  color: var(--color-yellow);
}

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: var(--leading-heading);
  margin: 0;
}

p {
  margin: 0;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

button {
  font-family: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

/* ---------- Text selection ---------- */
::selection {
  background: var(--color-yellow);
  color: #fff;
}

/* ---------- Focus ---------- */
:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

a, button, [tabindex] {
  outline-offset: 3px;
}

/* ---------- Screen-reader only ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

/* ---------- Home entry lock ----------
 * Applied only by JS (homepage-entry.js), only while the deferred content
 * has not yet been mounted. Never shipped as static/server-rendered CSS, so
 * a no-JS visitor always gets a normal scrollable page.
 */
html[data-home-entry="locked"],
html[data-home-entry="locked"] body {
  overflow: hidden;
  height: 100%;
}
