/* ============================================================
   HALAL SOJOURN — Design System
   Tokens · Base · Components
   ============================================================ */

/* ---------- TOKENS ---------- */
:root {
  /* Neutrals — warm limestone / sand */
  --paper:      #FAF6EC;   /* lightest page bg */
  --linen:      #F3EBDB;   /* sand */
  --sand:       #EDE3CF;   /* limestone */
  --limestone:  #E3D6BC;   /* deeper sand */
  --card:       #FFFCF5;   /* card surface */

  /* Faith-resonant accent — earthy emerald */
  --emerald:      #1F4D3F;
  --emerald-deep: #163A2F;
  --emerald-soft: #2C6552;
  --emerald-wash: #EAEFE9;  /* faint emerald tint on sand */

  /* Premium muted gold */
  --gold:      #B8924F;
  --gold-soft: #CBAA6E;
  --gold-deep: #9C7A3C;

  /* Warm accent — terracotta / saffron (youth + warmth) */
  --clay:      #C75B36;
  --clay-soft: #E08A57;
  --saffron:   #E0922F;
  --ember:     #B0432A;
  --clay-wash: #F7E6DA;

  /* Gradients */
  --grad-warm:    linear-gradient(118deg, #C75B36, #E0922F);
  --grad-gold:    linear-gradient(118deg, #9C7A3C, #CBAA6E);
  --grad-jewel:   linear-gradient(135deg, #163A2F 0%, #1F4D3F 48%, #2C6552 100%);
  --grad-ember:   linear-gradient(135deg, #1F4D3F 0%, #2C6552 55%, #C75B36 130%);
  --grad-line:    linear-gradient(180deg, transparent, var(--line) 22%, var(--line) 78%, transparent);

  /* Ink / text — warm near-black */
  --ink:        #232820;
  --text:       #2C302A;
  --text-muted: #6E6757;
  --text-faint: #938A77;
  --on-dark:        #F3EEE2;
  --on-dark-muted:  #BFC6B7;

  /* Lines / hairlines */
  --line:       #DDD0B6;
  --line-soft:  #E8DDC8;
  --line-dark:  rgba(243,238,226,0.18);

  /* Type families */
  --serif: "Cormorant", "Amiri", Georgia, serif;
  --sans:  "Hanken Grotesk", system-ui, -apple-system, sans-serif;
  --ar-serif: "Amiri", "Cormorant", serif;
  --ar-sans:  "Tajawal", "Hanken Grotesk", system-ui, sans-serif;

  /* Type scale */
  --fs-eyebrow: 0.72rem;
  --fs-small:   0.875rem;
  --fs-body:    1.0625rem;
  --fs-body-lg: 1.1875rem;
  --fs-lead:    1.375rem;

  /* Spacing (4px base) */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  --s9: 96px; --s10: 128px; --s11: 160px;

  /* Radius — editorial, near-square */
  --r-sm: 3px;
  --r:    5px;
  --r-lg: 10px;
  --r-pill: 999px;

  /* Shadows — quiet */
  --shadow-xs: 0 1px 2px rgba(35,40,32,0.05);
  --shadow-sm: 0 2px 8px -3px rgba(35,40,32,0.12);
  --shadow-md: 0 16px 40px -22px rgba(22,34,28,0.40), 0 2px 6px -3px rgba(22,34,28,0.10);
  --shadow-lg: 0 40px 80px -40px rgba(22,34,28,0.45);

  /* Layout */
  --maxw: 1280px;
  --maxw-narrow: 760px;
  --header-h: 76px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- RESET / BASE ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--emerald); color: var(--paper); }

/* Arabic typography */
[dir="rtl"] body, [lang="ar"] { font-family: var(--ar-sans); }
[lang="ar"] .display, [lang="ar"] .serif, [lang="ar"] h1, [lang="ar"] h2,
[lang="ar"] h3, [lang="ar"] .h-serif { font-family: var(--ar-serif); }

/* ---------- TYPE ---------- */
.serif, .h-serif { font-family: var(--serif); font-weight: 500; }
.display {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.012em;
  color: var(--ink);
  text-wrap: balance;
}
.display-xl { font-size: clamp(2.9rem, 6.4vw, 5.7rem); }
.display-lg { font-size: clamp(2.4rem, 4.8vw, 4.1rem); }
.display-md { font-size: clamp(2rem, 3.4vw, 3.05rem); }
.display-sm { font-size: clamp(1.6rem, 2.4vw, 2.25rem); line-height: 1.1; }
[lang="ar"] .display { letter-spacing: 0; line-height: 1.25; }

.lead {
  font-size: var(--fs-lead);
  line-height: 1.5;
  color: var(--text-muted);
  font-weight: 400;
  text-wrap: pretty;
}
.eyebrow {
  font-size: var(--fs-eyebrow);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-weight: 600;
  color: var(--gold-deep);
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
}
[lang="ar"] .eyebrow { letter-spacing: 0.05em; }
.eyebrow--light { color: var(--gold-soft); }
.eyebrow::before {
  content: "";
  width: 22px; height: 1px;
  background: currentColor;
  opacity: 0.7;
}
.eyebrow--center { justify-content: center; }

.muted { color: var(--text-muted); }
.gold-text { color: var(--gold-deep); }

/* ---------- LAYOUT ---------- */
.container { max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(20px, 5vw, 56px); }
.container--narrow { max-width: var(--maxw-narrow); }
.section { padding-block: clamp(56px, 9vw, var(--s10)); }
.section--tight { padding-block: clamp(40px, 6vw, var(--s9)); }
.bg-sand { background: var(--linen); }
.bg-limestone { background: var(--sand); }
.bg-emerald { background: var(--emerald); color: var(--on-dark); }
.bg-emerald .display, .bg-emerald h1, .bg-emerald h2, .bg-emerald h3 { color: var(--paper); }
.bg-paper { background: var(--paper); }

.grid { display: grid; gap: var(--s6); }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: var(--s4); }
.center { text-align: center; }
.maxw-prose { max-width: 60ch; }

/* ---------- BUTTONS ---------- */
.btn {
  --bg: var(--emerald);
  --fg: var(--paper);
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.6em;
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.95em 1.7em;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--bg);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: transform 0.35s var(--ease), background 0.3s var(--ease), color 0.3s var(--ease), box-shadow 0.3s var(--ease);
  line-height: 1;
  white-space: nowrap;
}
[lang="ar"] .btn { font-family: var(--ar-sans); font-weight: 500; }
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn--primary { --bg: var(--emerald); --fg: var(--paper); }
.btn--primary:hover { background: var(--emerald-deep); }
.btn--gold { --bg: var(--gold); --fg: #fff; border-color: var(--gold); }
.btn--gold:hover { background: var(--gold-deep); }
.btn--ghost {
  --bg: transparent; --fg: var(--emerald);
  border-color: var(--emerald);
}
.btn--ghost:hover { background: var(--emerald); color: var(--paper); }
.btn--light {
  --bg: transparent; --fg: var(--on-dark);
  border-color: rgba(243,238,226,0.5);
}
.btn--light:hover { background: var(--paper); color: var(--emerald); border-color: var(--paper); }
.btn--lg { padding: 1.1em 2.1em; font-size: 0.98rem; }
.btn--block { width: 100%; }

/* text link with underline reveal */
.link-arrow {
  display: inline-flex; align-items: center; gap: 0.5em;
  font-weight: 600; font-size: 0.9rem;
  letter-spacing: 0.03em;
  color: var(--emerald);
  padding-bottom: 2px;
  white-space: nowrap;
  border-bottom: 1px solid transparent;
  transition: gap 0.3s var(--ease), border-color 0.3s var(--ease);
}
.link-arrow svg { transition: transform 0.35s var(--ease); }
.link-arrow:hover { border-color: var(--emerald); }
.link-arrow:hover svg { transform: translateX(4px); }
[dir="rtl"] .link-arrow svg { transform: scaleX(-1); }
[dir="rtl"] .link-arrow:hover svg { transform: scaleX(-1) translateX(4px); }

/* ---------- HAIRLINE / MOTIF DIVIDERS ---------- */
.rule { height: 1px; background: var(--line); border: 0; width: 100%; }
.rule--soft { background: var(--line-soft); }
.divider-motif {
  display: flex; align-items: center; gap: var(--s4);
  color: var(--gold); opacity: 0.9;
}
.divider-motif::before, .divider-motif::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(to var(--grad-dir, right), transparent, var(--line));
}
.divider-motif::after { background: linear-gradient(to var(--grad-dir, right), var(--line), transparent); }

/* faint girih texture (applied as bg-image via inline style util) */
.motif-tex { position: relative; }
.motif-tex > * { position: relative; z-index: 1; }

/* ---------- IMAGE / MEDIA ---------- */
.media {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--limestone), var(--sand));
  border-radius: var(--r);
}
.media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.1s var(--ease);
}
.media__fallback {
  position: absolute; inset: 0;
  display: flex; align-items: flex-end;
  padding: var(--s5);
  font-family: var(--serif); font-size: 1.4rem; color: rgba(255,255,255,0.85);
  background: linear-gradient(150deg, var(--emerald-soft), var(--emerald-deep) 70%);
}
.media__tint {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(22,34,28,0.55), rgba(22,34,28,0.05) 45%, transparent 70%);
}

/* ---------- TAGS / BADGES ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 0.5em;
  font-size: 0.74rem; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--emerald);
  background: var(--emerald-wash);
  border: 1px solid rgba(31,77,63,0.14);
  padding: 0.42em 0.85em;
  border-radius: var(--r-pill);
}
.tag--gold { color: var(--gold-deep); background: rgba(184,146,79,0.12); border-color: rgba(184,146,79,0.28); }
.tag--solid { background: var(--emerald); color: var(--paper); border-color: var(--emerald); }

/* ---------- FORMS ---------- */
.field { display: flex; flex-direction: column; gap: 0.5em; }
.field label, .field-label {
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.02em;
  color: var(--ink);
}
.field .hint { font-size: 0.8rem; color: var(--text-faint); }
.input, .select, .textarea {
  font-family: var(--sans); font-size: 1rem;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 0.85em 1em;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
  width: 100%;
}
[lang="ar"] .input, [lang="ar"] .select, [lang="ar"] .textarea { font-family: var(--ar-sans); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--emerald);
  box-shadow: 0 0 0 3px rgba(31,77,63,0.12);
}
.textarea { resize: vertical; min-height: 120px; }

/* selectable chip / option card */
.choice {
  display: flex; align-items: center; gap: 0.7em;
  padding: 0.95em 1.1em;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  cursor: pointer;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease), transform 0.2s var(--ease);
  font-weight: 500;
  text-align: start;
}
.choice:hover { border-color: var(--gold-soft); }
.choice[aria-pressed="true"], .choice.is-active {
  border-color: var(--emerald);
  background: var(--emerald-wash);
  box-shadow: inset 0 0 0 1px var(--emerald);
}
.choice__check {
  width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--line); flex-shrink: 0;
  display: grid; place-items: center;
}
.choice.is-active .choice__check { border-color: var(--emerald); background: var(--emerald); }

/* ---------- CARD SHELL ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
}

/* ---------- UTIL ---------- */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.fade-up { opacity: 0; transform: translateY(18px); }
.in-view .fade-up, .fade-up.in { opacity: 1; transform: none; transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
