/* Page Le bureau : carrousel façon affiche, un membre par diapositive.
   Bandeau aux couleurs de la charte, photo ronde au centre, nom de part et d'autre, cartes flottantes autour.
   Sans JavaScript (.show sans .is-ready), les diapositives s'empilent et le parcours se lit sous chacune. */

/* ——— Tons : vert, bordeaux, or, vert profond ——— */
.show-c1 { --accent: var(--green-700); --accent-deep: var(--green-900); --accent-ink: #fff; --accent-text: var(--green-700); --bio-bg: var(--green-900); }
.show-c2 { --accent: var(--bordeaux-500); --accent-deep: var(--bordeaux-700); --accent-ink: #fff; --accent-text: var(--bordeaux-700); --bio-bg: var(--bordeaux-700); }
.show-c3 { --accent: var(--gold-500); --accent-deep: #b98f14; --accent-ink: var(--green-950); --accent-text: var(--gold-700); --bio-bg: var(--green-900); }
.show-c4 { --accent: var(--green-950); --accent-deep: #061910; --accent-ink: #fff; --accent-text: var(--green-800); --bio-bg: var(--green-950); }
:root[data-theme='dark'] .show-c1, :root[data-theme='dark'] .show-c4 { --accent-text: var(--green-300); }
:root[data-theme='dark'] .show-c2 { --accent-text: var(--bordeaux-300); }
:root[data-theme='dark'] .show-c3 { --accent-text: var(--gold-400); }
:root[data-theme='dark'] .show-c4 { --accent: #133a25; }

/* Le fond de la section prend une teinte douce du membre affiché */
.show-section { --tint: var(--green-700); background: color-mix(in srgb, var(--tint) 9%, var(--color-bg)); transition: background-color 900ms ease; }
.show-section[data-tone='2'] { --tint: var(--bordeaux-500); }
.show-section[data-tone='3'] { --tint: var(--gold-500); }
.show-section[data-tone='4'] { --tint: var(--green-950); }
:root[data-theme='dark'] .show-section { background: color-mix(in srgb, var(--tint) 16%, var(--color-bg)); }

.show-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin-bottom: clamp(20px, 3vw, 36px); }
.show-title { font-family: var(--font-text); font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-primary); }
.show-hint { font-size: 0.8125rem; color: var(--color-muted-fg); }
.no-js .show-hint { display: none; }

/* ——— Base : diapositives empilées (sans JS, et téléphone) ——— */
.show-stage { display: grid; gap: 28px; }
.show-slide {
  position: relative; isolation: isolate; display: grid; justify-items: center; gap: 12px;
  padding: 36px clamp(16px, 4vw, 32px) 28px; border-radius: 28px; color: var(--accent-ink); text-align: center;
}
.show-banner { position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--accent); }
.show-banner::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.16), transparent 55%);
}
.show-name { display: grid; font-family: var(--font-text); font-size: clamp(2rem, 1.4rem + 2.6vw, 3rem); font-weight: 600; line-height: 1; letter-spacing: -0.035em; color: var(--accent-ink); }

.show-portrait { --d: clamp(180px, 46vw, 240px); position: relative; order: -1; width: var(--d); height: var(--d); padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
/* Disque plus foncé derrière la photo, comme un halo */
.show-portrait::before { content: ''; position: absolute; inset: -9%; border-radius: 50%; background: var(--accent-deep); box-shadow: 0 30px 60px -24px rgba(0, 0, 0, 0.5); transition: transform 600ms var(--ease-spring); }
.show-portrait-disc { position: absolute; inset: 0; overflow: hidden; border-radius: 50%; }
.show-portrait picture { display: block; height: 100%; }
.show-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; transition: transform 900ms var(--ease-out); }
.show-portrait:hover::before { transform: scale(1.05); }
.show-portrait:hover img { transform: scale(1.06); }
.show-portrait:focus-visible { outline: 3px solid var(--accent-ink); outline-offset: 22px; }

.show-card {
  width: min(100%, 420px); padding: 14px 16px; border-radius: 16px; text-align: left;
  background: var(--color-surface); color: var(--color-fg); font-size: 0.875rem; line-height: 1.45;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 22px 44px -22px rgba(0, 0, 0, 0.45);
}
.show-kicker { display: block; margin-bottom: 4px; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-text); }
.show-role { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 12px; }
.show-role strong { grid-column: 1; font-size: 1rem; font-weight: 650; line-height: 1.25; }
.show-tag { grid-column: 2; grid-row: 1 / span 2; padding: 4px 10px; border-radius: var(--r-pill); background: var(--accent); color: var(--accent-ink); font-size: 0.75rem; font-weight: 700; }
.show-office { display: flex; align-items: center; gap: 12px; border-radius: var(--r-pill); padding: 8px 20px 8px 8px; font-weight: 600; }
.show-office img { flex: none; width: 28px; height: 28px; border-radius: 50%; }
.show-count { margin-left: auto; font-size: 0.75rem; font-weight: 600; color: var(--color-muted-fg); }
.show-chrome { display: flex; gap: 5px; margin-bottom: 10px; }
.show-chrome i { width: 8px; height: 8px; border-radius: 50%; background: var(--color-border-strong); }
.show-chrome i:first-child { background: var(--accent); }
.show-formation p { margin-bottom: 0; }
.show-cta {
  display: inline-flex; align-items: center; min-height: 36px; margin-top: 10px; padding: 0 16px; border: 0; border-radius: var(--r-pill);
  background: var(--accent); color: var(--accent-ink); font: 600 0.8125rem/1 var(--font-text); cursor: pointer;
  transition: background-color var(--fast) ease, transform var(--press-time) ease-out;
}
.show-cta:hover { background: var(--accent-deep); color: #fff; }
.show-cta:active { transform: scale(0.97); }
.show-cta:focus-visible, .show-close:focus-visible, .show-arrow:focus-visible, .show-dot:focus-visible, .show-play:focus-visible { outline: 3px solid var(--color-ring); outline-offset: 3px; }

/* Parcours complet */
.show-bio { width: 100%; margin-top: 8px; padding: 0 20px 22px; border-radius: 20px; background: var(--bio-bg); color: #e8efe9; text-align: left; font-size: 0.875rem; line-height: 1.55; }
.show-bio-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0 10px; }
.show-bio-title { display: grid; font-size: 1.0625rem; font-weight: 700; color: #fff; }
.show-bio-title span { font-size: 0.8125rem; font-weight: 500; color: rgba(255, 255, 255, 0.72); }
.show-close {
  display: inline-flex; align-items: center; gap: 8px; min-height: var(--target); padding: 0 16px; border: 0; border-radius: var(--r-pill);
  background: #fff; color: var(--green-950); font: 600 var(--step-small)/1 var(--font-text); cursor: pointer;
  transition: background-color var(--fast) ease, transform var(--press-time) ease-out;
}
.show-close:hover { background: var(--gold-400); }
.show-close:active { transform: scale(0.97); }
.show-close svg { width: 16px; height: 16px; }
.show-bio-summary { font-size: 0.9375rem; font-weight: 600; color: #fff; }
.show-bio-section { margin-top: 14px; break-inside: avoid; }
.show-bio-label { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold-400); }
.show-bio-section ul { display: grid; gap: 6px; margin-top: 6px; padding-left: 1.1em; }
.show-bio strong { color: #fff; font-weight: 600; }
.no-js .show-close, .no-js .show-cta, .show-controls { display: none; }

/* ——— Carrousel (JS actif) ——— */
.show.is-ready .show-controls { display: flex; }
.show.is-ready .show-stage { gap: 0; touch-action: pan-y; }
.show.is-ready .show-slide { grid-area: 1 / 1; visibility: hidden; pointer-events: none; transition: visibility 0s linear 700ms; }
.show.is-ready .show-slide.is-active { z-index: 2; visibility: visible; pointer-events: auto; transition: none; }

/* Entrée : le bandeau s'ouvre depuis le centre, la photo bascule, le nom glisse des côtés, les cartes arrivent une à une */
.show.is-ready .show-banner { clip-path: inset(0 50% 0 50% round 28px); transition: clip-path 700ms var(--ease-spring); }
.show.is-ready .is-active .show-banner { clip-path: inset(0 0 0 0 round 28px); }
.show.is-ready .show-portrait { opacity: 0; transform: scale(0.45) rotate(-14deg); transition: transform 600ms var(--ease-out), opacity 300ms ease; }
.show.is-ready .is-active .show-portrait { opacity: 1; transform: none; transition: transform 1000ms var(--ease-spring) 140ms, opacity 400ms ease 140ms; }
.show.is-ready .show-portrait img { transform: scale(1.35); }
.show.is-ready .is-active .show-portrait img { transform: none; transition: transform 1400ms var(--ease-out) 140ms; }
.show.is-ready .is-active .show-portrait:hover img { transform: scale(1.06); transition-delay: 0s; }
.show.is-ready .show-first, .show.is-ready .show-last { display: block; opacity: 0; transition: transform 500ms var(--ease-out), opacity 300ms ease; }
.show.is-ready .show-first { transform: translateX(-70px); }
.show.is-ready .show-last { transform: translateX(70px); }
.show.is-ready .is-active .show-first, .show.is-ready .is-active .show-last { opacity: 1; transform: none; transition: transform 900ms var(--ease-out) 260ms, opacity 500ms ease 260ms; }
.show.is-ready .show-card { opacity: 0; transform: translateY(26px) scale(0.86); transition: transform 450ms var(--ease-out), opacity 250ms ease; }
.show.is-ready .is-active .show-card { opacity: 1; transform: none; transition: transform 900ms var(--ease-spring), opacity 450ms ease; }
.show.is-ready .is-active .show-role { transition-delay: 380ms; }
.show.is-ready .is-active .show-office { transition-delay: 460ms; }
.show.is-ready .is-active .show-summary { transition-delay: 540ms; }
.show.is-ready .is-active .show-formation { transition-delay: 620ms; }

/* Parcours : s'ouvre en cercle depuis la photo, par-dessus la diapositive */
.show.is-ready .show-bio {
  position: absolute; inset: 0; z-index: 5; display: grid; grid-template-rows: auto 1fr; margin: 0; padding: 0 clamp(18px, 3vw, 40px);
  border-radius: 28px; overflow: hidden; clip-path: circle(0% at 50% var(--bio-y, 30%)); visibility: hidden;
  transition: clip-path 650ms var(--ease-out), visibility 0s linear 650ms;
}
.show.is-ready .is-bio .show-bio { clip-path: circle(150% at 50% var(--bio-y, 30%)); visibility: visible; transition: clip-path 800ms var(--ease-out), visibility 0s; }
.show.is-ready .show-bio-bar { padding-top: clamp(16px, 2.4vw, 28px); border-bottom: 1px solid rgba(255, 255, 255, 0.16); }
.show.is-ready .show-bio-body {
  display: flex; flex-direction: column; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.45) transparent;
}
/* Baobab doré, image fixe, dans la place libre sous le texte (au moins une bande quand le parcours est long) */
.show-bio-tree { display: none; }
.show.is-ready .show-bio-tree { display: block; position: relative; flex: 1 1 0; min-height: clamp(150px, 20vh, 220px); margin-top: 12px; }
.show.is-ready .show-bio-tree img {
  position: absolute; left: 50%; bottom: 12px; width: auto; height: calc(100% - 12px); max-height: 360px; max-width: 90%;
  object-fit: contain; translate: -50% 0; opacity: 0.9; filter: drop-shadow(0 18px 32px rgba(0, 0, 0, 0.35)); pointer-events: none;
}

/* Commandes : flèches, points aux couleurs de chaque membre, pause */
.show-controls { align-items: center; justify-content: center; flex-wrap: wrap; gap: 14px; margin-top: clamp(24px, 3vw, 36px); }
.show-arrow, .show-play {
  display: inline-grid; place-items: center; min-width: var(--target); height: var(--target); padding: 0; border: 0; border-radius: var(--r-pill);
  background: var(--color-surface); color: var(--color-fg); box-shadow: inset 0 0 0 1px var(--color-border-strong); cursor: pointer;
  transition: background-color var(--fast) ease, color var(--fast) ease, transform var(--press-time) ease-out;
}
.show-arrow:hover, .show-play:hover { background: var(--color-fg); color: var(--color-bg); }
.show-arrow:active, .show-play:active { transform: scale(0.94); }
.show-arrow svg, .show-play svg { width: 20px; height: 20px; }
.show-play { display: inline-flex; gap: 8px; padding: 0 16px 0 14px; font: 600 0.8125rem/1 var(--font-text); }
.show-play svg { width: 14px; height: 14px; }
.show-icon-play, .show.is-playing .show-icon-pause { display: block; }
.show-icon-pause, .show.is-playing .show-icon-play { display: none; }
.show-dots { display: flex; align-items: center; gap: 10px; }
.show-dot {
  position: relative; width: 20px; height: 20px; padding: 0; border: 0; border-radius: var(--r-pill); overflow: hidden; background: transparent;
  box-shadow: inset 0 0 0 2px var(--accent); cursor: pointer; transition: width 500ms var(--ease-spring);
}
/* Zone de clic de 44 px autour du point */
.show-dot::before { content: ''; position: absolute; inset: -12px -6px; }
.show-dot span { position: absolute; inset: 0; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 300ms ease; }
.show-dot:hover span { transform: scaleX(0.4); }
.show-dot[aria-current='true'] { width: 52px; }
.show-dot[aria-current='true'] span { transform: none; }
/* Lecture automatique : le point actif se remplit pendant l'affichage, puis passe au membre suivant */
.show.is-playing .show-dot[aria-current='true'] span { animation: show-progress var(--show-interval, 7s) linear forwards; }
.show.is-held .show-dot[aria-current='true'] span { animation-play-state: paused; }
@keyframes show-progress { from { transform: scaleX(0.04); } to { transform: scaleX(1); } }
:root[data-theme='dark'] .show-c4.show-dot { --accent: var(--green-300); }

/* ——— Composition d'affiche (écrans larges) ——— */
@media (min-width: 900px) {
  .show.is-ready .show-stage { height: clamp(560px, 50vw, 660px); }
  .show.is-ready .show-slide { display: block; padding: 0; border-radius: 0; text-align: left; }
  .show.is-ready .show-banner { inset: 19% 0 15%; border-radius: 36px; }
  .show.is-ready .show-banner { clip-path: inset(0 50% 0 50% round 36px); }
  .show.is-ready .is-active .show-banner { clip-path: inset(0 0 0 0 round 36px); }

  .show.is-ready .show-portrait { --d: clamp(230px, 24vw, 310px); position: absolute; left: 50%; top: 52%; margin: calc(var(--d) / -2) 0 0 calc(var(--d) / -2); }
  .show.is-ready .show-portrait:focus-visible { outline-offset: 30px; }

  /* Prénom à gauche de la photo, nom à droite, centrés sur le bandeau */
  .show.is-ready .show-name {
    position: absolute; left: 0; right: 0; top: 52%; translate: 0 -50%; display: flex; justify-content: space-between; align-items: center;
    padding-inline: 4.5%; font-size: clamp(2.25rem, 1rem + 2.6vw, 3.75rem); pointer-events: none;
  }
  .show.is-ready .show-first, .show.is-ready .show-last { max-width: calc(50% - clamp(230px, 24vw, 310px) / 2 - 7%); }
  .show.is-ready .show-last { text-align: right; }

  /* Cartes flottantes : elles débordent du bandeau, suivent la souris selon leur profondeur et oscillent doucement */
  .show.is-ready .show-card {
    position: absolute; width: clamp(200px, 21vw, 280px); margin: 0;
    translate: calc(var(--px, 0) * var(--depth) * 18px) calc(var(--py, 0) * var(--depth) * 14px);
  }
  .show.is-ready .show-role { --depth: 0.7; top: 3%; left: 14%; }
  .show.is-ready .show-office { --depth: 1.1; top: 26%; right: 5%; width: clamp(220px, 23vw, 300px); }
  .show.is-ready .show-summary { --depth: 0.9; bottom: 5%; left: 5%; width: clamp(220px, 24vw, 310px); }
  .show.is-ready .show-formation { --depth: 1.3; bottom: 1%; right: 13%; }
  .show.is-ready .is-active .show-card { animation: show-sway 7s ease-in-out infinite alternate; }
  .show.is-ready .is-active .show-office { animation-delay: -2s; }
  .show.is-ready .is-active .show-summary { animation-delay: -4s; }
  .show.is-ready .is-active .show-formation { animation-delay: -5.5s; }
  .show.is-ready .is-bio .show-card { animation-play-state: paused; }

  .show.is-ready .show-bio-text { columns: 2 300px; column-gap: 44px; padding-top: 6px; }
}
@keyframes show-sway { from { rotate: -1.2deg; } to { rotate: 1.2deg; } }

/* Téléphone et tablette : une diapositive en colonne, le parcours la recouvre */
@media (max-width: 899px) {
  .show.is-ready .show-name { order: 0; }
  /* Diapositive plus courte : la pastille « Comité directeur » est décorative */
  .show-office { display: none; }
  .show.is-ready .show-slide { min-height: 0; }
  .show.is-ready .show-bio { padding-inline: 18px; }
}
