/* ============================================================
   دليل رندا — نظام التصميم
   لهجة دافئة، محرّرة، مستوحاة من السفر: رمال وشمس مغاربية
   ============================================================ */

:root,
[data-theme='light'] {
  /* Type scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 5rem);
  --text-hero: clamp(2.75rem, 1rem + 6vw, 6.5rem);

  /* Spacing (4px base) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Surfaces — warm sand, sun-bleached paper */
  --color-bg: #f8f2e9;
  --color-surface: #fffdf9;
  --color-surface-2: #ffffff;
  --color-surface-offset: #f1e6d6;
  --color-surface-offset-2: #e9dac3;
  --color-surface-dynamic: #e3d2b6;
  --color-divider: #e4d5bd;
  --color-border: #d9c6a6;

  /* Text — warm charcoal ink */
  --color-text: #2c2118;
  --color-text-muted: #7a6a58;
  --color-text-faint: #b3a28a;
  --color-text-inverse: #fbf3e6;

  /* Primary accent — sun-baked terracotta */
  --color-primary: #b5502e;
  --color-primary-hover: #953f22;
  --color-primary-active: #7a331c;
  --color-primary-highlight: #f0d6c8;

  /* Secondary accent — deep Mediterranean teal (used sparingly, links/badges) */
  --color-secondary: #2f6b64;

  /* Rating colors */
  --color-success: #45793a;
  --color-success-hover: #345c2c;
  --color-success-highlight: #dbe8d3;

  --color-warning: #b0791f;
  --color-warning-hover: #8f6119;
  --color-warning-highlight: #f1e0bd;

  --color-error: #ab3737;
  --color-error-hover: #8a2c2c;
  --color-error-highlight: #f0d4d0;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  --shadow-sm: 0 1px 3px oklch(0.3 0.05 40 / 0.10);
  --shadow-md: 0 6px 16px oklch(0.3 0.05 40 / 0.12);
  --shadow-lg: 0 16px 40px oklch(0.3 0.05 40 / 0.16);

  --content-narrow: 640px;
  --content-default: 1000px;
  --content-wide: 1280px;
  --content-full: 100%;

  --font-display: 'Markazi Text', 'Traditional Arabic', serif;
  --font-body: 'Tajawal', 'Segoe UI', sans-serif;
}

[data-theme='dark'] {
  --color-bg: #1c1712;
  --color-surface: #221c16;
  --color-surface-2: #271f18;
  --color-surface-offset: #2b2219;
  --color-surface-offset-2: #33281d;
  --color-surface-dynamic: #3a2d20;
  --color-divider: #3a2f23;
  --color-border: #4a3c2a;

  --color-text: #f1e7d8;
  --color-text-muted: #bba98d;
  --color-text-faint: #816f57;
  --color-text-inverse: #2c2118;

  --color-primary: #e08657;
  --color-primary-hover: #e89b71;
  --color-primary-active: #f0af8d;
  --color-primary-highlight: #4a3324;

  --color-secondary: #6fb0a6;

  --color-success: #86b877;
  --color-success-hover: #9fcb92;
  --color-success-highlight: #33422b;

  --color-warning: #dcab55;
  --color-warning-hover: #e6bd74;
  --color-warning-highlight: #493a1e;

  --color-error: #dd8080;
  --color-error-hover: #e59999;
  --color-error-highlight: #45291f;

  --shadow-sm: 0 1px 3px oklch(0 0 0 / 0.3);
  --shadow-md: 0 6px 16px oklch(0 0 0 / 0.35);
  --shadow-lg: 0 16px 40px oklch(0 0 0 / 0.45);
}

/* ============================================================
   عام
   ============================================================ */

body {
  font-family: var(--font-body);
  overflow-x: hidden;
}

.container {
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

.container--default {
  max-width: var(--content-default);
}

section {
  padding-block: clamp(var(--space-12), 7vw, var(--space-24));
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--color-text);
}

a {
  color: inherit;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--color-primary);
  text-transform: uppercase;
}

.eyebrow::before {
  content: '';
  width: 22px;
  height: 2px;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  display: inline-block;
}

/* ============================================================
   الرأس
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: oklch(from var(--color-bg) l c h / 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid oklch(from var(--color-text) l c h / 0.08);
  transition: box-shadow var(--transition-interactive);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-block: var(--space-4);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
}

.brand-logo {
  color: var(--color-primary);
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text small {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.main-nav a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  padding: var(--space-2) 0;
  position: relative;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  color: var(--color-text);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--color-surface-offset);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

/* ============================================================
   البطل (الهيرو)
   ============================================================ */

.hero {
  position: relative;
  padding-block: clamp(var(--space-16), 10vw, var(--space-32)) clamp(var(--space-12), 6vw, var(--space-20));
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 700px 420px at 85% -10%, oklch(from var(--color-primary) l c h / 0.16), transparent 65%),
    radial-gradient(ellipse 600px 400px at 10% 110%, oklch(from var(--color-secondary) l c h / 0.12), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.hero .container {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: var(--space-16);
  align-items: center;
}

.hero-copy h1 {
  font-size: var(--text-hero);
  line-height: 1.05;
  margin-block: var(--space-5) var(--space-6);
}

.hero-copy h1 em {
  font-style: normal;
  color: var(--color-primary);
}

.hero-copy p {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 54ch;
  margin-bottom: var(--space-8);
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
}

.hero-stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.hero-stat strong {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.hero-stat span {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
}

/* Hero illustration — abstract travel motif, not a fake photo */
.hero-art {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-art svg {
  width: 100%;
  height: 100%;
  max-width: 420px;
}

/* ============================================================
   شريط التصفية
   ============================================================ */

.filters {
  position: sticky;
  top: 73px;
  z-index: 40;
  background: oklch(from var(--color-bg) l c h / 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid oklch(from var(--color-text) l c h / 0.08);
  padding-block: var(--space-4);
}

.filters .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  justify-content: space-between;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.filter-field label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 500;
}

.filter-select,
.filter-search {
  appearance: none;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text);
  min-width: 160px;
  min-height: 44px;
  cursor: pointer;
}

.filter-search {
  cursor: text;
  min-width: 200px;
}

.filter-select:focus-visible,
.filter-search:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.results-count {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.continent-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding-block: var(--space-4) 0;
}

.continent-tab {
  font-size: var(--text-sm);
  font-weight: 500;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}

.continent-tab:hover {
  border-color: var(--color-primary);
  color: var(--color-text);
}

.continent-tab.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-text-inverse);
}

/* ============================================================
   شبكة الفنادق
   ============================================================ */

.hotels-section {
  padding-block: clamp(var(--space-10), 6vw, var(--space-16));
}

.hotels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: var(--space-8);
  margin-top: var(--space-8);
}

.hotel-card {
  background: var(--color-surface);
  border: 1px solid oklch(from var(--color-text) l c h / 0.08);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition-interactive), transform var(--transition-interactive);
}

.hotel-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.hotel-photo-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--color-surface-offset);
  overflow: hidden;
}

.hotel-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

.hotel-card:hover .hotel-photo-wrap img {
  transform: scale(1.05);
}

.img-fallback {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-surface-offset), var(--color-surface-offset-2));
  color: var(--color-text-faint);
}

.img-fallback svg {
  width: 48px;
  height: 48px;
}

.rating-badge {
  position: absolute;
  z-index: 2;
  top: var(--space-3);
  inset-inline-end: var(--space-3);
  display: flex;
  flex-direction: row;
  direction: ltr;
  align-items: baseline;
  gap: 2px;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: var(--text-base);
  font-variant-numeric: tabular-nums;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(6px);
}

.rating-badge small {
  font-size: var(--text-xs);
  font-weight: 500;
  opacity: 0.85;
}

.rating-badge.rating-high {
  background: oklch(from var(--color-success) l c h / 0.92);
  color: white;
}
.rating-badge.rating-mid {
  background: oklch(from var(--color-warning) l c h / 0.92);
  color: white;
}
.rating-badge.rating-low {
  background: oklch(from var(--color-error) l c h / 0.92);
  color: white;
}

.hotel-body {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  flex: 1;
}

.hotel-name {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  direction: ltr;
  text-align: right;
  unicode-bidi: plaintext;
}

.hotel-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.hotel-meta svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--color-primary);
}

.hotel-date {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-variant-numeric: tabular-nums;
}

.hotel-lists {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-block: var(--space-1);
}

.hotel-list h4 {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: var(--space-2);
}

.hotel-list.pros h4 { color: var(--color-success); }
.hotel-list.cons h4 { color: var(--color-error); }

.hotel-list ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.hotel-list li {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  padding-inline-start: var(--space-5);
  position: relative;
}

.hotel-list.pros li::before,
.hotel-list.cons li::before {
  position: absolute;
  inset-inline-start: 0;
  top: 0.15em;
  font-size: var(--text-xs);
}

.hotel-list.pros li::before {
  content: '✓';
  color: var(--color-success);
  font-weight: 700;
}

.hotel-list.cons li::before {
  content: '–';
  color: var(--color-error);
  font-weight: 700;
}

.no-cons {
  font-size: var(--text-sm);
  color: var(--color-text-faint);
  font-style: italic;
}

.hotel-footer {
  margin-top: auto;
  padding-top: var(--space-4);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-5);
  min-height: 44px;
  text-decoration: none;
  border: 1px solid transparent;
  width: 100%;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--color-primary-hover);
}

.btn-primary svg {
  width: 16px;
  height: 16px;
}

/* ============================================================
   حالة عدم وجود نتائج
   ============================================================ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-24) var(--space-8);
  color: var(--color-text-muted);
  grid-column: 1 / -1;
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: var(--space-4);
  color: var(--color-text-faint);
}

.empty-state h3 {
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.empty-state p {
  max-width: 40ch;
  margin-bottom: var(--space-6);
}

.empty-state button {
  color: var(--color-primary);
  font-weight: 600;
  font-size: var(--text-sm);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ============================================================
   عن الموقع
   ============================================================ */

.about-section {
  background: var(--color-surface-offset);
  border-top: 1px solid var(--color-divider);
  border-bottom: 1px solid var(--color-divider);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  align-items: center;
}

.about-copy p {
  color: var(--color-text-muted);
  font-size: var(--text-base);
  margin-bottom: var(--space-4);
}

.about-copy p:last-child {
  margin-bottom: 0;
}

.pull-quote {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  line-height: 1.4;
  color: var(--color-text);
  border-inline-start: 3px solid var(--color-primary);
  padding-inline-start: var(--space-6);
}

.pull-quote cite {
  display: block;
  font-family: var(--font-body);
  font-style: normal;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-4);
}

/* ============================================================
   تذييل
   ============================================================ */

.site-footer {
  padding-block: var(--space-12);
  border-top: 1px solid var(--color-divider);
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.footer-note {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  max-width: 46ch;
}

.footer-links {
  display: flex;
  gap: var(--space-5);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* ============================================================
   استجابة للأجهزة المحمولة
   ============================================================ */

@media (max-width: 900px) {
  .hero .container {
    grid-template-columns: 1fr;
    gap: var(--space-10);
  }

  .hero-art {
    order: -1;
    max-width: 260px;
    margin-inline: auto;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .main-nav {
    display: none;
  }
}

@media (max-width: 640px) {
  .site-header .container {
    padding-block: var(--space-3);
  }

  .filters {
    top: 65px;
  }

  .filters .container {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-select,
  .filter-search {
    width: 100%;
    min-width: 0;
  }

  .results-count {
    text-align: center;
  }

  .hotels-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    flex-direction: column;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hotel-card,
  .hotel-photo-wrap img {
    transition: none !important;
  }
}
