/* ==========================================================================
   Accueil : diapositives et bloc de recherche. Conçu pour ne jamais déborder.
   ========================================================================== */
.home-find, .hs, .hs-viewport, .hs-slide { min-width: 0; max-width: 100%; box-sizing: border-box; }

/* ----- Diapositives ----- */
.hs { position: relative; border-radius: 26px; overflow: hidden; color: #fff; box-shadow: 0 16px 36px rgba(15, 23, 42, .16); }
.hs-viewport { overflow: hidden; border-radius: inherit; }
.hs-track { display: flex; transition: transform .6s cubic-bezier(.2, .7, .2, 1); will-change: transform; }
.hs-slide {
  position: relative;
  flex: 0 0 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 1.25rem 3.6rem;
  overflow: hidden;
  isolation: isolate;
}
.hs-slide::before, .hs-slide::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  pointer-events: none;
  z-index: -1;
}
.hs-slide::before { width: 240px; height: 240px; right: -90px; top: -110px; }
.hs-slide::after { width: 160px; height: 160px; right: 80px; bottom: -110px; }
.hs-tone-1 { background: linear-gradient(120deg, #2563EB 0%, #1E3A8A 100%); }
.hs-tone-2 { background: linear-gradient(120deg, #059669 0%, #0F766E 100%); }
.hs-tone-3 { background: linear-gradient(120deg, #4F46E5 0%, #6D28D9 100%); }
.hs-tone-4 { background: linear-gradient(120deg, #0D9488 0%, #0369A1 100%); }

.hs-body { display: grid; gap: .4rem; min-width: 0; max-width: 100%; flex: 1 1 auto; }
.hs-eyebrow {
  justify-self: start;
  padding: .2rem .65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.hs-title {
  margin: 0;
  font-size: clamp(1.3rem, 4.6vw, 2rem);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -.015em;
  overflow-wrap: anywhere;
}
.hs-text { margin: 0; font-size: .95rem; line-height: 1.45; color: rgba(255, 255, 255, .92); overflow-wrap: anywhere; }
.hs-cta {
  justify-self: start;
  margin-top: .35rem;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  min-height: 44px;
  padding: 0 1.05rem;
  border-radius: 999px;
  background: #fff;
  color: #1E3A8A;
  font-size: .92rem;
  font-weight: 800;
  text-decoration: none !important;
  max-width: 100%;
  white-space: normal;
  text-align: center;
  box-shadow: 0 6px 16px rgba(15, 23, 42, .18);
}
.hs-cta:hover { background: #F1F5F9; }
.hs-cta:focus-visible, .hs-arrow:focus-visible, .hs-dot:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.hs-icon {
  flex: none;
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .25);
}

/* ----- Commandes ----- */
.hs-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: .4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  pointer-events: none;
}
.hs-controls > * { pointer-events: auto; }
.hs-arrow {
  display: none;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .2);
  color: #fff;
  cursor: pointer;
}
.hs-arrow:hover { background: rgba(255, 255, 255, .34); }
.hs-dots { display: flex; align-items: center; gap: 2px; }
.hs-dot { width: 32px; height: 36px; display: grid; place-items: center; border: 0; background: transparent; cursor: pointer; padding: 0; }
.hs-dot span { width: 8px; height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .5); transition: width .3s ease, background-color .3s ease; }
.hs-dot.is-active span { width: 24px; background: #fff; }

@media (min-width: 760px) {
  .hs-slide { padding: 2rem 2.25rem 3.8rem; gap: 2rem; }
  .hs-arrow { display: grid; }
  .hs-icon { width: 84px; height: 84px; border-radius: 26px; }
}
@media (min-width: 760px) and (max-width: 1023px) { .hs-slide { min-height: 240px; } }

/* ----- Bloc de recherche ----- */
.home-find { display: grid; gap: .6rem; }
.home-find-title { margin: 0; font-size: 1.1rem; font-weight: 800; color: var(--text-primary); }
.home-search {
  display: flex;
  align-items: center;
  gap: .4rem;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: .3rem .3rem .3rem .85rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, .05);
}
.home-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring, rgba(37, 99, 235, .2)); }
.home-search-field { flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: .45rem; }
.home-search-icon { flex: none; color: var(--text-secondary); }
.home-search input[type="search"] {
  flex: 1 1 0;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 1rem;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.home-search-btn {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 1.05rem;
  border: 0;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-size: .95rem;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}
.home-search-btn:hover { background: var(--primary-hover, #1D4ED8); }
.home-search-btn:focus-visible { outline: 3px solid var(--primary-ring, rgba(37, 99, 235, .35)); outline-offset: 2px; }

/* Très petit écran : bouton réduit à son icône pour que tout tienne. */
@media (max-width: 380px) {
  .home-search { padding-left: .6rem; }
  .home-search-btn { width: 44px; padding: 0; font-size: 0; }
  .home-search-btn::before { content: ""; display: inline-block; width: 18px; height: 18px; background: #fff; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7' fill='none' stroke='black' stroke-width='2.4'/%3E%3Cpath d='M20 20l-4-4' stroke='black' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7' fill='none' stroke='black' stroke-width='2.4'/%3E%3Cpath d='M20 20l-4-4' stroke='black' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat; }
}

@media (prefers-reduced-motion: reduce) { .hs-track, .hs-dot span { transition: none; } }

/* ----- Diapositives avec photo ----- */
.hs-slide.has-photo { padding: 0; flex-direction: column; align-items: stretch; }
.hs-slide.has-photo .hs-body { padding: 2rem 1.25rem 3.8rem; justify-content: center; }
.hs-photo {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: 0;
  background: #0F172A;
  height: 180px;
  order: -1;
  flex: none;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .12);
}
.hs-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  transition: transform .9s cubic-bezier(.2, .7, .2, 1);
}
.hs-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0) 55%, rgba(15, 23, 42, .35) 100%);
  pointer-events: none;
}
.hs-slide.is-active .hs-photo img { transform: scale(1.04); }

@media (min-width: 760px) {
  .hs-slide.has-photo {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
    gap: 0;
    padding: 0;
    min-height: 300px;
  }
  .hs-slide.has-photo .hs-body { padding: 2.4rem 2.25rem 3.8rem; }
  .hs-photo {
    order: 0;
    height: auto;
    min-height: 100%;
    margin: 1.25rem 1.25rem 3.6rem 0;
    border-radius: 22px;
    box-shadow: 0 18px 34px rgba(15, 23, 42, .28), 0 0 0 1px rgba(255, 255, 255, .18) inset;
  }
  .hs-photo img { position: absolute; inset: 0; }
}
@media (min-width: 760px) and (max-width: 1023px) { .hs-slide.has-photo { min-height: 320px; } }
@media (prefers-reduced-motion: reduce) { .hs-photo img { transition: none; } .hs-slide.is-active .hs-photo img { transform: none; } }
