// v2-media.jsx — real renders + project catalog (Google Drive)

const DRIVE_IMG = (id, w = 1400) => `https://lh3.googleusercontent.com/d/${id}=w${w}`;

// id book — portfolio stills, one key per Drive file (PF folders)
const ID = {
  // PF0002 — Greenery Campus
  pf0002_1: "1vjX8jT02WY8apIizYD9YB1etefVp-AIw",
  pf0002_2: "1jYnHy-7w-x0wWJlsznUzdnQwNELtg0gh",
  // PF0003 — Terrace Steps Residence
  pf0003_1: "1rwmmCWi7EWmgolwB2AqEGImVojnZgwiB",
  pf0003_2: "1ttTlHxWaEsajnUN-pck6JjCP1VUnVeno",
  pf0003_3: "1-fFcLDEodp7BRIigzk46Roas8PFC7iFc",
  // PF0004 — Timber & Marble Apartment
  pf0004_living:  "1tNi5vU8PMTZnm7euPxTlCdVhjkK1OGch",
  pf0004_kitchen: "1BaVOfrch36-2Ta0HQnlHDIVq4SY5OlU4",
  pf0004_bedroom: "16VIzY-qSCYO1evmaNueN1JpCpvgp-1zo",
  // PF0006 — The Smith's Coffee Bar
  pf0006_1: "1cKfuMcG7OzgR21BcX6XRd0FEUCujjNnb",
  pf0006_2: "10XPa4v8iAnynnfCoclcmYmkN7n2QPknk",
  // PF0007 — Azure Wave Residence
  pf0007_1: "1sY2q8JZ3-vkHxXLMJ7PzPIkR3gxaMDvd",
  pf0007_2: "1EkyOceH2PM4uWiU0pdMhuhEuGPbRjY11",
  // PF0008 — Wave Promenade
  pf0008_1: "1wTXntcU8cipeo9T050JeppKE7xB9zwAW",
  pf0008_2: "1Xtk4aH2707EHa_ORh2J2Ci5K147v_AF2",
  pf0008_3: "1wuExNxc8TuZ_cCZWe2-GRg8IdYjnF7Gu",
  // PF0009 — Blue Haven Cottage
  pf0009_1: "1go3hvjRS74lTjJnGXuhVmH_vhV3QiDtM",
  pf0009_2: "1EZWQN720J7YtLrJrYMWa8pNBWK8IttEY",
  pf0009_3: "1XxZgx3duBMyhTwSxKI6aSwDw6BJgRO7c",
  pf0009_4: "1DEZ7S_hLr_eC_jssFoykLFCwvFlPoGuq",
  // PF0010 — Oasis Modern Villa
  pf0010_1: "1O8ij1_lmL1-Oj-BHTk7ZbHPr5X1A8gLe",
  // PF0011 — Urban Quarter Quartet
  pf0011_1: "1ktIpSLLa5y9Uc-acuWmNS2S1kMFHLuhJ",
  pf0011_2: "1_P4Yp3MV7_AQYCKMGBpSh7K_Xm9UAIE-",
};

const HERO_CLIP = "uploads/Video May 4 2026.mp4";

// ── Project catalog — single source of truth (PF portfolio) ───
const PROJECTS = [
  {
    slug: "terrace-steps", name: "Terrace Steps Residence", cat: "Residential",
    loc: "Switzerland", year: "2025", span: 2,
    summary: "A residence in a modern functionalist language, its cascading stepped geometry following the natural slope of the hill. Terracotta-toned balconies break the minimalist facade, adding warmth to a design given over entirely to space and harmony.",
    services: ["Exterior stills", "Marketing film"],
    cover: ID.pf0003_1,
    gallery: [ID.pf0003_1, ID.pf0003_2, ID.pf0003_3],
  },
  {
    slug: "azure-wave", name: "Azure Wave Residence", cat: "Hospitality",
    loc: "Dubai, UAE", year: "2026", span: 1,
    summary: "A premium terrace opened fully to the sea breeze and coastal light. Pale stone textures and an endless water horizon carry a continuous feeling of tranquility — minimalist architecture set against a modern Mediterranean lifestyle.",
    services: ["Hospitality stills", "Terrace & views"],
    cover: ID.pf0007_1,
    gallery: [ID.pf0007_1, ID.pf0007_2],
  },
  {
    slug: "greenery-campus", name: "Greenery Campus", cat: "Commercial",
    loc: "Baden-Baden, Germany", year: "2025", span: 1,
    summary: "An expansive campus built around light and openness, its volumes connected by a dramatic multi-storey glass gallery. Soft pastel and light-green tones keep the ensemble airy and calm, focused entirely on a sense of space and harmony.",
    services: ["Exterior stills", "Atrium & gallery"],
    cover: ID.pf0002_1,
    gallery: [ID.pf0002_1, ID.pf0002_2],
  },
  {
    slug: "wave-promenade", name: "Wave Promenade", cat: "Public",
    loc: "Ukraine", year: "2025", span: 2,
    summary: "A public promenade framework built on fluid, undulating lines that echo the shoreline, merging urban life with the water's edge. Pedestrian paths, integrated green pockets and open spaces set a vibrant yet tranquil environment for the community.",
    services: ["Masterplan visuals", "Public space", "Aerial view"],
    cover: ID.pf0008_1,
    gallery: [ID.pf0008_1, ID.pf0008_2, ID.pf0008_3],
  },
  {
    slug: "timber-marble", name: "Timber & Marble Apartment", cat: "Interiors",
    loc: "Prague, Czechia", year: "2026", span: 1,
    summary: "A city apartment drawn together into a single, harmonious interior. Deep wood panelling, elegant marble surfaces and wide windows create a fluid, restful environment tailored for contemporary city living.",
    services: ["Interior stills", "Animation"],
    cover: ID.pf0004_living,
    gallery: [ID.pf0004_living, ID.pf0004_kitchen, ID.pf0004_bedroom],
  },
  {
    slug: "urban-quarter", name: "Urban Quarter Quartet", cat: "Residential",
    loc: "Warsaw, Poland", year: "2025", span: 1,
    summary: "A residential ensemble of clean geometric lines and a rhythmic play of light and shadow. Prominent modular balconies and contrasting blocks create visual depth and dynamic balance, framed within a soft, open green landscape.",
    services: ["Exterior stills", "Facade studies"],
    cover: ID.pf0011_1,
    gallery: [ID.pf0011_1, ID.pf0011_2],
  },
  {
    slug: "smiths-coffee", name: "The Smith's Coffee Bar", cat: "Commercial",
    loc: "Edinburgh, UK", year: "2025", span: 1,
    summary: "A corner coffee bar built around a striking teal storefront — a bold exterior paired with a warm, nostalgic interior. Exposed wooden beams, patterned floor tiles and abundant greenery create an intimate, vintage-inspired atmosphere of classic European charm.",
    services: ["Exterior", "Interior"],
    cover: ID.pf0006_1,
    gallery: [ID.pf0006_1, ID.pf0006_2],
  },
  {
    slug: "blue-haven", name: "Blue Haven Cottage", cat: "Residential",
    loc: "Vermont, USA", year: "2025", span: 1,
    summary: "A serene countryside home rooted in classic suburban architecture — traditional comfort and peaceful living. The balanced facade, welcoming entryways and open spaces create a timeless sanctuary that feels instantly warm and inviting.",
    services: ["Exterior stills", "Marketing film"],
    cover: ID.pf0009_1,
    gallery: [ID.pf0009_1, ID.pf0009_2, ID.pf0009_3, ID.pf0009_4],
  },
  {
    slug: "oasis-villa", name: "Oasis Modern Villa", cat: "Residential",
    loc: "Miami, USA", year: "2026", span: 1,
    summary: "Wide glass facades, open terraces and a tranquil poolside lounge establish an atmosphere of serene relaxation and refined architectural harmony.",
    services: ["Exterior stills", "Pool & landscape"],
    cover: ID.pf0010_1,
    gallery: [ID.pf0010_1],
  },
];

const getProject = (slug) => PROJECTS.find(p => p.slug === slug) || PROJECTS[0];

// ── Real-render image card (with optional hover video) ────────
function Photo({ id, render, ratio = "4/5", alt = "", w = 1400, video, style }) {
  const imgId = id || (RENDERS ? RENDERS[render] : null) || render;
  return (
    <div className="plate" style={{ aspectRatio: ratio, ...style }}>
      <img className="plate-photo" src={DRIVE_IMG(imgId, w)} alt={alt} loading="lazy" />
      {video && (
        <video className="plate-video" src={video} muted loop playsInline preload="none"></video>
      )}
    </div>
  );
}

// legacy alias used by older calls
const RENDERS = ID;

Object.assign(window, { DRIVE_IMG, ID, RENDERS, PROJECTS, getProject, Photo, HERO_CLIP });
