/* ============================================================
   SKI NEW ENGLAND — Privacy & Terms
   One page, two anchors. Required reading for nobody, but the site
   runs analytics and sells sponsorships, so it has to exist.
   ============================================================ */
const LEGAL_EMAIL = "ads@skinewengland.com";

const PRIVACY = [
  ["What we collect", "We use Google Analytics to count visits and see which pages people use. That records things like your approximate location, browser, and the pages you open. We do not ask for your name, email, or account — there are no accounts on this site."],
  ["Ratings you leave", "Resort ratings are stored in your own browser only. They never reach our servers, and clearing your browser data erases them."],
  ["Advertising", "Sponsorships on this site are sold directly by us. Sponsors receive traffic figures for their slot — never anything about individual visitors."],
  ["Webcams and data", "Webcam images and conditions data come from the resorts and third-party feeds. When you view them, those providers may see the request. We do not control their policies."],
  ["Opting out", "You can block analytics with any ad blocker or browser privacy setting, and the site will work exactly the same."],
];

const TERMS = [
  ["Conditions are not a guarantee", "Snow totals, lift counts, and trail counts come from resort feeds and update on a delay. Always check with the mountain before you drive. We are not responsible for a wasted trip."],
  ["Not affiliated", "Ski New England is independent. Resort names, logos, and trademarks belong to their owners and appear here for identification only."],
  ["Your use of the site", "Use it for planning your own skiing. Do not scrape it, resell the data, or republish our writing without asking."],
  ["Sponsorships", "Sponsorship terms are agreed in writing for each season. Rates shown on the Advertise page are an offer to discuss, not a binding contract."],
  ["Changes", "We update this page when the site changes. Continuing to use the site means the current version applies."],
];

function LegalBlock({ id, eyebrow, title, items }) {
  return (
    <section id={id} style={{ scrollMarginTop: 90 }}>
      <div className="eyebrow" style={{ color: "var(--blue-500)", marginBottom: 10 }}>{eyebrow}</div>
      <h2 className="display" style={{ margin: 0, fontSize: "clamp(24px,3vw,34px)", letterSpacing: "-0.02em" }}>{title}</h2>
      <div style={{ display: "flex", flexDirection: "column", gap: 0, marginTop: 22 }}>
        {items.map(([h, b]) => (
          <div key={h} style={{ padding: "20px 0", borderTop: "1px solid var(--line)" }}>
            <div className="display" style={{ fontSize: 17, fontWeight: 700, letterSpacing: "-0.01em" }}>{h}</div>
            <p className="serif" style={{ fontSize: 15.5, lineHeight: 1.55, color: "var(--muted)", margin: "8px 0 0", maxWidth: 680 }}>{b}</p>
          </div>
        ))}
      </div>
    </section>
  );
}

function LegalPage({ go }) {
  return (
    <div>
      <PageHead eyebrow="The fine print" title="PRIVACY &amp; TERMS"
        sub="Short version: we count page views, we don't know who you are, and conditions data is a best effort — not a promise." />
      <section style={{ background: "var(--paper)", padding: "48px 0 64px" }}>
        <div className="wrap" style={{ display: "flex", flexDirection: "column", gap: 54 }}>
          <LegalBlock id="privacy" eyebrow="Section one" title="PRIVACY" items={PRIVACY} />
          <LegalBlock id="terms" eyebrow="Section two" title="TERMS OF USE" items={TERMS} />
          <div style={{ borderTop: "1px solid var(--line)", paddingTop: 22, display: "flex", flexWrap: "wrap", gap: 16, alignItems: "center", justifyContent: "space-between" }}>
            <div className="mono" style={{ fontSize: 11.5, color: "var(--muted-2)" }}>Last updated November 2026</div>
            <a href={"mailto:" + LEGAL_EMAIL} className="mono" style={{ fontSize: 12.5, fontWeight: 600, color: "var(--blue-500)" }}>Questions? {LEGAL_EMAIL}</a>
          </div>
        </div>
      </section>
    </div>
  );
}

Object.assign(window, { LegalPage });
