import { c as createComponent, m as maybeRenderHead, a as addAttribute, r as renderTemplate, b as createAstro, e as renderHead, d as renderComponent, f as renderSlot } from './astro/server_DrnzQWw3.mjs';
import 'kleur/colors';
import 'clsx';
import { r as readCms, b as getApprovedPosts, c as getPostBySlug, j as getPrimaryNav, e as getCategoryPath, k as getFooterPageLinks } from './cms_CRTVymfB.mjs';
/* empty css                          */

const $$Astro$2 = createAstro();
const $$Header = createComponent(async ($$result, $$props, $$slots) => {
  const Astro2 = $$result.createAstro($$Astro$2, $$props, $$slots);
  Astro2.self = $$Header;
  const cms = await readCms();
  const { breakingNews } = cms.settings;
  const approvedPosts = getApprovedPosts(cms);
  const breakingPosts = [
    ...(breakingNews.postSlugs ?? []).map((slug) => getPostBySlug(approvedPosts, slug)).filter(Boolean),
    ...approvedPosts.filter((post) => post.urgent)
  ].filter((post, index, list) => list.findIndex((item) => item.slug === post.slug) === index);
  const primaryNav = getPrimaryNav();
  const pathname = Astro2.url.pathname;
  const normalizePath = (value) => decodeURIComponent(value.replace(/\/+$/, "") || "/");
  const normalizedPathname = normalizePath(pathname);
  const isActive = (href) => {
    const target = normalizePath(href);
    if (target === "/") {
      return normalizedPathname === "/";
    }
    return normalizedPathname === target || normalizedPathname.startsWith(`${target}/`);
  };
  const categoryTabs = [
    { label: "\u0647\u0645\u0647", href: "/posts/" },
    ...cms.categories.map((category) => ({
      label: category,
      href: getCategoryPath(category)
    }))
  ];
  const breakingText = breakingPosts.length > 0 ? breakingPosts.map((post) => post.title).join(" \u2014 ") : breakingNews.items.join(" \u2014 ");
  const breakingHref = breakingPosts[0] ? `/posts/${breakingPosts[0].slug}/` : breakingNews.href;
  return renderTemplate`${maybeRenderHead()}<header class="bg-white shadow-sm sticky top-0 z-50"> <div class="max-w-7xl mx-auto px-4 lg:px-8"> <div class="flex items-center justify-between h-14 lg:h-16"> <a href="/" class="flex items-center gap-2.5 flex-shrink-0"> <img src="/assets/logo.png"${addAttribute(cms.settings.siteInfo.name, "alt")} class="h-24 w-auto object-contain block" loading="eager"> </a> <nav class="hidden lg:flex items-center gap-6 text-sm font-medium text-gray-600"> ${primaryNav.map((item) => renderTemplate`<a${addAttribute(item.href, "href")}${addAttribute([
    "transition-colors",
    isActive(item.href) ? "text-brand font-bold" : "text-gray-600 hover:text-brand"
  ], "class:list")}> ${item.label} </a>`)} </nav> <div class="flex items-center gap-2"> <a${addAttribute(breakingHref, "href")} class="hidden sm:flex items-center gap-1 bg-red-50 text-brand text-xs px-3 py-1.5 rounded-full font-medium"> <span class="material-icons text-sm leading-none">bolt</span> ${breakingNews.label} </a> <form action="/search/" method="get" class="relative"> <input type="search" name="q" placeholder="جستجو..." class="w-28 sm:w-40 lg:w-52 bg-gray-100 text-gray-700 text-sm rounded-full py-2 pr-9 pl-3 outline-none focus:ring-1 focus:ring-brand focus:bg-white transition"> <button type="submit" class="absolute right-2 top-1/2 -translate-y-1/2 text-gray-500 hover:text-brand transition-colors" aria-label="جستجو"> <span class="material-icons text-xl">search</span> </button> </form> <button class="p-2 text-gray-500 hover:text-brand transition-colors hidden sm:block" aria-label="اعلان‌ها"> <span class="material-icons">notifications_none</span> </button> </div> </div> <div class="flex overflow-x-auto gap-1.5 pb-3 scrollbar-hide -mx-1 px-1"> ${categoryTabs.map((category, index) => renderTemplate`<a${addAttribute(category.href, "href")}${addAttribute([
    "whitespace-nowrap text-xs px-3.5 py-1.5 rounded-full font-medium transition-colors",
    isActive(category.href) ? "bg-brand text-white" : "bg-gray-100 text-gray-600 hover:bg-gray-200"
  ], "class:list")}> ${category.label} </a>`)} </div> </div> </header> <div class="bg-brand text-white"> <div class="max-w-7xl mx-auto px-4 lg:px-8 py-2.5 flex items-center gap-3"> <a${addAttribute(breakingHref, "href")} class="bg-white text-brand text-xs font-bold px-2 py-0.5 rounded flex-shrink-0">${breakingNews.label}</a> <div class="overflow-hidden relative flex-1"> <p class="text-sm truncate"> ${breakingText} </p> </div> <span class="material-icons text-yellow-300 text-base flex-shrink-0">bolt</span> </div> </div>`;
}, "/Users/drfelfel/ruseemrooz/src/components/Header.astro", void 0);

const $$Astro$1 = createAstro();
const $$Footer = createComponent(async ($$result, $$props, $$slots) => {
  const Astro2 = $$result.createAstro($$Astro$1, $$props, $$slots);
  Astro2.self = $$Footer;
  const cms = await readCms();
  const footerPageLinks = getFooterPageLinks();
  const pathname = Astro2.url.pathname;
  const normalizePath = (value) => decodeURIComponent(value.replace(/\/+$/, "") || "/");
  const normalizedPathname = normalizePath(pathname);
  const isNavActive = (href) => {
    const target = normalizePath(href);
    if (target === "/") {
      return normalizedPathname === "/";
    }
    return normalizedPathname === target || normalizedPathname.startsWith(`${target}/`);
  };
  const mobileNav = [
    { icon: "home", label: "\u062E\u0627\u0646\u0647", href: "/" },
    { icon: "article", label: "\u0627\u062E\u0628\u0627\u0631", href: "/posts/" },
    { icon: "insights", label: "\u0627\u0642\u062A\u0635\u0627\u062F", href: getCategoryPath("\u0627\u0642\u062A\u0635\u0627\u062F") },
    { icon: "explore", label: "\u062C\u0647\u0627\u0646", href: getCategoryPath("\u0628\u06CC\u0646\u200C\u0627\u0644\u0645\u0644\u0644") },
    { icon: "bolt", label: "\u0627\u0646\u0631\u0698\u06CC", href: getCategoryPath("\u0627\u0646\u0631\u0698\u06CC") }
  ].map((item) => ({ ...item, active: isNavActive(item.href) }));
  return renderTemplate`${maybeRenderHead()}<footer class="bg-gray-900 text-white mt-12 pt-10 pb-28 lg:pb-10"> <div class="max-w-7xl mx-auto px-4 lg:px-8"> <div class="grid grid-cols-2 lg:grid-cols-4 gap-8 mb-8"> <div class="col-span-2 lg:col-span-1"> <div class="flex items-center gap-2 mb-3"> <img src="/assets/logo.png"${addAttribute(cms.settings.siteInfo.name, "alt")} class="h-12 w-auto object-contain block brightness-0 invert" loading="lazy"> </div> <p class="text-gray-400 text-sm leading-relaxed">${cms.settings.siteInfo.description}</p> </div> <div> <h4 class="font-bold mb-3 text-sm">بخش‌ها</h4> <ul class="space-y-2 text-gray-400 text-sm"> ${cms.categories.map((item) => renderTemplate`<li><a${addAttribute(getCategoryPath(item), "href")} class="hover:text-white transition-colors">${item}</a></li>`)} </ul> </div> <div> <h4 class="font-bold mb-3 text-sm">درباره ما</h4> <ul class="space-y-2 text-gray-400 text-sm"> ${footerPageLinks.map((item) => renderTemplate`<li><a${addAttribute(item.href, "href")} class="hover:text-white transition-colors">${item.label}</a></li>`)} </ul> </div> <div> <h4 class="font-bold mb-3 text-sm">خبرنامه</h4> <p class="text-gray-400 text-sm mb-3">آخرین اخبار را در ایمیل دریافت کنید</p> <div class="flex gap-2"> <input type="email" placeholder="ایمیل شما" class="flex-1 bg-gray-800 text-white text-sm px-3 py-2 rounded-lg outline-none focus:ring-1 focus:ring-brand min-w-0"> <button class="bg-brand text-white text-sm px-3 py-2 rounded-lg hover:bg-red-700 transition-colors flex-shrink-0">ثبت</button> </div> </div> </div> <div class="border-t border-gray-800 pt-6 text-center text-gray-500 text-xs">
© ${cms.settings.siteInfo.copyright} </div> </div> </footer> <nav class="lg:hidden fixed bottom-0 left-0 right-0 bg-white border-t border-gray-100 shadow-2xl z-50"> <div class="flex justify-around items-center py-2 px-2"> ${mobileNav.map((item) => renderTemplate`<a${addAttribute(item.href, "href")}${addAttribute([
    "flex flex-col items-center gap-0.5 px-3 py-1 transition-colors relative",
    item.active ? "text-brand" : "text-gray-400"
  ], "class:list")}> ${item.active && renderTemplate`<span class="absolute top-0 left-1/2 -translate-x-1/2 h-1 w-6 rounded-full bg-brand"></span>`} <span class="material-icons text-2xl">${item.icon}</span> <span${addAttribute(["text-xs", item.active && "font-bold"], "class:list")}>${item.label}</span> </a>`)} </div> </nav>`;
}, "/Users/drfelfel/ruseemrooz/src/components/Footer.astro", void 0);

const $$Astro = createAstro();
const $$BaseLayout = createComponent(($$result, $$props, $$slots) => {
  const Astro2 = $$result.createAstro($$Astro, $$props, $$slots);
  Astro2.self = $$BaseLayout;
  const {
    title = "\u0631\u0648\u0633 \u0627\u0645\u0631\u0648\u0632",
    description = "\u062E\u0628\u0631\u06AF\u0632\u0627\u0631\u06CC \u062A\u062E\u0635\u0635\u06CC \u067E\u0648\u0634\u0634 \u0627\u062E\u0628\u0627\u0631 \u0631\u0648\u0633\u06CC\u0647\u060C \u0627\u0648\u0631\u0627\u0633\u06CC\u0627 \u0648 \u0631\u0648\u0627\u0628\u0637 \u0645\u0646\u0637\u0642\u0647\u200C\u0627\u06CC"
  } = Astro2.props;
  return renderTemplate`<html lang="fa" dir="rtl"> <head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="description"${addAttribute(description, "content")}><title>${title}</title><link rel="stylesheet" href="https://rc0.ir/material-icons/iconfont/material-icons.css"><link rel="stylesheet" href="https://rc0.ir/vazirmatn/Vazirmatn-font-face.css">${renderHead()}</head> <body class="bg-gray-100 font-vazir text-gray-900"> ${renderComponent($$result, "Header", $$Header, {})} ${renderSlot($$result, $$slots["default"])} ${renderComponent($$result, "Footer", $$Footer, {})} </body></html>`;
}, "/Users/drfelfel/ruseemrooz/src/layouts/BaseLayout.astro", void 0);

export { $$BaseLayout as $ };
