/* =============================================================================
   Core Values — accordéon vertical
   - 5 colonnes de largeur ÉGALE, jamais modifiée
   - Chaque carte a sa propre image de fond (--card-bg)
   - Au repos : carte compacte, titre en bas, image visible
   - Hover (cardOpen) : UNE seule carte s'agrandit vers le bas, texte apparaît
   - Les autres cartes restent à leur hauteur compacte (align-items: flex-start)
   - Titres : Founder Grotesk 300 (Light réel) / --fs-card-title
   ============================================================================= */

.php-cv-section {
  background-color: #000000;
  padding: clamp(40px, 6vw, 80px) 0;
}

.php-cv-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

.php-cv-title {
  font-family: var(--font-condensed);
  font-size: var(--fs-h2-section);
  font-weight: var(--fw-h2-section);
  color: var(--color-text);
  text-align: center;
  letter-spacing: 0.02em;
  margin: 0 0 40px;
}

/* Rangée — flex-start : chaque carte garde SA hauteur */
.php-cv-row {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-start;   /* ← clé : cartes fermées ne s'étirent PAS */
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

/* ── Carte au repos ─────────────────────────────────────────────────────────── */

.php-cv-card {
  flex: 1 1 0%;              /* largeur égale, jamais modifiée */
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end; /* titre en bas */
  align-items: flex-start;
  text-align: left;
  box-sizing: border-box;
  padding: 16px 16px 28px 16px;
  border: none;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  position: relative;
  overflow: hidden;
  outline: none;
  min-height: 160px;          /* hauteur compacte fixe */
  height: 160px;              /* hauteur FIXE au repos */
  cursor: pointer;
  transition: height 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.php-cv-card:last-child {
  border-right: none;
}

/* Image propre à chaque carte — couvre tout le cadre */
/* background-image : défini en inline sur .php-cv-cardBg (évite url() dans --var résolu depuis css/) */
.php-cv-cardBg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
  transition: filter 0.4s ease;
  filter: brightness(0.3) saturate(0.6);
}

/* Voile dégradé bas → lisibilité du titre */
.php-cv-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.75) 0%,
    rgba(0, 0, 0, 0.1) 60%,
    transparent 100%
  );
  z-index: 1;
  pointer-events: none;
}

/* Ligne orange en haut (invisible au repos) */
.php-cv-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(218, 75, 16, 0.5) 20%,
    #da4b10 50%,
    rgba(218, 75, 16, 0.5) 80%,
    transparent 100%
  );
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.4s ease;
  z-index: 5;
  pointer-events: none;
}

/* ── Carte ouverte — s'agrandit vers le bas ─────────────────────────────────── */

.php-cv-card.php-cv-cardOpen {
  justify-content: flex-start; /* titre en haut, texte descend */
  height: auto;
  min-height: 200px;
}

.php-cv-card.php-cv-cardOpen .php-cv-cardBg {
  filter: brightness(0.28) saturate(0.65);
}

.php-cv-card.php-cv-cardOpen::after {
  opacity: 0;
}

.php-cv-card.php-cv-cardOpen::before {
  transform: scaleX(1);
}

/* ── Carte fermée pendant qu'une autre est ouverte ──────────────────────────── */

.php-cv-card.php-cv-cardShut .php-cv-cardBg {
  filter: brightness(0.18) saturate(0.4);
}

/* ── Titres : Founder Grotesk Light (300) — fichier réel, pas de synthèse ──── */

.php-cv-valTitle {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0.04em;
  font-family: var(--font-founder);
  font-size: var(--fs-card-title);
  font-weight: 300;
  color: #ffffff;
  line-height: 1.25;
  letter-spacing: 0.02em;
  margin: 0;
}

.php-cv-valTitleLine {
  display: block;
  white-space: normal;
  overflow-wrap: break-word;
}

/* ── Corps — masqué au repos, visible sur cardOpen ─────────────────────────── */

.php-cv-text {
  position: relative;
  z-index: 2;
  font-family: var(--font-founder);
  font-size: var(--fs-body);
  font-weight: 300;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition:
    max-height 0.5s cubic-bezier(0.22, 1, 0.32, 1),
    opacity 0.4s ease,
    margin-top 0.35s ease;
}

.php-cv-card.php-cv-cardOpen .php-cv-text {
  max-height: 14rem;
  opacity: 1;
  margin-top: 14px;
}

/* Force max-height: 0 sur les cartes fermées (quand une autre est ouverte) */
.php-cv-card.php-cv-cardShut .php-cv-text {
  max-height: 0 !important;
  opacity: 0 !important;
  margin-top: 0 !important;
}

.php-cv-card:focus-visible {
  outline: 2px solid rgba(218, 75, 16, 0.6);
  outline-offset: -2px;
}

/* ── Accessibilité ──────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .php-cv-card,
  .php-cv-card::before,
  .php-cv-cardBg,
  .php-cv-text {
    transition: none;
  }
  .php-cv-card.php-cv-cardOpen .php-cv-text {
    max-height: none;
  }
}

/* ── Tablette ≤ 1024px : 2 colonnes ───────────────────────────────────────── */

@media (max-width: 1024px) {
  .php-cv-row { flex-wrap: wrap; }

  .php-cv-card,
  .php-cv-card.php-cv-cardOpen,
  .php-cv-card.php-cv-cardShut {
    flex: 1 1 calc(50% - 1px);
    max-width: 50%;
  }

  .php-cv-card:nth-child(2n) { border-right: none; }

  .php-cv-card:nth-child(5) {
    flex: 1 1 100%;
    max-width: 100%;
    border-right: none;
  }
}

/* ── Mobile ≤ 560px : 1 colonne ────────────────────────────────────────────── */

@media (max-width: 560px) {
  .php-cv-title {
    font-size: var(--fs-h2-section);
    margin-bottom: 28px;
  }

  .php-cv-row {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 16px;
    border-top: none;
  }

  .php-cv-card,
  .php-cv-card.php-cv-cardOpen,
  .php-cv-card.php-cv-cardShut {
    flex: none;
    width: 100%;
    max-width: none;
    padding: 168px 18px 20px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    height: auto;
    min-height: 0;
    justify-content: flex-start;
    background: rgba(255, 255, 255, 0.02);
  }

  .php-cv-card::before {
    transform: scaleX(1);
  }

  .php-cv-card::after {
    inset: 0 0 auto 0;
    height: 150px;
    background: linear-gradient(
      to top,
      rgba(0, 0, 0, 0.65) 0%,
      rgba(0, 0, 0, 0.1) 75%,
      transparent 100%
    );
  }

  .php-cv-cardBg {
    inset: 0 0 auto 0;
    height: 150px;
    filter: brightness(0.55) saturate(0.7);
  }

  .php-cv-card.php-cv-cardOpen .php-cv-cardBg,
  .php-cv-card.php-cv-cardShut .php-cv-cardBg {
    filter: brightness(0.55) saturate(0.7);
  }

  .php-cv-valTitle {
    font-size: clamp(1.55rem, 4.8vw, 1.9rem);
    line-height: 1.18;
  }

  .php-cv-text,
  .php-cv-card.php-cv-cardShut .php-cv-text {
    max-height: none !important;
    opacity: 1 !important;
    margin-top: 12px !important;
    font-size: 0.98rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.82);
  }
}
