/* =====================================================================
   PAGE FONCTIONNALITÉS — direction artistique « Comptoir »

   Chargé APRÈS site.css et pages.css (DA commune). Ici :
     1. Le présentoir (index des fonctionnalités)
     2. L'étiquette prix
     3. L'aperçu fixe (ordinateur)
     4. Le jeu de cartes des métiers        5. Mobile
   ===================================================================== */

/* =====================================================================
   1. LE PRÉSENTOIR — une grande ligne par fonctionnalité, séparées par
   un filet noir franc, comme les rayons d'un présentoir
   ================================================================== */
.f-presentoir{ padding-top: clamp(56px, 6vw, 88px); }
.f-grille{ display: grid; gap: 48px; align-items: start; }
.f-index{ list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--noir); }
.f-ligne{ border-bottom: 2px solid var(--noir); }

.f-lien{ position: relative; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "sur sur" "nom fleche" "etiquette etiquette";
  gap: 6px 20px; align-items: center; padding: 26px 0 24px; color: var(--noir); }
.f-lien:hover{ color: var(--noir); }
.f-sur{ grid-area: sur; font-family: var(--display); font-weight: 700; font-size: .85rem; color: var(--rose); }
.f-nom{ grid-area: nom; font-family: var(--display); font-weight: 800; font-size: clamp(1.7rem, 1.25rem + 1.8vw, 2.7rem);
  letter-spacing: -.04em; line-height: 1.05; transition: transform .45s var(--sortie), color .3s; }
.f-fleche{ grid-area: fleche; display: grid; place-items: center; width: 48px; height: 48px; border: 2px solid var(--noir);
  transition: background .3s, color .3s, transform .45s var(--sortie); }
.f-fleche svg{ width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* La ligne active (survol, focus clavier, ou lecture sur ordinateur) */
.f-ligne.actif .f-nom, .f-lien:hover .f-nom, .f-lien:focus-visible .f-nom{ transform: translateX(10px); color: var(--rose); }
.f-ligne.actif .f-fleche, .f-lien:hover .f-fleche, .f-lien:focus-visible .f-fleche{ background: var(--rose); border-color: var(--rose); color: #fff; transform: rotate(-45deg); }

/* La définition sous la ligne (mobile, ou sans JavaScript) */
.f-def{ margin: -6px 0 26px; max-width: 64ch; color: var(--texte2); line-height: 1.7; }

/* =====================================================================
   2. L'ÉTIQUETTE PRIX — un vrai porte-prix de commerce : coin coupé,
   œillet, et une ficelle ; elle se balance quand la ligne s'active
   ================================================================== */
.f-etiquette{
  grid-area: etiquette; justify-self: start; position: relative; display: inline-flex; flex-direction: column; gap: 1px;
  margin-top: 10px; padding: 8px 16px 8px 30px; background: var(--noir); color: #fff;
  /* Le coin coupé à gauche, comme une étiquette de vêtement */
  clip-path: polygon(14px 0, 100% 0, 100% 100%, 14px 100%, 0 50%);
  transform-origin: 0 50%;
}
/* L'œillet */
.f-etiquette::before{ content: ""; position: absolute; left: 12px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px;
  border-radius: 50%; background: #fff; }
.f-etiquette small{ font-size: .74rem; font-weight: 600; color: rgba(255,255,255,.7); }
.f-etiquette b{ font-family: var(--display); font-size: 1rem; font-weight: 800; letter-spacing: -.01em; }
.f-ligne.actif .f-etiquette{ background: var(--rose); }
.f-ligne.actif .f-etiquette small{ color: rgba(255,255,255,.85); }

/* =====================================================================
   3. L'APERÇU FIXE — seulement sur ordinateur, et seulement avec le script
   ================================================================== */
.f-apercu{ display: none; }

@media (min-width: 1040px){
  .f-js .f-grille{ grid-template-columns: 1fr minmax(440px, 540px); gap: clamp(40px, 5vw, 80px); }
  .f-js .f-def{ display: none; }              /* la définition passe dans l'aperçu */
  .f-js .f-apercu{ display: block; align-self: stretch; }
  .f-apercu-colle{ position: sticky; top: 110px; display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: start; }

  .f-tel{ width: 168px; padding: 6px; border-radius: 28px; background: var(--noir); box-shadow: 8px 8px 0 var(--rose); }
  .f-ecrans{ position: relative; border-radius: 22px; overflow: hidden; background: #1a1614; }
  .f-ecrans img{ display: block; width: 100%; height: auto; }
  .f-ecrans img + img{ position: absolute; inset: 0; }

  /* La fiche : la définition de la ligne active, sur papier, bord pointillé */
  .f-fiches{ display: grid; padding: 22px 22px 24px; background: var(--papier); border: 2px dashed var(--ligne); }
  .f-fiche{ grid-area: 1 / 1; }               /* toutes superposées, une seule visible */
  .f-fiche-sur{ margin: 0 0 8px; font-family: var(--display); font-weight: 800; font-size: 1.05rem; letter-spacing: -.02em; color: var(--noir); }
  .f-fiche p:last-child{ margin: 0; font-size: .9rem; line-height: 1.62; color: var(--texte2); }
}

/* =====================================================================
   4. LE JEU DE CARTES DES MÉTIERS — sur papier, bord de ticket en haut
   ================================================================== */
.f-metiers{ position: relative; background: var(--papier); }
.f-decoupe-haut{ top: -8px; bottom: auto;
  background: radial-gradient(circle at 8px 8px, var(--papier) 5px, transparent 5.5px) 0 0 / 22px 16px repeat-x; }
.f-metiers-grille{ display: grid; gap: 56px; align-items: center; }
@media (min-width: 960px){ .f-metiers-grille{ grid-template-columns: 1fr 1.1fr; gap: 64px; } }
.f-metiers-titre{ max-width: 18ch; }
.f-metiers-actions{ margin-top: 28px; }

/* Les cartes : empilées au centre ; --n (−2 à 2) fixe la place de chacune
   dans l'éventail ; --p (0 à 1, posé par le script) ouvre l'éventail.
   Sans script, --p vaut 1 : l'éventail est ouvert. */
.f-deck{ --p: 1; position: relative; height: clamp(260px, 30vw, 360px); }
.f-carte{
  position: absolute; left: 50%; top: 50%; width: clamp(140px, 12vw, 180px); background: #fff; border: 2px solid var(--noir);
  color: var(--noir); transform-origin: 50% 120%;
  transform: translate(-50%, -50%)
             translateX(calc(var(--n) * 44% * var(--p)))   /* écart resserré : l'éventail tient dans sa colonne */
             rotate(calc(var(--n) * 9deg * var(--p)))
             translateY(calc(var(--n) * var(--n) * 6px * var(--p)));
  transition: box-shadow .3s, border-color .3s;
  z-index: calc(10 - var(--n) * var(--n));
}
/* height:auto est indispensable : sinon l'attribut height="800" de l'image s'applique tel quel */
.f-carte img{ display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-bottom: 2px solid var(--noir); }
.f-carte span{ display: block; padding: 10px 12px 12px; font-size: .78rem; color: var(--texte2); line-height: 1.35; }
.f-carte b{ display: block; font-family: var(--display); font-size: .95rem; color: var(--noir); margin-bottom: 2px; }
/* Au survol, la carte se soulève (ombre rose nette) et passe devant */
.f-carte:hover{ color: var(--noir); box-shadow: 6px 6px 0 var(--rose); border-color: var(--rose); z-index: 20; }

/* =====================================================================
   5. MOBILE
   ================================================================== */
@media (max-width: 959px){
  .p-hero .p-tampon{ position: absolute; right: 16px; top: 38px; width: 104px; }
  .p-hero .p-titre{ padding-right: 100px; }
  .f-deck{ height: 250px; }
  .f-carte{ width: 132px; transform: translate(-50%, -50%) translateX(calc(var(--n) * 48% * var(--p))) rotate(calc(var(--n) * 8deg * var(--p))); }
}
@media (max-width: 520px){
  .f-carte:nth-child(1), .f-carte:nth-child(5){ display: none; }   /* trois cartes sur petit écran */
}
