export const LEGAL_DOCS = [
  {
    slug: "terms-and-conditions",
    title: "Terms and Conditions",
    description: "The rules for using GateWise NG as a customer, resident, guard, visitor, administrator, or approved partner.",
    file: "terms-and-conditions.md"
  },
  {
    slug: "privacy-policy",
    title: "Privacy Policy",
    description: "How GateWise NG collects, uses, shares, protects, retains, and deletes personal data.",
    file: "privacy-policy.md"
  },
  {
    slug: "data-protection-policy",
    title: "Data Protection Policy",
    description: "The privacy and protection principles used when handling customer, resident, guard, visitor, and partner data.",
    file: "data-protection-policy.md"
  },
  {
    slug: "data-retention-and-deletion-policy",
    title: "Data Retention and Deletion Policy",
    description: "How data is retained, deleted, anonymized, or made unidentifiable after approved requests.",
    file: "data-retention-and-deletion-policy.md"
  },
  {
    slug: "cookies-and-cache-policy",
    title: "Cookies and Cache Policy",
    description: "How the website, WebApp, and MobileApp use cookies, cache, local storage, and app storage.",
    file: "cookies-and-cache-policy.md"
  },
  {
    slug: "data-processing-addendum",
    title: "Data Processing Addendum",
    description: "Customer-facing processing terms for estates and organizations using GateWise NG.",
    file: "data-processing-addendum.md"
  },
  {
    slug: "security-and-incident-response-policy",
    title: "Security and Incident Response Policy",
    description: "GateWise NG's public approach to platform security, shared responsibility, and incident handling.",
    file: "security-and-incident-response-policy.md"
  }
];

export const LEGAL_BASE_PATH = "/legal";

export function getLegalDocBySlug(slug) {
  return LEGAL_DOCS.find((doc) => doc.slug === slug) || null;
}

export function renderPublicPolicyFooter() {
  return `
    <footer class="welcome-footer" aria-label="GateWise NG footer">
      <div class="footer-grid">
        <section class="footer-brand">
          <a class="welcome-brand" href="/" aria-label="GateWise NG home">
            <span class="welcome-brand-mark">GW</span>
            <span>GateWise NG</span>
          </a>
          <p>Smart estate visitor management for residents, guards, supervisors, estate admins, and approved estate teams.</p>
          <span>A product of Globulus Technology Limited.</span>
        </section>
        <nav aria-label="Product links">
          <strong>Product</strong>
          <a href="/services">Services</a>
          <a href="/plans">Plans and features</a>
          <a href="/mobile-app">Mobile app</a>
          <a href="/onboarding">Estate signup</a>
          <a href="/demo">Protected demo</a>
          <a href="/app">Login</a>
        </nav>
        <nav aria-label="Company links">
          <strong>Company</strong>
          <a href="/about">About us</a>
          <a href="/partners">Partners</a>
          <a href="/contact">Contact us</a>
          <a href="/legal">Policy Center</a>
        </nav>
        <nav aria-label="Legal and privacy links">
          <strong>Legal</strong>
          ${LEGAL_DOCS.map((doc) => `<a href="/legal/${doc.slug}">${doc.title}</a>`).join("")}
        </nav>
      </div>
    </footer>
  `;
}