/* eslint-disable @next/next/no-img-element */
import Link from "next/link";
import { notFound } from "next/navigation";
import {
  ArrowRight,
  Award,
  BookOpen,
  Bot,
  BriefcaseBusiness,
  Calculator,
  ChevronRight,
  ClipboardCheck,
  Clock,
  GraduationCap,
  Languages,
  Lightbulb,
  Mic2,
  NotebookPen,
  PenLine,
  Presentation,
  Search,
  Scale,
  ShieldCheck,
  Stethoscope,
  Target,
  UsersRound,
} from "lucide-react";
import CVHeader from "@/components/layout/CVHeader";
import CVFooter from "@/components/layout/CVFooter";
import {
  blogCategory,
  blogDate,
  blogExcerpt,
  blogImage,
  blogPostUrl,
  blogReadTime,
  cleanText,
  getBlogCategories,
  getBlogPosts,
} from "@/lib/blogPosts";
import { mergeStaticBlogPosts } from "@/lib/staticBlogPosts";
import { STRATEGY_CATEGORIES } from "@/data/seo/strategyArticles";
import { TESOL_CLUSTER_LINKS } from "@/data/blog/tesolClusterPages";
import {
  CERTIFICATION_ARTICLE_CLUSTERS,
  CERTIFICATION_ARTICLE_LINKS_BY_CLUSTER,
} from "@/data/blog/certificationArticleClusters";
import { ALGEBRA_BLOG_CATEGORY } from "@/data/seo/algebraGrowthArticles";
import { CVAF_CATEGORIES } from "@/data/seo/cvafArticles";

const SITE_URL = "https://cambridgeveritas.com";
const BLOG_URL = `${SITE_URL}/blog`;
const DARK = "#2D0A18";
const MID = "#4A1429";
const POSTS_PER_PAGE = 12;
const TEACHER_CATEGORY = "teacher-training";
const INDIA_GUIDE_SLUG = "tesol-certification-in-india-complete-guide-2026-costs-courses-and-careers";

const PRIMARY_CATEGORY_SLUGS = [
  "fluency",
  "teacher-training",
  "ielts",
  "grammar",
  "pronunciation",
  "ai-in-education",
  "career-english",
  "medical-english",
  "spoken-english",
  "algebra-1",
];

const START_HERE_SLUGS = [
  INDIA_GUIDE_SLUG,
  "what-are-test-techniques-a-practical-guide-for-english-teachers",
  "digital-technology-and-online-teaching-what-english-teachers-really-need",
  "how-to-design-an-english-syllabus-that-actually-works",
  "how-teachers-should-respond-to-student-writing",
  "how-we-should-teach-english-lessons-from-flipped-learning-research",
];

const MAIN_FAQS = [
  ["What topics does the Cambridge Veritas blog cover?", "The blog covers TESOL and TEFL teacher development, certification, lesson planning, assessment, IELTS, pronunciation, grammar, specialist English, educational technology and professional communication."],
  ["Where can I find TESOL teacher-training articles?", "Use the dedicated TESOL and teacher-training hub to browse certification guides, teaching methodology, assessment, syllabus design, online teaching and career resources."],
  ["Are the English teaching articles free?", "Yes. The editorial guides and blog articles can be read without purchasing a Cambridge Veritas programme."],
  ["Does the blog replace a TESOL qualification?", "No. Editorial resources support learning and professional reflection, but they do not replace assessed training, observed teaching practice or an awarded qualification."],
];

const TEACHER_FAQS = [
  ["What is TESOL?", "TESOL means Teaching English to Speakers of Other Languages. It is a broad field covering English teaching in multilingual, international, online and community contexts."],
  ["What is the difference between TESOL and TEFL?", "TESOL is a broad term for teaching English to speakers of other languages. TEFL commonly refers to teaching English as a foreign language. Course recognition, assessment and teaching-practice requirements depend on the provider and qualification."],
  ["Where can English teachers find TESOL teaching resources?", "This hub organises Cambridge Veritas guides on certification, methodology, lesson planning, assessment, online teaching and careers. The free-resources library provides additional level- and skill-based teaching materials."],
  ["Can non-native English speakers become TESOL teachers?", "Many multilingual teachers build successful English-teaching careers. Requirements vary by employer and country, but strong English proficiency, teaching knowledge, practical evidence and relevant qualifications are important."],
];

const ALGEBRA_FAQS = [
  ["Are these official STAAR Algebra I resources?", "No. Cambridge Veritas tutorials and practice problems are original learning materials. Official blueprints, released questions, keys and rationales are linked from the Texas Education Agency."],
  ["Where should a student begin?", "Start with the Algebra 1 skills checklist or free diagnostic, then choose one focused tutorial or worksheet from the evidence."],
  ["Do the resources replace a teacher or tutor?", "No. They support independent practice. A student who remains stuck, cannot explain the work or shows persistent prerequisite gaps may benefit from school or tutor support."],
  ["Are the worksheets free to print?", "Yes. The Algebra 1 worksheets can be printed or saved as PDF for personal learning use and include worked answer keys."],
];

const TOPIC_HUBS = [
  { icon: GraduationCap, title: "TESOL & Teacher Training", text: "Certification, methodology, lesson planning, assessment and professional development.", href: "/blog/teacher-training", cta: "Explore TESOL resources" },
  { icon: Target, title: "Algebra 1 for Texas", text: "STAAR EOC preparation, parent decisions, study plans and free worked practice.", href: "/algebra-1/resources", cta: "Explore Algebra 1 resources" },
  { icon: Target, title: "IELTS & Specialist Training", text: "IELTS guidance, trainer development and specialist English teaching contexts.", href: "/blog/ielts", cta: "Browse IELTS guides" },
  { icon: BookOpen, title: "English Teaching Resources", text: "CEFR practice, grammar, pronunciation, activities and classroom support.", href: "/free-resources", cta: "Open free resources" },
  { icon: Lightbulb, title: "AI & Educational Technology", text: "Practical and responsible uses of technology in language education.", href: "/blog/ai-in-education", cta: "Explore technology guides" },
];

const CAREER_LINKS = [
  { title: "TESOL Career Guide", text: "Explore English-teaching roles, employer requirements, online work, international pathways and progression.", href: "/career" },
  { title: "TESOL Certification in India", text: "Compare costs, course selection, eligibility and career considerations.", href: `/blog/teacher-training/${INDIA_GUIDE_SLUG}` },
  { title: "Teaching English in China", text: "Understand qualifications, legal pathways, job types and classroom expectations.", href: "/blog/teacher-training/teaching-english-in-china-a-comprehensive-guide-2026" },
  { title: "TESOL Teaching Practice", text: "Learn how planning, observation, feedback, reflection and portfolio evidence work together.", href: "/tesol-teaching-practice" },
  { title: "Cambridge Veritas TESOL Reviews", text: "Read public CVTE graduate experiences and understand how course reviews are verified.", href: "/reviews#tesol-reviews" },
];

const TEACHER_PATHWAYS = [
  { title: "TESOL Certification Guides", text: "Eligibility, course selection, qualification comparisons, costs and career decisions.", query: "TESOL certification" },
  { title: "Teaching Methodology", text: "Flipped learning, classroom practice, language teaching principles and ESP.", query: "teaching" },
  { title: "Lesson Planning & Assessment", text: "Syllabus design, test techniques, writing feedback and evidence of learning.", query: "assessment" },
  { title: "Teaching English Online", text: "Digital technology, online delivery and practical teacher-development decisions.", query: "online teaching" },
];

const ARTICLE_ARTWORK_PALETTES = [
  ["#2D0A18", "#7A2444", "#F3D778"],
  ["#133B45", "#287482", "#BFE8E3"],
  ["#30245C", "#6653A7", "#DDD5FF"],
  ["#173E2F", "#39765C", "#D1E9B8"],
  ["#563313", "#A86224", "#FFE0A3"],
  ["#172D54", "#35639A", "#D6E7FF"],
];

const ARTICLE_ARTWORK_TOPICS = [
  { match: /reflect|journal|portfolio/i, label: "Reflective practice", Icon: NotebookPen },
  { match: /children|young learner|adult|mixed[- ]ability/i, label: "Learner groups", Icon: UsersRound },
  { match: /certificate.*\b(vs|versus)\b|\b(vs|versus)\b.*certificate|master'?s|\bma tesol\b|compare.*qualification/i, label: "Compare pathways", Icon: Scale },
  { match: /pronunciation|accent|voice|speaking|phonetic|\bipa\b/i, label: "Speech & pronunciation", Icon: Mic2 },
  { match: /ielts|assessment|exam|test technique|band descriptor|rubric/i, label: "Assessment insight", Icon: ClipboardCheck },
  { match: /artificial intelligence|\bai\b|digital|technology|online teaching/i, label: "Teaching technology", Icon: Bot },
  { match: /medical|doctor|healthcare|nursing/i, label: "Medical English", Icon: Stethoscope },
  { match: /algebra|math|equation|quadratic|staar|teks/i, label: "Algebra learning", Icon: Calculator },
  { match: /grammar|writing|essay|word|language mistake/i, label: "Language & writing", Icon: PenLine },
  { match: /career|job|employ|workplace|business english/i, label: "Career development", Icon: BriefcaseBusiness },
  { match: /lesson|classroom|teaching|teacher|tesol|tefl/i, label: "Teaching practice", Icon: Presentation },
  { match: /certificate|certification|qualification|degree/i, label: "Professional learning", Icon: Award },
  { match: /english|language|fluency/i, label: "English learning", Icon: Languages },
];

function titleHash(value) {
  return Array.from(String(value || "")).reduce((hash, character) => ((hash * 31) + character.charCodeAt(0)) >>> 0, 7);
}

function articleArtworkTheme(post) {
  const source = `${post?.title || ""} ${post?.summary || ""} ${post?.keywords || ""}`;
  const topic = ARTICLE_ARTWORK_TOPICS.find(({ match }) => match.test(source)) || {
    label: "Editorial guide",
    Icon: BookOpen,
  };
  const hash = titleHash(post?.title);
  return { ...topic, hash, palette: ARTICLE_ARTWORK_PALETTES[hash % ARTICLE_ARTWORK_PALETTES.length] };
}

function hasDedicatedArticleImage(image) {
  return Boolean(image && !/(^|\/)opengraph-image\/?(?:\?.*)?$/i.test(image));
}

export async function getBlogHubMetadata({ searchParams, categorySlug = "all", categoryName = "" }) {
  const params = await searchParams;
  const rawPage = Number(Array.isArray(params?.page) ? params.page[0] : params?.page);
  const page = Number.isFinite(rawPage) && rawPage > 1 ? Math.floor(rawPage) : 1;
  const query = cleanText(Array.isArray(params?.q) ? params.q[0] : params?.q);
  const isTeacher = categorySlug === TEACHER_CATEGORY;
  const isAlgebra = categorySlug === ALGEBRA_BLOG_CATEGORY.slug;
  const certificationCluster = CERTIFICATION_ARTICLE_CLUSTERS.find(
    (cluster) => cluster.category.slug === categorySlug
  );
  const isCategory = categorySlug && categorySlug !== "all";
  const basePath = isCategory ? `/blog/${categorySlug}` : "/blog";
  const baseUrl = `${SITE_URL}${basePath}`;
  const baseTitle = isTeacher
    ? "TESOL Resources & English Teacher Training Blog"
    : isAlgebra
      ? "Algebra 1 Guides for Texas Students and Parents"
    : certificationCluster
      ? certificationCluster.hubTitle
    : isCategory
      ? `${cleanText(categoryName, categorySlug)} Guides and Resources`
      : "TESOL & English Teaching Blog";
  const title = page > 1 ? `${baseTitle} – Page ${page} | Cambridge Veritas` : `${baseTitle} | Cambridge Veritas`;
  const description = isTeacher
    ? "Explore TESOL certification, lesson planning, assessment, teaching methodology, online English teaching and professional-development resources for English teachers."
    : isAlgebra
      ? "Explore Algebra 1 study plans, parent guides, Texas STAAR EOC preparation, worked tutorials and free printable practice resources."
    : certificationCluster?.key === "cvim"
      ? "Explore 15 practical IELTS teacher-training guides covering qualifications, lesson planning, all four test skills, Band Descriptors, feedback and career development."
      : certificationCluster?.key === "cvat"
        ? "Explore 20 practical voice, accent and pronunciation teaching guides covering IPA, English sounds, stress, intonation, diagnosis, feedback and trainer careers."
    : isCategory
      ? `Explore Cambridge Veritas ${cleanText(categoryName, categorySlug).toLowerCase()} articles, practical guides and professional learning resources.`
      : "Explore practical TESOL, TEFL and English-teaching guides covering certification, lesson planning, methodology, assessment, IELTS, pronunciation and teacher careers.";
  const canonical = query ? baseUrl : page > 1 ? `${baseUrl}?page=${page}` : baseUrl;

  return {
    metadataBase: new URL(SITE_URL),
    title,
    description,
    keywords: null,
    alternates: { canonical },
    robots: query ? { index: false, follow: true } : { index: true, follow: true },
    openGraph: { type: "website", url: canonical, siteName: "Cambridge Veritas", title, description },
    twitter: { card: "summary_large_image", title, description },
  };
}

export async function generateMetadata({ searchParams }) {
  return getBlogHubMetadata({ searchParams });
}

function CategoryBadge({ category }) {
  return <span className="inline-flex w-fit self-start items-center gap-1 rounded-full px-3 py-1 text-[10px] font-extrabold uppercase tracking-widest" style={{ background: `${category.color}15`, color: category.color, border: `1px solid ${category.color}30` }}><span>{category.emoji}</span>{category.name}</span>;
}

function ArticleArtwork({ post, featured = false }) {
  const image = blogImage(post);
  if (hasDedicatedArticleImage(image)) {
    return (
      <img
        src={image}
        alt=""
        width={featured ? "800" : "640"}
        height={featured ? "500" : "360"}
        fetchPriority={featured ? "high" : undefined}
        loading={featured ? undefined : "lazy"}
        decoding="async"
        className={`${featured ? "min-h-64" : ""} h-full w-full object-cover transition duration-700 group-hover:scale-105`}
      />
    );
  }

  const { Icon, label, palette, hash } = articleArtworkTheme(post);
  const [start, end, accent] = palette;
  const orbPosition = 16 + (hash % 54);

  return (
    <div
      aria-hidden="true"
      className="relative flex h-full min-h-full flex-col justify-between overflow-hidden p-5 text-white"
      style={{ background: `linear-gradient(145deg, ${start} 0%, ${end} 100%)` }}
    >
      <div className="absolute inset-0 opacity-25" style={{ backgroundImage: "linear-gradient(rgba(255,255,255,.11) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.11) 1px, transparent 1px)", backgroundSize: "28px 28px" }} />
      <div className="absolute -top-12 h-40 w-40 rounded-full blur-2xl" style={{ left: `${orbPosition}%`, backgroundColor: accent, opacity: 0.23 }} />
      <div className="relative flex items-center justify-between gap-3 text-[10px] font-black uppercase tracking-[0.16em] text-white/70">
        <span>Cambridge Veritas</span>
        <span className="rounded-full border border-white/20 bg-white/10 px-2.5 py-1">Editorial</span>
      </div>
      <div className={`relative ${featured ? "my-7" : "my-4"}`}>
        <div className="flex items-center gap-3">
          <span className="flex h-12 w-12 shrink-0 items-center justify-center rounded-2xl border border-white/20 bg-white/12 shadow-lg backdrop-blur-sm">
            <Icon className="h-6 w-6" style={{ color: accent }} strokeWidth={2.1} />
          </span>
          <span className="text-xs font-black uppercase tracking-[0.16em]" style={{ color: accent }}>{label}</span>
        </div>
        <p className={`${featured ? "mt-5 max-w-xl text-2xl" : "mt-4 text-base"} line-clamp-2 font-black leading-tight text-white`}>
          {post.title}
        </p>
      </div>
      <div className="relative h-1.5 w-16 rounded-full" style={{ backgroundColor: accent }} />
    </div>
  );
}

function FeaturedCard({ post }) {
  const category = blogCategory(post);
  return (
    <article className="group overflow-hidden rounded-3xl border border-[#E8DDD5] bg-white transition hover:-translate-y-1 hover:shadow-2xl">
      <Link href={blogPostUrl(post)} className="grid lg:grid-cols-2">
        <div className="relative min-h-64 overflow-hidden bg-[#F5EFE8]"><ArticleArtwork post={post} featured /><span className="absolute left-4 top-4 rounded-full bg-[#D4B038] px-3 py-1.5 text-xs font-extrabold text-[#1C0A12]">Featured TESOL guide</span></div>
        <div className="flex flex-col justify-center p-7 lg:p-10"><CategoryBadge category={category} /><h2 className="mt-3 text-2xl font-black leading-snug text-[#1C0A12] group-hover:text-[#4A1429]">{post.title}</h2><p className="mt-3 text-sm leading-7 text-[#7A5C65]">{blogExcerpt(post, 230)}</p><div className="mt-6 flex flex-wrap gap-4 text-xs text-[#7A5C65]"><span className="flex items-center gap-1.5"><Clock className="h-3.5 w-3.5" />{blogReadTime(post)} min read</span><span>{blogDate(post)}</span></div><span className="mt-6 inline-flex w-fit items-center gap-2 rounded-2xl bg-[#4A1429] px-6 py-3 text-sm font-extrabold text-white">Read the guide <ArrowRight className="h-4 w-4" /></span></div>
      </Link>
    </article>
  );
}

function BlogCard({ post }) {
  const category = blogCategory(post);
  return (
    <article className="group flex h-full flex-col overflow-hidden rounded-3xl border border-[#E8DDD5] bg-white transition hover:-translate-y-1 hover:shadow-xl">
      <Link href={blogPostUrl(post)} className="flex h-full flex-col"><div className="relative h-48 overflow-hidden bg-[#F5EFE8]"><ArticleArtwork post={post} /></div><div className="flex flex-1 flex-col p-5"><CategoryBadge category={category} /><h3 className="mt-2.5 line-clamp-2 text-base font-extrabold leading-snug text-[#1C0A12] group-hover:text-[#4A1429]">{post.title}</h3><p className="mt-2 line-clamp-3 text-xs leading-relaxed text-[#7A5C65]">{blogExcerpt(post)}</p><div className="mt-auto flex items-center justify-between gap-3 pt-5 text-xs text-[#7A5C65]"><span className="flex items-center gap-1"><Clock className="h-3 w-3" />{blogReadTime(post)} min</span><span className="flex items-center gap-1 font-bold text-[#4A1429]">Read <ChevronRight className="h-3.5 w-3.5" /></span></div></div></Link>
    </article>
  );
}

function pageHref({ category, page, query }) {
  const base = category && category !== "all" ? `/blog/${category}` : "/blog";
  const params = new URLSearchParams();
  if (query) params.set("q", query);
  if (page > 1) params.set("page", String(page));
  const qs = params.toString();
  return qs ? `${base}?${qs}` : base;
}

function Pagination({ currentPage, totalPages, selectedCategory, query }) {
  if (totalPages <= 1) return null;
  return <nav className="mt-10 flex flex-wrap items-center justify-center gap-2" aria-label="Blog pagination"><Link href={pageHref({ category: selectedCategory, page: Math.max(1, currentPage - 1), query })} className={`rounded-xl border border-[#E8DDD5] px-4 py-2 text-sm font-bold text-[#4A1429] ${currentPage === 1 ? "pointer-events-none opacity-40" : "hover:bg-white"}`}>Previous</Link>{Array.from({ length: totalPages }, (_, index) => index + 1).map((page) => <Link key={page} href={pageHref({ category: selectedCategory, page, query })} className={`flex h-10 w-10 items-center justify-center rounded-xl border text-sm font-black ${currentPage === page ? "border-[#4A1429] bg-[#4A1429] text-white" : "border-[#E8DDD5] bg-white text-[#4A1429]"}`}>{page}</Link>)}<Link href={pageHref({ category: selectedCategory, page: Math.min(totalPages, currentPage + 1), query })} className={`rounded-xl border border-[#E8DDD5] px-4 py-2 text-sm font-bold text-[#4A1429] ${currentPage === totalPages ? "pointer-events-none opacity-40" : "hover:bg-white"}`}>Next</Link></nav>;
}

function LatestArticlesSection({
  filteredPosts,
  gridPosts,
  selectedCategory,
  selectedCategoryData,
  query,
  currentPage,
  totalPages,
}) {
  return (
    <section aria-labelledby="latest-title">
      <div className="mb-7 flex flex-wrap items-end justify-between gap-4">
        <div>
          <p className="text-xs font-black uppercase tracking-[0.2em] text-[#8B1C1C]">Editorial library</p>
          <h2 id="latest-title" className="mt-2 text-3xl font-black text-[#1C0A12]">{query ? "Search Results" : "Latest Articles"}</h2>
          <p className="mt-2 text-sm text-[#7A5C65]">
            {filteredPosts.length} {filteredPosts.length === 1 ? "article" : "articles"}
            {selectedCategory !== "all" ? ` in ${selectedCategoryData?.name || "this category"}` : " across English teaching and learning"}
          </p>
        </div>
        {selectedCategory === "all" ? <Link href="/blog/teacher-training" className="inline-flex items-center gap-2 text-sm font-black text-[#8B1C1C]">TESOL teacher training resources <ArrowRight className="h-4 w-4" /></Link> : null}
      </div>
      {gridPosts.length ? (
        <div className="grid gap-6 sm:grid-cols-2 lg:grid-cols-3">
          {gridPosts.map((post) => <BlogCard key={post.id} post={post} />)}
        </div>
      ) : (
        <div className="rounded-3xl border border-[#E8DDD5] bg-white py-16 text-center">
          <Search className="mx-auto h-9 w-9 text-[#8B1C1C]" />
          <p className="mt-4 font-semibold text-[#7A5C65]">No articles found. Try a broader search.</p>
        </div>
      )}
      <Pagination currentPage={currentPage} totalPages={totalPages} selectedCategory={selectedCategory} query={query} />
    </section>
  );
}

export default async function BlogPage({ searchParams, categorySlug }) {
  const params = await searchParams;
  const selectedCategory = cleanText(categorySlug || params?.category, "all");
  const query = cleanText(Array.isArray(params?.q) ? params.q[0] : params?.q).toLowerCase();
  const rawPage = Number(Array.isArray(params?.page) ? params.page[0] : params?.page);
  const requestedPage = Number.isFinite(rawPage) && rawPage > 0 ? Math.floor(rawPage) : 1;
  const [databaseCategories, databasePosts] = await Promise.all([
    getBlogCategories().catch(() => []),
    getBlogPosts().catch(() => []),
  ]);
  const fallbackCategories = [
    ...STRATEGY_CATEGORIES.filter((category) => !CVAF_CATEGORIES.some((item) => item.slug === category.slug) && !CERTIFICATION_ARTICLE_CLUSTERS.some((cluster) => cluster.category.slug === category.slug)),
    ...CVAF_CATEGORIES.filter((category) => !CERTIFICATION_ARTICLE_CLUSTERS.some((cluster) => cluster.category.slug === category.slug)),
    ALGEBRA_BLOG_CATEGORY,
    { id: 2, name: "TEACHER TRAINING", slug: "teacher-training", color: "#8B1C1C", emoji: "🎓" },
    ...CERTIFICATION_ARTICLE_CLUSTERS.map((cluster) => cluster.category),
  ];
  const categories = [
    ...databaseCategories,
    ...fallbackCategories.filter(
      (fallback) => !databaseCategories.some((category) => category.slug === fallback.slug)
    ),
  ];
  const posts = mergeStaticBlogPosts(databasePosts);
  const selectedCategoryData = categories.find((item) => item.slug === selectedCategory);
  const isTeacherHub = selectedCategory === TEACHER_CATEGORY;
  const isAlgebraHub = selectedCategory === ALGEBRA_BLOG_CATEGORY.slug;
  const activeCertificationCluster = CERTIFICATION_ARTICLE_CLUSTERS.find(
    (cluster) => cluster.category.slug === selectedCategory
  );
  const filteredPosts = posts.filter((post) => {
    const category = blogCategory(post);
    const matchesCategory = selectedCategory === "all" || category.slug === selectedCategory;
    const haystack = `${post.title} ${post.summary} ${post.keywords}`.toLowerCase();
    return matchesCategory && (!query || haystack.includes(query));
  });
  const featuredPost = activeCertificationCluster
    ? null
    : selectedCategory === "all" || isTeacherHub
    ? posts.find((post) => post.slug === INDIA_GUIDE_SLUG) || filteredPosts[0]
    : filteredPosts[0];
  const featured = !query && requestedPage === 1 ? featuredPost : null;
  const startHerePosts = isTeacherHub && !query && requestedPage === 1
    ? START_HERE_SLUGS.map((slug) => posts.find((post) => post.slug === slug)).filter(Boolean)
    : [];
  const excludedIds = new Set([featuredPost?.id].filter(Boolean));
  const listingPosts = filteredPosts.filter((post) => !excludedIds.has(post.id));
  const totalPages = Math.max(1, Math.ceil(listingPosts.length / POSTS_PER_PAGE));
  if (!query && requestedPage > totalPages) notFound();
  const currentPage = Math.min(requestedPage, totalPages);
  const gridPosts = listingPosts.slice((currentPage - 1) * POSTS_PER_PAGE, currentPage * POSTS_PER_PAGE);
  const canonical = query
    ? `${SITE_URL}${selectedCategory === "all" ? "/blog" : `/blog/${selectedCategory}`}`
    : pageHref({ category: selectedCategory, page: currentPage, query: "" });
  const canonicalUrl = canonical.startsWith("http") ? canonical : `${SITE_URL}${canonical}`;
  const faqs = isTeacherHub ? TEACHER_FAQS : isAlgebraHub ? ALGEBRA_FAQS : MAIN_FAQS;
  const schemaPosts = [...startHerePosts, featured, ...gridPosts].filter(Boolean).filter((post, index, array) => array.findIndex((item) => item.id === post.id) === index).slice(0, 12);
  const schema = {
    "@context": "https://schema.org",
    "@graph": [
      { "@type": "Blog", "@id": `${canonicalUrl}#blog`, url: canonicalUrl, name: isTeacherHub ? "Cambridge Veritas TESOL Resources and English Teacher Training Blog" : isAlgebraHub ? "Cambridge Veritas Algebra 1 Guides for Texas Students and Parents" : "Cambridge Veritas TESOL & English Teaching Blog", description: isTeacherHub ? "TESOL certification, methodology, lesson planning, assessment, online teaching and professional-development resources for English teachers." : isAlgebraHub ? "Algebra 1 study plans, parent guides, Texas STAAR EOC preparation and free worked learning resources." : "Practical TESOL, TEFL and English-teaching resources covering certification, methodology, assessment, IELTS, pronunciation and teacher development.", publisher: { "@id": `${SITE_URL}/#organization` }, blogPost: schemaPosts.map((post) => ({ "@type": "BlogPosting", headline: post.title, url: `${SITE_URL}${blogPostUrl(post)}` })) },
      { "@type": "BreadcrumbList", "@id": `${canonicalUrl}#breadcrumb`, itemListElement: [{ "@type": "ListItem", position: 1, name: "Home", item: `${SITE_URL}/` }, { "@type": "ListItem", position: 2, name: "Blog", item: BLOG_URL }, ...(selectedCategory !== "all" ? [{ "@type": "ListItem", position: 3, name: selectedCategoryData?.name || "Teacher Training", item: `${SITE_URL}/blog/${selectedCategory}` }] : [])] },
      { "@type": "ItemList", "@id": `${canonicalUrl}#articles`, numberOfItems: schemaPosts.length, itemListElement: schemaPosts.map((post, index) => ({ "@type": "ListItem", position: index + 1, name: post.title, url: `${SITE_URL}${blogPostUrl(post)}` })) },
    ],
  };
  const categoryNav = categories.filter((category) => PRIMARY_CATEGORY_SLUGS.includes(category.slug));

  return (
    <div className="min-h-screen bg-[#FAF5F0]">
      <CVHeader />
      <main>
        <script type="application/ld+json" dangerouslySetInnerHTML={{ __html: JSON.stringify(schema).replace(/</g, "\\u003c") }} />
        <header className="relative overflow-hidden border-b-4 border-[#D4B038] px-4 py-12 text-white sm:py-16" style={{ background: `linear-gradient(160deg, ${DARK} 0%, ${MID} 60%, #6B1E3D 100%)` }}>
          <div className="relative mx-auto max-w-7xl">
            <nav aria-label="Breadcrumb" className="flex items-center justify-center gap-2 text-xs font-bold text-white/60"><Link href="/" className="hover:text-white">Home</Link><span>/</span>{selectedCategory !== "all" ? <><Link href="/blog" className="hover:text-white">Blog</Link><span>/</span><span>{selectedCategoryData?.name || "Teacher Training"}</span></> : <span>Blog</span>}</nav>
            <div className="mx-auto mt-6 max-w-4xl text-center"><p className="text-xs font-black uppercase tracking-[0.22em] text-[#D4B038]">Cambridge Veritas editorial hub</p><h1 className="mt-4 text-4xl font-black leading-tight sm:text-5xl lg:text-6xl">{activeCertificationCluster ? activeCertificationCluster.hubTitle : isTeacherHub ? "TESOL Resources & English Teacher Training Guides" : isAlgebraHub ? "Algebra 1 Guides for Texas Students and Parents" : selectedCategory !== "all" ? `${selectedCategoryData?.name || "English Teaching"} Guides and Resources` : "TESOL, TEFL & English Teaching Blog"}</h1><div className="mx-auto mt-6 max-w-4xl space-y-4 text-base leading-8 text-white/76 sm:text-lg">{activeCertificationCluster ? <><p>Follow a structured collection of practical guides for {activeCertificationCluster.label}, from career decisions and subject knowledge to lesson planning, assessment and feedback.</p><p>Each article answers a distinct search question, cites its sources and links to related teaching guidance without replacing employer or official assessment requirements.</p></> : isTeacherHub ? <><p>Explore practical TESOL resources for English teachers and aspiring educators. Start with certification guidance, then move into teaching methodology, lesson planning, classroom assessment, syllabus design, online teaching and professional development.</p><p>Use this hub to connect evidence-informed teaching ideas with classroom decisions, free resources, teaching-practice guidance and the Cambridge Veritas TESOL pathway.</p></> : isAlgebraHub ? <><p>Use parent decision guides, study plans and error diagnostics alongside the free Algebra 1 tutorial and worksheet library.</p><p>Texas exam guidance links to current TEA sources. Cambridge Veritas worked problems are original and are never presented as released STAAR questions.</p></> : <><p>Cambridge Veritas publishes practical guides for English teachers, TESOL professionals, IELTS trainers and language learners. Explore evidence-informed resources on TESOL and TEFL certification, teaching methodology, lesson planning, classroom assessment, pronunciation, IELTS, technology and professional development.</p><p>If you are preparing to become an English teacher, start with our TESOL teacher-training resources. Experienced educators can explore methodology, assessment, syllabus design, AI in language education and specialist English teaching.</p></>}</div></div>
            <form action={selectedCategory !== "all" ? `/blog/${selectedCategory}` : "/blog"} className="relative mx-auto mt-8 max-w-xl"><Search className="absolute left-5 top-1/2 h-5 w-5 -translate-y-1/2 text-[#7A5C65]" /><input name="q" defaultValue={Array.isArray(params?.q) ? params.q[0] : params?.q || ""} aria-label="Search blog articles" placeholder="Search TESOL, assessment, IELTS, pronunciation…" className="h-13 w-full rounded-3xl border-2 border-transparent bg-white px-6 py-4 pl-14 text-sm text-[#1C0A12] shadow-lg outline-none focus:border-[#D4B038]" /></form>
            <div className="mx-auto mt-7 flex max-w-6xl flex-wrap justify-center gap-2"><CategoryChip href="/blog" active={selectedCategory === "all"} label="All topics" emoji="📚" />{categoryNav.map((category) => <CategoryChip key={category.id} href={`/blog/${category.slug}`} active={selectedCategory === category.slug} label={category.name} emoji={category.emoji} />)}</div>
          </div>
        </header>

        <div className="mx-auto max-w-7xl px-4 py-12 sm:px-6 lg:px-8 lg:py-16">
          <LatestArticlesSection
            filteredPosts={filteredPosts}
            gridPosts={gridPosts}
            selectedCategory={selectedCategory}
            selectedCategoryData={selectedCategoryData}
            query={query}
            currentPage={currentPage}
            totalPages={totalPages}
          />

          {!query && requestedPage === 1 ? (
            <div className="mt-16">
              {activeCertificationCluster ? <CertificationClusterHub cluster={activeCertificationCluster} /> : isTeacherHub ? <TeacherHubIntro posts={startHerePosts} /> : isAlgebraHub ? <AlgebraHubIntro /> : <MainHubIntro />}
              {!activeCertificationCluster && !isAlgebraHub ? <section className="mt-14"><SectionHeading eyebrow="Start your TESOL career" title="Build Knowledge Before Choosing a Training Path" text="Use independent guides to compare certification, understand international teaching contexts and see what practical teaching evidence involves." /><div className="grid gap-5 md:grid-cols-3">{CAREER_LINKS.map((item) => <Link key={item.title} href={item.href} className="group rounded-3xl border border-[#E8DDD5] bg-white p-6 shadow-sm transition hover:-translate-y-1 hover:border-[#D4B038] hover:shadow-lg"><BriefcaseBusiness className="h-8 w-8 text-[#8B1C1C]" /><h3 className="mt-4 text-xl font-black text-[#1C0A12]">{item.title}</h3><p className="mt-3 text-sm leading-6 text-[#7A5C65]">{item.text}</p><span className="mt-5 inline-flex items-center gap-2 text-sm font-black text-[#8B1C1C]">Read the guide <ArrowRight className="h-4 w-4 transition group-hover:translate-x-1" /></span></Link>)}</div></section> : null}
              {featured ? <section className="mt-14"><SectionHeading eyebrow="Featured cornerstone guide" title={isAlgebraHub ? "Start With a Parent Decision Guide" : "Start With TESOL Certification in India"} text={isAlgebraHub ? "Use specific learning evidence to decide what support a student needs before comparing tutoring formats." : "A practical commercial-investigation guide covering costs, course selection, eligibility and career considerations without competing with the transactional TESOL course page."} /><FeaturedCard post={featured} /></section> : null}
            </div>
          ) : null}

          {!isAlgebraHub ? <ExpertSection /> : null}
          <section className="mt-14" id="faq"><SectionHeading eyebrow="Helpful answers" title={isTeacherHub ? "Frequently Asked Questions About TESOL Resources" : isAlgebraHub ? "Frequently Asked Questions About Algebra 1 Resources" : "Frequently Asked Questions About the Blog"} text={isAlgebraHub ? "Clear guidance on how to use the original learning resources and find current official Texas assessment information." : "Clear guidance on how the editorial hub supports teachers, trainees and English learners."} /><div className="mx-auto max-w-4xl divide-y divide-[#E8DDD5] rounded-3xl border border-[#E8DDD5] bg-white px-5 sm:px-7">{faqs.map(([question, answer]) => <details key={question} className="py-5"><summary className="cursor-pointer list-none font-black text-[#1C0A12] marker:content-none">{question}</summary><p className="mt-3 leading-7 text-[#7A5C65]">{answer}</p></details>)}</div></section>
        </div>
      </main>
      <CVFooter />
    </div>
  );
}

function CategoryChip({ href, active, label, emoji }) {
  return <Link href={href} className={`inline-flex items-center gap-2 rounded-full border px-4 py-2.5 text-xs font-extrabold uppercase tracking-wide transition ${active ? "border-[#D4B038] bg-[#D4B038] text-[#1C0A12]" : "border-white/20 bg-white/10 text-white/80 hover:bg-white/20"}`}><span>{emoji}</span>{label}</Link>;
}

function SectionHeading({ eyebrow, title, text }) {
  return <div className="mx-auto mb-8 max-w-3xl text-center"><p className="text-xs font-black uppercase tracking-[0.2em] text-[#8B1C1C]">{eyebrow}</p><h2 className="mt-3 text-3xl font-black leading-tight text-[#1C0A12] sm:text-4xl">{title}</h2><p className="mt-4 leading-7 text-[#7A5C65]">{text}</p></div>;
}

function MainHubIntro() {
  return <><section><SectionHeading eyebrow="Curated topic hubs" title="Find English Teaching and Learning Resources" text="Begin with a focused hub instead of searching a mixed chronological archive. Each pathway brings related editorial guides and practical resources together." /><div className="grid gap-5 md:grid-cols-2 lg:grid-cols-4">{TOPIC_HUBS.map((hub) => <TopicHubCard key={hub.title} hub={hub} />)}</div></section><section className="mt-14 grid gap-5 lg:grid-cols-2"><EditorialPanel title="IELTS & Specialist Teacher Training" text="Explore IELTS teaching and preparation, medical English, professional communication and specialist learning contexts." links={[["IELTS guides", "/blog/ielts"], ["Medical English", "/blog/medical-english"], ["English for Specific Purposes", "/blog/teacher-training/understanding-english-for-specific-purposes-esp-a-comprehensive-guide"]]} /><EditorialPanel title="English Learning & Communication" text="Browse grammar, pronunciation, spoken English and fluency guidance for learners and the teachers who support them." links={[["Grammar guides", "/blog/grammar"], ["Pronunciation", "/blog/pronunciation"], ["Spoken English", "/blog/spoken-english"], ["Fluency", "/blog/fluency"]]} /></section></>;
}

function AlgebraHubIntro() {
  const links = [
    ["Complete Algebra 1 resource hub", "Original tutorials, Texas exam guidance and a structured path through the subject.", "/algebra-1/resources"],
    ["Printable worksheets with answers", "Equations, inequalities, functions, systems, quadratics and word problems.", "/algebra-1/worksheets"],
    ["STAAR Algebra I EOC study guide", "Current official-source map, study cycle and eight-week preparation plan.", "/algebra-1/staar-eoc-study-guide"],
    ["Algebra 1 TEKS skills checklist", "Rate skills from evidence and choose a focused next step.", "/algebra-1/skills-checklist"],
  ];

  return (
    <section>
      <SectionHeading
        eyebrow="Teach first, promote support when relevant"
        title="Start With the Free Algebra 1 Learning Library"
        text="The blog helps parents make decisions. The resource library gives students complete explanations, printable practice and worked solutions before any tutoring CTA."
      />
      <div className="grid gap-5 md:grid-cols-2">
        {links.map(([title, text, href]) => (
          <Link key={href} href={href} className="group rounded-3xl border border-[#E8DDD5] bg-white p-6 shadow-sm transition hover:-translate-y-1 hover:border-[#D4B038] hover:shadow-lg">
            <Target className="h-8 w-8 text-[#256E73]" aria-hidden="true" />
            <h3 className="mt-4 text-xl font-black text-[#1C0A12]">{title}</h3>
            <p className="mt-3 text-sm leading-6 text-[#7A5C65]">{text}</p>
            <span className="mt-5 inline-flex items-center gap-2 text-sm font-black text-[#256E73]">Open resource <ArrowRight className="h-4 w-4 transition group-hover:translate-x-1" /></span>
          </Link>
        ))}
      </div>
    </section>
  );
}

function CertificationClusterHub({ cluster }) {
  const articles = CERTIFICATION_ARTICLE_LINKS_BY_CLUSTER[cluster.key] || [];

  return (
    <section>
      <SectionHeading
        eyebrow={`${articles.length}-part ${cluster.programme} editorial series`}
        title={cluster.hubTitle}
        text={`Use the complete ${cluster.label} collection in sequence or open the question that matches your current teaching or career decision.`}
      />
      <ol className="grid gap-4 md:grid-cols-2">
        {articles.map((article) => (
          <li key={article.href}>
            <Link
              href={article.href}
              className="group flex h-full gap-4 rounded-3xl border border-[#E8DDD5] bg-white p-5 shadow-sm transition hover:-translate-y-1 hover:border-[#D4B038] hover:shadow-lg"
            >
              <span className="flex h-10 w-10 shrink-0 items-center justify-center rounded-2xl bg-[#4A1429] text-sm font-black text-white">
                {article.order}
              </span>
              <span className="min-w-0">
                <span className="block font-black leading-6 text-[#1C0A12]">
                  {article.title}
                </span>
                <span className="mt-2 block text-sm leading-6 text-[#7A5C65]">
                  {article.excerpt}
                </span>
                <span className="mt-4 inline-flex items-center gap-2 text-xs font-black text-[#8B1C1C]">
                  Read {article.readTime}-minute guide
                  <ArrowRight className="h-3.5 w-3.5 transition group-hover:translate-x-1" />
                </span>
              </span>
            </Link>
          </li>
        ))}
      </ol>
      <div className="mt-8 flex justify-center">
        <Link
          href={cluster.commercialPath}
          className="inline-flex items-center gap-2 rounded-2xl bg-[#4A1429] px-6 py-3 text-sm font-black text-white transition hover:bg-[#641B37]"
        >
          {cluster.commercialLabel}
          <ArrowRight className="h-4 w-4" />
        </Link>
      </div>
    </section>
  );
}

function TeacherHubIntro({ posts }) {
  return (
    <>
      <section>
        <SectionHeading
          eyebrow="Printable teaching-practice tools"
          title="Plan, Observe and Document TESOL Teaching"
          text="Use the three cornerstone resources together: plan a lesson, collect focused observation evidence and turn selected artifacts into a professional teaching portfolio."
        />
        <div className="grid gap-5 md:grid-cols-3">
          {[
            ["TESOL lesson plan template", "A printable planning framework plus a completed communicative-lesson example.", "/tesol-lesson-plan-template"],
            ["Teaching portfolio examples", "An evidence map, worked entry and privacy-aware portfolio checklist.", "/tesol-teaching-portfolio-examples"],
            ["Observation and feedback rubric", "A printable rubric for low-inference notes and actionable development feedback.", "/tesol-observation-rubric"],
          ].map(([title, text, href]) => (
            <Link key={href} href={href} className="group rounded-3xl border border-[#E8DDD5] bg-white p-6 shadow-sm transition hover:-translate-y-1 hover:border-[#D4B038] hover:shadow-lg">
              <GraduationCap className="h-8 w-8 text-[#8B1C1C]" aria-hidden="true" />
              <h3 className="mt-4 text-xl font-black text-[#1C0A12]">{title}</h3>
              <p className="mt-3 text-sm leading-6 text-[#7A5C65]">{text}</p>
              <span className="mt-5 inline-flex items-center gap-2 text-sm font-black text-[#8B1C1C]">Open resource <ArrowRight className="h-4 w-4 transition group-hover:translate-x-1" /></span>
            </Link>
          ))}
        </div>
      </section>

      <section className="mt-14">
        <SectionHeading
          eyebrow="Start here: TESOL teacher training"
          title="Core TESOL Guides for English Teachers"
          text="Begin with certification, assessment, syllabus design, learner feedback, methodology and online teaching. These existing cornerstone resources establish the core of the Cambridge Veritas TESOL editorial cluster."
        />
        <div className="grid gap-5 md:grid-cols-2 lg:grid-cols-3">
          {posts.map((post) => <BlogCard key={post.id} post={post} />)}
        </div>
      </section>

      <section className="mt-14">
        <SectionHeading
          eyebrow="10-part decision series"
          title="TESOL Certification & Career Cluster"
          text="Follow the guides in order or open the question that matches your decision. Each page owns a distinct informational intent and points to the commercial course page only when programme comparison becomes relevant."
        />
        <ol className="grid gap-4 md:grid-cols-2">
          {TESOL_CLUSTER_LINKS.map((guide) => (
            <li key={guide.href}>
              <Link
                href={guide.href}
                className="group flex h-full gap-4 rounded-3xl border border-[#E8DDD5] bg-white p-5 shadow-sm transition hover:-translate-y-1 hover:border-[#D4B038] hover:shadow-lg"
              >
                <span className="flex h-10 w-10 shrink-0 items-center justify-center rounded-2xl bg-[#4A1429] text-sm font-black text-white">
                  {guide.order}
                </span>
                <span>
                  <span className="block font-black leading-6 text-[#1C0A12]">{guide.title}</span>
                  <span className="mt-2 block text-sm leading-6 text-[#7A5C65]">{guide.summary}</span>
                  <span className="mt-4 inline-flex items-center gap-2 text-xs font-black text-[#8B1C1C]">
                    {guide.isExistingCornerstone ? "Open cornerstone guide" : "Read guide"}
                    <ArrowRight className="h-3.5 w-3.5 transition group-hover:translate-x-1" />
                  </span>
                </span>
              </Link>
            </li>
          ))}
        </ol>
      </section>

      <section className="mt-14">
        <SectionHeading
          eyebrow="TESOL & teacher training"
          title="Browse by Professional Teaching Need"
          text="Move from qualification research into methodology, planning, assessment and digital teaching without mixing transactional course intent into the editorial hub."
        />
        <div className="grid gap-5 md:grid-cols-2 lg:grid-cols-4">
          {TEACHER_PATHWAYS.map((pathway) => (
            <Link
              key={pathway.title}
              href={`/blog/teacher-training?q=${encodeURIComponent(pathway.query)}`}
              className="group rounded-3xl border border-[#E8DDD5] bg-white p-6 shadow-sm transition hover:border-[#D4B038] hover:shadow-lg"
            >
              <GraduationCap className="h-8 w-8 text-[#8B1C1C]" />
              <h3 className="mt-4 text-xl font-black text-[#1C0A12]">{pathway.title}</h3>
              <p className="mt-3 text-sm leading-6 text-[#7A5C65]">{pathway.text}</p>
              <span className="mt-5 inline-flex items-center gap-2 text-sm font-black text-[#8B1C1C]">
                Browse articles
                <ArrowRight className="h-4 w-4 transition group-hover:translate-x-1" />
              </span>
            </Link>
          ))}
        </div>
        <div className="mt-8 flex flex-wrap justify-center gap-3">
          <Link href="/free-resources" className="rounded-2xl bg-[#4A1429] px-6 py-3 text-sm font-black text-white">Free TESOL teaching resources</Link>
          <Link href="/certifications/cambridge-veritas-certificate-in-TESOL" className="rounded-2xl border border-[#D4B038] bg-white px-6 py-3 text-sm font-black text-[#4A1429]">120-hour TESOL certification</Link>
          <Link href="/introduction-class/tesol" className="rounded-2xl border border-[#D4B038] bg-white px-6 py-3 text-sm font-black text-[#4A1429]">Free TESOL introduction class</Link>
        </div>
      </section>
    </>
  );
}

function TopicHubCard({ hub }) {
  const Icon = hub.icon;
  return <Link href={hub.href} className="group rounded-3xl border border-[#E8DDD5] bg-white p-6 shadow-sm transition hover:-translate-y-1 hover:border-[#D4B038] hover:shadow-lg"><Icon className="h-8 w-8 text-[#8B1C1C]" /><h3 className="mt-4 text-xl font-black text-[#1C0A12]">{hub.title}</h3><p className="mt-3 text-sm leading-6 text-[#7A5C65]">{hub.text}</p><span className="mt-5 inline-flex items-center gap-2 text-sm font-black text-[#8B1C1C]">{hub.cta} <ArrowRight className="h-4 w-4 transition group-hover:translate-x-1" /></span></Link>;
}

function EditorialPanel({ title, text, links }) {
  return <section className="rounded-3xl border border-[#E8DDD5] bg-white p-7 shadow-sm"><h2 className="text-2xl font-black text-[#1C0A12]">{title}</h2><p className="mt-3 leading-7 text-[#7A5C65]">{text}</p><div className="mt-5 flex flex-wrap gap-3">{links.map(([label, href]) => <Link key={label} href={href} className="rounded-full border border-[#D4B038]/50 bg-[#FFFBEB] px-4 py-2 text-sm font-black text-[#4A1429]">{label}</Link>)}</div></section>;
}

function ExpertSection() {
  return <section className="mt-14 overflow-hidden rounded-[32px] border border-[#D4B038]/35 bg-gradient-to-br from-[#2D0A18] to-[#4A1429] p-7 text-white sm:p-10"><div className="grid gap-8 lg:grid-cols-[1fr_0.9fr] lg:items-center"><div><p className="text-xs font-black uppercase tracking-[0.2em] text-[#D4B038]">Learn from Cambridge Veritas experts</p><h2 className="mt-3 text-3xl font-black">Transparent Editorial and Subject Review</h2><p className="mt-4 leading-7 text-white/72">Teacher-training guidance is reviewed for usefulness, factual care and alignment with the stated teaching context. Dr Krishnatrya brings a PhD from City, University of London and 15+ years of training experience across five countries, with specialisms in TESOL methodology, lesson planning, language awareness and reflective teacher development.</p><p className="mt-4 text-sm leading-6 text-white/58">Commercial programme information is kept distinct from editorial guidance. Qualification and accreditation claims should be checked against the relevant programme page and named awarding or regulatory evidence.</p></div><div className="rounded-3xl border border-white/15 bg-white/10 p-6"><ShieldCheck className="h-9 w-9 text-[#D4B038]" /><h3 className="mt-4 text-xl font-black">How content is reviewed</h3><ul className="mt-4 space-y-3 text-sm text-white/75"><li>Named reviewer and relevant expertise where applicable</li><li>Published and last-reviewed dates on substantive articles</li><li>Primary and reputable references for consequential claims</li><li>Human review of AI-assisted drafting and corrections</li></ul><div className="mt-6 flex flex-wrap gap-3"><Link href="/editorial-policy" className="rounded-2xl bg-[#D4B038] px-5 py-3 text-sm font-black text-[#1C0A12]">Read the editorial policy</Link><a href="https://www.linkedin.com/in/krishnatrya/" target="_blank" rel="noopener noreferrer" className="rounded-2xl border border-white/25 px-5 py-3 text-sm font-black text-white">Reviewer profile</a></div></div></div></section>;
}
