.xpa-cv {
  margin-top: clamp(60px, 9vw, 120px);
}
/* Panneau seul (sans carrousel) : pas d'espace résiduel */
.xpa-cv--panel-only {
  margin-top: 0;
}

/* ── PANNEAU VIEWER (off-canvas, glisse depuis la droite) ───────────── */
.xpa-cv-viewer {
  --xpa-cv-panel-bg: var(--xpa-green, #C4D74D);
  position: fixed;
  top: 0;
  right: 0;
  z-index: 400;
  width: min(640px, 94vw);
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--xpa-cv-panel-bg);
  color: #232323;
  transform: translateX(100%);
  transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.12);
}
.xpa-cv.is-open .xpa-cv-viewer {
  transform: translateX(0);
}

.xpa-cv-viewer-inner {
  padding: clamp(8px, 1.5vw, 16px) clamp(20px, 4vw, 48px) 64px;
}

.xpa-cv-close {
  position: fixed;
  top: 13px;
  left: 20px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
      white-space: nowrap;
    height: auto;
    border: 1px solid black;
    background-color: var(--xpa-green);
    padding: 5px 10px;
    text-transform: uppercase;
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: none;
  color: #232323;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.xpa-cv-close:hover {
  background: #232323;
  color: var(--xpa-mutted-parchment);
  color: var(--xpa-cv-panel-bg);
}

/* fond assombri derrière le panneau */
.xpa-cv-backdrop {
  position: fixed;
  inset: 0;
  z-index: 390;
  background: rgba(20, 18, 22, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.xpa-cv.is-open .xpa-cv-backdrop {
  opacity: 1;
  pointer-events: auto;
}

/* bloque le scroll de la page quand le panneau est ouvert */
html.xpa-cv-lock,
body.xpa-cv-lock {
  overflow: hidden;
}

.xpa-cv-detail {
  display: none;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}
.xpa-cv-detail.is-active {
  display: grid;
}

/* Dans le panneau : une seule colonne (image au-dessus du texte) */
.xpa-cv-viewer .xpa-cv-detail.is-active {
  display: block;
}
.xpa-cv-viewer .xpa-cv-detail-figure {
  aspect-ratio: 16 / 10;
  /* max-height: 46vh; */
  margin-bottom: 22px;
  margin-top: 42px;
}
.xpa-cv-viewer .xpa-cv-detail-figure.is-empty {
  aspect-ratio: 16 / 10;
}

.xpa-cv-detail-figure {
  margin: 0;
  aspect-ratio: 4 / 5;
  max-height: 74vh;
  overflow: hidden;
  background: var(--xpa-mutted-parchment);
}
.xpa-cv-detail-figure img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.xpa-cv-detail-figure.is-empty {
  aspect-ratio: 4 / 5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.5;
}

.xpa-cv-detail-content { min-width: 0; }

.xpa-cv-detail-title {
  display: inline;
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  padding: 4px 8px;
  background-color: var(--xpa-mutted-parchment);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.xpa-cv-detail-subtitle {
  margin: 0;
  font-size: 1rem;
  width: fit-content;
  padding: 2px 8px;
  margin-left: 40px;
  background-color: var(--xpa-mutted-parchment);
}
.xpa-cv-detail-company {
  font-weight: 700;
  margin-left: 25px;
  padding: 2px 8px;
  width: fit-content;
  background-color: var(--xpa-mutted-parchment);
}

.xpa-cv-detail-desc {
  margin-top: 16px;
  font-size: clamp(0.95rem, 1.2vw, 1.05rem);
  line-height: 1.6;
}
.xpa-cv-detail-desc p { 
  margin: 0; 
  font-size: 1.2rem;
}
.xpa-cv-detail-desc p + p { margin-top: 0.6em; }

.xpa-cv-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  position: absolute;
  z-index: 10;
  gap: 6px;
  margin: 16px 16px;
  padding: 0;

}
.xpa-cv-tag {
  padding: 3px 9px;
  border: 1px solid rgba(35, 35, 35, 0.5);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  background-color: var(--xpa-mutted-parchment);
}

.xpa-cv-detail-dl { margin: 20px 0 0; }
.xpa-cv-detail-dl dt {
  margin-top: 14px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.6;
}
.xpa-cv-detail-dl dt:first-child { margin-top: 0; }
.xpa-cv-detail-dl dd {
  margin: 4px 0 0;
  font-size: 0.92rem;
  line-height: 1.5;
}
.xpa-cv-dates,
.xpa-cv-people {
  list-style: none;
  margin: 0;
  padding: 0;
}
.xpa-cv-person-role { font-weight: 700; }
.xpa-cv-person-city { opacity: 0.65; }

/* ── DROPDOWNS (details) ────────────────────────────────────────────── */
.xpa-cv-dropdowns {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
}
.xpa-cv-dropdown-wrapper {
  border-top: 1px solid rgba(35, 35, 35, 0.25);
}
.xpa-cv-dropdown-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.6;
  list-style: none;
}
.xpa-cv-dropdown-summary::-webkit-details-marker { display: none; }
.xpa-cv-dropdown-summary::after {
  content: "+";
  font-size: 1rem;
  line-height: 1;
}
.xpa-cv-dropdown-wrapper[open] .xpa-cv-dropdown-summary::after { content: "–"; }
.xpa-cv-dropdown-body {
  padding: 0 0 14px;
  font-size: 0.92rem;
  line-height: 1.5;
}
.xpa-cv-dropdown-body p { margin: 0; }
.xpa-cv-dropdown-body p + p { margin-top: 0.6em; }

.xpa-cv-detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
}

/* IMP: TEMPORAIRE, à  réactiver au prochain push 
.xpa-cv-detail-actions a:first-of-type {
  display: none;
}*/

.xpa-cv-detail-actions .xpa-cv-detail-link {
  margin-top: 0;
}

.xpa-cv-detail-link {
  display: inline-flex;
  align-items: center;
  margin-top: 22px;
  padding: 12px 20px;
  border: 1px solid #232323;
  color: #232323;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.xpa-cv-detail-link:hover {
  background: #232323;
  color: #f3eff5;
}

/* ── PARTIE 2 :
CARROUSEL  ────────────── */
.xpa-cv-body {
  --xpa-cv-pad: max(var(--margin), calc((100vw - 1120px) / 2 + var(--margin)));
  --cv-overhang: 5vw; 
  position: relative;
  left: 50%;
  width: 100vw;
  margin-left: -50vw;
  margin-right: -50vw;
  margin-top: clamp(30px, 4vw, 50px);
  overflow: hidden;
}

.xpa-cv-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-inline: var(--xpa-cv-pad);
  margin-bottom: 16px;
}
.xpa-cv-heading {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.xpa-cv-header-wrapper-title {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  padding: 10px 0px 20px 0px;
}

.xpa-cv-header-wrapper-dates-venues dt,
.xpa-cv-header-wrapper-dates-venues dd {
  width: fit-content;
  background-color: var(--xpa-mutted-parchment);
  padding: 4px 8px;
}

.xpa-cv-header-wrapper-dates-venues dt {
  font-size: 1rem;
  font-weight: 700;
}

.xpa-cv-header-wrapper-dates-venues dd {
  font-size: 0.8rem;
}

.xpa-cv-nav { display: flex; gap: 8px; }

.xpa-cv-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid #232323;
  border-radius: 0;
  background: transparent;
  color: #232323;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}
.xpa-cv-arrow:hover:not(:disabled) {
  background: #232323;
  color: #f3eff5;
}
.xpa-cv-arrow:disabled { opacity: 0.3; cursor: default; }
.xpa-cv-arrow svg { display: block; }

.xpa-cv-carousel {
  --cv-gap: 20px;
  --cv-visible: 5;
  --cv-h1: 420px;
  --cv-h2: 440px;
  --cv-h3: 430px;
  --cv-h4: 460px;
  --cv-h5: 440px;
  --cv-h6: 450px;
  display: flex;
  align-items: flex-end;
  gap: var(--cv-gap);
  width: calc(100% + (var(--cv-overhang) * 2));
  margin-left: calc(var(--cv-overhang) * -1);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 0 0 16px;
  scroll-padding-left: 0;
  cursor: grab;
  scrollbar-width: thin;
}
.xpa-cv-carousel.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}
.xpa-cv-carousel.is-dragging * {
  user-select: none;
  pointer-events: none;
}
.xpa-cv-carousel:focus-visible {
  outline: 1.5px solid #232323;
  outline-offset: 6px;
}
.xpa-cv-carousel::-webkit-scrollbar { height: 6px; }
.xpa-cv-carousel::-webkit-scrollbar-track { background: rgba(35, 35, 35, 0.08); }
.xpa-cv-carousel::-webkit-scrollbar-thumb { background: rgba(35, 35, 35, 0.45); }

/* ── CARTES (filmstrip : label dessus, image hauteurs variées, infos dessus) ─ */
.xpa-cv-card {
  position: relative;
  flex: 0 0 calc((100% - (var(--cv-visible) - 1) * var(--cv-gap)) / var(--cv-visible));
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: #232323;
  cursor: pointer;
  text-align: left;
}

/* Label au-dessus : puce + titre */
.xpa-cv-card-label {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}
.xpa-cv-card-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border: 1px solid #232323;
  border-radius: 50%;
  transform: translateY(-1px);
}
.xpa-cv-card.is-active .xpa-cv-card-dot { background: #232323; }
.xpa-cv-card-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Image (hauteur pilotée par le cycle nth-child) */
.xpa-cv-card-media {
  position: relative;
  display: block;
  width: 100%;
  height: 300px;
  overflow: hidden;
  background: #e4dfe8;
}
.xpa-cv-card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.xpa-cv-card:hover .xpa-cv-card-media img { transform: scale(1.04); }
.xpa-cv-card.is-active .xpa-cv-card-media {
  outline: 1.5px solid #232323;
  outline-offset: 2px;
}
.xpa-cv-card-media.is-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 12px;
  text-align: center;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.5;
}
.xpa-cv-card-media.is-empty span { display: block; }

/* Infos en petit, posées sur l'image (bas) */
.xpa-cv-card-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 22px 10px 9px;
  color: #f3eff5;
  background: linear-gradient(to top, rgba(20, 18, 22, 0.72) 0%, rgba(20, 18, 22, 0) 100%);
}
.xpa-cv-card-date {
  font-size: 0.64rem;
  line-height: 1.3;
}
.xpa-cv-card-more {
  display: inline-block;
  margin-left: 3px;
  padding: 0 4px;
  border: 1px solid rgba(243, 239, 245, 0.6);
  border-radius: 999px;
  font-size: 0.56rem;
}
.xpa-cv-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.xpa-cv-card-tag {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.9;
}

/* Hauteurs variées (cycle de 6) */
.xpa-cv-card:nth-child(6n+1) .xpa-cv-card-media { height: var(--cv-h1); }
.xpa-cv-card:nth-child(6n+2) .xpa-cv-card-media { height: var(--cv-h2); }
.xpa-cv-card:nth-child(6n+3) .xpa-cv-card-media { height: var(--cv-h3); }
.xpa-cv-card:nth-child(6n+4) .xpa-cv-card-media { height: var(--cv-h4); }
.xpa-cv-card:nth-child(6n+5) .xpa-cv-card-media { height: var(--cv-h5); }
.xpa-cv-card:nth-child(6n+6) .xpa-cv-card-media { height: var(--cv-h6); }

/* ── RESPONSIVE ─────────────────────────────────────────────────────── */
@media (max-width: 1280px) {
  .xpa-cv-carousel {
    --cv-visible: 4;
    --cv-h1: 360px; --cv-h2: 380px; --cv-h3: 370px;
    --cv-h4: 400px; --cv-h5: 380px; --cv-h6: 390px;
  }
}
@media (max-width: 1024px) {
  .xpa-cv-carousel {
    --cv-visible: 3;
    --cv-h1: 320px; --cv-h2: 340px; --cv-h3: 330px;
    --cv-h4: 360px; --cv-h5: 340px; --cv-h6: 350px;
  }
}
@media (max-width: 900px) {
  .xpa-cv-detail.is-active { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .xpa-cv-carousel {
    --cv-visible: 2;
    --cv-h1: 280px; --cv-h2: 300px; --cv-h3: 290px;
    --cv-h4: 320px; --cv-h5: 300px; --cv-h6: 310px;
  }
}
@media (max-width: 520px) {
  .xpa-cv-carousel {
    --cv-visible: 1.3;
    --cv-h1: 320px; --cv-h2: 340px; --cv-h3: 330px;
    --cv-h4: 360px; --cv-h5: 340px; --cv-h6: 350px;
  }
}
