// frontend/app/[locale]/partners/page.tsx
import type { Metadata } from "next";
import Link from "next/link";
import type { Locale } from "@/lib/i18n";
import { isLocale } from "@/lib/i18n";

const SITE_URL = process.env.NEXT_PUBLIC_SITE_URL || "https://newsoras.com";
const SITE_NAME = "Newsoras";

const PARTNERS_EMAIL = process.env.NEXT_PUBLIC_PARTNERS_EMAIL || "partners@newsoras.com";
const LAST_UPDATED_ISO = process.env.NEXT_PUBLIC_PARTNERS_LAST_UPDATED || "2026-01-04";

// Opcional: si vas a subir un PDF con tu media/partner kit
const PARTNER_KIT_URL = process.env.NEXT_PUBLIC_PARTNER_KIT_URL || ""; // e.g. https://newsoras.com/partner-kit.pdf

type Copy = {
  title: string;
  subtitle: string;

  metaTitle: string;
  metaDescription: string;

  lastUpdatedLabel: string;

  tocTitle: string;
  toc: { id: string; label: string }[];

  introTitle: string;
  introP: string[];

  whoTitle: string;
  whoCards: { t: string; d: string; bullets: string[] }[];

  opportunitiesTitle: string;
  opportunitiesP: string[];
  opportunities: { t: string; d: string }[];

  standardsTitle: string;
  standardsP: string[];
  standards: string[];

  processTitle: string;
  processSteps: { n: string; t: string; d: string }[];

  logosTitle: string;
  logosP: string;

  faqTitle: string;
  faqs: { q: string; a: string }[];

  contactTitle: string;
  contactP: string;
  contactCta: string;

  footerNote: string;
};

function fmtDate(locale: Locale, iso: string) {
  const d = new Date(iso + "T00:00:00Z");
  const y = d.getUTCFullYear();
  const m = d.getUTCMonth() + 1;
  const day = d.getUTCDate();
  const pad = (n: number) => String(n).padStart(2, "0");

  if (locale === "es") return `${pad(day)}/${pad(m)}/${y}`;
  if (locale === "zh") return `${y}-${pad(m)}-${pad(day)}`;
  return `${y}-${pad(m)}-${pad(day)}`;
}

function getCopy(locale: Locale): Copy {
  if (locale === "es") {
    return {
      title: "Partners",
      subtitle:
        "Estamos abiertos a alianzas con medios, expertos y organizaciones que valoren la veracidad, el contexto y la transparencia.",

      metaTitle: "Partners — Newsoras",
      metaDescription:
        "Partners en Newsoras: colaboraciones editoriales, expertos, creadores y organizaciones. Estándares de transparencia, brand safety e independencia editorial. Contacto para alianzas.",

      lastUpdatedLabel: "Última actualización",

      tocTitle: "Índice",
      toc: [
        { id: "por-que", label: "Por qué colaborar" },
        { id: "quienes", label: "Con quién colaboramos" },
        { id: "oportunidades", label: "Oportunidades" },
        { id: "estandares", label: "Estándares" },
        { id: "proceso", label: "Proceso" },
        { id: "logos", label: "Partners destacados" },
        { id: "faq", label: "FAQ" },
        { id: "contacto", label: "Contacto" },
      ],

      introTitle: "Por qué colaborar con Newsoras",
      introP: [
        "Newsoras es periodismo independiente con foco en geopolítica, mercados y tecnología. Nuestro objetivo es ofrecer claridad y contexto con estándares altos.",
        "Buscamos alianzas que sumen valor real al lector: expertos con criterio, medios que cuiden la credibilidad, y organizaciones con datos o reportes de calidad.",
        "La IA puede usarse como asistente de redacción y apoyo editorial, pero no reemplaza verificación ni criterio humano.",
      ],

      whoTitle: "Con quién colaboramos",
      whoCards: [
        {
          t: "Medios / Publishers",
          d: "Co-publicación, colaboraciones y proyectos especiales (siempre con transparencia).",
          bullets: ["Syndication (caso por caso)", "Co-autorías", "Coberturas conjuntas", "Intercambio de enlaces con criterio"],
        },
        {
          t: "Expertos / Analistas",
          d: "Columnas, entrevistas, explicadores y análisis con background verificable.",
          bullets: ["Opinión con disclosure", "Entrevistas", "Notas “deep dive”", "Revisión de datos/fechas"],
        },
        {
          t: "Creadores (Podcast/YouTube/X)",
          d: "Formatos cortos, resúmenes con contexto y colaboración cross-plataforma.",
          bullets: ["Guiones/resúmenes", "Entrevistas", "Contenido evergreen", "Recortes para redes"],
        },
        {
          t: "ONG / Think Tanks / Universidades",
          d: "Piezas basadas en reportes y datasets, con enlaces y atribución clara.",
          bullets: ["Notas basadas en investigación", "Explicación de metodología", "Visualizaciones simples", "Transparencia total de fuentes"],
        },
      ],

      opportunitiesTitle: "Oportunidades de colaboración",
      opportunitiesP: [
        "Si estás construyendo una marca seria, la mejor estrategia es la consistencia: contenido útil, citación clara, y una experiencia rápida en mobile.",
      ],
      opportunities: [
        { t: "Columna / Sección invitada", d: "Un espacio periódico con tu firma y tu área de expertise." },
        { t: "Entrevistas y Q&A", d: "Formato simple con edición cuidada, pensado para SEO." },
        { t: "Proyectos especiales", d: "Series temáticas, análisis por capítulos, o guías evergreen." },
        { t: "Data + contexto", d: "Piezas con números, fuentes, y explicación accesible." },
        { t: "Eventos (online)", d: "Conversaciones/streams con resumen editorial posterior." },
      ],

      standardsTitle: "Estándares (no negociables)",
      standardsP: [
        "La credibilidad es el activo más valioso. Por eso, estas reglas existen para proteger al lector y al partner.",
      ],
      standards: [
        "Independencia editorial: ningún partner compra cobertura como si fuera noticia.",
        "Transparencia: co-autorías, patrocinios o afiliación se declaran claramente.",
        "Fuentes: cuando algo es un hecho, se respalda con fuentes verificables.",
        "IA como asistente: puede ayudar a redactar, pero no es fuente y puede errar.",
        "Correcciones: si hay error verificable, se corrige y se deja constancia.",
        "Brand safety: rechazamos contenido engañoso, manipulación o desinformación.",
      ],

      processTitle: "Proceso de partnership",
      processSteps: [
        { n: "1", t: "Propuesta", d: "Nos contás qué querés hacer, por qué, y links relevantes." },
        { n: "2", t: "Fit", d: "Evaluamos calidad, alineación editorial y riesgos (brand safety)." },
        { n: "3", t: "Piloto", d: "Probamos una colaboración pequeña para medir resultados." },
        { n: "4", t: "Escala", d: "Si funciona, definimos un plan recurrente y métricas simples." },
      ],

      logosTitle: "Partners destacados",
      logosP:
        "Todavía no hay partners publicados. A medida que se cierren colaboraciones reales, aparecerán aquí (con permiso explícito).",

      faqTitle: "FAQ",
      faqs: [
        {
          q: "¿Puedo aparecer como partner sin contrato?",
          a: "No. Solo publicamos partners/collabs reales y con permiso explícito, para evitar confusiones.",
        },
        {
          q: "¿Se puede hacer contenido patrocinado?",
          a: "Sí, pero siempre etiquetado como patrocinado y sin presentarlo como noticia.",
        },
        {
          q: "¿La IA escribe por ustedes?",
          a: "La IA puede ayudar a redactar o pulir, pero la responsabilidad editorial final es humana.",
        },
        {
          q: "¿Qué tipo de métricas manejan?",
          a: "Depende del formato. En general: tráfico (UTM), engagement, y performance por artículo/placement.",
        },
      ],

      contactTitle: "Hablemos",
      contactP:
        "Escribinos con: quién sos, qué proponés, links de referencia, y el tipo de colaboración que te interesa.",
      contactCta: "Escribir a Partners",

      footerNote:
        "Newsoras — Independencia editorial + estándares altos. Colaboraciones sí, pero con transparencia.",
    };
  }

  if (locale === "zh") {
    return {
      title: "合作伙伴",
      subtitle: "我们欢迎与媒体、专家与组织合作：真实、透明、以读者价值为核心。",

      metaTitle: "合作伙伴 — Newsoras",
      metaDescription:
        "Newsoras 合作伙伴：媒体合作、专家专栏、内容共创与研究组织合作。透明披露、编辑独立与品牌安全标准。",

      lastUpdatedLabel: "最后更新",

      tocTitle: "目录",
      toc: [
        { id: "por-que", label: "为什么合作" },
        { id: "quienes", label: "合作对象" },
        { id: "oportunidades", label: "合作机会" },
        { id: "estandares", label: "标准" },
        { id: "proceso", label: "流程" },
        { id: "logos", label: "已展示的合作方" },
        { id: "faq", label: "FAQ" },
        { id: "contacto", label: "联系" },
      ],

      introTitle: "为什么与 Newsoras 合作",
      introP: [
        "Newsoras 是独立新闻与分析平台，聚焦地缘政治、市场与科技。",
        "我们寻找能为读者提供真实价值的合作：可信专家、重视信誉的媒体、以及拥有优质数据/报告的组织。",
        "AI 可以作为编辑助手，但不替代核查与人类判断。",
      ],

      whoTitle: "合作对象",
      whoCards: [
        { t: "媒体 / Publisher", d: "联合发布与专题合作（透明披露）。", bullets: ["联合署名", "专题合作", "内容互链（有原则）"] },
        { t: "专家 / 分析师", d: "专栏、访谈与解释性内容，强调可核查背景。", bullets: ["专栏", "访谈", "深度解读", "数据核对"] },
        { t: "创作者", d: "播客/视频/社媒共创，强调内容质量与可信度。", bullets: ["脚本/摘要", "访谈", "长青内容", "社媒剪辑"] },
        { t: "研究组织/高校", d: "基于报告与数据集的内容，清晰引用与方法说明。", bullets: ["研究解读", "方法说明", "简洁可视化", "来源透明"] },
      ],

      opportunitiesTitle: "合作机会",
      opportunitiesP: ["认真做内容的合作，关键是：一致性、清晰引用、移动端体验。"],
      opportunities: [
        { t: "客座专栏", d: "定期署名栏目，匹配你的专业领域。" },
        { t: "访谈/Q&A", d: "适合 SEO 的清晰结构与编辑。" },
        { t: "专题系列", d: "主题系列与深度项目。" },
        { t: "数据与背景", d: "用数据讲清楚事实与逻辑。" },
        { t: "线上活动", d: "对谈/直播 + 事后编辑总结。" },
      ],

      standardsTitle: "标准（原则性）",
      standardsP: ["可信度是核心资产。为保护读者与合作方，我们坚持以下规则："],
      standards: [
        "编辑独立：不以“新闻”形式出售报道。",
        "透明披露：共创/赞助/利益关系必须说明。",
        "事实与来源：事实需可核查来源支撑。",
        "AI 仅作助手：不作为来源，可能出错。",
        "更正机制：有可核查错误即更正并注明。",
        "品牌安全：拒绝误导与操纵性内容。",
      ],

      processTitle: "合作流程",
      processSteps: [
        { n: "1", t: "提案", d: "说明你是谁、想做什么、并提供参考链接。" },
        { n: "2", t: "匹配评估", d: "评估质量、编辑一致性与风险。" },
        { n: "3", t: "小规模试点", d: "先做一次小合作，观察结果。" },
        { n: "4", t: "扩大", d: "若有效，制定长期计划与指标。" },
      ],

      logosTitle: "已展示的合作方",
      logosP: "目前尚无公开展示的合作方。未来仅在获得明确许可后展示。",

      faqTitle: "FAQ",
      faqs: [
        { q: "没有合同能展示为合作伙伴吗？", a: "不行。我们只展示真实合作并获得明确许可的合作方。" },
        { q: "能做赞助内容吗？", a: "可以，但必须清晰标注，不伪装成新闻。" },
        { q: "AI 会替你们写文章吗？", a: "AI 可辅助写作与润色，但最终编辑责任由人类承担。" },
      ],

      contactTitle: "联系",
      contactP: "请说明：你是谁、合作想法、参考链接、合作类型。",
      contactCta: "发送合作邮件",

      footerNote: "Newsoras — 独立编辑判断 + 高标准。合作可以，但透明必须。",
    };
  }

  return {
    title: "Partners",
    subtitle:
      "We’re open to collaborations with publishers, experts, and organizations that value truth, context, and transparency.",

    metaTitle: "Partners — Newsoras",
    metaDescription:
      "Newsoras partnerships: editorial collaborations, experts, creators and organizations. Transparency, brand safety, editorial independence, and how to work together.",

    lastUpdatedLabel: "Last updated",

    tocTitle: "Contents",
    toc: [
      { id: "por-que", label: "Why collaborate" },
      { id: "quienes", label: "Who we work with" },
      { id: "oportunidades", label: "Opportunities" },
      { id: "estandares", label: "Standards" },
      { id: "proceso", label: "Process" },
      { id: "logos", label: "Featured partners" },
      { id: "faq", label: "FAQ" },
      { id: "contacto", label: "Contact" },
    ],

    introTitle: "Why collaborate with Newsoras",
    introP: [
      "Newsoras is independent journalism focused on geopolitics, markets, and technology. Our goal is clarity and context with high standards.",
      "We partner with people and organizations that bring real reader value: credible experts, responsible publishers, and research groups with strong data.",
      "AI may be used as editorial assistance, but it never replaces verification or human judgment.",
    ],

    whoTitle: "Who we collaborate with",
    whoCards: [
      {
        t: "Publishers / Media",
        d: "Co-publishing, collaborations, and special projects—with clear transparency.",
        bullets: ["Co-authored pieces", "Special series", "Selective syndication", "Principled cross-linking"],
      },
      {
        t: "Experts / Analysts",
        d: "Columns, interviews, explainers, and deep dives with a verifiable track record.",
        bullets: ["Guest columns", "Interviews", "Data checks", "Clear opinion disclosures"],
      },
      {
        t: "Creators (Podcast/YouTube/X)",
        d: "Cross-platform collaborations that keep quality and trust high.",
        bullets: ["Scripts & summaries", "Interviews", "Evergreen guides", "Social cuts"],
      },
      {
        t: "NGOs / Think Tanks / Universities",
        d: "Reporting built on research, datasets, and method transparency.",
        bullets: ["Research explainers", "Method notes", "Simple visuals", "Strong sourcing"],
      },
    ],

    opportunitiesTitle: "Collaboration opportunities",
    opportunitiesP: [
      "If you’re building a serious brand, consistency wins: useful content, clear sourcing, and fast mobile UX.",
    ],
    opportunities: [
      { t: "Guest column", d: "A recurring signature space tied to your expertise." },
      { t: "Interviews & Q&A", d: "A clean SEO-friendly format with careful editing." },
      { t: "Special projects", d: "Multi-part series, thematic deep dives, evergreen guides." },
      { t: "Data + context", d: "Pieces that explain numbers and methodology clearly." },
      { t: "Online events", d: "Conversations/streams with an editorial recap." },
    ],

    standardsTitle: "Standards (non-negotiable)",
    standardsP: ["Credibility is the asset. These rules protect readers and partners:"],
    standards: [
      "Editorial independence: no partner “buys” coverage as if it were news.",
      "Transparency: co-authorship, sponsorships, and affiliations are disclosed.",
      "Sourcing: factual claims require verifiable sources.",
      "AI as assistant: it can help draft, but it’s not a source and can be wrong.",
      "Corrections: verified errors get corrected with a visible record.",
      "Brand safety: we reject deceptive or manipulative content.",
    ],

    processTitle: "Partnership process",
    processSteps: [
      { n: "1", t: "Proposal", d: "Tell us what you want to do and share relevant links." },
      { n: "2", t: "Fit", d: "We evaluate quality, editorial alignment, and risk." },
      { n: "3", t: "Pilot", d: "We start small to test results and workflow." },
      { n: "4", t: "Scale", d: "If it works, we define a recurring plan and simple metrics." },
    ],

    logosTitle: "Featured partners",
    logosP:
      "No partners are displayed yet. We only list real collaborations with explicit permission—no implied endorsements.",

    faqTitle: "FAQ",
    faqs: [
      { q: "Can I be listed as a partner without an agreement?", a: "No. We only list real collaborations with explicit permission." },
      { q: "Do you do sponsored content?", a: "Yes, but always labeled and never presented as news." },
      { q: "Does AI write for you?", a: "AI can help draft or polish, but final editorial responsibility is human." },
    ],

    contactTitle: "Let’s talk",
    contactP: "Send: who you are, your proposal, relevant links, and the collaboration type you want.",
    contactCta: "Email Partners",

    footerNote: "Newsoras — Independent editorial standards. Collaboration is welcome, transparency is required.",
  };
}

// --- SEO: generateMetadata ---------------------------------------------------
export async function generateMetadata({
  params,
}: {
  params: Promise<{ locale: string }>;
}): Promise<Metadata> {
  const { locale: rawLocale } = await params;
  const locale: Locale = isLocale(rawLocale) ? rawLocale : "en";
  const t = getCopy(locale);

  const canonical = new URL(`/${locale}/partners`, SITE_URL).toString();

  return {
    title: t.metaTitle,
    description: t.metaDescription,
    alternates: {
      canonical,
      languages: {
        en: new URL(`/en/partners`, SITE_URL).toString(),
        es: new URL(`/es/partners`, SITE_URL).toString(),
        zh: new URL(`/zh/partners`, SITE_URL).toString(),
      },
    },
    openGraph: {
      type: "website",
      url: canonical,
      siteName: SITE_NAME,
      title: t.metaTitle,
      description: t.metaDescription,
      locale: locale === "es" ? "es_ES" : locale === "zh" ? "zh_CN" : "en_US",
      images: [
        {
          // ✅ crear: /public/og/partners.png (1200x630)
          url: new URL(`/og/partners.png`, SITE_URL).toString(),
          width: 1200,
          height: 630,
          alt: `${SITE_NAME} — Partners`,
        },
      ],
    },
    twitter: {
      card: "summary_large_image",
      title: t.metaTitle,
      description: t.metaDescription,
      images: [new URL(`/og/partners.png`, SITE_URL).toString()],
    },
    robots: {
      index: true,
      follow: true,
      googleBot: {
        index: true,
        follow: true,
        "max-image-preview": "large",
        "max-snippet": -1,
        "max-video-preview": -1,
      },
    },
  };
}

// --- JSON-LD ---------------------------------------------------------------
function jsonLdOrganization(locale: Locale) {
  const inLanguage = locale === "es" ? "es" : locale === "zh" ? "zh" : "en";

  return {
    "@context": "https://schema.org",
    "@type": "Organization",
    "@id": `${SITE_URL}#organization`,
    name: SITE_NAME,
    url: SITE_URL,
    logo: `${SITE_URL}/logo.png`,
    email: PARTNERS_EMAIL,
    inLanguage,
  };
}

function jsonLdWebsite(locale: Locale) {
  const inLanguage = locale === "es" ? "es" : locale === "zh" ? "zh" : "en";
  return {
    "@context": "https://schema.org",
    "@type": "WebSite",
    "@id": `${SITE_URL}#website`,
    url: SITE_URL,
    name: SITE_NAME,
    publisher: { "@id": `${SITE_URL}#organization` },
    inLanguage,
  };
}

function jsonLdPartnersPage(locale: Locale) {
  const inLanguage = locale === "es" ? "es" : locale === "zh" ? "zh" : "en";
  const url = `${SITE_URL}/${locale}/partners`;

  return {
    "@context": "https://schema.org",
    "@type": "WebPage",
    "@id": `${url}#webpage`,
    url,
    name: `${SITE_NAME} — Partners`,
    isPartOf: { "@id": `${SITE_URL}#website` },
    about: { "@id": `${SITE_URL}#organization` },
    inLanguage,
  };
}

function jsonLdBreadcrumbs(locale: Locale) {
  const url = `${SITE_URL}/${locale}/partners`;
  const home = `${SITE_URL}/${locale}`;

  return {
    "@context": "https://schema.org",
    "@type": "BreadcrumbList",
    itemListElement: [
      { "@type": "ListItem", position: 1, name: "Home", item: home },
      { "@type": "ListItem", position: 2, name: "Partners", item: url },
    ],
  };
}

function jsonLdFAQ(locale: Locale) {
  const t = getCopy(locale);
  const url = `${SITE_URL}/${locale}/partners`;

  return {
    "@context": "https://schema.org",
    "@type": "FAQPage",
    "@id": `${url}#faq`,
    mainEntity: t.faqs.map((x) => ({
      "@type": "Question",
      name: x.q,
      acceptedAnswer: {
        "@type": "Answer",
        text: x.a,
      },
    })),
  };
}

// --- Page -------------------------------------------------------------------
export default async function PartnersPage({ params }: { params: Promise<{ locale: string }> }) {
  const { locale: rawLocale } = await params;
  const locale: Locale = isLocale(rawLocale) ? rawLocale : "en";
  const t = getCopy(locale);
  const lastUpdated = fmtDate(locale, LAST_UPDATED_ISO);

  const subject =
    locale === "es"
      ? "Partners — Newsoras"
      : locale === "zh"
      ? "合作伙伴 — Newsoras"
      : "Partners — Newsoras";

  const mailtoHref = `mailto:${encodeURIComponent(PARTNERS_EMAIL)}?subject=${encodeURIComponent(subject)}`;

  const orgLd = jsonLdOrganization(locale);
  const siteLd = jsonLdWebsite(locale);
  const pageLd = jsonLdPartnersPage(locale);
  const crumbsLd = jsonLdBreadcrumbs(locale);
  const faqLd = jsonLdFAQ(locale);

  return (
    <main className="container" style={{ paddingTop: 22, paddingBottom: 30 }}>
      {/* ✅ JSON-LD: Organization + WebSite + WebPage + Breadcrumbs + FAQ */}
      <script
        type="application/ld+json"
        // eslint-disable-next-line react/no-danger
        dangerouslySetInnerHTML={{ __html: JSON.stringify(orgLd) }}
      />
      <script
        type="application/ld+json"
        // eslint-disable-next-line react/no-danger
        dangerouslySetInnerHTML={{ __html: JSON.stringify(siteLd) }}
      />
      <script
        type="application/ld+json"
        // eslint-disable-next-line react/no-danger
        dangerouslySetInnerHTML={{ __html: JSON.stringify(pageLd) }}
      />
      <script
        type="application/ld+json"
        // eslint-disable-next-line react/no-danger
        dangerouslySetInnerHTML={{ __html: JSON.stringify(crumbsLd) }}
      />
      <script
        type="application/ld+json"
        // eslint-disable-next-line react/no-danger
        dangerouslySetInnerHTML={{ __html: JSON.stringify(faqLd) }}
      />

      {/* Hero */}
      <section className="card" style={{ position: "relative", overflow: "hidden", padding: 22 }}>
        <div
          aria-hidden
          style={{
            position: "absolute",
            inset: -60,
            background:
              "radial-gradient(600px 220px at 20% 0%, var(--accent-glow), transparent 70%), radial-gradient(500px 220px at 80% 20%, rgba(37, 99, 235, 0.25), transparent 70%)",
            filter: "blur(8px)",
            opacity: 0.9,
          }}
        />

        <div style={{ position: "relative" }}>
          <div style={{ display: "flex", alignItems: "center", gap: 12, marginBottom: 10 }}>
            <div
              style={{
                width: 44,
                height: 44,
                borderRadius: 12,
                background: "linear-gradient(135deg, var(--accent), #2563eb)",
                boxShadow: "0 0 18px var(--accent-glow)",
              }}
            />
            <div>
              <h1 className="h1" style={{ margin: 0 }}>
                {t.title}
              </h1>
              <p className="p" style={{ margin: "6px 0 0 0", color: "var(--text-secondary)" }}>
                {t.subtitle}
              </p>
            </div>
          </div>

          <div style={{ display: "flex", flexWrap: "wrap", gap: 10, alignItems: "center", marginTop: 10 }}>
            <span className="badge" style={{ borderColor: "var(--text-muted)" }}>
              {t.lastUpdatedLabel}: {lastUpdated}
            </span>
            <span className="badge">Transparency</span>
            <span className="badge">Editorial Standards</span>
            <span className="badge">Brand Safety</span>
          </div>

          <div style={{ display: "flex", gap: 10, flexWrap: "wrap", marginTop: 12 }}>
            <a href="#contacto" className="badge" style={{ padding: "10px 14px" }}>
              {locale === "es" ? "Proponer colaboración" : locale === "zh" ? "提出合作" : "Propose a collab"}
            </a>
            {PARTNER_KIT_URL ? (
              <a
                href={PARTNER_KIT_URL}
                className="badge"
                style={{ padding: "10px 14px", borderColor: "var(--text-muted)" }}
              >
                {locale === "es" ? "Partner Kit" : locale === "zh" ? "合作资料" : "Partner kit"}
              </a>
            ) : null}
            <Link href={`/${locale}/advertising`} className="badge" style={{ padding: "10px 14px", borderColor: "var(--text-muted)" }}>
              {locale === "es" ? "Publicidad" : locale === "zh" ? "广告合作" : "Advertising"}
            </Link>
          </div>
        </div>
      </section>

      {/* TOC */}
      <section className="card" style={{ padding: 20, marginTop: 18 }}>
        <h2 className="h2" style={{ marginBottom: 12 }}>
          {t.tocTitle}
        </h2>
        <div style={{ display: "flex", gap: 10, flexWrap: "wrap" }}>
          {t.toc.map((x) => (
            <a key={x.id} href={`#${x.id}`} className="badge" style={{ borderColor: "var(--text-muted)" }}>
              {x.label}
            </a>
          ))}
        </div>
      </section>

      {/* Intro */}
      <section className="card" style={{ padding: 20, marginTop: 18 }} id="por-que">
        <h2 className="h2" style={{ marginBottom: 10 }}>
          {t.introTitle}
        </h2>
        {t.introP.map((p) => (
          <p key={p} className="p" style={{ marginTop: 10, color: "var(--text-secondary)" }}>
            {p}
          </p>
        ))}
      </section>

      {/* Who */}
      <section className="card" style={{ padding: 20, marginTop: 18 }} id="quienes">
        <h2 className="h2" style={{ marginBottom: 12 }}>
          {t.whoTitle}
        </h2>

        <div style={{ display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(240px, 1fr))", gap: 12 }}>
          {t.whoCards.map((c) => (
            <div
              key={c.t}
              style={{
                border: "1px solid var(--line)",
                borderRadius: 18,
                padding: 16,
                background: "rgba(255,255,255,0.02)",
                display: "flex",
                flexDirection: "column",
                gap: 10,
              }}
            >
              <div style={{ fontWeight: 1000, fontSize: "1.05rem" }}>{c.t}</div>
              <div style={{ color: "var(--text-secondary)", fontSize: 14, lineHeight: 1.6 }}>{c.d}</div>
              <ul style={{ margin: 0, paddingLeft: 18, color: "var(--text-secondary)", lineHeight: 1.7 }}>
                {c.bullets.map((b) => (
                  <li key={b}>{b}</li>
                ))}
              </ul>
              <div style={{ marginTop: "auto", display: "flex", gap: 10, flexWrap: "wrap" }}>
                <a href="#contacto" className="badge" style={{ padding: "10px 14px" }}>
                  {locale === "es" ? "Quiero colaborar" : locale === "zh" ? "我想合作" : "I want to collaborate"}
                </a>
              </div>
            </div>
          ))}
        </div>
      </section>

      {/* Opportunities */}
      <section className="card" style={{ padding: 20, marginTop: 18 }} id="oportunidades">
        <h2 className="h2" style={{ marginBottom: 10 }}>
          {t.opportunitiesTitle}
        </h2>
        {t.opportunitiesP.map((p) => (
          <p key={p} className="p" style={{ marginTop: 10, color: "var(--text-secondary)" }}>
            {p}
          </p>
        ))}

        <div style={{ display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(240px, 1fr))", gap: 12, marginTop: 12 }}>
          {t.opportunities.map((x) => (
            <div
              key={x.t}
              style={{
                border: "1px solid var(--line)",
                borderRadius: 16,
                padding: 14,
                background: "rgba(255,255,255,0.02)",
              }}
            >
              <div style={{ fontWeight: 900, marginBottom: 6 }}>{x.t}</div>
              <div style={{ color: "var(--text-secondary)", fontSize: 14, lineHeight: 1.6 }}>{x.d}</div>
            </div>
          ))}
        </div>
      </section>

      {/* Standards + Process */}
      <section style={{ display: "grid", gridTemplateColumns: "1fr", gap: 18, marginTop: 18 }}>
        <div className="card" style={{ padding: 20 }} id="estandares">
          <h2 className="h2" style={{ marginBottom: 10 }}>
            {t.standardsTitle}
          </h2>
          {t.standardsP.map((p) => (
            <p key={p} className="p" style={{ marginTop: 10, color: "var(--text-secondary)" }}>
              {p}
            </p>
          ))}
          <ul style={{ marginTop: 12, paddingLeft: 18, color: "var(--text-secondary)", lineHeight: 1.75 }}>
            {t.standards.map((b) => (
              <li key={b}>{b}</li>
            ))}
          </ul>
        </div>

        <div className="card" style={{ padding: 20 }} id="proceso">
          <h2 className="h2" style={{ marginBottom: 12 }}>
            {t.processTitle}
          </h2>

          <div style={{ display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(220px, 1fr))", gap: 12 }}>
            {t.processSteps.map((s) => (
              <div
                key={s.n}
                style={{
                  border: "1px solid var(--line)",
                  borderRadius: 16,
                  padding: 14,
                  background: "rgba(255,255,255,0.02)",
                  display: "flex",
                  gap: 12,
                }}
              >
                <div
                  className="badge"
                  style={{
                    borderColor: "var(--text-muted)",
                    width: 36,
                    height: 36,
                    borderRadius: 12,
                    display: "inline-flex",
                    alignItems: "center",
                    justifyContent: "center",
                    fontWeight: 900,
                  }}
                >
                  {s.n}
                </div>
                <div>
                  <div style={{ fontWeight: 900, marginBottom: 4 }}>{s.t}</div>
                  <div style={{ color: "var(--text-secondary)", fontSize: 14, lineHeight: 1.6 }}>{s.d}</div>
                </div>
              </div>
            ))}
          </div>
        </div>
      </section>

      {/* Logos / placeholders */}
      <section className="card" style={{ padding: 20, marginTop: 18 }} id="logos">
        <h2 className="h2" style={{ marginBottom: 8 }}>
          {t.logosTitle}
        </h2>
        <p className="p" style={{ marginTop: 10, color: "var(--text-secondary)" }}>
          {t.logosP}
        </p>

        <div
          style={{
            marginTop: 14,
            display: "grid",
            gridTemplateColumns: "repeat(auto-fit, minmax(140px, 1fr))",
            gap: 12,
          }}
        >
          {Array.from({ length: 6 }).map((_, i) => (
            <div
              key={i}
              style={{
                height: 54,
                borderRadius: 16,
                border: "1px dashed var(--line)",
                background: "rgba(255,255,255,0.02)",
                display: "flex",
                alignItems: "center",
                justifyContent: "center",
                color: "var(--text-muted)",
                fontSize: 12,
                userSelect: "none",
              }}
            >
              {locale === "es" ? "Logo (próximamente)" : locale === "zh" ? "Logo（即将）" : "Logo (coming soon)"}
            </div>
          ))}
        </div>
      </section>

      {/* FAQ */}
      <section className="card" style={{ padding: 20, marginTop: 18 }} id="faq">
        <h2 className="h2" style={{ marginBottom: 14 }}>
          {t.faqTitle}
        </h2>

        <div style={{ display: "grid", gridTemplateColumns: "1fr", gap: 10 }}>
          {t.faqs.map((x, idx) => (
            <details
              key={x.q}
              style={{
                border: "1px solid var(--line)",
                borderRadius: 16,
                padding: 14,
                background: "rgba(255,255,255,0.02)",
              }}
              open={idx === 0}
            >
              <summary style={{ cursor: "pointer", fontWeight: 900, color: "var(--text-primary)", listStyle: "none" }}>
                {x.q}
              </summary>
              <p className="p" style={{ marginTop: 10, color: "var(--text-secondary)" }}>
                {x.a}
              </p>
            </details>
          ))}
        </div>
      </section>

      {/* Contact */}
      <section className="card" style={{ padding: 20, marginTop: 18 }} id="contacto">
        <h2 className="h2" style={{ marginBottom: 8 }}>
          {t.contactTitle}
        </h2>
        <p className="p" style={{ marginTop: 8, color: "var(--text-secondary)" }}>
          {t.contactP}
        </p>

        <div style={{ display: "flex", gap: 10, flexWrap: "wrap", marginTop: 12 }}>
          <a href={mailtoHref} className="badge" style={{ padding: "10px 14px", borderColor: "var(--text-muted)" }}>
            {t.contactCta} ({PARTNERS_EMAIL})
          </a>
          <Link href={`/${locale}/contact`} className="badge" style={{ padding: "10px 14px" }}>
            {locale === "es" ? "Página de contacto" : locale === "zh" ? "联系页面" : "Contact page"}
          </Link>
          <Link href={`/${locale}/advertising`} className="badge" style={{ padding: "10px 14px", borderColor: "var(--text-muted)" }}>
            {locale === "es" ? "Publicidad" : locale === "zh" ? "广告合作" : "Advertising"}
          </Link>
          <Link href={`/${locale}`} className="badge" style={{ padding: "10px 14px" }}>
            Home
          </Link>
        </div>

        <div style={{ marginTop: 14, color: "var(--text-muted)", fontSize: 12 }}>
          {t.footerNote}
        </div>
      </section>
    </main>
  );
}

// --- Notes (assets + env) ----------------------------------------------------
// 1) /public/og/partners.png (1200x630)
// 2) /public/logo.png        (512x512)
// 3) .env.local:
//    NEXT_PUBLIC_SITE_URL=https://newsoras.com
//    NEXT_PUBLIC_PARTNERS_EMAIL=partners@newsoras.com
//    NEXT_PUBLIC_PARTNERS_LAST_UPDATED=2026-01-04
//    NEXT_PUBLIC_PARTNER_KIT_URL=https://newsoras.com/partner-kit.pdf   (opcional)
