/** Served from Express/Vite static `/images/*` — real local JPEGs. */
export const LOCAL_STAY_IMAGES = [
  "/images/stay-1.jpg",
  "/images/stay-2.jpg",
  "/images/stay-3.jpg",
  "/images/stay-4.jpg",
  "/images/stay-5.jpg",
  "/images/stay-6.jpg",
  "/images/stay-7.jpg",
  "/images/stay-8.jpg",
] as const;

/** Prefer per-city files; theme files kept only as last-resort fallbacks. */
export const LOCAL_CITY_IMAGES = [
  "/images/city-tunis.jpg",
  "/images/city-hammamet.jpg",
  "/images/city-sousse.jpg",
  "/images/city-djerba.jpg",
  "/images/city-kairouan.jpg",
  "/images/city-bizerte.jpg",
  "/images/city-tozeur.jpg",
  "/images/city-monastir.jpg",
  "/images/city-la-marsa.jpg",
  "/images/city-gammarth.jpg",
  "/images/city-nabeul.jpg",
  "/images/city-mahdia.jpg",
  "/images/city-sfax.jpg",
  "/images/city-tabarka.jpg",
] as const;

export const LOCAL_CITY_IMAGE = "/images/city-tunis.jpg";
export const LOCAL_HERO_IMAGE = "/images/hero.jpg";

export function stayImage(index: number) {
  return LOCAL_STAY_IMAGES[index % LOCAL_STAY_IMAGES.length];
}

export function cityImage(index: number) {
  return LOCAL_CITY_IMAGES[index % LOCAL_CITY_IMAGES.length];
}

export function cityImageBySlug(slug?: string | null) {
  if (!slug) return LOCAL_CITY_IMAGE;
  const path = `/images/city-${slug}.jpg`;
  return (LOCAL_CITY_IMAGES as readonly string[]).includes(path) ? path : LOCAL_CITY_IMAGE;
}
