/* Main App + practical info + hero + tweaks */
const { useState: _u1, useEffect: _u2, useMemo: _u3 } = React;

// ─────────────────────────────────────────────────────────────
// Wi-Fi card with copy-to-clipboard on the password
// ─────────────────────────────────────────────────────────────
function WifiRow({ label, value, copiable, t, dark }) {
  const [copied, setCopied] = _u1(false);
  const onCopy = () => {
    if (!copiable) return;
    try {
      navigator.clipboard.writeText(value);
      setCopied(true);
      setTimeout(() => setCopied(false), 1800);
    } catch (e) {}
  };
  return (
    <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: 6, gap: 8 }}>
      <span style={{ opacity: 0.7 }}>{label}</span>
      <span
        onClick={onCopy}
        style={{
          fontWeight: 600, fontFamily: 'ui-monospace, SFMono-Regular, monospace',
          cursor: copiable ? 'pointer' : 'default',
          display: 'inline-flex', alignItems: 'center', gap: 6,
          padding: copiable ? '3px 8px' : 0,
          borderRadius: 6,
          background: copiable ? 'rgba(201,169,97,0.15)' : 'transparent',
          transition: 'all 0.15s',
        }}
      >
        {value}
        {copiable && (copied ? <IconCheck size={13}/> : <IconCopy size={12}/>)}
      </span>
    </div>
  );
}

function PracticalInfo({ t, lang, dark, data }) {
  return (
    <div style={{
      display: 'grid', gap: 12,
      gridTemplateColumns: 'repeat(auto-fit, minmax(240px, 1fr))',
    }}>
      <InfoCard icon={IconWifi} title={t.wifi} accent dark={dark}>
        <WifiRow label={t.wifiNetwork} value={data.meta.wifi.ssid} dark={dark}/>
        <WifiRow label={t.wifiPassword} value={data.meta.wifi.password} copiable t={t} dark={dark}/>
      </InfoCard>

      <InfoCard icon={IconClock} title={t.arrival} dark={dark}>
        <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 4 }}>
          <span style={{ opacity: 0.7 }}>{t.arrivalTime}</span>
          <span style={{ fontWeight: 600 }}>{data.meta.checkIn}</span>
        </div>
        <div style={{ display: 'flex', justifyContent: 'space-between' }}>
          <span style={{ opacity: 0.7 }}>{t.departureTime}</span>
          <span style={{ fontWeight: 600 }}>{data.meta.checkOut}</span>
        </div>
      </InfoCard>

      <InfoCard icon={IconCar} title={t.parking} dark={dark}>
        {t.parkingDesc}
      </InfoCard>

      <InfoCard icon={IconStorage} title={t.storage} dark={dark}>
        {t.storageDesc}
      </InfoCard>

      <InfoCard icon={IconShield} title={t.security} dark={dark}>
        {t.securityDesc}
      </InfoCard>

      <InfoCard icon={IconPhone} title={t.contact} dark={dark}>
        <div style={{ marginBottom: 10, opacity: 0.8 }}>{data.meta.ownerName} — {t.contactHint}</div>
        <div style={{ display: 'flex', gap: 8, flexWrap: 'wrap' }}>
          <a href={data.meta.phoneHref} style={{
            display: 'inline-flex', alignItems: 'center', gap: 6,
            background: '#C9A961', color: '#1E3A2E', padding: '8px 13px',
            borderRadius: 999, textDecoration: 'none', fontWeight: 600,
            fontSize: 13,
          }}>
            <IconPhone size={14}/> {data.meta.phone}
          </a>
          <a href={`mailto:${data.meta.email}`} style={{
            display: 'inline-flex', alignItems: 'center', gap: 6,
            background: dark ? 'rgba(245,234,208,0.08)' : 'rgba(30,58,46,0.06)',
            color: 'inherit', padding: '8px 13px',
            borderRadius: 999, textDecoration: 'none', fontWeight: 600,
            fontSize: 13, border: dark ? '1px solid rgba(245,234,208,0.1)' : '1px solid rgba(30,58,46,0.08)',
          }}>
            <IconMail size={14}/> {t.writeOwner}
          </a>
        </div>
      </InfoCard>
    </div>
  );
}

// Address / "How to get here" card — dedicated block with maps links
function AddressBlock({ t, data, dark }) {
  return (
    <div className="address-block" style={{
      background: dark ? 'rgba(255,255,255,0.04)' : '#fff',
      border: dark ? '1px solid rgba(255,255,255,0.08)' : '1px solid rgba(30,58,46,0.08)',
      borderRadius: 10, padding: '22px 22px 20px',
      display: 'grid', gridTemplateColumns: 'auto 1fr auto', gap: 18, alignItems: 'center',
    }}>
      <div style={{
        width: 52, height: 52, borderRadius: 999,
        background: dark ? 'rgba(201,169,97,0.12)' : 'rgba(201,169,97,0.14)',
        color: '#C9A961', display: 'flex', alignItems: 'center', justifyContent: 'center', flexShrink: 0,
      }}>
        <IconHome size={26}/>
      </div>
      <div style={{ minWidth: 0 }}>
        <div style={{
          fontFamily: 'Inter, sans-serif', fontSize: 10, letterSpacing: '0.18em',
          textTransform: 'uppercase', color: '#C9A961', marginBottom: 4, fontWeight: 600,
        }}>{t.howToGet}</div>
        <div style={{
          fontFamily: '"Cormorant Garamond", serif', fontSize: 20, fontWeight: 600,
          color: dark ? '#F5EAD0' : '#1E3A2E', marginBottom: 2,
        }}>{data.meta.address}</div>
        <div style={{
          fontFamily: 'ui-monospace, SFMono-Regular, monospace', fontSize: 11.5,
          color: dark ? 'rgba(245,234,208,0.5)' : 'rgba(30,58,46,0.55)',
        }}>
          GPS {data.meta.gps[0].toFixed(4)}° N, {data.meta.gps[1].toFixed(4)}° E
        </div>
      </div>
      <div className="address-actions" style={{ display: 'flex', gap: 6, flexWrap: 'wrap', justifyContent: 'flex-end' }}>
        <a
          href={googleDirections([50.0755, 14.4378], data.meta.gps)}
          target="_blank" rel="noopener noreferrer"
          style={{
            display: 'inline-flex', alignItems: 'center', gap: 6,
            background: '#C9A961', color: '#1E3A2E',
            padding: '9px 14px', borderRadius: 999,
            textDecoration: 'none', fontWeight: 600, fontSize: 13,
            fontFamily: 'Inter, sans-serif',
          }}>
          <IconNavigate size={13}/> {t.navigateHere}
        </a>
        <PillLink href={data.meta.mapyLink} dark={dark}>
          <IconPinDrop size={12}/> Mapy.cz
        </PillLink>
      </div>
    </div>
  );
}

// Amenities / Resort — two light-weight columns
function VillaFactBlock({ t, dark }) {
  const Col = ({ title, items, icon: I }) => (
    <div style={{
      padding: '22px 22px 22px',
      background: dark ? 'rgba(255,255,255,0.04)' : '#fff',
      border: dark ? '1px solid rgba(255,255,255,0.08)' : '1px solid rgba(30,58,46,0.08)',
      borderRadius: 10,
    }}>
      <div style={{ display:'flex', alignItems:'center', gap: 10, marginBottom: 14 }}>
        <div style={{ color: '#C9A961' }}><I size={22} stroke={1.5}/></div>
        <div style={{
          fontFamily:'"Cormorant Garamond", serif', fontSize: 22, fontWeight: 600,
          color: dark ? '#F5EAD0' : '#1E3A2E', letterSpacing: '-0.01em',
        }}>{title}</div>
      </div>
      <ul style={{
        margin: 0, padding: 0, listStyle: 'none',
        display: 'grid', gap: 6,
        fontFamily: 'Inter, sans-serif', fontSize: 14,
        color: dark ? 'rgba(245,234,208,0.78)' : 'rgba(30,58,46,0.78)',
      }}>
        {items.map((x, i) => (
          <li key={i} style={{ display: 'flex', alignItems: 'flex-start', gap: 8 }}>
            <span style={{
              display: 'inline-block', width: 5, height: 5, borderRadius: 999,
              background: '#C9A961', marginTop: 8, flexShrink: 0,
            }}/>
            {x}
          </li>
        ))}
      </ul>
    </div>
  );
  return (
    <div style={{ display: 'grid', gap: 12, gridTemplateColumns: 'repeat(auto-fit, minmax(280px, 1fr))' }}>
      <Col title={t.amenities} items={t.amenitiesList} icon={IconHome}/>
      <Col title={t.resort} items={t.resortList} icon={IconStar}/>
    </div>
  );
}

// ─────────────────────────────────────────────────────────────
// Category nav (sticky pill bar) — filters + smooth scroll
// ─────────────────────────────────────────────────────────────
function CategoryNav({ t, dark, selected, setSelected }) {
  const cats = ['all', 'trips', 'water', 'sport', 'walks', 'wellness', 'cycling', 'gastro'];
  return (
    <div style={{
      position: 'sticky', top: 0, zIndex: 20,
      background: dark ? 'rgba(15,36,28,0.88)' : 'rgba(247,243,234,0.92)',
      backdropFilter: 'blur(12px)', WebkitBackdropFilter: 'blur(12px)',
      borderBottom: dark ? '1px solid rgba(245,234,208,0.08)' : '1px solid rgba(30,58,46,0.08)',
      padding: '12px 0', margin: '0 -20px 28px',
    }}>
      <div style={{
        display: 'flex', gap: 6, overflowX: 'auto', padding: '0 20px',
        scrollbarWidth: 'none',
      }} className="scroll-x">
        {cats.map(c => {
          const isSel = selected === c;
          const label = c === 'all' ? t.seeAll : t.category[c];
          return (
            <button key={c} onClick={() => {
              setSelected(c);
              if (c !== 'all') {
                const el = document.getElementById(`cat-${c}`);
                if (el) el.scrollIntoView({ behavior: 'smooth', block: 'start' });
              } else {
                document.getElementById('activities-top')?.scrollIntoView({ behavior: 'smooth', block: 'start' });
              }
            }} style={{
              flexShrink: 0, padding: '8px 14px', borderRadius: 999,
              background: isSel ? '#1E3A2E' : (dark ? 'rgba(255,255,255,0.06)' : 'rgba(30,58,46,0.04)'),
              color: isSel ? '#F5EAD0' : (dark ? 'rgba(245,234,208,0.7)' : 'rgba(30,58,46,0.75)'),
              border: 'none', cursor: 'pointer',
              fontFamily: 'Inter, sans-serif', fontSize: 13, fontWeight: 500,
              whiteSpace: 'nowrap', letterSpacing: '0.01em',
            }}>{label}</button>
          );
        })}
      </div>
    </div>
  );
}

// ─────────────────────────────────────────────────────────────
// Hero
// ─────────────────────────────────────────────────────────────
function Hero({ t, lang, setLang, data, dark, heroVariant }) {
  const firstWord = t.welcome.split(' ')[0];
  const rest = t.welcome.split(' ').slice(1).join(' ');
  return (
    <header style={{ position: 'relative', overflow: 'hidden', minHeight: 460 }}>
      <HeroBackground dark={dark} variant={heroVariant}/>

      {/* Top bar: villa mark + lang */}
      <div style={{
        position: 'relative', zIndex: 2,
        display: 'flex', justifyContent: 'space-between', alignItems: 'center',
        padding: '22px 20px 0', gap: 12, flexWrap: 'wrap',
      }}>
        <div style={{
          fontFamily: '"Cormorant Garamond", serif',
          color: '#F5EAD0', fontSize: 15, letterSpacing: '0.22em',
          textTransform: 'uppercase', fontWeight: 500,
        }}>Vila Albatros</div>
        <LangSwitcher lang={lang} setLang={setLang} dark={true}/>
      </div>

      {/* Title */}
      <div style={{
        position: 'relative', zIndex: 2,
        padding: '70px 20px 70px', textAlign: 'center',
      }}>
        <div style={{
          fontFamily: 'Inter, sans-serif', fontSize: 11, letterSpacing: '0.24em',
          textTransform: 'uppercase', color: '#C9A961', marginBottom: 18,
          fontWeight: 500,
        }}>
          <span style={{ display: 'inline-block', borderTop: '1px solid #C9A961', width: 32, verticalAlign: 'middle', margin: '0 12px 4px' }}/>
          Lužické hory · Resort Malevil
          <span style={{ display: 'inline-block', borderTop: '1px solid #C9A961', width: 32, verticalAlign: 'middle', margin: '0 12px 4px' }}/>
        </div>
        <h1 style={{
          fontFamily: '"Cormorant Garamond", serif',
          fontSize: 'clamp(40px, 8vw, 72px)', fontWeight: 400,
          color: '#F5EAD0', margin: 0, lineHeight: 1.05,
          letterSpacing: '-0.02em',
        }}>
          <span style={{ fontStyle: 'italic' }}>{firstWord}</span>{' '}
          {rest}
        </h1>
        <p style={{
          fontFamily: 'Inter, sans-serif', fontSize: 15, lineHeight: 1.6,
          color: 'rgba(245,234,208,0.82)', maxWidth: 560, margin: '22px auto 0',
          textWrap: 'balance',
        }}>{t.subtitle}</p>
      </div>
    </header>
  );
}

// ─────────────────────────────────────────────────────────────
// Owner message
// ─────────────────────────────────────────────────────────────
function OwnerMessage({ t, data, dark }) {
  return (
    <section style={{
      background: dark ? 'rgba(255,255,255,0.03)' : '#fff',
      borderRadius: 10, padding: '36px 28px', margin: '32px 0',
      border: dark ? '1px solid rgba(255,255,255,0.06)' : '1px solid rgba(30,58,46,0.08)',
      position: 'relative',
    }}>
      <div style={{
        fontFamily: 'Inter, sans-serif', fontSize: 11, letterSpacing: '0.2em',
        textTransform: 'uppercase', color: '#C9A961', marginBottom: 16, fontWeight: 500,
      }}>{t.ownerMsg}</div>
      <div style={{
        fontFamily: '"Cormorant Garamond", serif', fontSize: 'clamp(20px, 2.8vw, 26px)',
        lineHeight: 1.45, color: dark ? '#F5EAD0' : '#1E3A2E',
        fontStyle: 'italic', whiteSpace: 'pre-line', marginBottom: 24,
        fontWeight: 500, letterSpacing: '-0.005em',
      }}>{t.ownerLetter}</div>
      <svg width="120" height="36" viewBox="0 0 120 36" style={{ display:'block', marginBottom: 8 }}>
        <path d="M5 22 Q 15 6 22 18 Q 28 30 38 14 Q 45 4 52 20 Q 60 30 68 12 Q 76 2 86 22 Q 92 30 104 10"
          fill="none" stroke="#C9A961" strokeWidth="1.2" strokeLinecap="round"/>
      </svg>
      <div style={{ fontFamily:'"Cormorant Garamond", serif', fontSize: 22, fontWeight:600, color: dark?'#F5EAD0':'#1E3A2E' }}>
        {data.meta.ownerName}
      </div>
      <div style={{ fontFamily:'Inter, sans-serif', fontSize: 13, color: dark?'rgba(245,234,208,0.55)':'rgba(30,58,46,0.55)' }}>
        {t.ownerRole}
      </div>
    </section>
  );
}

// ─────────────────────────────────────────────────────────────
// Tweaks panel
// ─────────────────────────────────────────────────────────────
function TweaksPanel({ visible, t, dark, setDark, density, setDensity, heroVariant, setHeroVariant, onPersist }) {
  if (!visible) return null;
  const row = (label, children) => (
    <div style={{ marginBottom: 14 }}>
      <div style={{ fontFamily:'Inter, sans-serif', fontSize: 10, letterSpacing: '0.14em', textTransform:'uppercase', color: dark?'rgba(245,234,208,0.55)':'rgba(30,58,46,0.55)', marginBottom: 6 }}>{label}</div>
      {children}
    </div>
  );
  const btn = (active, onClick, content, key) => (
    <button key={key} onClick={onClick} style={{
      flex: 1, padding: '8px 10px', border: 'none', cursor: 'pointer',
      background: active ? '#1E3A2E' : (dark ? 'rgba(255,255,255,0.06)' : 'rgba(30,58,46,0.05)'),
      color: active ? '#F5EAD0' : (dark ? 'rgba(245,234,208,0.7)' : 'rgba(30,58,46,0.7)'),
      fontFamily: 'Inter, sans-serif', fontSize: 12, fontWeight: 500,
      display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 5,
      borderRadius: 6,
    }}>{content}</button>
  );
  const tw = t.tweaks;
  return (
    <div style={{
      position: 'fixed', right: 16, bottom: 16, zIndex: 90,
      background: dark ? '#173028' : '#fff',
      color: dark ? '#F5EAD0' : '#1E3A2E',
      border: dark ? '1px solid rgba(245,234,208,0.12)' : '1px solid rgba(30,58,46,0.12)',
      borderRadius: 12, padding: 18, minWidth: 260,
      boxShadow: '0 16px 40px rgba(0,0,0,0.18)',
      fontFamily: 'Inter, sans-serif',
    }}>
      <div style={{ fontFamily:'"Cormorant Garamond", serif', fontSize: 20, fontWeight: 600, marginBottom: 14 }}>{tw.title}</div>
      {row(tw.theme, (
        <div style={{ display:'flex', gap: 6 }}>
          {btn(!dark, () => { setDark(false); onPersist({ dark: false }); }, <><IconSun size={14}/> {tw.light}</>, 'l')}
          {btn(dark, () => { setDark(true); onPersist({ dark: true }); }, <><IconMoon size={14}/> {tw.dark}</>, 'd')}
        </div>
      ))}
      {row(tw.density, (
        <div style={{ display:'flex', gap: 6 }}>
          {btn(density==='list', () => { setDensity('list'); onPersist({ density: 'list' }); }, <><IconList size={14}/> {tw.list}</>, 'li')}
          {btn(density==='grid', () => { setDensity('grid'); onPersist({ density: 'grid' }); }, <><IconGrid size={14}/> {tw.grid}</>, 'gr')}
          {btn(density==='tile', () => { setDensity('tile'); onPersist({ density: 'tile' }); }, <><IconTile size={14}/> {tw.tile}</>, 'ti')}
        </div>
      ))}
      {row(tw.hero, (
        <div style={{ display:'flex', gap: 6 }}>
          {btn(heroVariant==='botanical', () => { setHeroVariant('botanical'); onPersist({ heroVariant:'botanical' }); }, tw.botanical, 'b')}
          {btn(heroVariant==='topo', () => { setHeroVariant('topo'); onPersist({ heroVariant:'topo' }); }, tw.topo, 't')}
          {btn(heroVariant==='minimal', () => { setHeroVariant('minimal'); onPersist({ heroVariant:'minimal' }); }, tw.minimal, 'm')}
        </div>
      ))}
    </div>
  );
}

// ─────────────────────────────────────────────────────────────
// Section heading
// ─────────────────────────────────────────────────────────────
function SectionHeading({ eyebrow, title, subtitle, dark }) {
  return (
    <div style={{ marginBottom: 22 }}>
      <div style={{
        fontFamily: 'Inter, sans-serif', fontSize: 11, letterSpacing: '0.22em',
        textTransform: 'uppercase', color: '#C9A961', marginBottom: 8, fontWeight: 500,
        display: 'flex', alignItems: 'center', gap: 10,
      }}>
        <span style={{
          display:'inline-flex', alignItems:'center', justifyContent:'center',
          width: 22, height: 22, borderRadius: 999,
          border: '1px solid #C9A961', fontSize: 10,
        }}>{eyebrow}</span>
        <span>·</span>
      </div>
      <h2 style={{
        fontFamily: '"Cormorant Garamond", serif', fontSize: 'clamp(28px, 5vw, 40px)',
        fontWeight: 500, letterSpacing: '-0.015em', lineHeight: 1.1,
        margin: 0, color: dark ? '#F5EAD0' : '#1E3A2E',
      }}>{title}</h2>
      {subtitle && (
        <p style={{
          fontFamily: 'Inter, sans-serif', fontSize: 14, lineHeight: 1.55,
          color: dark ? 'rgba(245,234,208,0.65)' : 'rgba(30,58,46,0.65)',
          maxWidth: 600, margin: '10px 0 0',
        }}>{subtitle}</p>
      )}
    </div>
  );
}

// ─────────────────────────────────────────────────────────────
// Main App
// ─────────────────────────────────────────────────────────────
function App({ initialTweaks }) {
  const data = window.VILLA_DATA;
  const [lang, setLang] = _u1(() => localStorage.getItem('villa_lang') || 'cs');
  const [dark, setDark] = _u1(!!initialTweaks.dark);
  const [density, setDensity] = _u1(initialTweaks.density || 'grid');
  const [heroVariant, setHeroVariant] = _u1(initialTweaks.heroVariant || 'botanical');
  const [selectedCat, setSelectedCat] = _u1('all');
  const [openActivity, setOpenActivity] = _u1(null);
  const [tweaksVisible, setTweaksVisible] = _u1(false);

  _u2(() => { localStorage.setItem('villa_lang', lang); }, [lang]);
  _u2(() => { document.documentElement.lang = lang === 'cs' ? 'cs' : lang; }, [lang]);

  _u2(() => {
    const handler = (e) => {
      if (e.data?.type === '__activate_edit_mode') setTweaksVisible(true);
      if (e.data?.type === '__deactivate_edit_mode') setTweaksVisible(false);
    };
    window.addEventListener('message', handler);
    window.parent.postMessage({ type:'__edit_mode_available' }, '*');
    return () => window.removeEventListener('message', handler);
  }, []);

  const persistKey = (edits) => {
    window.parent.postMessage({ type:'__edit_mode_set_keys', edits }, '*');
  };

  const t = data.i18n[lang];
  const bg = dark ? '#0F241C' : '#F7F3EA';
  const fg = dark ? '#F5EAD0' : '#1E3A2E';

  _u2(() => {
    document.body.style.background = bg;
    document.body.style.color = fg;
  }, [bg, fg]);

  const cats = ['trips','water','walks','cycling','sport','wellness','gastro'];

  return (
    <div style={{
      background: bg, color: fg, minHeight: '100vh',
      fontFamily: 'Inter, sans-serif', transition: 'background 0.3s, color 0.3s',
    }}>
      <Hero t={t} lang={lang} setLang={setLang} data={data} dark={dark} heroVariant={heroVariant}/>

      <main style={{ maxWidth: 1100, margin: '0 auto', padding: '40px 20px 60px' }}>
        {/* 1 — Practical info */}
        <div style={{ marginBottom: 32 }}>
          <SectionHeading eyebrow="1" title={t.practical} dark={dark}/>
          <PracticalInfo t={t} lang={lang} dark={dark} data={data}/>
        </div>

        {/* Address / How to get here */}
        <div style={{ marginBottom: 48 }}>
          <AddressBlock t={t} data={data} dark={dark}/>
        </div>

        {/* Villa + Resort facts */}
        <div style={{ marginBottom: 48 }}>
          <VillaFactBlock t={t} dark={dark}/>
        </div>

        {/* Owner message */}
        <OwnerMessage t={t} data={data} dark={dark}/>

        {/* 2 — Activities */}
        <div id="activities-top" style={{ marginTop: 48 }}>
          <SectionHeading eyebrow="2" title={t.activities} subtitle={t.activitiesSub} dark={dark}/>
        </div>
        <CategoryNav t={t} dark={dark} selected={selectedCat} setSelected={setSelectedCat}/>

        {cats.map(c => (
          <CategorySection
            key={c} catKey={c}
            activities={data.activities}
            t={t} lang={lang} dark={dark} density={density}
            selectedCat={selectedCat}
            onOpen={setOpenActivity}
          />
        ))}

        {/* Footer */}
        <footer style={{
          marginTop: 60, paddingTop: 36,
          borderTop: dark ? '1px solid rgba(245,234,208,0.1)' : '1px solid rgba(30,58,46,0.1)',
          textAlign: 'center',
        }}>
          <div style={{ fontFamily:'"Cormorant Garamond", serif', fontSize: 26, fontStyle:'italic', color: dark?'rgba(245,234,208,0.85)':'rgba(30,58,46,0.85)' }}>
            {t.footer}
          </div>
          <div style={{ marginTop: 10, fontSize: 12, letterSpacing:'0.2em', textTransform:'uppercase', color: '#C9A961' }}>
            {t.footerNote}
          </div>
          <div style={{
            marginTop: 14, fontSize: 12, fontFamily: 'Inter, sans-serif',
            color: dark ? 'rgba(245,234,208,0.5)' : 'rgba(30,58,46,0.55)',
          }}>
            <a href={data.meta.phoneHref} style={{ textDecoration: 'none', borderBottom: '1px dotted currentColor' }}>{data.meta.phone}</a>
            <span style={{ margin: '0 10px', opacity: 0.4 }}>·</span>
            <a href={`mailto:${data.meta.email}`} style={{ textDecoration: 'none', borderBottom: '1px dotted currentColor' }}>{data.meta.email}</a>
          </div>
        </footer>
      </main>

      <ActivityModal a={openActivity} t={t} lang={lang} dark={dark} onClose={() => setOpenActivity(null)} villaGps={data.meta.gps}/>

      <TweaksPanel
        visible={tweaksVisible}
        t={t}
        dark={dark} setDark={setDark}
        density={density} setDensity={setDensity}
        heroVariant={heroVariant} setHeroVariant={setHeroVariant}
        onPersist={persistKey}
      />
    </div>
  );
}

Object.assign(window, {
  App, PracticalInfo, CategoryNav, Hero, OwnerMessage, TweaksPanel, SectionHeading,
  AddressBlock, VillaFactBlock, WifiRow,
});
