---
import SectionMark from "./SectionMark.astro";

interface Props {
  slug: string;
  label: string;
  title: string;
  summary: string;
  tone: string;
  href?: string;
}

const { slug, label, title, summary, tone, href = "#" } = Astro.props;

const sectionArt: Record<
  string,
  { src: string; alt: string; eyebrow: string; caption: string }
> = {
  business: {
    src: "https://commons.wikimedia.org/wiki/Special:Redirect/file/Grand-Place,_Brussels_%2839528722772%29.jpg",
    alt: "Grand-Place in Brussels.",
    eyebrow: "Ledger",
    caption: "Continental deals and operator weather",
  },
  education: {
    src: "https://commons.wikimedia.org/wiki/Special:Redirect/file/Jagiellonian_University_Collegium_Novum%2C_1882_designed_by_Feliks_Ksi%C4%99%C5%BCarski%2C_24_Go%C5%82%C4%99bia_street%2C_Old_Town%2C_Krak%C3%B3w%2C_Poland_%284%29.jpg",
    alt: "Collegium Novum at Jagiellonian University in Krakow.",
    eyebrow: "Dossier",
    caption: "Krakow, memory, and the institutional sublime",
  },
  family: {
    src: "https://commons.wikimedia.org/wiki/Special:Redirect/file/Kongsberg_IMG_0357.JPG",
    alt: "Riverfront in Kongsberg, Norway.",
    eyebrow: "Archive",
    caption: "Private weather by the Norwegian river",
  },
  "fun-postings": {
    src: "https://commons.wikimedia.org/wiki/Special:Redirect/file/Grand-Place,_Brussels_%2839528722772%29.jpg",
    alt: "Grand-Place in Brussels at dusk.",
    eyebrow: "Poster wall",
    caption: "Flyers, evenings, and elegant side quests",
  },
  writing: {
    src: "https://commons.wikimedia.org/wiki/Special:Redirect/file/Escp-Paris.jpg",
    alt: "ESCP building in Paris.",
    eyebrow: "Notebook",
    caption: "Paris pages with brass in the margins",
  },
  "jazz-music": {
    src: "https://commons.wikimedia.org/wiki/Special:Redirect/file/Level_42_Kongsberg_Jazzfestival_2017_%28214257%29.jpg",
    alt: "Performance at Kongsberg Jazzfestival.",
    eyebrow: "Low light",
    caption: "Kongsberg nights and disciplined swing",
  },
  languages: {
    src: "https://commons.wikimedia.org/wiki/Special:Redirect/file/Grand-Place,_Brussels_%2839528722772%29.jpg",
    alt: "Historic buildings in Brussels.",
    eyebrow: "Register shift",
    caption: "French, English, Norwegian, and trouble",
  },
  "ai-lab": {
    src: "/images/ai-lab/corpus-grid.svg",
    alt: "Illustrated knowledge corpus grid.",
    eyebrow: "Machine room",
    caption: "Private memory with cited answers",
  },
  norway: {
    src: "https://commons.wikimedia.org/wiki/Special:Redirect/file/Kongsberg_IMG_0357.JPG",
    alt: "Waterfront in Kongsberg, Norway.",
    eyebrow: "Field report",
    caption: "Silver city, civic weather, due process",
  },
  projects: {
    src: "/images/ai-lab/api-flow.svg",
    alt: "Diagram of a connected API workflow.",
    eyebrow: "Bench test",
    caption: "Products, repairs, and live deployments",
  },
  cv: {
    src: "https://commons.wikimedia.org/wiki/Special:Redirect/file/Villanova_University_A_panoramic_shot.jpg",
    alt: "Panoramic view of Villanova University.",
    eyebrow: "Record",
    caption: "A timeline written across cities",
  },
};

const art = sectionArt[slug];
---

<article class="section-card">
  <div class="section-card__header">
    <div class="section-card__stamp">
      <SectionMark slug={slug} className="section-mark--card" />
      <span class="section-card__label">{label}</span>
    </div>
    <span class="section-card__tone">{tone}</span>
  </div>
  {art && (
    <figure class="section-card__art">
      <img src={art.src} alt={art.alt} loading="lazy" />
      <figcaption>
        <span>{art.eyebrow}</span>
        <strong>{art.caption}</strong>
      </figcaption>
    </figure>
  )}
  <h3>{title}</h3>
  <p>{summary}</p>
  <a href={href} class="section-card__link">Open section</a>
</article>
