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

* {
  margin: 0;
}

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

body {
  min-height: 100vh;
}

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

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

button {
  cursor: pointer;
  background: none;
  border: none;
}

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

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

/* Base document */
html {
  direction: rtl;
}

body {
  background-color: var(--color-background);
  color: var(--color-on-background);
  font-family: var(--font-body);
  font-size: var(--fs-body-lg);
  line-height: var(--lh-body-lg);
  letter-spacing: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  font-weight: var(--fw-heading);
  letter-spacing: normal;
  color: var(--color-primary);
}

h1 {
  font-size: var(--fs-h1-mobile);
  line-height: var(--lh-h1);
}

h2 {
  font-size: var(--fs-h2-mobile);
  line-height: var(--lh-h2);
}

h3 {
  font-size: var(--fs-h3);
  line-height: var(--lh-h3);
}

@media (min-width: 768px) {
  h1 {
    font-size: var(--fs-h1);
  }
  h2 {
    font-size: var(--fs-h2);
  }
}

p {
  color: var(--color-on-surface-variant);
}

small {
  font-size: var(--fs-body-sm);
  line-height: var(--lh-body-sm);
}

/* Focus visibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-gold-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Skip link */
.skip-link {
  position: absolute;
  inset-inline-start: var(--space-2);
  top: -100px;
  z-index: 100;
  background-color: var(--color-primary);
  color: var(--color-on-primary);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-button);
  font-family: var(--font-heading);
  font-weight: 600;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: var(--space-2);
}

.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: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
