// TitratePlan — educational + policy content sections
// Anchor targets referenced from the footer.
// Content is written to attribute claims to manufacturers / clinicians rather than
// stating them as TitratePlan's own medical recommendations.

function ArticleSection({ id, eyebrow, title, children }) {
  return (
    <section id={id} className="article">
      <div className="article-eyebrow label-mono">{eyebrow}</div>
      <h2 className="article-title">{title}</h2>
      <div className="article-body">{children}</div>
    </section>
  );
}

function SiteRotationGuide() {
  return (
    <ArticleSection id="site-rotation" eyebrow="Reference" title="Injection site rotation">
      <p>
        Manufacturer prescribing information for GLP-1 medications such as semaglutide and tirzepatide describes them as subcutaneous (just-under-the-skin) injections. Pen labels generally instruct users to rotate injection sites with each weekly dose. The notes below summarize publicly available manufacturer guidance — they are not medical advice. Always follow the directions on your pen and the instructions from your prescriber.
      </p>
      <h3>Zones described in product labeling</h3>
      <ul>
        <li><strong>Abdomen</strong> — at least 2 inches (5 cm) away from the navel, according to manufacturer instructions for use.</li>
        <li><strong>Front of thigh</strong> — the upper, outer area.</li>
        <li><strong>Back of upper arm</strong> — the fatty area behind the tricep (typically requires assistance from another person).</li>
      </ul>
      <p className="small muted">
        Each zone has a left and right side, giving six rotation sites in practice. Hip/buttock injection is listed in some insulin product inserts, but is not described in the prescribing information for GLP-1 medications (semaglutide, tirzepatide).
      </p>
      <h3>About rotation</h3>
      <p>
        Manufacturer instructions for use generally direct users to vary the injection site each week. TitratePlan can suggest a rotation in your schedule if you turn on "Rotate injection sites" in the setup form — this is a planning aid, not a clinical recommendation. Check your specific pen's instructions for use and ask your prescriber if you're unsure where you should be injecting.
      </p>
      <p className="article-aside">
        This page summarizes information found in publicly available manufacturer prescribing information. It is not medical advice and should not replace the instructions that came with your medication or the guidance of your prescriber.
      </p>
    </ArticleSection>
  );
}

function HowTitrationWorks() {
  return (
    <ArticleSection id="titration" eyebrow="Reference" title="How GLP-1 titration is typically described">
      <p>
        "Titration" is the term manufacturers and prescribers use for the gradual dose-increase schedule that comes with GLP-1 medications. Product labels generally start patients at the lowest dose and step the dose up at fixed intervals (commonly every four weeks). Manufacturers describe this approach as a way to help the body adjust to the medication.
      </p>
      <h3>What the product labels say</h3>
      <p>
        According to the prescribing information for these medications, semaglutide for weight management is typically initiated at 0.25 mg weekly and steps through 0.5 mg, 1 mg, 1.7 mg, and 2.4 mg. Tirzepatide labeling describes a starting dose of 2.5 mg with steps through 5, 7.5, 10, 12.5, and 15 mg. Your prescriber decides which schedule applies to you.
      </p>
      <h3>Your prescriber sets the pace</h3>
      <p>
        Prescribing information notes that prescribers may keep patients at a given dose longer than the standard interval — for example, if a patient is responding well or experiencing tolerability issues. The schedule TitratePlan generates is based on standard labeled escalation cadence; it is not a recommendation that you increase your dose on any particular day. Any change to your dosing should be discussed with your prescriber.
      </p>
      <h3>Maintenance</h3>
      <p>
        Product labels describe a "maintenance" dose as the dose a prescriber and patient decide to remain at long-term. The choice of when to stop escalating, and at what dose, is one that prescribing information describes as individualized to the patient.
      </p>
      <p className="article-aside">
        This page summarizes publicly available manufacturer prescribing information. It is not medical advice. Any decisions about your dose should be made with your prescriber.
      </p>
    </ArticleSection>
  );
}

function MissedDose() {
  return (
    <ArticleSection id="missed-dose" eyebrow="Reference" title="If you miss a dose: what manufacturer labels say">
      <p>
        Most GLP-1 product inserts include guidance for missed weekly doses. The summaries below come directly from publicly available manufacturer prescribing information. If you have missed a dose, the safest first step is to read your specific pen's instructions for use and contact your prescriber or pharmacist.
      </p>
      <h3>Semaglutide (per manufacturer prescribing information)</h3>
      <ul>
        <li>Manufacturer labeling generally states that if the missed dose is within 5 days, the dose may be administered as soon as possible, with the next dose taken on the regular schedule.</li>
        <li>If more than 5 days have passed, manufacturer labeling generally instructs patients to skip the missed dose and resume on the next scheduled day.</li>
      </ul>
      <h3>Tirzepatide (per manufacturer prescribing information)</h3>
      <ul>
        <li>Manufacturer labeling generally states that if the missed dose is within 4 days, the dose may be administered as soon as possible.</li>
        <li>If more than 4 days have passed, manufacturer labeling generally instructs patients to skip the missed dose and resume on the next scheduled day.</li>
      </ul>
      <h3>Longer interruptions</h3>
      <p>
        Some product inserts note that if a patient has been off their medication for several weeks, a prescriber may want to reassess the appropriate restarting dose. If you have been off for an extended period, contact your prescriber before resuming.
      </p>
      <p className="article-aside">
        Always confirm with your prescriber or pharmacist. Your medication's instructions for use and your prescriber's directions take precedence over any information on this page.
      </p>
    </ArticleSection>
  );
}

function StorageTravel() {
  return (
    <ArticleSection id="storage" eyebrow="Reference" title="Storage &amp; travel">
      <p>
        Manufacturer prescribing information includes storage instructions for GLP-1 pens. The notes below summarize commonly listed guidance. Always check the storage instructions on your specific pen's carton and patient information leaflet.
      </p>
      <h3>At home (per manufacturer labeling)</h3>
      <ul>
        <li>Unopened pens are generally stored refrigerated (typically 36–46°F / 2–8°C).</li>
        <li>Product inserts generally instruct patients not to freeze the medication and to discard a pen if it has frozen.</li>
        <li>After first use, many pens may be stored at controlled room temperature for a limited time — manufacturer labeling describes the specific window for each product. Check your pen's insert for the room-temperature limit.</li>
        <li>Manufacturer labeling generally directs patients to store pens in their original carton to protect from light.</li>
      </ul>
      <h3>Traveling</h3>
      <ul>
        <li>Most travelers carry pens in carry-on luggage rather than checked baggage, where hold temperatures can drop below freezing.</li>
        <li>Insulated medication bags with cold packs are commonly used; manufacturer instructions discourage direct contact with ice.</li>
        <li>TSA permits medically necessary liquids and medications through security; bringing the pharmacy label or a doctor's note can simplify screening.</li>
      </ul>
      <h3>Disposal</h3>
      <p>
        Manufacturer prescribing information directs patients to dispose of used pens in an FDA-cleared sharps disposal container. Many communities have drop-off programs at pharmacies or hospitals. Your pharmacist can describe options in your area.
      </p>
      <p className="article-aside">
        This page summarizes information commonly found in manufacturer prescribing information. It is not medical advice. Refer to your specific pen's instructions for use for the storage rules that apply to your medication.
      </p>
    </ArticleSection>
  );
}

function About() {
  return (
    <ArticleSection id="about" eyebrow="About" title="About TitratePlan">
      <p>
        TitratePlan is a free, browser-based scheduling tool for people taking GLP-1 medications such as semaglutide or tirzepatide. It turns the standard, manufacturer-described titration cadence into a calendar you can export and add to Apple Calendar, Google Calendar, or Outlook.
      </p>
      <h3>What it is</h3>
      <p>
        A planning aid. TitratePlan generates a draft schedule based on publicly available manufacturer prescribing information so you have something concrete to bring to your appointments, set reminders against, and confirm with your prescriber.
      </p>
      <h3>What it is not</h3>
      <p>
        TitratePlan is not a medical service. It does not provide medical advice, diagnosis, or treatment. It is not affiliated with, endorsed by, or sponsored by Novo Nordisk, Eli Lilly, or any pharmaceutical manufacturer. Brand names are referenced for identification only and remain the property of their respective owners.
      </p>
      <h3>How it pays for itself</h3>
      <p>
        TitratePlan is supported by display advertising. There are no accounts and nothing to subscribe to.
      </p>
    </ArticleSection>
  );
}

function Privacy() {
  return (
    <ArticleSection id="privacy" eyebrow="Policy" title="Privacy">
      <p>
        TitratePlan is built to keep your information on your device. The summary below describes how the site works today; it may be updated as the site changes.
      </p>
      <h3>What stays on your device</h3>
      <ul>
        <li>Your generated schedule and any entries you make in the Daily Log are saved to your browser's local storage. They are not uploaded to a TitratePlan server.</li>
        <li>There is no account system. There is no profile linked to you across sessions or devices.</li>
        <li>You can export your log entries as a CSV at any time from the Daily Log page. Clearing your browser data will remove the entries saved on this device.</li>
      </ul>
      <h3>Analytics and advertising</h3>
      <ul>
        <li>The site may use privacy-respecting analytics to count page views and understand which features are used. These analytics are intended to avoid collecting personally identifying information.</li>
        <li>Display advertising on the site may use cookies to serve and measure ads. Where required by law, a consent banner will appear and you may decline non-essential cookies. The site continues to function if you decline.</li>
      </ul>
      <h3>What we do not do</h3>
      <ul>
        <li>We do not sell the information you enter into the Daily Log.</li>
        <li>We do not share your log entries with pharmaceutical manufacturers or with advertisers.</li>
      </ul>
    </ArticleSection>
  );
}

function AdvertisingDisclosure() {
  return (
    <ArticleSection id="advertising" eyebrow="Disclosure" title="Advertising disclosure">
      <p>
        TitratePlan is a free utility supported by advertising.
      </p>
      <h3>How advertising appears on the site</h3>
      <ul>
        <li>Display ads are served programmatically through ad networks. TitratePlan does not individually select or endorse the products shown in those ads.</li>
        <li>Where a placement is sponsored or affiliated, the site labels it as such. Sponsored placements never alter the medical reference content on the site (schedules, missed-dose summaries, storage notes, and so on).</li>
      </ul>
      <h3>Editorial independence</h3>
      <p>
        Reference content on this site is drawn from publicly available manufacturer prescribing information. No advertiser or sponsor pays for placement within that content, and no advertiser influences what schedules the planner generates.
      </p>
    </ArticleSection>
  );
}

Object.assign(window, {
  SiteRotationGuide,
  HowTitrationWorks,
  MissedDose,
  StorageTravel,
  About,
  Privacy,
  AdvertisingDisclosure,
});
