/* ============================================================
   CSS Reset — Modern, minimal
   Based on modern-normalize + custom additions
   Yaz Design System v1.0
   ============================================================ */

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

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

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-base);
  color: var(--color-text-primary);
  background: var(--color-bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-text-primary);
  font-weight: var(--font-semibold);
  line-height: 1.3;
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
h5 { font-size: var(--text-base); }
h6 { font-size: var(--text-sm); }

p {
  margin-bottom: var(--space-4);
}

/* ── Links ── */
a {
  color: var(--color-text-link);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-default);
}

a:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

/* ── Images ── */
img, svg, video, canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ── Form elements ── */
input, button, textarea, select {
  font: inherit;
  color: inherit;
}

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

/* ── Lists ── */
ul, ol {
  list-style: none;
}

/* ── Tables ── */
table {
  border-collapse: collapse;
  width: 100%;
}

/* ── HR ── */
hr {
  border: none;
  border-top: var(--border-width-thin) solid var(--color-border-primary);
  margin: var(--space-6) 0;
}

/* ── Code ── */
code, pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

pre {
  overflow-x: auto;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-bg-tertiary);
  border: var(--border-width-thin) solid var(--color-border-primary);
}

code {
  padding: 0.2em 0.4em;
  border-radius: var(--radius-sm);
  background: var(--color-bg-tertiary);
  font-size: 0.875em;
}

pre code {
  padding: 0;
  background: none;
  font-size: inherit;
}

/* ── Focus visible ── */
:focus-visible {
  outline: var(--border-width-md) solid var(--color-border-focus);
  outline-offset: 2px;
}

/* ── Selection ── */
::selection {
  background: var(--color-accent);
  color: var(--color-accent-text);
}

/* ── Scrollbar (dark theme) ── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--neutral-700);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--neutral-600);
}

/* ── Reduced motion ── */
@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;
  }
}

/* ── RTL Support ── */
[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] input,
[dir="rtl"] textarea {
  text-align: right;
}

/* ── Print ── */
@media print {
  body {
    background: white;
    color: black;
  }
}
