/**
 * BT-PWS-SIGNATURE-SEPARATION-ACCUEIL-PARCOURS-004
 * BT-PWS-PARCOURS-INTRODUCTION-NAVIGATION-005
 * BT-PWS-PARCOURS-COCKPIT-VISUEL-006
 * Accueil (commercial) vs Votre parcours (rail + intro + image synthèse)
 */

/* Accueil: no rail / progress / mobile journey chrome */
body[data-pws-section="accueil"] [data-parcours-chrome],
.cockpit-shell[data-pws-section="accueil"] [data-parcours-chrome] {
  display: none !important;
}

body[data-pws-section="accueil"] .cockpit-journey,
.cockpit-shell[data-pws-section="accueil"].cockpit-journey {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}

body[data-pws-section="accueil"] .cockpit-journey .cockpit-stage,
.cockpit-shell[data-pws-section="accueil"] .cockpit-stage {
  grid-column: 1;
  grid-row: 1;
}

/* Home-only / parcours-only visibility (JS also toggles hidden) */
body[data-pws-section="parcours"] [data-home-only],
.cockpit-shell[data-pws-section="parcours"] [data-home-only] {
  display: none !important;
}

body[data-pws-section="accueil"] [data-parcours-only],
.cockpit-shell[data-pws-section="accueil"] [data-parcours-only] {
  display: none !important;
}

/* Real unmount: inactive journey panels never participate in layout/a11y */
.pws-journey-panel[hidden] {
  display: none !important;
}

/* Parcours: hide dossier on non-step-7 via existing JS; ensure no leftover footer gap */
.pws-journey-nav {
  display: none !important;
}

/* Nav active state for Votre parcours */
.menu a[data-nav-section].is-active {
  color: var(--gold, #d4af37);
}

/* ---- Rail: contrast hint + étape 7 three lines ---- */
.pws-journey-rail-hint {
  margin: 0 0 14px;
  font-size: 0.75rem;
  line-height: 1.4;
  color: rgba(250, 248, 245, 0.88);
  font-weight: 500;
}

.pws-journey-step-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
}

.pws-journey-step-sub {
  display: block;
  font-size: 0.68rem;
  line-height: 1.3;
  font-weight: 400;
  color: rgba(250, 248, 245, 0.62);
}

.pws-journey-step-btn.is-active .pws-journey-step-sub {
  color: rgba(250, 248, 245, 0.78);
}

.pws-journey-step-status {
  display: none;
  margin-top: 1px;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--gold, #d4af37);
  opacity: 0.9;
}

.pws-journey-step-btn[data-step-status="submitted"] .pws-journey-step-status {
  display: block;
}

/* ---- Cockpit 3 zones (parcours desktop) — rail ~13% | info ~48% | image ~39% ---- */
@media (min-width: 961px) {
  .cockpit-shell[data-pws-section="parcours"].cockpit-journey {
    --rail-w: 13%;
    grid-template-columns: minmax(168px, 13%) minmax(0, 1fr);
    height: calc(100dvh - var(--public-header-height));
    max-height: calc(100dvh - var(--public-header-height));
  }

  .cockpit-shell[data-pws-section="parcours"] .cockpit-stage {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  }

  .cockpit-shell[data-pws-section="parcours"] .cockpit-content {
    justify-content: flex-start;
    overflow-y: auto;
    overscroll-behavior: contain;
    min-height: 0;
  }

  .cockpit-shell[data-pws-section="parcours"] .pws-journey-rail {
    overflow-y: auto;
    overscroll-behavior: contain;
    min-width: 0;
  }
}

/* ---- Parcours intro densifiée (BT-006) ---- */
.pws-parcours-intro {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.8vh, 18px);
}

.pws-parcours-intro-hero h1 {
  margin: 0 0 8px;
  font-family: var(--font-display, "Cinzel", serif);
  font-size: clamp(1.2rem, 2.1vw, 1.65rem);
  line-height: 1.25;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: rgba(250, 248, 245, 0.98);
}

.pws-parcours-intro-lead {
  margin: 0 0 6px;
  font-size: 0.95rem;
  line-height: 1.45;
  color: rgba(250, 248, 245, 0.92);
}

.pws-parcours-intro-note {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: rgba(250, 248, 245, 0.78);
}

.pws-parcours-section-title {
  margin: 0 0 10px;
  font-family: var(--font-display, "Cinzel", serif);
  font-size: clamp(0.88rem, 1.35vw, 1rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold, #d4af37);
  font-weight: 700;
}

.pws-parcours-card-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.pws-parcours-card {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius, 12px);
  border: 1px solid rgba(212, 175, 55, 0.35);
  background:
    linear-gradient(165deg, rgba(22, 58, 95, 0.88) 0%, rgba(15, 40, 71, 0.94) 100%);
  box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.08);
}

.pws-parcours-card h3 {
  margin: 0 0 4px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gold, #d4af37);
  line-height: 1.25;
}

.pws-parcours-card p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: rgba(250, 248, 245, 0.88);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pws-parcours-steps-lead {
  margin: 0 0 10px;
  font-size: 0.85rem;
  line-height: 1.4;
  color: rgba(250, 248, 245, 0.86);
}

.pws-parcours-steps-groups {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.pws-parcours-steps-groups > li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border-radius: var(--radius, 12px);
  border: 1px solid rgba(212, 175, 55, 0.28);
  background: rgba(10, 26, 47, 0.55);
  position: relative;
}

.pws-parcours-steps-groups > li.is-final {
  border-color: rgba(212, 175, 55, 0.55);
  background:
    linear-gradient(165deg, rgba(22, 58, 95, 0.75) 0%, rgba(15, 40, 71, 0.9) 100%);
}

.pws-parcours-steps-range {
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--gold, #d4af37);
}

.pws-parcours-steps-desc {
  font-size: 0.76rem;
  line-height: 1.3;
  color: rgba(250, 248, 245, 0.9);
}

.pws-parcours-reassure {
  padding: 10px 14px;
  border-radius: var(--radius, 12px);
  border: 1px solid rgba(212, 175, 55, 0.28);
  background: rgba(10, 26, 47, 0.45);
}

.pws-parcours-reassure p {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.4;
  color: rgba(250, 248, 245, 0.86);
}

.pws-parcours-step1-sep {
  height: 1px;
  margin: 2px 0;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.55), transparent);
}

.pws-parcours-step1-title {
  margin: 0 0 8px;
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  line-height: 1.3;
  color: rgba(250, 248, 245, 0.96);
  font-weight: 600;
}

/* ---- Image synthèse parcours (remplace composition abstraite) ---- */
.pws-parcours-synthese {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

.pws-parcours-synthese[hidden],
[data-home-visual][hidden] {
  display: none !important;
}

.pws-parcours-synthese-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
  display: block;
}

body[data-pws-section="parcours"][data-pws-step="1"] [data-home-visual],
.cockpit-shell[data-pws-section="parcours"][data-pws-step="1"] [data-home-visual] {
  display: none !important;
}

body[data-pws-section="accueil"] [data-parcours-visual],
.cockpit-shell[data-pws-section="accueil"] [data-parcours-visual],
body:not([data-pws-step="1"]) [data-parcours-visual],
.cockpit-shell:not([data-pws-step="1"]) [data-parcours-visual] {
  display: none !important;
}

.cockpit-journey:has(.pws-lux-hero.is-active) .cockpit-visual:not(.metier-visual) img.pws-parcours-synthese-img {
  object-fit: cover;
  object-position: 50% 42%;
}

@media (max-width: 1100px) {
  .pws-parcours-steps-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  body[data-pws-section="accueil"] .pws-journey-mobile-header {
    display: none !important;
  }

  .pws-parcours-card-grid {
    grid-template-columns: 1fr;
  }

  .pws-parcours-steps-groups {
    grid-template-columns: 1fr 1fr;
  }

  .cockpit-shell[data-pws-section="parcours"] .cockpit-visual {
    min-height: 200px;
    max-height: 260px;
  }

  .pws-parcours-synthese-img {
    object-position: 50% 38%;
  }
}

@media (max-width: 640px) {
  .pws-parcours-steps-groups {
    grid-template-columns: 1fr;
  }

  .cockpit-shell[data-pws-section="parcours"] .cockpit-visual {
    max-height: 220px;
  }
}
