/* =====================================================
   BASE STYLES — Reset, RTL, Typography, Globals
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@400;500;600;700&family=Assistant:wght@400;500;600;700&display=swap');

/* --- Box Model Reset --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* --- Document --- */
html {
  direction: rtl;
  lang: he;
  font-size: 18px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden; /* prevent RTL page overflow from shifting fixed elements */
}

body {
  overflow-x: hidden;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Skip to Content (Accessibility) --- */
.skip-link {
  position: absolute;
  top: -100%;
  right: var(--space-4);
  z-index: var(--z-modal);
  padding: var(--space-3) var(--space-6);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  text-decoration: none;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 0;
}

/* --- Focus Styles (WCAG) --- */
:focus-visible {
  outline: 3px solid var(--color-blue);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* --- Selection --- */
::selection {
  background-color: rgba(201, 146, 42, 0.2);
  color: var(--color-primary);
}

/* --- Media Defaults --- */
img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* --- Link Defaults --- */
a {
  color: var(--color-blue);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-blue-dark);
}

/* --- List Defaults --- */
ul,
ol {
  list-style: none;
}

/* --- Form Defaults --- */
button,
input,
select,
textarea {
  font-family: var(--font-body);
  font-size: var(--text-base);
  direction: rtl;
  text-align: right;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

input,
textarea,
select {
  width: 100%;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.40);
}

input::placeholder,
textarea::placeholder {
  color: var(--color-text-muted);
}

/* --- Heading Scale --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  color: var(--color-primary);
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

/* --- Paragraph & Body --- */
p {
  line-height: var(--leading-normal);
  color: var(--color-text-secondary);
}

strong {
  font-weight: var(--weight-semibold);
  color: var(--color-text);
}

/* --- Layout Container --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

/* --- Section Base --- */
section {
  padding-block: var(--section-py);
}

/* --- Section Header (reusable pattern) --- */
.section-label {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-3);
}

.section-title {
  font-size: var(--text-4xl);
  font-weight: var(--weight-bold);
  color: var(--color-primary);
  margin-bottom: var(--space-4);
  line-height: var(--leading-snug);
}

.section-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  max-width: 60ch;
  line-height: var(--leading-relaxed);
}

/* Centered section header variant */
.section-header {
  text-align: center;
  margin-bottom: var(--space-12);
}

.section-header .section-subtitle {
  margin-inline: auto;
}

/* --- Divider --- */
.divider {
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--color-gold), var(--color-gold-light));
  border-radius: var(--radius-full);
  margin-block: var(--space-4);
}

.section-header .divider {
  margin-inline: auto;
}

/* --- Utility: 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;
}

/* --- Utility: Visually Hidden (focusable) --- */
.sr-only-focusable:focus {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* --- RTL Icon Flip --- */
[dir="rtl"] .icon-arrow {
  transform: scaleX(-1);
}

/* --- 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;
  }
}
