// Shared bits across the three variants — Virginia Tech brand assets.
//
// Type:   Acherus Grotesque (primary VT sans, not on Google → DM Sans substitute)
//         Crimson Text   (VT brand serif, IS on Google Fonts)
//         Gineso Condensed (VT condensed display → Barlow Condensed substitute)
//         Rubik (also a VT brand sans)
//
// Color:  VT Chicago Maroon #861F41, Burnt Orange #E87722, Hokie Stone #75787B,
//         plus secondary palette (Sustainable Teal, Vibrant Turquoise, Boundless Pink).
//
// Photos: Real VTCRC photography pulled from vtcrc.com (CDN URLs). When the live
//         CDN has only a single hero photo we use additional VT-style supplements.

const VT = {
  // Primary
  maroon:       '#861F41',  // Chicago Maroon — VT primary
  orange:       '#E87722',  // Burnt Orange — VT primary
  hokieStone:   '#75787B',  // Hokie Stone — neutral
  black:        '#1C1C1C',
  white:        '#FFFFFF',

  // Tints / supporting
  cream:        '#F4F1E8',
  paper:        '#F8F5EC',
  warmGray:     '#E5E1D6',
  ink:          '#1A1612',
  maroonDeep:   '#5B0F26',
  maroonTint:   '#F2D8DF',
  orangeSoft:   '#F9D4B6',

  // Secondary brand
  teal:         '#008476',  // Sustainable Teal
  turquoise:    '#2CD5C4',  // Vibrant Turquoise
  pink:         '#C95B96',  // Boundless Pink
};

// Type stacks. Two-font system: Montserrat for headlines, Nunito Sans for
// everything else. The legacy token names (serif, rubik, condensed) all now
// resolve to Montserrat so existing variant code keeps working without churn.
const VT_FONT = {
  sans:      '"Nunito Sans", system-ui, sans-serif',
  serif:     '"Montserrat", system-ui, sans-serif',
  condensed: '"Montserrat", system-ui, sans-serif',
  rubik:     '"Montserrat", system-ui, sans-serif',
  mono:      '"Nunito Sans", ui-monospace, monospace',
};

// VTCRC photography — real assets from vtcrc.com plus a few supplements.
const VTCRC_IMG = {
  // Confirmed real VTCRC site assets
  hero:           'https://www.vtcrc.com/wp-content/uploads/2025/11/image_6483441-3-scaled-1.jpg',
  archWonders:    'https://www.vtcrc.com/wp-content/uploads/2025/12/Architectural-Wonders.jpg',
  buildToSuit:    'https://www.vtcrc.com/wp-content/uploads/2025/12/new-building.jpg',
  labsPromo:      'https://www.vtcrc.com/wp-content/uploads/2025/12/labs-promo.jpg',

  // Aliases for clarity in variant code
  heroSculpture:  'https://www.vtcrc.com/wp-content/uploads/2025/11/image_6483441-3-scaled-1.jpg',

  // Supplemental — VT-style campus / lab / Blacksburg photography.
  // Using picsum.photos with stable seeds (reliable CDN) for the imagery the
  // live VTCRC site lazy-loads behind SVG placeholders.
  labScientist:   'https://picsum.photos/seed/vtcrc-lab-science/1600/1280',
  labWork:        'https://picsum.photos/seed/vtcrc-lab-work/1600/1200',
  labClose:       'https://www.vtcrc.com/wp-content/uploads/2025/12/labs-promo.jpg',
  meeting:        'https://picsum.photos/seed/vtcrc-erc-meeting/1600/1200',
  coworking:      'https://picsum.photos/seed/vtcrc-cogro-coworking/1600/1200',
  event:          'https://picsum.photos/seed/vtcrc-sefc-energy/1600/1200',
  heroCampus:     'https://picsum.photos/seed/vtcrc-blacksburg-campus/1800/1200',
  corridor:       'https://www.vtcrc.com/wp-content/uploads/2025/12/Architectural-Wonders.jpg',
  archDetail:     'https://www.vtcrc.com/wp-content/uploads/2025/12/new-building.jpg',
  bldgExt:        'https://www.vtcrc.com/wp-content/uploads/2025/12/Architectural-Wonders.jpg',
  ridge:          'https://picsum.photos/seed/vtcrc-new-river-valley/1600/1200',
};

const SearchIcon = ({size=16, stroke=1.5, color='currentColor'}) => (
  <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke={color} strokeWidth={stroke} strokeLinecap="round" strokeLinejoin="round">
    <circle cx="11" cy="11" r="7"/><line x1="20" y1="20" x2="16.5" y2="16.5"/>
  </svg>
);

const ArrowIcon = ({size=16, stroke=1.8, color='currentColor', dir='right'}) => {
  const rot = {right:0, left:180, up:-90, down:90}[dir] || 0;
  return (
    <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke={color} strokeWidth={stroke} strokeLinecap="round" strokeLinejoin="round" style={{transform:`rotate(${rot}deg)`}}>
      <line x1="4" y1="12" x2="20" y2="12"/><polyline points="14 6 20 12 14 18"/>
    </svg>
  );
};

const SocialRow = ({color='currentColor', size=18}) => (
  <div style={{display:'flex', gap:14, color}}>
    {['F','X','IG','IN','YT'].map(s => (
      <span key={s} style={{
        width:size+12, height:size+12, borderRadius:999, border:`1px solid ${color}`,
        display:'inline-flex', alignItems:'center', justifyContent:'center',
        fontSize:10, fontWeight:600, letterSpacing:'0.04em', fontFamily:VT_FONT.sans,
      }}>{s}</span>
    ))}
  </div>
);

// Photo helper — img with object-cover
const Photo = ({src, alt='', radius=0, ratio, style={}, children}) => (
  <div style={{
    position:'relative', width:'100%', overflow:'hidden',
    borderRadius:radius, aspectRatio:ratio,
    background:'#2a2520',
    ...style
  }}>
    <img src={src} alt={alt} loading="lazy"
      style={{width:'100%', height:'100%', objectFit:'cover', display:'block'}}/>
    {children}
  </div>
);

// VTCRC primary nav structure (parsed from vtcrc.com main menu).
// Each top-level item has an optional dropdown of children. The active flag
// is used by variant nav renderers; the children render in the dropdown panel.
const NAV_ITEMS = [
  {
    l: 'Community', href: '/community/', active: false,
    blurb: 'A connected ecosystem of innovators, neighbors, and partners.',
    items: [
      { l: 'Play Here',         href: '/play-here/',        desc: 'Local trails, food, music, and game-day energy.' },
      { l: 'Live Here',         href: '/live-here/',        desc: 'A high-quality, low-cost life in the New River Valley.' },
      { l: 'Sponsorships',      href: '/sponsorships/',     desc: 'Support events that fuel the corridor.' },
      { l: 'Tenant Directory',  href: '/tenant-directory/', desc: '230+ companies. Find who you need.' },
    ],
  },
  {
    l: 'Property', href: '/property/', active: false,
    blurb: 'Flexible leases, custom build-outs, award-winning architecture.',
    items: [
      { l: 'Build to Suit and Pad Sites', href: '/build-to-suit-and-pad-sites/', desc: 'Ready-to-break-ground plots for custom space.' },
      { l: 'Property Management',         href: '/property-management/',         desc: 'On-site teams keep your space humming.' },
      { l: 'Available Suites',            href: '/available-suites/',            desc: 'Move-in-ready offices and labs.' },
      { l: 'Request Information',         href: '/request-information/',         desc: 'Tell us what you need — we\'ll get back fast.' },
    ],
  },
  {
    l: 'Work Here', href: '/work-here/', active: true,
    blurb: 'Programs, centers, and spaces designed for breakout work.',
    items: [
      { l: 'Entrepreneur Resource Center', href: '/entrepreneur-resource-center/', desc: 'Community, capital, and mentorship for founders.' },
      { l: 'Secure Energy Future Center',  href: '/sefc/',                         desc: 'Sustainable, defense-aligned energy innovation.' },
      { l: 'COgro (Coworking)',            href: '/coworking/',                    desc: 'Flexible shared workspaces from $700/mo.' },
      { l: 'COgro Labs (Wet and Dry Labs)',href: '/wet-dry-labs/',                 desc: 'Custom wet & dry lab facilities.' },
    ],
  },
  {
    l: 'News & Events', href: '/category/news', active: false,
    blurb: 'What\'s happening in the park and across the Commonwealth.',
    items: [
      { l: 'News',         href: '/category/news',                                 desc: 'Headlines, milestones, and tenant wins.' },
      { l: 'Calendar',     href: '/events/category/events',                        desc: 'Upcoming meetups, talks, and demo days.' },
      { l: 'YouTube',      href: 'https://www.youtube.com/@VTCorporateResearchCenter', desc: 'Watch tours, talks, and tenant stories.' },
      { l: 'Game Changer', href: '/game-changer/',                                 desc: 'Our signature speaker series.' },
    ],
  },
];

// Stylized VT-style "VT" mark, matching the Virginia Tech wordmark logic
const VTMark = ({color='#861F41', bg='#FFFFFF', size=44}) => (
  <div style={{
    width:size, height:size, background:bg, color,
    display:'flex', alignItems:'center', justifyContent:'center',
    fontFamily:VT_FONT.sans, fontWeight:800, fontSize:size*0.5,
    letterSpacing:'-0.08em', flexShrink:0,
  }}>VT</div>
);

Object.assign(window, {
  VT, VT_FONT, VTCRC_IMG, SearchIcon, ArrowIcon, SocialRow, Photo, VTMark, NAV_ITEMS
});
