/* ============================================================
   PS Pattern — Hero Home (Figma 16113:5676)
   Photo plein cadre + overlay sombre, titre display, CTA rouge,
   séparateur "La promesse". Tokens : assets/css/tokens.css (--ps-*)
   ============================================================ */

.ps-hero-home {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  display: flex;
  background-color: var(--ps-color-black);
  color: var(--ps-color-white);
  overflow: hidden;
}

/* --- Background photo + overlay --- */
.ps-hero-home__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.ps-hero-home__bg-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.ps-hero-home__overlay {
  position: absolute;
  inset: 0;
  background: var(--ps-gradient-hero-overlay);
}

/* 2026-11-09 retour Yann : fondu noir à droite (masque le technicien,
   laisse vivre le logo). Transparent à gauche → noir à droite. */
.ps-hero-home__overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, 0.85) 60%, #000 74%);
}

/* --- Content --- */
.ps-hero-home__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  /* Largeur revue 2026-06-09 : le cap à 1440 créait des marges trop larges sur
     écran > 1440 vs Figma. Gouttière proportionnelle (3.6vw ≈ 52px @1440, le
     ratio Figma 52/1440), contenu jusqu'à 1760 avant centrage. */
  max-width: 1760px;
  margin-inline: auto;
  padding-inline: clamp(2rem, 3.6vw, 5rem);
  /* clear la nav en haut (~110px) + air en bas, contenu centré vertical */
  padding-block: 140px var(--ps-spacing-64);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--ps-spacing-122);
}

.ps-hero-home__lead {
  display: flex;
  flex-direction: column;
  gap: var(--ps-spacing-32);
}

/* Eyebrow */
.ps-hero-home__eyebrow {
  margin: 0;
  font-weight: var(--ps-font-weight-bold);            /* Avenir Heavy → 700 (élégance > 900 chunky) */
  font-size: var(--ps-font-size-14);
  letter-spacing: var(--ps-letter-spacing-eyebrow);   /* 2px */
  text-transform: uppercase;
  color: var(--ps-color-on-dark-62);
}

/* Title display — 3 lignes */
.ps-hero-home__title {
  margin: 0;
  font-weight: var(--ps-font-weight-light);           /* Avenir Light → NS 400 (la + fine dispo) */
  font-size: clamp(2.75rem, 7vw, var(--ps-font-size-100));
  line-height: var(--ps-line-height-tight);           /* 1.0 */
  letter-spacing: -0.05em;                            /* -5px / 100px, scale via em */
  color: var(--ps-color-white);
}

.ps-hero-home__title-line {
  display: block;
}

/* Headline : titre 3 lignes à gauche + logo à droite, même hauteur.
   Hauteur logo = 3 × font-size du titre (line-height 1.0). Si la place manque,
   object-fit réduit le logo sans le déformer. */
.ps-hero-home__headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ps-spacing-40);
}

/* Le titre garde ses 3 lignes : c'est le logo qui rétrécit si la place manque */
.ps-hero-home__title {
  flex: 0 0 auto;
}

.ps-hero-home__logo {
  flex: 0 1 auto;
  min-width: 0;
  display: block;
  height: calc(3 * clamp(2.75rem, 7vw, var(--ps-font-size-100)));
  width: auto;
  max-width: 34%;
  object-fit: contain;
  object-position: right center;
}

/* Row : subtitle + CTA */
.ps-hero-home__row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--ps-spacing-40);
  flex-wrap: wrap;
}

.ps-hero-home__subtitle {
  margin: 0;
  max-width: 603px;
  font-weight: var(--ps-font-weight-regular);
  font-size: var(--ps-font-size-20);
  line-height: var(--ps-line-height-relaxed);         /* 1.5 */
  letter-spacing: var(--ps-letter-spacing-body);
  color: var(--ps-color-on-dark-78);
}

/* Boutons : voir assets/css/patterns/ps-buttons.css (.ps-btn / --primary). */

/* --- Séparateur "La promesse" --- */
.ps-hero-home__promise {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: var(--ps-spacing-32);
  padding-top: var(--ps-spacing-25);
  border-top: 1px solid var(--ps-color-on-dark-14);
}

.ps-hero-home__promise-label {
  margin: 0;
  font-weight: var(--ps-font-weight-bold);
  font-size: var(--ps-font-size-11);
  letter-spacing: var(--ps-letter-spacing-eyebrow-sm); /* 1.98px */
  text-transform: uppercase;
  color: var(--ps-color-on-dark-62);
}

.ps-hero-home__promise-text {
  margin: 0;
  max-width: 672px;
  font-style: italic;                                  /* Avenir Book Oblique → NS 400 italic */
  font-weight: var(--ps-font-weight-regular);
  font-size: var(--ps-font-size-19);
  line-height: var(--ps-line-height-editorial);        /* 1.4 */
  letter-spacing: var(--ps-letter-spacing-body);
  color: var(--ps-color-white);
}

/* ============================================================
   Responsive
   ============================================================ */

/* 2026-11-24 : mobile, « entretien et transport » sortait de l'écran (44px).
   Les 3 lignes sont conservées, taille réglée pour tenir dès 320px
   (choix Morgan contre un titre recomposé librement). */
@media (max-width: 768px) {
  /* le logo est masqué : le titre peut rétrécir et passer à la ligne au lieu de déborder */
  .ps-hero-home__title {
    flex: 1 1 auto;
    min-width: 0;
  }
}
@media (max-width: 600px) {
  .ps-hero-home__title {
    font-size: clamp(1.75rem, 9.6vw, 2.75rem);
  }
}

@media (max-width: 768px) {
  /* Mobile : le logo de la nav suffit */
  .ps-hero-home__logo {
    display: none;
  }

  .ps-hero-home__inner {
    padding-block: 110px var(--ps-spacing-48);
    gap: var(--ps-spacing-64);
  }

  .ps-hero-home__row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--ps-spacing-32);
  }

  .ps-hero-home__subtitle {
    max-width: none;
    font-size: var(--ps-font-size-18);
  }

  .ps-hero-home__promise {
    grid-template-columns: 1fr;
    gap: var(--ps-spacing-12);
  }
}

/* 2026-11-25 (Morgan) : bouton centré sous le logo, sur grand écran.
   Le bloc passe en grille 2 colonnes ; .ps-hero-home__headline et .ps-hero-home__row
   s'effacent (display: contents) pour que le logo et le bouton partagent la colonne de
   droite, centrés l'un sur l'autre. Colonne 1 = largeur du titre (ses 3 lignes ne
   repassent jamais à la ligne), colonne 2 = largeur du logo, jamais moins que le bouton ;
   s'il manque de la place, c'est le logo qui rétrécit (object-fit). Sous 1024 px :
   mise en page d'origine (le bouton passe sous le texte). */
@media (min-width: 1024px) {
  .ps-hero-home__lead {
    display: grid;
    grid-template-columns: max-content minmax(min-content, max-content);
    justify-content: space-between;
    align-items: center;
    column-gap: var(--ps-spacing-40);
    row-gap: var(--ps-spacing-32);
  }

  .ps-hero-home__headline,
  .ps-hero-home__row {
    display: contents;
  }

  .ps-hero-home__eyebrow {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .ps-hero-home__title {
    grid-column: 1;
    grid-row: 2;
  }

  .ps-hero-home__logo {
    grid-column: 2;
    grid-row: 2;
    justify-self: center;
    max-width: 100%;
    object-position: center;
  }

  .ps-hero-home__subtitle {
    grid-column: 1;
    grid-row: 3;
    align-self: end;
    contain: inline-size; /* ne fixe pas la largeur de la colonne : elle suit le titre */
  }

  .ps-hero-home__row > .ps-btn {
    grid-column: 2;
    grid-row: 3;
    justify-self: center;
    align-self: end;
    white-space: nowrap;
  }
}
