/* ==========================================================================
   Modern Accessible CSS Reset & Baseline (RTL Native)
   ========================================================================== */

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

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: var(--line-height-base);
  color: var(--color-ink-primary);
  background-color: var(--color-bg-base);
  direction: rtl;
  text-align: right;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  background-color: var(--color-bg-base);
  color: var(--color-ink-primary);
}

/* Typography Defaults */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: var(--line-height-heading);
  color: var(--color-ink-primary);
  text-wrap: balance;
}

p {
  line-height: var(--line-height-base);
  color: var(--color-ink-secondary);
  text-wrap: pretty;
}

a {
  color: var(--color-brand-blue);
  text-decoration: none;
  transition: color var(--motion-fast);
}

a:hover {
  color: var(--color-brand-blue-hover);
}

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

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

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

ul, ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}

code, pre, kbd, samp {
  font-family: var(--font-mono);
  direction: ltr;
  text-align: left;
}

/* Skip Link for Keyboard Accessibility */
.skip-link {
  position: absolute;
  top: -100px;
  right: var(--space-4);
  background: var(--color-brand-blue);
  color: #FFFFFF;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: var(--font-size-sm);
  z-index: var(--z-modal);
  transition: top var(--motion-fast);
  box-shadow: var(--shadow-floating);
  text-decoration: none;
}

.skip-link:focus {
  top: var(--space-4);
  outline: 3px solid var(--color-brand-navy);
}

/* Focus Visible Styling (WCAG 2.2 AA / AAA) */
:focus-visible {
  outline: 2px solid var(--color-brand-blue);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

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