/* Harupa.pro — shared chrome: language-aware NavBar wrapper + Footer.
Exports window.HPChrome = { SiteNav, SiteFooter, useLangState, scrollToId }. */
(function () {
const { useState, useEffect } = React;
const DS = window.HarupaProDesignSystem_4a4a6a;
const { NavBar } = DS;
const I = window.HPIcons;
const css = `
.ft { background: var(--graphite); color: var(--on-dark-soft); padding: 72px 28px 40px; }
.ft__wrap { max-width: var(--container); margin: 0 auto; }
.ft__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; flex-wrap: wrap;
padding-bottom: 40px; border-bottom: 1px solid var(--graphite-line); }
.ft__brand { display: flex; gap: 13px; align-items: center; }
.ft__name { font-family: var(--font-serif); font-size: 24px; color: var(--on-dark); letter-spacing: -0.4px; }
.ft__tag { font-family: var(--font-mono); font-size: 10px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--on-dark-faint); margin-top: 3px; }
.ft__links { display: flex; gap: 14px; }
.ft__icon { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--graphite-line); color: var(--on-dark-soft);
display: flex; align-items: center; justify-content: center; text-decoration: none; transition: var(--transition-control); }
.ft__icon:hover { color: var(--on-dark); border-color: var(--amber-light); background: var(--graphite-3); }
.ft__bottom { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; margin-top: 28px; }
.ft__copy { font-family: var(--font-mono); font-size: 12px; color: var(--on-dark-faint); }
.ft__mail { color: var(--amber-light); text-decoration: none; font-family: var(--font-mono); font-size: 13px; }
.ft__mail:hover { text-decoration: underline; }
@media (max-width: 700px) { .ft__top { flex-direction: column; } }
/* Chrome ignores var() colors on :visited anchors — pin literal token values. */
a.hp-btn:visited { color: #1b1813; }
a.svc__link:visited, a.art__read:visited { color: #8a5418; }
a.ft__icon:visited { color: #b8ae9c; }
a.ft__mail:visited { color: #d69a52; }
/* Responsive override: the DS NavBar ships no media queries; its non-wrapping
links row forces a min-content width wider than tablet viewports. Collapse
the centre links first, then trim chrome on phones. */
@media (max-width: 1120px) {
.hp-nav .hp-nav__links { display: none; }
}
@media (max-width: 560px) {
.hp-nav.hp-nav { padding: 0 16px; gap: 12px; }
.hp-nav .hp-nav__brand-sub { display: none; }
.hp-nav .hp-nav__right { gap: 10px; }
}
`;
if (!document.getElementById("hp-chrome-css")) {
const s = document.createElement("style"); s.id = "hp-chrome-css"; s.textContent = css; document.head.appendChild(s);
}
function scrollToId(id) {
if (id === "home") { window.scrollTo({ top: 0, behavior: "smooth" }); return; }
const el = document.getElementById(id);
if (!el) return;
const y = el.getBoundingClientRect().top + window.scrollY - 58;
window.scrollTo({ top: Math.max(0, y), behavior: "smooth" });
}
/* Language state hook: syncs ,
, meta description, ?lang=. */
function useLangState(page) {
const [lang, setLang] = useState(window.hpGetLang());
useEffect(() => { window.hpApplyLangMeta(lang, page); }, [lang, page]);
/* Workaround for a style-invalidation race: