/* ==========================================================================
   drhadiamali.com — Base / Reset / Typography
   All directional CSS uses logical properties so this file works correctly
   for RTL (Farsi/Arabic) and LTR (English) without separate overrides.
   ========================================================================== */

/* ---- Fonts (self-hosted, no CDN) ---- */
@font-face {
  font-family: "YekanBakh";
  src: url("../fonts/YekanBakh-VF.woff2") format("woff2-variations"),
       url("../fonts/YekanBakh-VF.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

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

/* ---- Reset ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  block-size: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-block-size: 100%;
  font-family: var(--font-fa);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text-on-light);
  background: var(--color-white);
}

/* English-language content / LTR contexts */
:lang(en) body,
.font-en {
  font-family: var(--font-en);
}

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

a {
  color: inherit;
  text-decoration: none;
}

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

ul,
ol {
  list-style: none;
}

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

/* ---- Headings ---- */
h1, h2, h3, h4, h5, h6 {
  line-height: var(--lh-heading);
  font-weight: 700;
  text-wrap: balance;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }

p {
  text-wrap: pretty;
}

/* ---- Focus visibility (rule #13 — no hover-only essential function) ---- */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ---- Layout helpers ---- */
.container {
  inline-size: 100%;
  max-inline-size: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.section {
  padding-block: var(--section-pad-block);
}

.visually-hidden {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

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