/* ============================================================
   LAMSA — base.css
   Design tokens, reset, typography, buttons, forms, utilities.
   RTL-friendly: layout uses logical properties throughout.
   ============================================================ */

:root {
  /* Color tokens — warm terracotta */
  --ink: #171310;
  --charcoal: #201B17;
  --graphite: #332A24;
  --graphite-soft: #3D332C;
  --ivory: #F6F0E4;
  --paper: #FFFFFF;
  --terra: #C0563B;
  --terra-soft: #E08A6A;
  --terra-deep: #8C3A24;
  --clay: #E8D5C3;
  --success: #2E7D4F;
  --danger: #B3322B;
  --warning: #A8791C;
  --focus-ring: #E08A6A;

  /* Typography */
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-sans: "Manrope", -apple-system, "Segoe UI", system-ui, sans-serif;
  --font-arabic: "Cairo", "Segoe UI", "Tahoma", sans-serif;

  /* Spacing */
  --space: 0.25rem;
  --container: 1440px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --section-y: clamp(4rem, 10vw, 8rem);

  /* Motion */
  --ease-expo: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.33, 0.6, 0.24, 1);
  --dur-fast: 160ms;
  --dur-mid: 350ms;
  --dur-slow: 650ms;

  /* Elevation */
  --shadow-float: 0 20px 60px rgba(0, 0, 0, 0.35);
  --shadow-card: 0 8px 30px rgba(0, 0, 0, 0.28);
  --glass: rgba(23, 19, 16, 0.82);

  /* Surfaces */
  --bg: var(--ink);
  --bg-elev: var(--charcoal);
  --bg-card: #1C1714;
  --border: var(--graphite);
  --text: var(--ivory);
  --text-muted: rgba(246, 240, 228, 0.64);
  --text-faint: rgba(246, 240, 228, 0.42);
}

/* Light surfaces (editorial blocks) */
.theme-light {
  --bg: var(--ivory);
  --text: var(--ink);
  --text-muted: rgba(14, 14, 16, 0.66);
  --text-faint: rgba(14, 14, 16, 0.45);
  --border: rgba(14, 14, 16, 0.14);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

/* Arabic typography */
[dir="rtl"] body,
[dir="rtl"] .input,
[dir="rtl"] button,
[dir="rtl"] input,
[dir="rtl"] select,
[dir="rtl"] textarea {
  font-family: var(--font-arabic);
  letter-spacing: 0 !important;
}

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

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

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

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

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.15;
  color: var(--text);
}

[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3 {
  font-family: var(--font-arabic);
  font-weight: 700;
}

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.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;
}

[hidden] {
  display: none !important;
}

/* ---------- Typography helpers ---------- */

.eyebrow {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--terra);
  margin: 0 0 1rem;
}

[dir="rtl"] .eyebrow {
  letter-spacing: 0.08em;
}

.section__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.75rem, 4vw, 3rem);
  line-height: 1.08;
}

/* ---------- Layout utilities ---------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.section--dark {
  background: var(--charcoal);
  color: var(--text);
}

.section__head {
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

.section__head--row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
}

.section__head--center {
  text-align: center;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 1rem 1.9rem;
  border-radius: 2px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: background var(--dur-mid) var(--ease-soft), color var(--dur-mid) var(--ease-soft), transform var(--dur-mid) var(--ease-soft), border-color var(--dur-mid) var(--ease-soft);
  user-select: none;
  line-height: 1;
}

[dir="rtl"] .btn {
  letter-spacing: 0.03em;
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: var(--ivory);
  color: var(--ink);
}

.btn--primary:hover {
  background: var(--terra-soft);
  color: var(--ink);
}

.btn--dark {
  background: var(--ink);
  color: var(--ivory);
}

.btn--dark:hover {
  background: var(--terra);
  color: var(--ink);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--graphite);
}

.btn--ghost:hover {
  border-color: var(--terra);
  color: var(--terra-soft);
}

.btn--block {
  width: 100%;
}

/* ---------- Links ---------- */

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--terra);
  padding-bottom: 0.2rem;
  color: var(--text);
  transition: color var(--dur-fast);
}

.link-arrow:hover {
  color: var(--terra-soft);
}

[dir="rtl"] .link-arrow svg {
  transform: scaleX(-1);
}

.wa-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--terra-soft);
  font-weight: 600;
  font-size: 0.9rem;
}

/* ---------- Icon button ---------- */

.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 2px;
  color: var(--text);
  transition: color var(--dur-fast), background var(--dur-fast);
}

.icon-btn:hover {
  color: var(--terra-soft);
  background: rgba(255, 255, 255, 0.06);
}

.badge-dot {
  position: absolute;
  inset-block-start: 2px;
  inset-inline-end: 0;
  min-width: 16px;
  height: 16px;
  padding-inline: 4px;
  border-radius: 999px;
  background: var(--terra);
  color: var(--ink);
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
}

/* ---------- Badges & swatches ---------- */

.badge {
  display: inline-block;
  padding: 0.3rem 0.6rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--ivory);
  color: var(--ink);
  border-radius: 1px;
}

.badge--terra {
  background: var(--terra);
}

.badge--sale {
  background: var(--terra);
  color: #fff;
}

.swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--swatch, #ccc);
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: inline-block;
}

/* ---------- Forms ---------- */

.input,
select.input,
textarea.input {
  width: 100%;
  padding: 0.95rem 1.1rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  transition: border-color var(--dur-fast);
}

.input::placeholder {
  color: var(--text-muted);
}

.input.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 1px var(--danger);
}

.input:focus {
  outline: none;
  border-color: var(--terra);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.1rem;
}

.form-field__label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.form-field__error {
  color: var(--danger);
  font-size: 0.82rem;
}

.form-field__hint {
  font-size: 0.78rem;
  color: var(--text-faint);
  margin: 0;
}

/* ---------- Animations (progressive, reduced-motion aware) ---------- */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes kenburns {
  from { transform: scale(1.05); }
  to { transform: scale(1.18); }
}

[data-reveal] {
  opacity: 0;
}

.revealed {
  opacity: 1;
  animation: fadeUp var(--dur-slow) var(--ease-expo) both;
}

@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;
  }
  [data-reveal] {
    opacity: 1;
    transform: none;
  }
  .hero__media {
    animation: none !important;
  }
}
