/* ==========================================================================
   PlanRihla — Activity Booking Guide
   Built to the `tripadvisor-design` system:
   light theme · sans-serif · 4px grid · 8px radius · FLAT (no shadows)
   no gradients · no blur · no pill shapes · solid colors only
   ========================================================================== */

/* ---------- Design tokens ----------
   NOTE: the skill shipped no extracted palette (0 colors). Neutrals below are
   the skill's own detected values (#f9fafb surface, #6b7280 muted); brand
   accent replaces TripAdvisor green with the project's orange/deep-blue.     */
:root {
  /* Surfaces */
  --background:   #FFFFFF;
  --surface:      #F9FAFB;
  --surface-2:    #F1F3F5;

  /* Text */
  --text:         #2D2D2D;
  --text-muted:   #6B7280;
  --text-invert:  #FFFFFF;

  /* Brand */
  --primary:      #1A2B49;  /* deep blue — header, footer, headings */
  --primary-dark: #11203A;
  --accent:       #FF6B35;  /* replaces TripAdvisor green — CTAs only */
  --accent-dark:  #E85A2A;

  /* Lines */
  --border:       #E5E7EB;
  --border-strong:#D1D5DB;

  /* Type */
  --font: "Tajawal", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Radius — single step, per design system */
  --radius: 8px;

  /* Layout */
  --maxw: 1280px;
  --motion: 150ms ease-out;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
/* Must beat component display rules (e.g. .card{display:flex}) when JS hides items */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--background);
  direction: rtl;
  text-align: right;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 700; color: var(--primary); }
p { margin: 0; }
button { font-family: inherit; }

/* ---------- Type scale ---------- */
.h1 { font-size: 32px; font-weight: 700; }
.h2 { font-size: 28px; font-weight: 700; }
.h3 { font-size: 20px; font-weight: 700; }
.text-sm { font-size: 14px; }
.text-xs { font-size: 12px; }
.muted { color: var(--text-muted); }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 16px; }
.section { padding: 40px 0; }
.section--surface { background: var(--surface); }
.section__head { margin-bottom: 24px; }
.section__head h2 { font-size: 28px; }
.section__head p { color: var(--text-muted); margin-top: 8px; }
.section__headrow {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}

/* ==========================================================================
   Buttons — 8px radius, flat, no pills
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-size: 16px; font-weight: 700;
  padding: 12px 24px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: none; cursor: pointer;
  transition: background-color var(--motion), color var(--motion), border-color var(--motion);
}
.btn--primary { background: var(--accent); color: var(--text-invert); }
.btn--primary:hover { background: var(--accent-dark); }
.btn--dark { background: var(--primary); color: var(--text-invert); }
.btn--dark:hover { background: var(--primary-dark); }
.btn--outline { border-color: var(--border-strong); color: var(--primary); background: var(--background); }
.btn--outline:hover { border-color: var(--primary); background: var(--surface); }
.btn--sm { padding: 8px 16px; font-size: 14px; }
.btn--block { width: 100%; }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--background);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 700; }
.brand__mark {
  width: 32px; height: 32px; display: grid; place-items: center;
  background: var(--accent); color: var(--text-invert);
  border-radius: var(--radius); font-size: 16px;
}
.brand__name { color: var(--primary); }
.brand__name span { color: var(--accent); }

.nav__links { display: flex; align-items: center; gap: 8px; }
.nav__links a {
  font-size: 15px; font-weight: 500; color: var(--text);
  padding: 8px 12px; border-radius: var(--radius);
  transition: background-color var(--motion), color var(--motion);
}
.nav__links a:hover { background: var(--surface); }
.nav__links a.is-active { color: var(--primary); font-weight: 700; }

.nav__toggle {
  display: none; width: 40px; height: 40px; padding: 8px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--background); cursor: pointer;
  flex-direction: column; gap: 4px; justify-content: center; align-items: center;
}
.nav__toggle span { width: 20px; height: 2px; background: var(--text); }

/* ==========================================================================
   Hero — image + solid overlay (no gradient, no blur)
   ========================================================================== */
.hero { position: relative; background: var(--primary); }
.hero__bg { position: absolute; inset: 0; }
.hero__bg img { width: 100%; height: 100%; object-fit: cover; }
.hero__scrim { position: absolute; inset: 0; background: rgba(26, 43, 73, 0.56); }
.hero__inner { position: relative; padding: 48px 0; }
.hero h1 { color: var(--text-invert); font-size: 32px; max-width: 640px; }
.hero__lead { color: var(--text-invert); font-size: 16px; margin-top: 12px; max-width: 560px; }

/* Search — the primary conversion element */
.search {
  margin-top: 24px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  display: flex; flex-direction: column; gap: 8px;
  max-width: 720px;
}
.search__field {
  display: flex; flex-direction: column; gap: 4px;
  padding: 8px 12px; border-radius: var(--radius); background: var(--surface);
  flex: 1; min-width: 0;
}
.search__field label { font-size: 12px; font-weight: 700; color: var(--text-muted); }
.search__field select, .search__field input {
  width: 100%; border: none; background: transparent; outline: none;
  font-family: inherit; font-size: 16px; font-weight: 700; color: var(--primary);
  padding: 0;
}
.search .btn { padding: 16px 24px; }

/* ==========================================================================
   Category tiles — 8px radius, bordered, flat
   ========================================================================== */
.cats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.cat {
  display: flex; align-items: center; gap: 12px;
  padding: 16px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--motion), background-color var(--motion);
}
.cat:hover { border-color: var(--primary); background: var(--surface); }
.cat__icon {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  background: var(--surface-2); border-radius: var(--radius); font-size: 20px;
}
.cat__label { font-weight: 700; font-size: 15px; color: var(--primary); }
.cat__count { font-size: 12px; color: var(--text-muted); }

/* ==========================================================================
   Activity cards
   ========================================================================== */
.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }

.card {
  display: flex; flex-direction: column;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--motion);
}
.card:hover { border-color: var(--border-strong); }
.card__media { position: relative; aspect-ratio: 4 / 3; background: var(--surface-2); }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__tag {
  position: absolute; top: 8px; right: 8px;
  background: var(--background); color: var(--primary);
  font-size: 12px; font-weight: 700;
  padding: 4px 8px; border-radius: var(--radius);
  border: 1px solid var(--border);
}
.card__body { display: flex; flex-direction: column; gap: 8px; padding: 16px; flex: 1; }
.card__eyebrow { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.card__title { font-size: 16px; font-weight: 700; color: var(--primary); }
.card__desc { font-size: 14px; color: var(--text-muted); flex: 1; }

/* Bubble rating (TripAdvisor pattern, recolored to accent) */
.rating { display: flex; align-items: center; gap: 8px; }
.bubbles { display: inline-flex; gap: 2px; }
.bubbles i {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); display: block;
}
.bubbles i.is-empty { background: var(--border-strong); }
.rating__count { font-size: 12px; color: var(--text-muted); }

/* Meta badges */
.meta { display: flex; flex-wrap: wrap; gap: 4px; }
.meta span {
  font-size: 12px; font-weight: 500; color: var(--text);
  background: var(--surface); border: 1px solid var(--border);
  padding: 4px 8px; border-radius: var(--radius);
}

.card__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
.price { display: flex; flex-direction: column; line-height: 1.2; }
.price__from { font-size: 12px; color: var(--text-muted); }
.price__value { font-size: 20px; font-weight: 700; color: var(--primary); }
.price__unit { font-size: 12px; font-weight: 400; color: var(--text-muted); }

/* Free attractions: no product to book, so no dead button */
.free-tag {
  font-size: 13px; font-weight: 700; color: var(--primary);
  background: var(--surface); border: 1px solid var(--border);
  padding: 8px 12px; border-radius: var(--radius); white-space: nowrap;
}

/* ==========================================================================
   Destination cards
   ========================================================================== */
.dest {
  position: relative; display: block; overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--radius);
  aspect-ratio: 3 / 2;
  transition: border-color var(--motion);
}
.dest:hover { border-color: var(--primary); }
.dest img { width: 100%; height: 100%; object-fit: cover; }
.dest__label {
  position: absolute; inset-inline: 8px; bottom: 8px;
  background: var(--background); border-radius: var(--radius);
  padding: 8px 12px;
}
.dest__name { font-weight: 700; font-size: 15px; color: var(--primary); }
.dest__count { font-size: 12px; color: var(--text-muted); }
.dest--soon { pointer-events: none; }
.dest--soon .dest__name { color: var(--text-muted); }

/* ==========================================================================
   Trust / Why
   ========================================================================== */
.why { display: grid; gap: 16px; grid-template-columns: 1fr; }
.why-card {
  background: var(--background); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
}
.why-card__icon {
  width: 40px; height: 40px; display: grid; place-items: center;
  background: var(--surface-2); border-radius: var(--radius);
  font-size: 20px; margin-bottom: 12px;
}
.why-card h3 { font-size: 16px; margin-bottom: 8px; }
.why-card p { font-size: 14px; color: var(--text-muted); }

/* Disclosure */
.note {
  margin-top: 24px; padding: 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px; color: var(--text-muted); text-align: center;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 40px 0 24px; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 24px; margin-bottom: 24px; }
.footer-col h4 { font-size: 14px; margin-bottom: 12px; color: var(--primary); }
.footer-col a, .footer-col p { display: block; font-size: 14px; color: var(--text-muted); padding: 4px 0; }
.footer-col a:hover { color: var(--primary); }
.footer-bottom {
  border-top: 1px solid var(--border); padding-top: 16px;
  display: flex; flex-direction: column; gap: 8px;
  font-size: 12px; color: var(--text-muted);
}

/* ==========================================================================
   Inner page header (destination / listing)
   ========================================================================== */
.page-head { border-bottom: 1px solid var(--border); padding: 24px 0; }
.breadcrumb { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.breadcrumb a:hover { color: var(--primary); }
.page-head h1 { font-size: 28px; }
.page-head p { color: var(--text-muted); margin-top: 8px; max-width: 640px; }

.info {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-bottom: 24px;
}
.info h2 { font-size: 16px; margin-bottom: 8px; }
.info ul { display: grid; gap: 4px; }
.info li { font-size: 14px; color: var(--text-muted); }

/* Filter rows */
.filter-group { margin-bottom: 16px; }
.filter-group__label {
  font-size: 12px; font-weight: 700; color: var(--text-muted);
  margin-bottom: 8px; letter-spacing: 0.02em;
}
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.filter-group .filters { margin-bottom: 0; }
.filters a, .filters button {
  font-family: inherit; font-size: 14px; font-weight: 500; color: var(--text);
  background: var(--background); border: 1px solid var(--border);
  padding: 8px 12px; border-radius: var(--radius); cursor: pointer;
  transition: border-color var(--motion), background-color var(--motion), color var(--motion);
}
.filters a:hover, .filters button:hover { border-color: var(--primary); background: var(--surface); }
.filters button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.filters a.is-active, .filters button.is-active {
  background: var(--primary); color: var(--text-invert); border-color: var(--primary);
}
.filters__count { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; }
.filters__count strong { color: var(--primary); font-weight: 700; }

/* Empty state */
.empty {
  display: none;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px 16px; text-align: center;
}
.empty.is-visible { display: block; }
.empty p { color: var(--text-muted); font-size: 14px; margin-bottom: 16px; }

/* Image credits list */
.credits { display: grid; gap: 8px; }
.credit {
  display: flex; align-items: center; gap: 12px;
  background: var(--background); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px 12px;
}
.credit img {
  width: 64px; height: 48px; flex: none;
  object-fit: cover; border-radius: var(--radius); background: var(--surface-2);
}
.credit__body { min-width: 0; flex: 1; }
.credit__title { font-size: 14px; font-weight: 700; color: var(--primary); }
.credit__meta { font-size: 12px; color: var(--text-muted); }
.credit__lic {
  flex: none; font-size: 12px; font-weight: 700; color: var(--text);
  background: var(--surface); border: 1px solid var(--border);
  padding: 4px 8px; border-radius: var(--radius); white-space: nowrap;
}
@media (max-width: 560px) {
  .credit { flex-wrap: wrap; }
  .credit__lic { margin-inline-start: 76px; }
}

/* Prose (about page) */
.prose { max-width: 720px; }
.prose h2 { font-size: 20px; margin: 32px 0 8px; }
.prose p { margin-bottom: 12px; color: var(--text); }
.prose ul { list-style: disc; padding-inline-start: 20px; margin-bottom: 12px; }
.prose li { margin-bottom: 4px; color: var(--text); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (min-width: 640px) {
  .search { flex-direction: row; align-items: stretch; }
  .search .btn { white-space: nowrap; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .cats { grid-template-columns: repeat(4, 1fr); }
  .why { grid-template-columns: repeat(3, 1fr); }
  .footer-bottom { flex-direction: row; justify-content: space-between; }
}

@media (min-width: 1024px) {
  .container { padding-inline: 24px; }
  .section { padding: 48px 0; }
  .hero__inner { padding: 64px 0; }
  .hero h1 { font-size: 40px; }
  .grid { grid-template-columns: repeat(4, 1fr); }
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
  .page-head h1 { font-size: 32px; }
}

@media (max-width: 860px) {
  .nav__toggle { display: flex; }
  .nav__links {
    position: absolute; top: 64px; right: 0; left: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--background);
    border-bottom: 1px solid var(--border);
    max-height: 0; overflow: hidden;
    transition: max-height 300ms ease-out;
  }
  .nav__links.is-open { max-height: 320px; }
  .nav__links a:not(.btn) { padding: 16px; border-bottom: 1px solid var(--border); border-radius: 0; }
  .nav__links .btn { margin: 12px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
