<template>
  <main>
    <header class="flex | bg-white | rounded-2xl | p-8 mb-16">
      <h1 class="font-serif | px-8">{{ page.content.title }}</h1>
      <button class="btn | ml-auto">Demander un RDV</button>
    </header>
    <div class="kanban">
      <section 
        class="flow"
        aria-labelledby="votre-brief-label"
        data-status="past"
      >
        <h2 id="votre-brief-label">
          <span data-icon="">Votre brief</span>
        </h2>
        <article class="card">
          <hgroup class="order-last">
            <h3 class="card__title | font-serif | text-lg">Votre Brief</h3>
          </hgroup>
          <div class="card__meta | flex">
            <time class="card__date | text-grey-700" datetime="2024-06-12">12 juin 2024</time>
          </div>
          <figure class="card__images" data-count="13">
            <img
              src="http://localhost:8888/media/pages/inspirations/shape-of-the-nature/6ed93d6950-1725442486/d82f18573c439d6edd434ffca62471a7.png"
              alt=""
            />
            <img
              src="http://localhost:8888/media/pages/inspirations/shape-of-the-nature/a4222f5029-1725442486/22f8779f680ed826a2d0a1d2af6018c9.jpg"
              alt=""
            />
            <img
              src="http://localhost:8888/media/pages/inspirations/shape-of-the-nature/1bbe051c5a-1725442486/0c41d3266e9ce2872f30608cceb28239.png"
              alt=""
            />
          </figure>
        </article>
      </section>
      <section 
        class="flow"
        aria-labelledby="offre-commerciale-label"
        data-status="past"
      >
        <h2 id="offre-commerciale-label">
          <span data-icon="">Offre Commerciale</span>
        </h2>
        <article class="card">
          <hgroup class="order-last">
            <h3 class="card__title | font-serif | text-lg">Offre - 2</h3>
            <p class="text-primary | font-medium">4 commentaires</p>
          </hgroup>
          <div class="card__meta | flex">
            <time class="card__date | text-grey-700" datetime="2024-06-12">12 juin 2024</time>
            <span class="text-primary | font-medium | ml-auto">Validé</span>
          </div>
          <figure class="card__images">
            <img
              src="http://localhost:8888/media/pages/inspirations/shape-of-the-nature/6ed93d6950-1725442486/d82f18573c439d6edd434ffca62471a7.png"
              alt=""
            />
            <img
              src="http://localhost:8888/media/pages/inspirations/shape-of-the-nature/a4222f5029-1725442486/22f8779f680ed826a2d0a1d2af6018c9.jpg"
              alt=""
            />
            <img
              src="http://localhost:8888/media/pages/inspirations/shape-of-the-nature/1bbe051c5a-1725442486/0c41d3266e9ce2872f30608cceb28239.png"
              alt=""
            />
          </figure>
        </article>
        <article class="card">
          <hgroup class="order-last">
            <h3 class="card__title | font-serif | text-lg">Offre - 3</h3>
            <p class="text-primary | font-medium">4 commentaires</p>
          </hgroup>
          <div class="card__meta | flex">
            <time class="card__date | text-grey-700" datetime="2024-06-12">12 juin 2024</time>
          </div>
        </article>
        <article class="card">
          <hgroup class="order-last">
            <h3 class="card__title | font-serif | text-lg">Offre Initiale</h3>
            <p class="text-primary | font-medium">4 commentaires</p>
          </hgroup>
          <div class="card__meta | flex">
            <time class="card__date | text-grey-700" datetime="2024-06-12">12 juin 2024</time>
          </div>
        </article>
      </section>
      <section 
        class="flow"
        aria-labelledby="brief-enrichi-label"
        data-status="past"
        >
        <h2 id="brief-enrichi-label">
          <span data-icon="">Brief Enrichi</span>
        </h2>
        <article class="card">
          <hgroup class="order-last">
            <h3 class="card__title | font-serif | text-lg">Brief Enrichi</h3>
            <p class="text-primary | font-medium">4 commentaires</p>
          </hgroup>
          <div class="card__meta | flex">
            <time class="card__date | text-grey-700" datetime="2024-06-12">12 juin 2024</time>
            <span class="text-primary | font-medium | ml-auto">Validé</span>
          </div>
          <figure class="card__images" data-count="15">
            <img
              src="http://localhost:8888/media/pages/inspirations/shape-of-the-nature/6ed93d6950-1725442486/d82f18573c439d6edd434ffca62471a7.png"
              alt=""
            />
            <img
              src="http://localhost:8888/media/pages/inspirations/shape-of-the-nature/a4222f5029-1725442486/22f8779f680ed826a2d0a1d2af6018c9.jpg"
              alt=""
            />
            <img
              src="http://localhost:8888/media/pages/inspirations/shape-of-the-nature/1bbe051c5a-1725442486/0c41d3266e9ce2872f30608cceb28239.png"
              alt=""
            />
          </figure>
        </article>
      </section>
      <section
        class="flow"
        aria-labelledby="echantillon-virtuel-label"
        data-status="current"
      >
        <h2 id="echantillon-virtuel-label">
          <span data-icon="">Échantillon Virtuel</span>
        </h2>
        <article class="card">
          <hgroup class="order-last">
            <h3 class="card__title | font-serif | text-lg">Rendu 360°</h3>
            <p class="text-primary | font-medium">4 commentaires</p>
          </hgroup>
          <div class="card__meta | flex">
            <time class="card__date | text-grey-700" datetime="2024-06-12">12 juin 2024</time>
          </div>
          <figure class="card__images" data-count="13">
            <img
              src="http://localhost:8888/media/pages/inspirations/shape-of-the-nature/6ed93d6950-1725442486/d82f18573c439d6edd434ffca62471a7.png"
              alt=""
            />
            <img
              src="http://localhost:8888/media/pages/inspirations/shape-of-the-nature/a4222f5029-1725442486/22f8779f680ed826a2d0a1d2af6018c9.jpg"
              alt=""
            />
            <img
              src="http://localhost:8888/media/pages/inspirations/shape-of-the-nature/1bbe051c5a-1725442486/0c41d3266e9ce2872f30608cceb28239.png"
              alt=""
            />
          </figure>
        </article>
      </section>
    </div>
  </main>
</template>

<script setup>
import { usePageStore } from "../stores/page";
import { useUserStore } from "../stores/user";
import { ref, computed } from "vue";
import { storeToRefs } from "pinia";

const { page } = storeToRefs(usePageStore());
const user = useUserStore().user;
</script>

<style scope>
.kanban {
  --header-height: 2.25rem; /* 36px */
  --header-bg-color: var(--color-grey-200);
  --header-title-bg-color: var(--color-grey-700);
  --gap: var(--gutter);
  position: relative;
  display: flex;
  gap: var(--gap);
  overflow-y: auto;
  margin: 0 calc(-1 * var(--gutter));
  padding: 0 var(--gutter);
}
.kanban > section {
  flex-grow: 1;
  min-width: 20rem;
}

.kanban > section h2 {
  position: relative;
  background-color: var(--header-bg-color);
  border-radius: var(--rounded-md);
  font-size: var(--text-sm);
  height: var(--header-height); 
}
.kanban > section h2 > span {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-8);
  background-color: var(--header-title-bg-color);
  color: var(--color-white);
  height: 100%;
  width: fit-content;
  padding: 0 var(--space-12);
  border-top-left-radius: inherit;
  border-bottom-left-radius: inherit;
  font-weight: 500;
}
.kanban > section + section h2::before {
  content: "";
  display: inline-block;
  position: absolute;
  top: calc(var(--header-height) / 2 - 1.5px);
  right: 100%;
  width: var(--gap);
  height: 3px;
  background-color: var(--color-grey-200);
  z-index: -1;
}

[data-status="past"] h2::after {
  content: "";
  position: absolute;
  top: 0;
  right: var(--space-4);
  bottom: 0;
  display: inline-block;
  width: var(--icon-size, var(--header-height));
  height: var(--icon-size, var(--header-height));
  background: var(--icon-color, currentColor);
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: var(--icon-size, 1rem);
  mask-image: var(--icon, var(--icon-check));
}
[data-status="current"] {
  --header-bg-color: var(--color-primary-20);
  --header-title-bg-color: var(--color-primary);
}
</style>
