// Sample directory used by all artist artboards.
// Mix of members (28) and high-school student artists (8) = 36 total.
// Mediums, towns, "visitable" (Open Studios participant), and commissions
// status are real fields you'd filter on.

const ARTISTS = [
  // ─── Members ───────────────────────────────────────────────
  { id: "mcortez",  name: "Maribel Cortez",   pronouns: "she/her", type: "member", medium: ["Quilting"], town: "Stockton", joined: 1994, visitable: true,  commissions: "limited", featured: true, tags: ["Quilt Wall artist"], shade: "#0E3E78" },
  { id: "hplumb",   name: "Henry Plumb",       pronouns: "he/him",  type: "member", medium: ["Letterpress", "Printmaking"], town: "Plainville", joined: 2008, visitable: true,  commissions: "open", shade: "#1F5A8C" },
  { id: "adiop",    name: "Aïsha Diop",        pronouns: "she/her", type: "member", medium: ["Photography"], town: "Palco",    joined: 2019, visitable: false, commissions: "open", shade: "#6E94BC" },
  { id: "cwestra",  name: "Cal Westra",        pronouns: "he/him",  type: "member", medium: ["Woodworking"], town: "Webster",  joined: 2002, visitable: true,  commissions: "open",    shade: "#0E3E78" },
  { id: "spark",    name: "Sun Park",          pronouns: "they/them",type: "member",medium: ["Painting"], town: "Stockton",   joined: 2014, visitable: false, commissions: "open",    shade: "#1F5A8C" },
  { id: "jbeau",    name: "Joe Beaumont",      pronouns: "he/him",  type: "member", medium: ["Printmaking"], town: "Plainville", joined: 2011, visitable: true,  commissions: "closed", shade: "#6E94BC" },
  { id: "lschaef",  name: "Lillian Schaeffer", pronouns: "she/her", type: "member", medium: ["Quilting"], town: "Stockton",     joined: 1988, visitable: true,  commissions: "limited", tags: ["Quilt Wall artist"], shade: "#0E3E78" },
  { id: "dmwangi",  name: "Doreen Mwangi",     pronouns: "she/her", type: "member", medium: ["Ceramics"], town: "Damar",        joined: 2017, visitable: false, commissions: "open",   shade: "#1F5A8C" },
  { id: "ehart",    name: "Esau Hartmann",     pronouns: "he/him",  type: "member", medium: ["Sculpture", "Metalwork"], town: "Webster", joined: 2003, visitable: true,  commissions: "open",  shade: "#6E94BC" },
  { id: "itate",    name: "Imogene Tate",      pronouns: "she/her", type: "member", medium: ["Watercolor", "Painting"], town: "Logan",    joined: 2020, visitable: true,  commissions: "open",  shade: "#0E3E78" },
  { id: "plindsey", name: "Pat Lindsey",       pronouns: "she/her", type: "member", medium: ["Fiber", "Weaving"], town: "Stockton",    joined: 1996, visitable: true,  commissions: "closed", shade: "#1F5A8C" },
  { id: "dwuori",   name: "Devin Wuori",       pronouns: "he/him",  type: "member", medium: ["Drawing"], town: "Plainville",   joined: 2022, visitable: false, commissions: "open",    shade: "#6E94BC" },
  { id: "mrein",    name: "Marcus Reinholt",   pronouns: "he/him",  type: "member", medium: ["Photography"], town: "Palco",    joined: 2015, visitable: true,  commissions: "open",    shade: "#0E3E78" },
  { id: "bvol",     name: "Bea Volstad",       pronouns: "she/her", type: "member", medium: ["Painting"], town: "Zurich",      joined: 2010, visitable: false, commissions: "open",    shade: "#1F5A8C" },
  { id: "tiwasaki", name: "Theo Iwasaki",      pronouns: "he/him",  type: "member", medium: ["Woodworking"], town: "Woodston", joined: 2019, visitable: true,  commissions: "open",    shade: "#6E94BC" },
  { id: "cotieno",  name: "Charlie Otieno",    pronouns: "he/him",  type: "member", medium: ["Music"], town: "Stockton",       joined: 2018, visitable: false, commissions: "open",    shade: "#0E3E78" },
  { id: "ghalv",    name: "Ginnie Halverson",  pronouns: "she/her", type: "member", medium: ["Glass"], town: "Plainville",     joined: 2006, visitable: true,  commissions: "limited", tags: ["Quilt Wall artist"], shade: "#1F5A8C" },
  { id: "rmcgee",   name: "Roselynne McGee",   pronouns: "she/her", type: "honorary", medium: ["Quilting"], town: "Logan",     joined: 1979, visitable: false, commissions: "closed", tags: ["Quilt Wall artist", "Honorary"], shade: "#6E94BC" },
  { id: "jpruitt",  name: "Jay Pruitt",        pronouns: "they/them",type: "member",medium: ["Printmaking"], town: "Stockton",joined: 2021, visitable: true,  commissions: "open",    shade: "#0E3E78" },
  { id: "hvu",      name: "Hank Vu",           pronouns: "he/him",  type: "member", medium: ["Painting"], town: "Palco",       joined: 2013, visitable: false, commissions: "open",    shade: "#1F5A8C" },
  { id: "afelix",   name: "Ada Felix",         pronouns: "she/her", type: "member", medium: ["Fiber"], town: "Damar",          joined: 2016, visitable: true,  commissions: "limited", shade: "#6E94BC" },
  { id: "sbriggs",  name: "Sonny Briggs",      pronouns: "he/him",  type: "member", medium: ["Music", "Songwriting"], town: "Stockton", joined: 2024, visitable: false, commissions: "open", shade: "#0E3E78" },
  { id: "rmald",    name: "Rosa Maldonado",    pronouns: "she/her", type: "member", medium: ["Painting"], town: "Webster",     joined: 2009, visitable: false, commissions: "open",    shade: "#1F5A8C" },
  { id: "whenning", name: "Walt Henning",      pronouns: "he/him",  type: "member", medium: ["Woodturning"], town: "Zurich",   joined: 1992, visitable: true,  commissions: "open",    tags: ["Quilt Wall artist"], shade: "#6E94BC" },
  { id: "abhat",    name: "Asha Bhattacharya", pronouns: "she/her", type: "member", medium: ["Mixed media"], town: "Stockton", joined: 2023, visitable: false, commissions: "open",    shade: "#0E3E78" },
  { id: "ebrandt",  name: "Eli Brandt",        pronouns: "he/him",  type: "member", medium: ["Photography"], town: "Stockton", joined: 2017, visitable: false, commissions: "open",    shade: "#1F5A8C" },
  { id: "ntagawa",  name: "Nori Tagawa",       pronouns: "they/them",type: "member",medium: ["Ceramics"], town: "Plainville", joined: 2008, visitable: true,  commissions: "limited", shade: "#6E94BC" },
  { id: "glindst",  name: "Greta Lindstrom",   pronouns: "she/her", type: "member", medium: ["Quilting"], town: "Webster",     joined: 2001, visitable: true,  commissions: "open",    shade: "#0E3E78" },

  // ─── Student artists (HS) ──────────────────────────────────
  { id: "jstein",   name: "Jacob Steinmiller", pronouns: "he/him",  type: "student", medium: ["Drawing", "Comics"], town: "Stockton",   school: "Stockton HS",   grade: 12, joined: 2025, visitable: false, commissions: "open",   shade: "#1F5A8C" },
  { id: "lcho",     name: "Lily Cho",          pronouns: "she/her", type: "student", medium: ["Photography"],       town: "Plainville", school: "Plainville HS", grade: 11, joined: 2026, visitable: false, commissions: "closed", shade: "#6E94BC" },
  { id: "motieno",  name: "Marcus Otieno",     pronouns: "he/him",  type: "student", medium: ["Printmaking"],       town: "Stockton",   school: "Stockton HS",   grade: 10, joined: 2025, visitable: false, commissions: "closed", shade: "#0E3E78" },
  { id: "swallin",  name: "Sage Wallin",       pronouns: "they/them",type: "student",medium: ["Painting"],          town: "Palco",      school: "Palco HS",      grade: 12, joined: 2024, visitable: true,  commissions: "open",   shade: "#1F5A8C" },
  { id: "dheller",  name: "Devon Heller",      pronouns: "he/him",  type: "student", medium: ["Ceramics"],          town: "Plainville", school: "Plainville HS", grade: 11, joined: 2025, visitable: false, commissions: "closed", shade: "#6E94BC" },
  { id: "irein",    name: "Ivy Reinholt",      pronouns: "she/her", type: "student", medium: ["Photography"],       town: "Palco",      school: "Palco HS",      grade: 12, joined: 2024, visitable: false, commissions: "open",   shade: "#0E3E78" },
  { id: "byoon",    name: "Ben Yoon",          pronouns: "he/him",  type: "student", medium: ["Sculpture"],         town: "Stockton",   school: "Stockton HS",   grade: 10, joined: 2025, visitable: false, commissions: "closed", shade: "#1F5A8C" },
  { id: "mpetrov",  name: "Mira Petrov",       pronouns: "she/her", type: "student", medium: ["Fiber", "Embroidery"], town: "Plainville", school: "Plainville HS", grade: 12, joined: 2024, visitable: true,  commissions: "open",   shade: "#6E94BC" },
];

// Town coordinates within Rooks County, roughly.
// Rooks County is ~24 mi × ~36 mi (E–W × N–S). These x/y are 0–100.
const TOWNS = [
  { id: "Stockton",   x: 47, y: 51, label: "Stockton",   note: "County seat · the Annex" },
  { id: "Plainville", x: 30, y: 75, label: "Plainville" },
  { id: "Palco",      x: 18, y: 60, label: "Palco" },
  { id: "Damar",      x: 12, y: 25, label: "Damar" },
  { id: "Webster",    x: 36, y: 28, label: "Webster" },
  { id: "Woodston",   x: 62, y: 24, label: "Woodston" },
  { id: "Zurich",     x: 64, y: 70, label: "Zurich" },
  { id: "Logan",      x: 86, y: 44, label: "Logan" },
];

// Initials helper for portrait placeholders.
function initials(name) {
  return name.split(" ").map(w => w[0]).join("").slice(0, 2).toUpperCase();
}

// Portrait placeholder tile (used by all artist views)
function ArtistTile({ a, size = "md" }) {
  const ART_DEEP = "#000E22";
  const PAPER = "#FBF7EE";
  const cap = {
    sm: { fontMono: 56, name: 14, craft: 11.5, pad: "10px 12px 12px" },
    md: { fontMono: 84, name: 16, craft: 12,   pad: "12px 14px 14px" },
    lg: { fontMono: 120, name: 20, craft: 13,  pad: "16px 18px 18px" },
  }[size];
  const slug = a.id || a.name.toLowerCase().replace(/\s+/g, '-').replace(/[^a-z0-9-]/g, '');
  return (
    <a href={`#/artists/${slug}`} style={{
      background: a.shade, borderRadius: 6, overflow: "hidden",
      display: "flex", flexDirection: "column", aspectRatio: "4 / 5",
      position: "relative", textDecoration: "none",
    }}>
      {/* type badge */}
      {a.type === "student" && (
        <div style={{
          position: "absolute", top: 10, left: 10, zIndex: 2,
          background: "#6E94BC", color: "#000E22",
          padding: "3px 8px", borderRadius: 4,
          fontSize: 10, fontWeight: 700, letterSpacing: "0.14em",
          textTransform: "uppercase",
        }}>
          Student
        </div>
      )}
      {a.tags && a.tags.includes("Honorary") && (
        <div style={{
          position: "absolute", top: 10, left: 10, zIndex: 2,
          background: "#DCE7F1", color: "#01234B",
          padding: "3px 8px", borderRadius: 4,
          fontSize: 10, fontWeight: 700, letterSpacing: "0.14em",
          textTransform: "uppercase",
        }}>
          Honorary
        </div>
      )}
      {a.visitable && (
        <div title="Open during Open Studios" style={{
          position: "absolute", top: 10, right: 10, zIndex: 2,
          width: 14, height: 14, borderRadius: 999,
          background: "#78BE4D", border: "2px solid rgba(251,247,238,0.85)",
        }} />
      )}
      <div style={{ flex: 1, position: "relative" }}>
        <div style={{
          position: "absolute", inset: 0,
          display: "flex", alignItems: "center", justifyContent: "center",
          fontFamily: "var(--font-display)", fontWeight: 800,
          color: "rgba(251,247,238,0.5)", fontSize: cap.fontMono, letterSpacing: "-0.05em",
        }}>
          {initials(a.name)}
        </div>
        <svg style={{ position: "absolute", top: 0, right: 0 }} width="42" height="42" viewBox="0 0 100 100">
          <polygon points="0,0 100,0 100,100" fill="rgba(251,247,238,0.14)" />
        </svg>
      </div>
      <div style={{ background: ART_DEEP, padding: cap.pad, color: PAPER }}>
        <div style={{
          fontFamily: "var(--font-display)", fontWeight: 800,
          fontSize: cap.name, lineHeight: 1.1, marginBottom: 4,
        }}>{a.name}</div>
        <div style={{ fontSize: cap.craft, opacity: 0.7 }}>
          {a.medium[0]} · {a.town}
        </div>
      </div>
    </a>
  );
}

// Chip (filter pill)
function Chip({ active, count, color = "#01234B", children, style }) {
  return (
    <span style={{
      display: "inline-flex", alignItems: "center", gap: 8,
      padding: "8px 14px", borderRadius: 999,
      fontSize: 13.5, fontWeight: 600,
      color: active ? "#FBF7EE" : color,
      background: active ? color : "transparent",
      border: `1.5px solid ${active ? color : "rgba(1,35,75,0.18)"}`,
      whiteSpace: "nowrap",
      ...style,
    }}>
      {children}
      {count != null && (
        <span style={{
          fontSize: 11, fontWeight: 700,
          color: active ? "rgba(251,247,238,0.7)" : "rgba(1,35,75,0.5)",
        }}>{count}</span>
      )}
    </span>
  );
}

window.ARTISTS = ARTISTS;
window.TOWNS = TOWNS;
window.initials = initials;
window.ArtistTile = ArtistTile;
window.Chip = Chip;
