// components.jsx — shared chrome: Logo, Header, Footer, primitive bits
const { useState, useEffect, useRef, useMemo } = React;

// ─── Router context ─────────────────────────────────────────────
const RouterCtx = React.createContext({ path: "/", go: () => {}, loc: null });
const useRoute = () => React.useContext(RouterCtx);

// ─── Logo mark — leaf+pearl icon (official artwork via CSS mask) ─
function LogoMark({ size = 28, color = "var(--terra)" }) {
  return (
    <span
      aria-hidden
      style={{
        display: "inline-block",
        width: size,
        height: size * (1612 / 2273),
        background: color,
        WebkitMask: "url(photos/logo-mark.png) center / contain no-repeat",
        mask: "url(photos/logo-mark.png) center / contain no-repeat",
        flexShrink: 0,
      }}
    />
  );
}

// ─── Logo (header) — mark + wordmark ───────────────────────────
function Logo({ light = false }) {
  const fg = light ? "#fff" : "var(--warm-dark)";
  const sub = light ? "rgba(255,255,255,.6)" : "var(--warm-500)";
  const markColor = light ? "rgba(255,255,255,.85)" : "var(--terra)";
  return (
    <div style={{ display: "flex", alignItems: "center", gap: 10 }}>
      <LogoMark size={28} color={markColor} />
      <div style={{
        fontFamily: "var(--font-serif)",
        fontSize: 22,
        fontStyle: "italic",
        fontWeight: 500,
        color: fg,
        letterSpacing: "-0.01em",
        lineHeight: 1,
        whiteSpace: "nowrap",
        fontVariationSettings: '"opsz" 48',
      }}>
        Healing Pearl Massage
      </div>
    </div>
  );
}

// ─── Full circular badge — uses the official artwork PNG ───────
function LogoBadge({ size = 280 }) {
  return (
    <img
      src="photos/logo-badge.png"
      alt="Healing Pearl Massage — Treat yourself to relax"
      width={size} height={size}
      style={{ display: "block", width: size, height: size, objectFit: "contain" }}
    />
  );
}

// ─── Leaf divider — ornamental section break, uses the leaf mark ─
function LeafDivider({ width = 200 }) {
  return (
    <div aria-hidden style={{
      display: "flex", alignItems: "center", justifyContent: "center",
      gap: 16, margin: "0 auto", maxWidth: width,
      color: "var(--terra)",
    }}>
      <span style={{ flex: 1, height: 1, background: "var(--warm-300)" }}/>
      <LogoMark size={20} color="var(--terra)"/>
      <span style={{ flex: 1, height: 1, background: "var(--warm-300)" }}/>
    </div>
  );
}

// ─── Header ─────────────────────────────────────────────────────
function Header() {
  const { path, go, loc } = useRoute();
  const [scrolled, setScrolled] = useState(false);
  const [switcherOpen, setSwitcherOpen] = useState(false);
  const [drawerOpen, setDrawerOpen] = useState(false);
  const switcherRef = useRef(null);
  const LOCS = window.HP_LOCATIONS;
  const inBooking = !!loc && path.startsWith(`/${loc.id}/book`);

  // Close drawer on route change
  useEffect(() => { setDrawerOpen(false); }, [path]);
  // Lock body scroll while drawer open
  useEffect(() => {
    if (drawerOpen) {
      const prev = document.body.style.overflow;
      document.body.style.overflow = "hidden";
      return () => { document.body.style.overflow = prev; };
    }
  }, [drawerOpen]);

  useEffect(() => {
    const onScroll = () => setScrolled(window.scrollY > 8);
    window.addEventListener("scroll", onScroll);
    return () => window.removeEventListener("scroll", onScroll);
  }, []);

  // Close switcher on outside click
  useEffect(() => {
    if (!switcherOpen) return;
    const onDocClick = (e) => {
      if (switcherRef.current && !switcherRef.current.contains(e.target)) setSwitcherOpen(false);
    };
    document.addEventListener("mousedown", onDocClick);
    return () => document.removeEventListener("mousedown", onDocClick);
  }, [switcherOpen]);

  // Close switcher on route change
  useEffect(() => { setSwitcherOpen(false); }, [path]);

  const isDomain = !loc;

  const nav = isDomain
    ? [
        { label: "Locations", to: "/", match: (p) => p === "/" },
        { label: "About",     to: "/about" },
      ]
    : [
        { label: "Services",   to: `/${loc.id}/services` },
        { label: "Reviews",    to: `/${loc.id}/reviews` },
        { label: "Our Studio", to: `/${loc.id}/about` },
        { label: "Visit",      to: `/${loc.id}/visit`, alt: [`/${loc.id}/contact`, `/${loc.id}/area`] },
      ];

  const isActive = (n) => {
    if (n.match) return n.match(path);
    if (path === n.to) return true;
    if (n.alt && n.alt.some(a => path === a || path.startsWith(a + "/"))) return true;
    return n.to !== "/" && path.startsWith(n.to);
  };

  return (
    <header
      style={{
        position: "sticky", top: 0, zIndex: 50,
        background: scrolled ? "rgba(250,250,247,.85)" : "rgba(250,250,247,0)",
        backdropFilter: scrolled ? "blur(14px) saturate(160%)" : "none",
        WebkitBackdropFilter: scrolled ? "blur(14px) saturate(160%)" : "none",
        borderBottom: scrolled ? "1px solid var(--line-soft)" : "1px solid transparent",
        transition: "all .2s ease",
      }}
    >
      <div className="wrap" style={{ display: "flex", alignItems: "center", justifyContent: "space-between", gap: 24, paddingTop: 16, paddingBottom: 16 }}>
        <div style={{ cursor: "pointer" }} onClick={() => go("/")}>
          <Logo />
        </div>

        <nav className="hide-sm" style={{ display: "flex", alignItems: "center", gap: 28 }}>
          {nav.map((n) => (
            <a
              key={n.to}
              onClick={() => go(n.to)}
              style={{
                fontSize: 13,
                color: isActive(n) ? "var(--ink)" : "var(--ink-3)",
                fontWeight: isActive(n) ? 600 : 500,
                position: "relative",
                paddingBottom: 4,
                cursor: "pointer",
                whiteSpace: "nowrap",
              }}
            >
              {n.label}
              {isActive(n) && (
                <span style={{ position: "absolute", left: 0, right: 0, bottom: 0, height: 2, background: "var(--accent)" }} />
              )}
            </a>
          ))}
        </nav>

        <div className="hide-sm" style={{ display: "flex", alignItems: "center", gap: 10 }}>
          {inBooking ? (
            <a className="btn-tertiary" onClick={() => go(`/${loc.id}`)}>Exit booking</a>
          ) : (
            <>
              {loc ? (
                <div ref={switcherRef} style={{ position: "relative" }}>
              <button
                className="loc-pill"
                onClick={() => setSwitcherOpen(v => !v)}
                title="Switch studio"
                style={{ border: 0, fontFamily: "inherit" }}
              >
                <span className="mono" aria-hidden>{loc.monogram}</span>
                <span style={{ display: "flex", flexDirection: "column", alignItems: "flex-start", lineHeight: 1.15 }}>
                  <span style={{ fontWeight: 600, fontSize: 12, color: "var(--loc-deep)" }}>{loc.name}</span>
                  <span style={{ fontSize: 10, color: "var(--loc-deep)", opacity: .7, letterSpacing: ".06em", textTransform: "uppercase" }}>{loc.cityShort}</span>
                </span>
                <svg className="caret" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2"><polyline points="6 9 12 15 18 9"/></svg>
              </button>
              {switcherOpen && (
                <div className="loc-pop">
                  <div style={{ fontSize: 10, letterSpacing: ".14em", textTransform: "uppercase", color: "var(--muted)", padding: "8px 12px 6px", fontWeight: 500 }}>Switch studio</div>
                  {LOCS.map(l => {
                    const swatchColor = l.accent === "clay" ? "#5E7591" : "#7A8B6F";
                    return (
                      <div key={l.id} className={"opt" + (l.id === loc.id ? " current" : "")} onClick={() => { setSwitcherOpen(false); go(`/${l.id}`); }}>
                        <span className="swatch" style={{ background: swatchColor, color: "#fff", display: "grid", placeItems: "center", fontSize: 10, fontWeight: 600 }}>{l.monogram}</span>
                        <div>
                          <div style={{ fontSize: 14, fontWeight: 600, color: "var(--ink)", lineHeight: 1.2 }}>{l.name}</div>
                          <div style={{ fontSize: 11, color: "var(--muted)", marginTop: 1 }}>{l.cityShort}</div>
                        </div>
                        <span/>
                      </div>
                    );
                  })}
                  <div style={{ borderTop: "1px solid var(--line-soft)", marginTop: 4, paddingTop: 4 }}>
                    <div className="opt" onClick={() => { setSwitcherOpen(false); go("/"); }}>
                      <span/>
                      <div style={{ fontSize: 12, color: "var(--ink-3)" }}>All locations →</div>
                      <span/>
                    </div>
                  </div>
                </div>
              )}
            </div>
          ) : null}
          <button className="btn btn-primary" onClick={() => go(loc ? `/${loc.id}/book` : "/")}>
            {loc ? "Book Now" : "Find a studio"}
          </button>
            </>
          )}
        </div>
      </div>

      {/* Mobile hamburger — visible only < 720px */}
      <div className="show-sm" style={{ position: "absolute", top: 14, right: 14, display: "none" }}>
        <button
          onClick={() => setDrawerOpen(true)}
          aria-label="Open menu"
          style={{
            appearance: "none", background: "var(--white)", border: "1px solid var(--line)",
            width: 44, height: 44, borderRadius: 8, display: "grid", placeItems: "center", cursor: "pointer",
          }}
        >
          <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="var(--warm-dark)" strokeWidth="1.6">
            <line x1="4" y1="7" x2="20" y2="7"/>
            <line x1="4" y1="12" x2="20" y2="12"/>
            <line x1="4" y1="17" x2="20" y2="17"/>
          </svg>
        </button>
      </div>

      {/* Mobile drawer */}
      {drawerOpen && (
        <MobileDrawer
          loc={loc}
          path={path}
          nav={nav}
          isActive={isActive}
          locs={LOCS}
          inBooking={inBooking}
          onClose={() => setDrawerOpen(false)}
          onNavigate={go}
        />
      )}

      {/* Breadcrumb bar — shop pages only, hidden during booking */}
      {loc && !inBooking && <Breadcrumbs />}

      {/* Last-visited shortcut — parent pages, only after visiting a shop */}
      {!loc && <LastVisitedBar />}
    </header>
  );
}

// ─── Mobile drawer ──────────────────────────────────────────────
function MobileDrawer({ loc, path, nav, isActive, locs, inBooking, onClose, onNavigate }) {
  return (
    <div style={{
      position: "fixed", inset: 0, zIndex: 200,
      background: "var(--cream)",
      display: "flex", flexDirection: "column",
    }}>
      {/* Top bar */}
      <div style={{ display: "flex", alignItems: "center", justifyContent: "space-between", padding: "16px 16px", borderBottom: "1px solid var(--line-soft)" }}>
        <div onClick={() => { onClose(); onNavigate("/"); }}>
          <Logo />
        </div>
        <button onClick={onClose} aria-label="Close menu" style={{
          appearance: "none", background: "transparent", border: "1px solid var(--line)",
          width: 44, height: 44, borderRadius: 8, display: "grid", placeItems: "center", cursor: "pointer",
        }}>
          <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="var(--warm-dark)" strokeWidth="1.6">
            <line x1="6" y1="6" x2="18" y2="18"/><line x1="18" y1="6" x2="6" y2="18"/>
          </svg>
        </button>
      </div>

      {/* Location pill */}
      {loc && (
        <div style={{ padding: "20px 16px 12px" }}>
          <div className="t-micro" style={{ color: "var(--gray-500)", marginBottom: 10 }}>You're at</div>
          <div style={{ display: "flex", alignItems: "center", gap: 12 }}>
            <span style={{ width: 36, height: 36, borderRadius: "50%", background: "var(--loc-color)", color: "#fff", display: "grid", placeItems: "center", fontSize: 13, fontWeight: 600 }}>{loc.monogram}</span>
            <div style={{ flex: 1 }}>
              <div style={{ fontSize: 16, fontWeight: 600 }}>{loc.name}</div>
              <div className="t-small" style={{ color: "var(--gray-500)" }}>{loc.cityShort}</div>
            </div>
            {locs.length > 1 && (
              <button className="btn-tertiary" onClick={() => { onClose(); onNavigate(`/${locs.find(l => l.id !== loc.id).id}`); }}>Switch</button>
            )}
          </div>
        </div>
      )}

      {/* Nav */}
      <nav style={{ padding: "8px 16px 16px", borderTop: loc ? "1px solid var(--line-soft)" : "none", marginTop: loc ? 16 : 0 }}>
        {nav.map((n) => (
          <a key={n.to}
            onClick={() => { onClose(); onNavigate(n.to); }}
            style={{
              display: "flex", alignItems: "center", justifyContent: "space-between",
              padding: "16px 0", borderBottom: "1px solid var(--line-soft)",
              fontSize: 18, fontWeight: isActive(n) ? 600 : 500,
              color: isActive(n) ? "var(--accent)" : "var(--warm-dark)",
              cursor: "pointer",
            }}>
            <span>{n.label}</span>
            <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5"><polyline points="9 6 15 12 9 18"/></svg>
          </a>
        ))}
      </nav>

      {/* Primary CTA */}
      <div style={{ marginTop: "auto", padding: 16, borderTop: "1px solid var(--line-soft)" }}>
        {loc && (
          <div style={{ marginBottom: 12, fontSize: 13, color: "var(--gray-500)" }} className="tnum">
            <a href={`tel:${loc.phoneTel}`} style={{ color: "var(--warm-dark)", fontWeight: 600 }}>{loc.phone}</a> · Open today till 8:00 PM
          </div>
        )}
        <button className="btn btn-primary" style={{ width: "100%", justifyContent: "center", padding: "16px 22px" }} onClick={() => { onClose(); onNavigate(loc ? `/${loc.id}/book` : "/"); }}>
          {loc ? `Book at ${loc.cityShort}` : "Find a studio"}
        </button>
      </div>
    </div>
  );
}

// ─── Last visited band ──────────────────────────────────────────
function LastVisitedBar() {
  const { path, go } = useRoute();
  const [lastId, setLastId] = useState(null);

  useEffect(() => {
    try {
      const id = localStorage.getItem("hp_last_loc");
      if (id && window.HP_LOCATIONS.find(l => l.id === id)) setLastId(id);
    } catch {}
  }, []);

  if (!lastId) return null;
  // Don't show the "back to last visited" hint on the locator itself —
  // the locator IS the place users go to pick a studio, so the shortcut is redundant noise.
  if (path === "/") return null;
  const last = window.HP_LOCATIONS.find(l => l.id === lastId);
  if (!last) return null;
  const c = last.accent === "clay" ? "#5E7591" : "#7A8B6F";

  return (
    <div style={{ background: "var(--surface)", borderBottom: "1px solid var(--line-soft)" }}>
      <div className="wrap" style={{ paddingTop: 8, paddingBottom: 8, display: "flex", alignItems: "center", justifyContent: "space-between", gap: 16, flexWrap: "wrap", fontSize: 12 }}>
        <span style={{ color: "var(--ink-3)" }}>Viewing all studios.</span>
        <a onClick={() => go(`/${last.id}`)} style={{ display: "inline-flex", alignItems: "center", gap: 8, color: "var(--ink-2)", cursor: "pointer", fontWeight: 500, whiteSpace: "nowrap" }}>
          <span style={{ width: 18, height: 18, borderRadius: "50%", background: c, color: "#fff", display: "grid", placeItems: "center", fontSize: 9, fontWeight: 600 }}>{last.monogram}</span>
          Back to {last.name} →
        </a>
      </div>
    </div>
  );
}

// ─── Breadcrumbs ────────────────────────────────────────────────
function Breadcrumbs() {
  const { path, go, loc } = useRoute();
  const segs = path.split("/").filter(Boolean);
  // segs[0] === loc.id
  const sub = segs[1];
  const sub2 = segs[2];

  const labelMap = {
    services: "Services",
    reviews:  "Reviews",
    about:    "Our Studio",
    studio:   "Our Studio",
    visit:    "Visit",
    contact:  "Visit",
    area:     "Visit",
    book:     "Book",
  };
  let here = sub ? (labelMap[sub] || sub) : null;
  let parentCrumb = null;
  if (sub === "services" && sub2) {
    const svc = window.HP_SERVICES.find(s => s.id === sub2);
    parentCrumb = { label: "Services", to: `/${loc.id}/services` };
    here = svc ? svc.shortName : sub2;
  }

  return (
    <div className="crumbs">
      <div className="wrap" style={{ paddingTop: 10, paddingBottom: 10, display: "flex", alignItems: "center", flexWrap: "wrap" }}>
        <a onClick={() => go("/")}>Healing Pearl</a>
        <span className="sep">/</span>
        <a onClick={() => go(`/${loc.id}`)} className={!here ? "here" : ""}>{loc.name}</a>
        {parentCrumb && (<>
          <span className="sep">/</span>
          <a onClick={() => go(parentCrumb.to)}>{parentCrumb.label}</a>
        </>)}
        {here && (<>
          <span className="sep">/</span>
          <span className="here">{here}</span>
        </>)}
      </div>
    </div>
  );
}

// ─── Footer ─────────────────────────────────────────────────────
function Footer() {
  const { loc, go } = useRoute();
  const LOCS = window.HP_LOCATIONS;
  const SERVICES = window.HP_SERVICES;
  const isDomain = !loc;

  return (
    <footer style={{ background: "#1F1612", color: "#fff", marginTop: 96 }}>
      <div className="wrap" style={{ paddingTop: 96, paddingBottom: 48 }}>
        {isDomain ? (
          // ─── BRAND FOOTER ────────────────────────────────────
          <div className="grid-12" style={{ marginBottom: 64 }}>
            <div style={{ gridColumn: "span 6" }}>
              <div style={{ transform: "scale(1.5)", transformOrigin: "top left", marginBottom: 32 }}>
                <Logo light />
              </div>
              <p className="t-body" style={{ marginTop: 8, color: "rgba(255,255,255,.65)", maxWidth: 360, lineHeight: 1.65 }}>
                Family-owned massage studios in Katy and Fulshear.
              </p>
            </div>
            <FooterCol span={2} title="Locations" items={LOCS.map(l => ({ label: `${l.name}, ${l.cityShort}`, to: `/${l.id}` }))} go={go} />
            <FooterCol span={2} title="Brand" items={[
              { label: "About", to: "/about" },
            ]} go={go} />
            <FooterCol span={2} title="Contact" items={[
              { label: "General", to: `/${LOCS[0].id}/visit` },
            ]} go={go} />
          </div>
        ) : (
          // ─── SHOP FOOTER ─────────────────────────────────────
          <div className="grid-12" style={{ marginBottom: 64 }}>
            <div style={{ gridColumn: "span 6" }}>
              <div style={{ display: "flex", alignItems: "center", gap: 16, marginBottom: 24 }}>
                <span style={{ width: 48, height: 48, borderRadius: "50%", background: "var(--accent)", color: "#fff", display: "grid", placeItems: "center", fontSize: 16, fontWeight: 600 }}>{loc.monogram}</span>
                <div>
                  <div className="t-micro" style={{ color: "rgba(255,255,255,.55)" }}>You're at</div>
                  <div className="t-h3" style={{ color: "#fff", marginTop: 4 }}>{loc.name}</div>
                </div>
              </div>
              <div style={{ display: "flex", flexDirection: "column", gap: 8, fontSize: 14, color: "rgba(255,255,255,.78)", lineHeight: 1.65 }}>
                <div>{loc.streetLine1}<br className="show-sm"/>{loc.streetLine2}</div>
                <div className="tnum"><a href={`tel:${loc.phoneTel}`} style={{ color: "#fff" }}>{loc.phone}</a></div>
                <div style={{ color: "rgba(255,255,255,.55)" }}>Today · 9:30 AM – 8:00 PM</div>
              </div>
              <div style={{ marginTop: 24, display: "flex", gap: 8 }}>
                <button className="btn btn-primary" style={{ padding: "12px 22px" }} onClick={() => go(`/${loc.id}/book`)}>Book at {loc.cityShort}</button>
              </div>
            </div>

            <FooterCol span={2} title={`${loc.cityShort} studio`} items={[
              { label: "Services & pricing", to: `/${loc.id}/services` },
              { label: "Reviews", to: `/${loc.id}/reviews` },
              { label: "Our Studio", to: `/${loc.id}/about` },
              { label: "Visit", to: `/${loc.id}/visit` },
            ]} go={go} />

            <FooterCol span={2} title="Services" items={SERVICES.slice(0, 5).map(s => ({
              label: s.id === "essential-oil-prenatal" ? "Pre-Natal Massage" : s.shortName,
              to: `/${loc.id}/services/${s.id}`,
            }))} go={go} />

            <div style={{ gridColumn: "span 2" }}>
              <div className="t-micro" style={{ color: "rgba(255,255,255,.5)", marginBottom: 16 }}>
                Healing Pearl
              </div>
              <ul style={{ listStyle: "none", padding: 0, margin: 0, display: "flex", flexDirection: "column", gap: 10 }}>
                <li><a onClick={() => go("/")} style={{ color: "rgba(255,255,255,.85)", fontSize: 14, cursor: "pointer" }}>All locations</a></li>
                <li><a onClick={() => go("/about")} style={{ color: "rgba(255,255,255,.85)", fontSize: 14, cursor: "pointer" }}>About</a></li>
                {LOCS.filter(l => l.id !== loc.id).map(l => (
                  <li key={l.id}>
                    <a onClick={() => go(`/${l.id}`)} style={{ color: "rgba(255,255,255,.55)", fontSize: 13, cursor: "pointer" }}>
                      → {l.name}
                    </a>
                  </li>
                ))}
              </ul>
            </div>
          </div>
        )}

        <div style={{ borderTop: "1px solid rgba(255,255,255,.1)", paddingTop: 24, display: "flex", justifyContent: "space-between", alignItems: "center", gap: 16, flexWrap: "wrap", fontSize: 12, color: "rgba(255,255,255,.45)" }}>
          <div>© 2026 M&amp;E Pearl LLC dba Healing Pearl Massage. All rights reserved.</div>
          <div style={{ display: "flex", gap: 24 }}>
            <a onClick={() => go("/privacy")} style={{ color: "rgba(255,255,255,.45)", cursor: "pointer" }}>Privacy</a>
            <a onClick={() => go("/terms")} style={{ color: "rgba(255,255,255,.45)", cursor: "pointer" }}>Terms</a>
          </div>
        </div>
      </div>
    </footer>
  );
}

function FooterCol({ title, items, go, span = 3 }) {
  return (
    <div style={{ gridColumn: `span ${span}` }}>
      <div className="t-micro" style={{ color: "rgba(255,255,255,.5)", marginBottom: 16 }}>
        {title}
      </div>
      <ul style={{ listStyle: "none", padding: 0, margin: 0, display: "flex", flexDirection: "column", gap: 10 }}>
        {items.map((it) => (
          <li key={it.label}>
            <a onClick={() => go(it.to)} style={{ color: "rgba(255,255,255,.85)", fontSize: 14, cursor: "pointer" }}>{it.label}</a>
          </li>
        ))}
      </ul>
    </div>
  );
}
// ─── Stars ──────────────────────────────────────────────────────
function Stars({ value = 5, size = 14, color = "var(--accent)" }) {
  return (
    <span style={{ display: "inline-flex", gap: 2, color }}>
      {[1,2,3,4,5].map(i => (
        <svg key={i} width={size} height={size} viewBox="0 0 24 24" fill={i <= value ? color : "transparent"} stroke={color} strokeWidth="1.2">
          <polygon points="12,2 15,9 22,9.5 17,14.5 18.5,22 12,18 5.5,22 7,14.5 2,9.5 9,9"/>
        </svg>
      ))}
    </span>
  );
}

// ─── Section header (eyebrow + H2 in display serif + optional meta) ─
function SectionHead({ eyebrow, title, sub, align = "left", maxWidth = 720 }) {
  return (
    <div className="section-head" style={{ textAlign: align, maxWidth, margin: align === "center" ? "0 auto" : 0 }}>
      {eyebrow && <div className="eyebrow"><span className="dot-mark"/>{eyebrow}</div>}
      <h2 className="t-h2" style={{ color: "var(--gray-950)", textWrap: "balance" }}>
        {title}
      </h2>
      {sub && <p className="t-body" style={{ marginTop: 8, color: "var(--gray-700)", textWrap: "pretty" }}>{sub}</p>}
    </div>
  );
}

// ─── Decorative marker — minimal version, no Eastern seal ───────
function SealStamp() { return null; }

// expose
Object.assign(window, { useRoute, RouterCtx, Logo, LogoMark, LogoBadge, LeafDivider, Header, Breadcrumbs, Footer, Stars, SectionHead, SealStamp });
