/* ============================================================
   Le Pincelier, accueil : carrousel des univers (coverflow à tranches)
   Chargée uniquement sur index.php, après home.css.
   ============================================================ */

.h-cf {
  position: relative;
  height: calc(var(--cf-h, 420px) + 3rem);
  touch-action: pan-y;
}

.h-cf__track { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; }

/* Une carte (active) ou une tranche (voisines) */
.h-cf__item {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--cf-w, 560px);
  height: var(--cf-h, 420px);
  transform: translate(-50%, -50%);
  overflow: hidden;
  background: var(--night-2);
  box-shadow: 0 28px 50px -24px rgba(0, 0, 0, .75);
  cursor: pointer;
  transition:
    left .65s var(--ease-out),
    width .65s var(--ease-out),
    height .65s var(--ease-out),
    opacity .4s var(--ease),
    filter .65s var(--ease);
}
.h-cf__item.is-active { cursor: default; }
.h-cf__item.is-side { filter: grayscale(.9) contrast(.95); }

/* Voile sombre sur les tranches */
.h-cf__item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--night);
  opacity: var(--dim, 0);
  pointer-events: none;
  transition: opacity .65s var(--ease);
}

/* Le lien occupe toute la carte ; l'image garde sa taille et est recadrée par la tranche */
.h-cf__card { position: absolute; inset: 0; display: block; color: var(--ink); text-decoration: none; }
.h-cf__media {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--cf-w, 560px);
  height: var(--cf-h, 420px);
  transform: translate(-50%, -50%);
  display: block;
}
.h-cf__media picture, .h-cf__media img { display: block; width: 100%; height: 100%; }
.h-cf__media img { object-fit: cover; -webkit-user-drag: none; user-select: none; }

/* Bandeau de légende */
.h-cf__bar {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: var(--cf-w, 560px);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--paper);
  color: var(--ink);
  opacity: 0;
  transition: opacity .3s var(--ease);
}
.h-cf__item.is-active .h-cf__bar { opacity: 1; transition-delay: .3s; }

.h-cf__text { display: grid; gap: .15rem; min-width: 0; }
.h-cf__title { font: italic 500 clamp(1.45rem, 2.2vw, 1.9rem)/1.1 var(--serif); }
.h-cf__sub { font-size: .85rem; line-height: 1.35; color: var(--ink-soft); }
.h-cf__count {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font: 700 .7rem/1.4 var(--sans);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--oxblood);
}
.h-cf__count svg { transition: transform .4s var(--ease-out); }
.h-cf__card:hover .h-cf__count svg,
.h-cf__card:focus-visible .h-cf__count svg { transform: translateX(5px); }
.h-cf__item.is-active .h-cf__card:focus-visible { outline-offset: -4px; }

/* Flèches */
.h-cf__nav {
  position: absolute;
  top: 50%;
  z-index: 40;
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border: 1px solid var(--line-dark);
  border-radius: 50%;
  background: rgba(23, 18, 15, .6);
  color: var(--on-night);
  cursor: pointer;
  transition: background-color .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
}
.h-cf__nav:hover { background: var(--gilt-light); border-color: var(--gilt-light); color: var(--ink); }
.h-cf__nav--prev { left: 0; }
.h-cf__nav--next { right: 0; }
.h-cf__nav[hidden] { display: none; }

.h-cf__live {
  position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.h-cf.is-jumping .h-cf__item { transition: none !important; }

/* Sans JavaScript : les cartes s'empilent simplement */
.h-cf:not(.is-ready) { height: auto; }
.h-cf:not(.is-ready) .h-cf__track { position: static; display: grid; gap: 1.25rem; }
@media (min-width: 48em) { .h-cf:not(.is-ready) .h-cf__track { grid-template-columns: repeat(3, 1fr); } }
.h-cf:not(.is-ready) .h-cf__item {
  position: relative; top: auto; left: auto; width: auto; height: auto; aspect-ratio: 4 / 3; transform: none;
}
.h-cf:not(.is-ready) .h-cf__media, .h-cf:not(.is-ready) .h-cf__bar { width: 100%; }
.h-cf:not(.is-ready) .h-cf__bar { opacity: 1; }

@media (max-width: 40em) {
  .h-cf__bar { padding: .8rem .9rem; }
  .h-cf__sub { display: none; }
  .h-cf__nav { width: 2.75rem; height: 2.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  .h-cf__item, .h-cf__bar, .h-cf__item::after { transition: none !important; }
}
